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_vm/f_screenshot | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 qmenu/qmenu_vm/f_screenshot (limited to 'qmenu/qmenu_vm/f_screenshot') diff --git a/qmenu/qmenu_vm/f_screenshot b/qmenu/qmenu_vm/f_screenshot new file mode 100644 index 0000000..cac22bc --- /dev/null +++ b/qmenu/qmenu_vm/f_screenshot @@ -0,0 +1,18 @@ +err="qmenu-vm - Error: Failed to take a screenshot! Please make sure that 'scrot' is installed inside $qube." + +target=$(printf 'Focused window\nAll visible windows' | dmenu-unlinked -l 2 -i -p "$qube:" | cut -f1 -d\ ) + +if [ "$target" = Focused ]; then + + if [ "$(xprop -id "$(xdotool getwindowfocus)" _QUBES_VMNAME | cut -d\" -f2)" = "$qube" ]; then + + (qvm-run -q "$qube" 'scrot -q 100 -u $HOME/Pictures/screenshot' || notify-send -u normal "$err")& + else + echo 'Go back...' | dmenu-unlinked -p "Warning: Unable to take a screenshot. Please focus a window belonging to $qube." > /dev/null 2>&1 + fi + +elif [ "$target" = All ]; then + + (qvm-run -q "$qube" 'scrot -q 100 $HOME/Pictures/screenshot' || notify-send -u normal "$err")& +fi + -- cgit v1.2.3