summaryrefslogtreecommitdiff
path: root/.local/bin/jdm
diff options
context:
space:
mode:
authorJacob McDonnell <jacob@jacobmcdonnell.com>2023-01-03 18:36:25 -0500
committerJacob McDonnell <jacob@jacobmcdonnell.com>2023-01-03 18:36:25 -0500
commitb9e00afded90f03ac18f75aa7dfc8e7f3e146348 (patch)
treec297115213f6113177b6b17743739addc16307ef /.local/bin/jdm
parent09e361a7a4d76ae88520b7a89fe8d0ac3192fcba (diff)
Added some scripts
Diffstat (limited to '.local/bin/jdm')
-rwxr-xr-x.local/bin/jdm12
1 files changed, 12 insertions, 0 deletions
diff --git a/.local/bin/jdm b/.local/bin/jdm
new file mode 100755
index 0000000..d035b6e
--- /dev/null
+++ b/.local/bin/jdm
@@ -0,0 +1,12 @@
+#!/bin/sh
+declare -i count=1 # used as a reference throughout the script
+for desktop in $XDG_DATA_HOME/xsessions/*.desktop # looks at all the desktop files in /usr/share/xsessions
+do
+ name[$count]=$(grep "Name" $desktop | sed "s/Name=/$count /g") # grabs the name and adds it to an array
+ program[$count]=$(grep "Exec" $desktop | sed "s/Exec=//g") # grabs the path of the executable and adds it to an array
+ count=$((count+1))
+done
+name[$count]="$count TTY" # adds an option for TTY
+select=$(dialog --title "Jacob's Display Manager" --menu "Select a WM:" 0 0 0 ${name[*]} 3>&1 1>&2 2>&3 3>&-) # creates the menu box
+[ "$select" != "$count" ] && [ "$select" != "0" ] && export wm=${program[$select]} && startx # startx if TTY is not selected
+clear && cat /etc/motd # clears the ncurses prompt after executing and cat the message of the day file