quick workspace
This commit is contained in:
24
shrinkpdf.sh
24
shrinkpdf.sh
@@ -1,11 +1,21 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#shrinkpdf - resize pdf to smaller size. Warning: if no second file name is provided, the default behavior is to overwrite the original pdf
|
if [ "$1" == "-h" ] ; then
|
||||||
# usage:
|
echo "
|
||||||
# shrinkpdf.sh large.pdf
|
shrinkpdf - resize pdf to smaller size. Warning: if no second file name is provided, the default behavior is to overwrite the original pdf
|
||||||
# shrinkpdf.sh large.pdf small.pdf
|
usage:
|
||||||
# dependencies:
|
shrinkpdf.sh large.pdf
|
||||||
# ps2pdf from Ghostscript
|
shrinkpdf.sh large.pdf small.pdf
|
||||||
# mktemp from GNU Coreutils
|
dependencies:
|
||||||
|
ps2pdf from Ghostscript
|
||||||
|
mktemp from GNU Coreutils
|
||||||
|
|
||||||
|
Usage: shrinkpdf.sh infile.pdf
|
||||||
|
shrinkpdf.sh infile outfile.pdf
|
||||||
|
"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
#Setup defaults
|
#Setup defaults
|
||||||
fn=$1
|
fn=$1
|
||||||
|
|||||||
47
ws
Executable file
47
ws
Executable file
@@ -0,0 +1,47 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
if [ "$1" == "-h" ] ; then
|
||||||
|
echo "
|
||||||
|
ws - quickly setup workspace environment by invoking some terminals
|
||||||
|
- intended to be invoked within a window manager environ like i3
|
||||||
|
- can use a default workDir variable preference if ~/.bashrc.local exists
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
#with an existing terminal:
|
||||||
|
ws
|
||||||
|
ws ~/projects
|
||||||
|
|
||||||
|
#with i3wm for example:
|
||||||
|
1. select workspace e.g. <\$mod+2>
|
||||||
|
2. open dbus quick menu <\$mod+d> and type ws
|
||||||
|
"
|
||||||
|
echo "$(tput setaf 6)$workDir $(tput setaf 7)was previous working directory"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
myLocalConfig="$HOME/.bashrc.local"
|
||||||
|
|
||||||
|
if [[ -e $myLocalConfig ]]; then
|
||||||
|
source $myLocalConfig
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $1 ]]; then
|
||||||
|
workingDirectory=$1
|
||||||
|
else
|
||||||
|
workingDirectory=${workDir:-~/projects} #e.g. if workDir is defined in .bashrc.local
|
||||||
|
fi
|
||||||
|
|
||||||
|
# echo $workDir
|
||||||
|
# echo $workingDirectory
|
||||||
|
|
||||||
|
#urxvt -e "dimr &"
|
||||||
|
urxvt -cd $workingDirectory -title "$(basename $workingDirectory) woola" -e bash -ic "$HOME/bin/woola" &
|
||||||
|
urxvt -cd $workingDirectory -title "$(basename $workingDirectory) ranger" -e bash -ic "ranger" &
|
||||||
|
urxvt -cd $workingDirectory &
|
||||||
|
|
||||||
|
if [[ -e $myLocalConfig ]]; then
|
||||||
|
sed -i -E "s|(export workDir=).+|\1$workingDirectory|" "$myLocalConfig"
|
||||||
|
export workDir=$workingDirectory
|
||||||
|
fi
|
||||||
|
|
||||||
Reference in New Issue
Block a user