diff --git a/mv2figs.sh b/mv2figs.sh index 1f00cf4..6af5f16 100755 --- a/mv2figs.sh +++ b/mv2figs.sh @@ -1,8 +1,24 @@ #!/bin/bash -#mv2figs: used by the screenshot shortcut set in .config/i3/config +#!/bin/bash +if [ "$1" == "-h" ] ; then + echo " + mv2figs - move image to figure assets folder and put html figure string containing relative link to the asset on system clipboard + - used by the screenshot shortcut set in .config/sway/config and .config/i3/config + - default figure assets set as HOME/figures + + Usage: mv2figs.sh img.jpg + mv2figs.sh img.jpg ~/myproject/assets + " + exit 0 +fi + +set -e #default image location -blobFolder=$HOME/figures +# blobFolder=$HOME/figures +blobFolder=${2:-$HOME/figures} + +#TODO: add xorg-x11 vs wayland logic here # wayland: use "wl-copy" #xorg-x11: use "xclip -selection clipboard" diff --git a/pdf2bib.sh b/pdf2bib.sh index 8d587b7..2b06f55 100755 --- a/pdf2bib.sh +++ b/pdf2bib.sh @@ -58,7 +58,7 @@ xsltproc --novalid $styleSheet $uid.xml > $uid.bib #extract some strings to make a nice filename for the pdf key="LastName"; -author=$(grep $key --max-count=1 $uid.xml | sed -E "s#\W*<$key>(.+)\W*#\1#") +author=$(grep $key --max-count=1 $uid.xml | sed -E "s#\W*<$key>(.+)\W*#\1#" | tr -d " ") key="MedlineTA"; journal=$(grep $key --max-count=1 $uid.xml | sed -E "s#\W*<$key>(.+)\W*#\1#" | tr -d " ") diff --git a/sdoi.sh b/sdoi.sh index 4eb1bd5..79388b0 100755 --- a/sdoi.sh +++ b/sdoi.sh @@ -55,7 +55,7 @@ if [ -z "$fn" ]; then else #extract some strings to make a nice filename for the pdf key="LastName"; - author=$(grep $key --max-count=1 $uid.xml | sed -E "s#\W*<$key>(.+)\W*#\1#") + author=$(grep $key --max-count=1 $uid.xml | sed -E "s#\W*<$key>(.+)\W*#\1#" | tr -d " ") key="MedlineTA"; journal=$(grep $key --max-count=1 $uid.xml | sed -E "s#\W*<$key>(.+)\W*#\1#" | tr -d " ") diff --git a/spmid.sh b/spmid.sh index 3b1fcf2..75fd356 100755 --- a/spmid.sh +++ b/spmid.sh @@ -39,7 +39,7 @@ if [ -z "$fn" ]; then else #extract some strings to make a nice filename for the pdf key="LastName"; - author=$(grep $key --max-count=1 $uid.xml | sed -E "s#\W*<$key>(.+)\W*#\1#") + author=$(grep $key --max-count=1 $uid.xml | sed -E "s#\W*<$key>(.+)\W*#\1#" | tr -d " ") key="MedlineTA"; journal=$(grep $key --max-count=1 $uid.xml | sed -E "s#\W*<$key>(.+)\W*#\1#" | tr -d " ") diff --git a/ws b/ws index c420331..9ec8170 100755 --- a/ws +++ b/ws @@ -10,7 +10,7 @@ if [ "$1" == "-h" ] ; then ws ws ~/projects - #with i3wm for example: + #with i3wm|sway for example: 1. select workspace e.g. <\$mod+2> 2. open dbus quick menu <\$mod+d> and type ws " @@ -21,6 +21,8 @@ fi set -e myLocalConfig="$HOME/.bashrc.local" +# myTerm=${TERM:-urxvt} +myTerm=${TERM:-alacritty} if [[ -e $myLocalConfig ]]; then source $myLocalConfig @@ -35,10 +37,20 @@ fi # echo $workDir # echo $workingDirectory +if [[ $myTerm == urxvt ]]; then #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 & +fi + +if [[ $myTerm == alacritty ]]; then +alacritty --working-directory $workingDirectory --title "$(basename $workingDirectory) woola" -e bash -ic "$HOME/bin/woola" & +alacritty --working-directory $workingDirectory --title "$(basename $workingDirectory) ranger" -e bash -ic "ranger" & +alacritty --working-directory $workingDirectory & +else + echo "edit script for compatibility with terminal" +fi if [[ -e $myLocalConfig ]]; then sed -i -E "s|(export workDir=).+|\1$workingDirectory|" "$myLocalConfig"