-
-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for Thunar Qubes VM tools
- Loading branch information
Showing
4 changed files
with
164 additions
and
0 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<action> | ||
<icon>folder-copy</icon> | ||
<name>Copy to VM</name> | ||
<unique-id>1507455450991127-4</unique-id> | ||
<command>/usr/lib/qubes/qvm-actions.sh copy %F</command> | ||
<description></description> | ||
<patterns>*</patterns> | ||
<directories/> | ||
<audio-files/> | ||
<image-files/> | ||
<other-files/> | ||
<text-files/> | ||
<video-files/> | ||
</action> | ||
<action> | ||
<icon>folder-move</icon> | ||
<name>Move to VM</name> | ||
<unique-id>1507455437157027-3</unique-id> | ||
<command>/usr/lib/qubes/qvm-actions.sh move %F</command> | ||
<description></description> | ||
<patterns>*</patterns> | ||
<directories/> | ||
<audio-files/> | ||
<image-files/> | ||
<other-files/> | ||
<text-files/> | ||
<video-files/> | ||
</action> | ||
<action> | ||
<icon>document-open</icon> | ||
<name>Open in VM</name> | ||
<unique-id>1507455471075266-5</unique-id> | ||
<command>/usr/lib/qubes/qvm-actions.sh openvm %F</command> | ||
<description></description> | ||
<patterns>*</patterns> | ||
<audio-files/> | ||
<image-files/> | ||
<other-files/> | ||
<text-files/> | ||
<video-files/> | ||
</action> | ||
<action> | ||
<icon>gtk-convert</icon> | ||
<name>Convert in DisposableVM</name> | ||
<unique-id>1507455488971315-6</unique-id> | ||
<command>/usr/lib/qubes/qvm-actions.sh p %F</command> | ||
<description></description> | ||
<patterns>*.pdf</patterns> | ||
<other-files/> | ||
</action> | ||
<action> | ||
<icon>gtk-convert</icon> | ||
<name>Convert in DisposableVM</name> | ||
<unique-id>1507455503129941-7</unique-id> | ||
<command>/usr/lib/qubes/qvm-actions.sh img %F</command> | ||
<description></description> | ||
<patterns>*</patterns> | ||
<image-files/> | ||
</action> | ||
<action> | ||
<icon>document-open</icon> | ||
<name>Open in DisposableVM</name> | ||
<unique-id>1507455559234996-8</unique-id> | ||
<command>/usr/lib/qubes/qvm-actions.sh opendvm %F</command> | ||
<description></description> | ||
<patterns>*</patterns> | ||
<audio-files/> | ||
<image-files/> | ||
<other-files/> | ||
<text-files/> | ||
<video-files/> | ||
</action> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/bin/bash | ||
|
||
# Allow us to handle filenames with spaces using newline separator from Thunar | ||
IFS=' | ||
' | ||
|
||
# Check if at least two arguments are provided: actions + file(s) | ||
if [ "$#" -le 1 ]; then | ||
echo "Not enough arguments provided. Aborting..." | ||
fi | ||
|
||
# File(s) | ||
files=${*:2} | ||
|
||
# copy and move handle a list of files where other actions don't | ||
case $1 in | ||
copy) | ||
qvm-copy-to-vm '$default' $files | zenity --notification --text="Copying files..." --timeout 3 | ||
;; | ||
move) | ||
qvm-move-to-vm '$default' $files | zenity --notification --text="Moving files..." --timeout 3 | ||
;; | ||
img) | ||
for file in $files | ||
do | ||
/usr/lib/qubes/qvm-convert-img.gnome $file | ||
done | ||
;; | ||
pdf) | ||
for file in $files | ||
do | ||
/usr/lib/qubes/qvm-convert-pdf.gnome $file | ||
done | ||
;; | ||
openvm) | ||
for file in $files | ||
do | ||
qvm-open-in-vm '$default' $file | zenity --notification --text "Opening $file in VM..." --timeout 3 & | ||
done | ||
;; | ||
opendvm) | ||
for file in $files | ||
do | ||
qvm-open-in-dvm $files | zenity --notification --text "Opening $file in DisposableVM..." --timeout 3 & | ||
done | ||
;; | ||
*) | ||
echo "Unknown action. Aborting..." | ||
exit 1 | ||
;; | ||
esac |
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