# HG changeset patch # User Aleksej Bobylev # Date 1414624599 -7200 # Node ID cce2b600b834e01f6f5dc04477a141476b8ae8fb # Parent cd967cdca7aea6f4f999afcded5eb8c6fda42695 pcmanfm: add few custom actions diff -r cd967cdca7ae -r cce2b600b834 pcmanfm/receipt --- a/pcmanfm/receipt Thu Oct 30 01:06:47 2014 +0200 +++ b/pcmanfm/receipt Thu Oct 30 01:16:39 2014 +0200 @@ -39,9 +39,15 @@ # XDG autostart desktop file (lxsession will use it automatically) cp -a $stuff/autostart $fs/etc/xdg - - # Fix icon in pcmanfm.desktop + + # Change icon in pcmanfm.desktop sed -i 's/Icon=.*/Icon=folder/' \ $install/usr/share/applications/pcmanfm.desktop cp -a $install/usr/share/applications $fs/usr/share + + # Add custom actions + mkdir -p $fs/usr/share/file-manager + cp -a $stuff/actions $fs/usr/share/file-manager + cp -a $stuff/gvfs-mount-archive.sh $fs/usr/bin + chmod +x $fs/usr/bin/gvfs-mount-archive.sh } diff -r cd967cdca7ae -r cce2b600b834 pcmanfm/stuff/actions/development-menu.desktop --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pcmanfm/stuff/actions/development-menu.desktop Thu Oct 30 01:16:39 2014 +0200 @@ -0,0 +1,7 @@ +[Desktop Entry] +Type=Menu +ItemsList=gvfs-info;show-ca-parameters; + +Icon=applications-development +Name=SliTaz Development Actions +Name[ru]=Разработка SliTaz diff -r cd967cdca7ae -r cce2b600b834 pcmanfm/stuff/actions/gvfs-info.desktop --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pcmanfm/stuff/actions/gvfs-info.desktop Thu Oct 30 01:16:39 2014 +0200 @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Action +TargetLocation=true +Icon=help-about +Profiles=gvfs-info; +Name=GVFS info +Name[ru]=Информация GVFS + +[X-Action-Profile gvfs-info] +Exec=sh -c "gvfs-info %u 2>&1 | sed -e '/: /!s|$|&\\n|g' -e '/: /s|: |\\n|1g' | yad --title='GVFS info' --window-icon='gtk-info' --list --width=600 --height=320 --column='Name' --column='Value' --button='gtk-close'" + +#NoExec=sh -c "gvfs-info %u | yad --center --title='GVFS info' --window-icon='gtk-info' --text-info --width=600 --height=320 --fore=#FFF --back=#000 --fontname=monospace --button='gtk-close'" diff -r cd967cdca7ae -r cce2b600b834 pcmanfm/stuff/actions/gvfs-mount-archive.desktop --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pcmanfm/stuff/actions/gvfs-mount-archive.desktop Thu Oct 30 01:16:39 2014 +0200 @@ -0,0 +1,11 @@ +[Desktop Entry] +Type=Action +Name=Mount the archive +Name[ru]=Подключить архив +Icon=package-x-generic +Profiles=on_archive; + +[X-Action-Profile on_archive] +TryExec=/usr/lib/gvfs/gvfsd-archive +Exec=gvfs-mount-archive.sh '%u' +MimeTypes=application/zip;application/gzip;application/x-cd-image;application/x-compressed-tar;application/x-bzip-compressed-tar;application/vnd.android.package-archive;application/x-xpinstall;application/x-raw-disk-image;application/x-rar;application/x-cpio;application/x-7z-compressed;application/x-tazpkg;application/x-ms-dos-executable; diff -r cd967cdca7ae -r cce2b600b834 pcmanfm/stuff/actions/root.desktop --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pcmanfm/stuff/actions/root.desktop Thu Oct 30 01:16:39 2014 +0200 @@ -0,0 +1,11 @@ +[Desktop Entry] +Type=Action +Name=Open Folder As Root +Name[ru]=Открыть папку от имени Root +Icon=dialog-password +Profiles=root_on_folder; + +[X-Action-Profile root_on_folder] +ShowIfTrue=test $(whoami) != root +Exec=tazbox su "pcmanfm %u" +MimeTypes=inode/directory; diff -r cd967cdca7ae -r cce2b600b834 pcmanfm/stuff/actions/rootedit.desktop --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pcmanfm/stuff/actions/rootedit.desktop Thu Oct 30 01:16:39 2014 +0200 @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Action +Name=Edit as Root +Name[ru]=Править от имени Root +Icon=dialog-password +Profiles=file_root_edit; + +[X-Action-Profile file_root_edit] +Exec=subox "editor %f" +MimeTypes=text/*; diff -r cd967cdca7ae -r cce2b600b834 pcmanfm/stuff/actions/show-ca-parameters.desktop --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pcmanfm/stuff/actions/show-ca-parameters.desktop Thu Oct 30 01:16:39 2014 +0200 @@ -0,0 +1,9 @@ +[Desktop Entry] +Type=Action +Name=Show Custom Actions parameters +Name[ru]=Параметры Custom Actions +Profiles=any; +Icon=document-properties + +[X-Action-Profile any] +Exec=yad --title="Info" --window-icon="gtk-info" --list --text="Custom Actions parameters for the selected items:" --column="Description" --column="Parameter" --column="Value" "(first) basename" %%b "%b" "space-separated list of basenames" %%B "%B" "" "" "" "count of selected items" %%c "%c" "" "" "" "(first) base directory" %%d "%d" "space-separated list of base directory\nof each selected items" %%D "%D" "" "" "" "(first) file name" %%f "%f" "space-separated list of selected file names" %%F "%F" "" "" "" "hostname of the (first) URI" %%h "%h" "" "" "" "mimetype of the (first) selected item" %%m "%m" "space-separated list of the mimetypes\nof the selected items" %%M "%M" "" "" "" "username of the (first) URI" %%n "%n" "port number of the (first) URI" %%p "%p" "scheme of the (first) URI" %%s "%s" "" "" "" "(first) URI" %%u "%u" "space-separated list of selected URIs" %%U "%U" "" "" "" "(first) basename without the extension" %%w "%w" "space-separated list of basenames\nwithout their extension" %%W "%W" "" "" "" "(first) extension" %%x "%x" "space-separated list of extensions" %%X "%X" --height=370 --width=768 --button="gtk-close" diff -r cd967cdca7ae -r cce2b600b834 pcmanfm/stuff/actions/slideshow.desktop --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pcmanfm/stuff/actions/slideshow.desktop Thu Oct 30 01:16:39 2014 +0200 @@ -0,0 +1,31 @@ +[Desktop Entry] +Type=Action +Name=Run Slideshow +Name[ru]=Запустить слайдшоу +Icon=image-x-generic +Profiles=viewnior_on_folder;viewnior_on_images;gpicview_on_folder;gpicview_on_images; + +[X-Action-Profile viewnior_on_folder] +TryExec=viewnior +ShowIfTrue=test -n "$(find %f -maxdepth 1 -iname '*.png' -o -iname '*.jpg' -o -iname '*.jpeg' -iname '*.gif' -o -iname '*.svg')" +Exec=viewnior --fullscreen --slideshow %f +MimeTypes=inode/directory; + +[X-Action-Profile viewnior_on_images] +TryExec=viewnior +Exec=viewnior --fullscreen --slideshow %F +MimeTypes=image/*; +SelectionCount=>1 + +[X-Action-Profile gpicview_on_folder] +TryExec=gpicview +ShowIfTrue=test -n "$(find %f -maxdepth 1 -iname '*.png' -o -iname '*.jpg' -o -iname '*.jpeg' -iname '*.gif' -o -iname '*.svg')" +Exec=gpicview --slideshow %f +MimeTypes=inode/directory; + +[X-Action-Profile gpicview_on_images] +TryExec=gpicview +#Bug: gpicview shows other images after selected +Exec=gpicview --slideshow %F +MimeTypes=image/*; +SelectionCount=>1 diff -r cd967cdca7ae -r cce2b600b834 pcmanfm/stuff/actions/wallpaper.desktop --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pcmanfm/stuff/actions/wallpaper.desktop Thu Oct 30 01:16:39 2014 +0200 @@ -0,0 +1,11 @@ +[Desktop Entry] +Type=Action +Name=Set as wallpaper +Name[ru]=Сделать фоном рабочего стола +Icon=preferences-desktop-wallpaper +Profiles=image_wallpaper; + +[X-Action-Profile image_wallpaper] +MimeTypes=image/*; +Exec=pcmanfm -w %f +SelectionCount==1 diff -r cd967cdca7ae -r cce2b600b834 pcmanfm/stuff/gvfs-mount-archive.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pcmanfm/stuff/gvfs-mount-archive.sh Thu Oct 30 01:16:39 2014 +0200 @@ -0,0 +1,4 @@ +#!/bin/sh +# gvfs-mount-archive: simple wrapper for PCManFM action "Mount archive" + +gvfs-mount "archive://$(echo "$1" | sed 's|:|%3A|g;s|/|%2F|g')"