Update some scripts

This commit is contained in:
Thomas Dehaeze 2020-11-03 11:39:35 +01:00
parent b5fa40b136
commit cd9697c18b

View File

@ -876,14 +876,13 @@ Finally, lock the screen using =i3lock=.
curl "$address" curl "$address"
fi fi
#+end_src #+end_src
* =readbib= - Open Bibliography File
* =readbib= - Open Bibliography File
#+begin_src bash :tangle ~/.local/bin/readbib #+begin_src bash :tangle ~/.local/bin/readbib
cd ~/Cloud/pdfs/ && ls | rofi -dmenu -lines 20 | xargs -I {} zathura {} cd ~/Cloud/pdfs/ && ls | rofi -dmenu -lines 20 | xargs -I {} zathura {}
#+end_src #+end_src
* =readnotes= - Open Note File * =readnotes= - Open Note File
#+begin_src bash :tangle ~/.local/bin/readnotes #+begin_src bash :tangle ~/.local/bin/readnotes
cd ~/Cloud/thesis/ressources/notes/pdfs/ && ls *.pdf | rofi -dmenu -lines 20 | xargs -I {} zathura {} cd ~/Cloud/thesis/ressources/notes/pdfs/ && ls *.pdf | rofi -dmenu -lines 20 | xargs -I {} zathura {}
#+end_src #+end_src
@ -921,12 +920,12 @@ Finally, lock the screen using =i3lock=.
* =pdf2png= - Convert a PDF to PNG * =pdf2png= - Convert a PDF to PNG
#+begin_src bash :tangle ~/.local/bin/pdf2png #+begin_src bash :tangle ~/.local/bin/pdf2png
if [[ -f $1 && $1 == *.pdf ]]; then if [[ -f "$1" && "$1" == *.pdf ]]; then
pdftoppm -png $1 > $(echo $1 | cut -f 1 -d '.' | sed 's/$/.png/') pdftoppm -png "$1" > "$(echo "$1" | cut -f 1 -d '.' | sed 's/$/.png/')"
fi fi
#+end_src #+end_src
* =pdf-shrink= - Pdf Shrink
* =pdf-shrink= - Pdf Shrink
#+begin_src bash :tangle ~/.local/bin/pdf-shrink #+begin_src bash :tangle ~/.local/bin/pdf-shrink
shrink () shrink ()
{ {
@ -1021,3 +1020,25 @@ The requirement is to have =pdftk= or =stapler= installed.
fi fi
#+end_src #+end_src
* =rofi-calc= - Simple Calculation using Rofi
#+begin_src bash :tangle ~/.local/bin/rofi-calc
rofi -show calc -mode calc -no-show-match -no-sort
#+end_src
* =pass-gen= - Generate Random Alphanumeric Password
#+begin_src bash :tangle ~/.local/bin/pass-gen
num=$(rofi -dmenu -p "Number of caracters")
pass=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
re='^[0-9]+$'
if [[ $num =~ $re ]] ; then
pass=${pass:0:$num}
fi
printf "$pass" | xclip -sel clip && \
dunstify 'Password' 'Generated'
#+end_src