From: Andrew Lorimer Date: Sun, 17 Feb 2019 04:54:46 +0000 (+1100) Subject: add mime-terminal functions X-Git-Url: https://git.lorimer.id.au/scripts.git/diff_plain/e3f29b2cdb1702349cb5483eda0a548755eb8475 add mime-terminal functions --- diff --git a/mime-terminal.sh b/mime-terminal.sh new file mode 100755 index 0000000..5674818 --- /dev/null +++ b/mime-terminal.sh @@ -0,0 +1,23 @@ +#! /bin/bash + +# +# Various wrapper functions for xdg-open +# Also refer to desktop entries in ~/.local/share/applications +# + +# opens a new terminal window and unzips a file +function munzip() { + urxvt -e zsh -c "unzip \"$1\" -d \"${1%.*}\" && cd \"${1%.*}\";zsh" +} + +# opens a new window and does ls -l for a file +function mcd() { + urxvt -hold -e zsh -ic "ls -ltrh | tail -1; zsh" +} + +# opens a new window and displays a text file +function mcat() { + urxvt -e zsh -c "cat \"$1\";zsh" +} + +"$@"