From 01a33ab0913d439150065ac23644c4f140ff8917 Mon Sep 17 00:00:00 2001 From: Casper Date: Mon, 23 Dec 2024 17:13:45 -0700 Subject: added qmenu! --- qmenu/qmenu-am | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 qmenu/qmenu-am (limited to 'qmenu/qmenu-am') 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 -- cgit v1.2.3