aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authoromagdy <omar.professional8777@gmail.com>2024-11-24 02:53:37 +0200
committeromagdy <omar.professional8777@gmail.com>2024-11-24 02:53:37 +0200
commite3c3e7180d9d84db8a4d2669788a5111f39f7c0a (patch)
tree4fee7372d671baecf15f9dea5bedd0b5f032bcd8 /scripts
parent74ed2de10ee90a3cad1c3fca351668b34850828f (diff)
downloaddotfiles-e3c3e7180d9d84db8a4d2669788a5111f39f7c0a.tar.xz
dotfiles-e3c3e7180d9d84db8a4d2669788a5111f39f7c0a.zip
Nothing worth mentioning
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/.scripts/create_tmp.sh16
-rwxr-xr-xscripts/.scripts/toggle_waybar.sh8
2 files changed, 22 insertions, 2 deletions
diff --git a/scripts/.scripts/create_tmp.sh b/scripts/.scripts/create_tmp.sh
index 56d5fbb..097940d 100755
--- a/scripts/.scripts/create_tmp.sh
+++ b/scripts/.scripts/create_tmp.sh
@@ -1,7 +1,19 @@
#!/bin/sh
-# Choose an extenstion for the temp file
-choice=$(echo -e "cpp\nc\npy\nrs\njs\nts\ngo\ntxt\nmd\nhtml\ncss" | dmenu -p "Select extension: " -l 10)
+choice="py"
+# Detect whether we're in a Wayland or X11 session
+if [ "$XDG_SESSION_TYPE" = "wayland" ]; then
+ # Wayland session - use wofi
+ launcher="wofi --dmenu -i -l 10"
+ choice=$(echo -e "cpp\nc\npy\nrs\njs\nts\ngo\ntxt\nmd\nhtml\ncss" | wofi --dmenu -p "Select extension: " -l 10)
+elif [ "$XDG_SESSION_TYPE" = "x11" ]; then
+ # X11 session - use dmenu
+ # Choose an extenstion for the temp file
+ choice=$(echo -e "cpp\nc\npy\nrs\njs\nts\ngo\ntxt\nmd\nhtml\ncss" | dmenu -p "Select extension: " -l 10)
+else
+ echo "Error: Could not detect display server (Wayland or X11)."
+ exit 1
+fi
# choose random word from a dictionary
random_word=$(cat /usr/share/dict/cracklib-small | shuf -n 1)
diff --git a/scripts/.scripts/toggle_waybar.sh b/scripts/.scripts/toggle_waybar.sh
new file mode 100755
index 0000000..74d19c5
--- /dev/null
+++ b/scripts/.scripts/toggle_waybar.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+if pgrep -x "waybar" >/dev/null; then
+ pkill -x "waybar"
+else
+ waybar &
+ /home/omar/.config/hypr/change/waybar-alt-5
+fi