You are not logged in.
Here is a custom command on extracting tar.xz files. Might help some one else.
Action by TuxLyn {2012-03-08}
------------------------------------------------------------------
Name: Extract (tar.xz)
Command: xz -d %n; txz=%n; tar xvf ${txz:0:-3}
File Pattern: *.xz
Contains: Other Files
------------------------------------------------------------------
I will be adding more actions in time to my wiki @ http://wiki.gotux.net/config:thunar
for any one interested you can also see custom bash functions @ http://wiki.gotux.net/config:bash
Last edited by TuxLyn (2012-03-08 08:00:32)
::: Using Arch Linux Since October 25, 2011 :::
::: Tutorials: http://distrogeeks.com/ :::
Offline
Any particular reason you're doing that in two steps? I doubt my tar is specially patched and just using 'tar xf $file' works.
Offline
Not really, just the way I've figured it out my self. Thanks for the tip do, will try it later.
::: Using Arch Linux Since October 25, 2011 :::
::: Tutorials: http://distrogeeks.com/ :::
Offline
I have these in my .bashrc, perhaps they can help you with adding custom actions:
# ARCHIVES
# usage: ex <file>
ex ()
{
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) unrar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xf $1 ;;
*.tbz2) tar xjf $1 ;;
*.tgz) tar xzf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1 ;;
*.7z) 7z x $1 ;;
*.xz) tar xvJf $1 ;;
*) echo "'$1' cannot be extracted via ex()" ;;
esac
else
echo "'$1' is not a valid file"
fi
}
If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Offline
@Unia, heh I was actually about to code something similar. Thank you.
Here is mine for ZIP/RAR, http://wiki.gotux.net/config:bash#custo … -extractor
I will be coding custom extract function that includes all of this archives listed here http://wiki.gotux.net/help:arc
Last edited by TuxLyn (2012-03-08 17:24:35)
::: Using Arch Linux Since October 25, 2011 :::
::: Tutorials: http://distrogeeks.com/ :::
Offline
Thanks for the hints.
Can anybody please help me to create a thunar custom command to use the ex() function of Unia which is described above? Apparently, my custom commands in Thunar do not access definitions in my .bashrc file. In a bash shell, the ex() function works. Is there a way to make Thunar access ex() via custom commands?
Thanks in advance.
Offline
First of all: this thread is more than 3 years old. you should start a new thread next time.
and to answer your question, simply save Unia's script as some file and add
#!/usr/bin/env bash
at the top of the file and
for i in "$@"; do ex "$i"; done
at the end.
Make it executable.
Then define the custom action in thunar with command
/path/to/script %N
and define the file suffixes in the conditions tab.
This works with single files and also multiple selections in thunar
Last edited by Rasi (2016-02-07 17:27:24)
He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.
Douglas Adams
Offline
@bejo
Please don't necrobump. Open a new thread and link to this one.
https://wiki.archlinux.org/index.php/Fo … bumping.22
Closing.
Errr.. since this seems to be a Community Contributions thread, I'll go ahead an re-open the thread.
Last edited by x33a (2016-02-10 09:03:59)
Offline