Created
June 16, 2019 09:31
-
-
Save 100111001/92df1b3d3789ea71bd15a5d1b34d2a6a to your computer and use it in GitHub Desktop.
Bash version of the qvm-filemanager.pl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
front=$(xprop -notype -root _NET_ACTIVE_WINDOW | awk '{if (match($0,"^_NET_ACTIVE_WINDOW: window id # (0x[0-9a-f]*), 0x0$",m)){print m[1];} exit 0;}' ) | |
test -n "$front" | |
vm=$(xprop -id "$front" -notype _QUBES_VMNAME | awk '{if (match($0,"^_QUBES_VMNAME = \"([^\"]*)\"$",m)){print m[1];} exit 0;}') | |
if [ -n "$vm" ]; then | |
exec qvm-run -- "$vm" 'sh -c "[ -f /usr/bin/nemo ] && exec /usr/bin/nemo || [ -f /usr/bin/nautilus ] && exec /usr/bin/nautilus --new-window --no-default-window || [ -f /usr/bin/dolphin ] && exec /usr/bin/dolphin"' | |
else | |
exec /usr/bin/thunar | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Considers not installed file managers in templates.