Skip to content

Instantly share code, notes, and snippets.

@holmeszyx
Last active August 15, 2016 03:41
Show Gist options
  • Save holmeszyx/e6fb22f6a34f193fee3585c73476f351 to your computer and use it in GitHub Desktop.
Save holmeszyx/e6fb22f6a34f193fee3585c73476f351 to your computer and use it in GitHub Desktop.
create a menu to extract zip which compress with gbk charset
[Desktop Entry]
Type=Service
ServiceTypes=KonqPopupMenu/Plugin
MimeType=application/zip;
X-KDE-Priority=TopLevel
X-KDE-Submenu=Extract
Icon=ark
Actions=extract-bgk-zip
[Desktop Action extract-bgk-zip]
Name=Extract GBK zip
Icon=ark
Exec=~/bin/unzip_gbk.sh %F
#!/bin/bash
filename=$1
if [[ $filename == "" ]]; then
exit 1
fi
pure_name=$(echo ${filename} | cut -d "." -f1)
unzip -O GBK ${filename} -d ${pure_name}
  • create servermeu folder in local path.

    ~/.local/share/kservices5/ServiceMenus/

  • put desktop to folder created above.

  • put bash file into local bin dir.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment