Skip to content

Instantly share code, notes, and snippets.

@Tokariew
Created October 24, 2021 10:44
Show Gist options
  • Save Tokariew/6dfa945e263f5e5d2a23028f981490da to your computer and use it in GitHub Desktop.
Save Tokariew/6dfa945e263f5e5d2a23028f981490da to your computer and use it in GitHub Desktop.
dmenu scripts
#!/bin/sh
chosen=$(printf "%s\nAll" "$(ls ~/Music)" | dmenu -i -p "select folder to shuffle")
if [ -z "$chosen" ]; then
exit 0
else
killall ashuffle
grouping=$(printf "Yes\nNo" | dmenu -i -p "Group by album?")
[ "$grouping" = "Yes" ] && test="ashuffle --by-album" || test="ashuffle --queue-buffer 2"
{ [ "$chosen" = "All" ] && ($test); } || mpc search filename "$chosen" | ($test -f - &)
fi
#!/bin/sh
chosen=$(printf "Restart Qtile\nQuit Qtile\nLock Session\nSuspend\nReboot\nShutdown" | dmenu -l 10 -i -p "What are we doing?" -fn "Monospace:14")
if [ -z "$chosen" ]; then
exit 0
else
case $chosen in
Restart*) qtile cmd-obj -o cmd -f restart ;;
Quit*) qtile cmd-obj -o cmd -f shutdown ;;
Lock*) loginctl lock-session ;;
Suspend) systemctl suspend ;;
Reboot) systemctl reboot ;;
Shutdown) systemctl poweroff ;;
esac
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment