diff options
author | Casper <me@skylarcloud.xyz> | 2024-12-23 17:13:45 -0700 |
---|---|---|
committer | Casper <me@skylarcloud.xyz> | 2024-12-23 17:13:45 -0700 |
commit | 01a33ab0913d439150065ac23644c4f140ff8917 (patch) | |
tree | 9ad71bd7e6f5a5aad2c2cdbff4bb75de12565998 /qmenu/qmenu-am | |
parent | 7b5a0e9e88f015cb68a46bb657661f4663e287af (diff) |
added qmenu!
Diffstat (limited to 'qmenu/qmenu-am')
-rw-r--r-- | qmenu/qmenu-am | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/qmenu/qmenu-am b/qmenu/qmenu-am new file mode 100644 index 0000000..0b00b29 --- /dev/null +++ b/qmenu/qmenu-am @@ -0,0 +1,32 @@ +#!/bin/sh + +case $1 in + + --all) + + app_list=$(grep '^Name=\|^Exec=' "$HOME"/.local/share/applications/*.desktop /usr/share/applications/*.desktop) + + chosen=$(printf =; echo "$app_list" | grep ':Name=' | cut -d= -f2- | dmenu-unlinked) || exit 1;; + + --focused) + + qube=$(xprop -id "$(xdotool getwindowfocus)" _QUBES_VMNAME | cut -f2 -d\") + + [ "$qube" = '_QUBES_VMNAME: not found.' ] && exit 2 + + qube_label=$(grep -s "^$(qvm-prefs "$qube" label)=" "$HOME"/.config/qmenu.conf | cut -d= -f2) + + [ -z "$qube_label" ] && qube_label='#000000' + + app_list=$(grep '^Name=\|^Exec=' "$HOME/.local/share/qubes-appmenus/$qube"/apps/*.desktop) + + chosen=$(echo "$app_list" | grep ':Name=' | cut -f3- -d: | dmenu-unlinked -p "$qube:" -sb "$qube_label") || exit 1;; + + *) + + printf "Usage: $0 [OPTION]\nLaunch domU and dom0 applications via dmenu.\n\n --all\n --focused\n\n" + + [ "$1" = --help ] && exit 0; exit 2 +esac + +$(echo "$app_list" | grep "$(echo "$app_list" | grep "$chosen$" | cut -d: -f1)" | grep ':Exec=' | cut -d= -f2-) || exit 2 |