Add buku-dmenu

This commit is contained in:
Thomas Dehaeze 2019-06-22 17:27:21 +02:00
parent dc851917d6
commit 0c3dbadea5

View File

@ -478,10 +478,10 @@ mode=bookmarks main
dm-tool switch-to-greeter dm-tool switch-to-greeter
;; ;;
suspend) suspend)
~/scripts/lockscreen.sh && $logind suspend $logind suspend && ~/scripts/lockscreen.sh
;; ;;
hibernate) hibernate)
~/scripts/lockscreen.sh && $logind hibernate $logind hibernate && ~/scripts/lockscreen.sh
;; ;;
reboot) reboot)
$logind reboot $logind reboot
@ -497,6 +497,7 @@ mode=bookmarks main
exit 0 exit 0
#+end_src #+end_src
* readbib * readbib
:PROPERTIES: :PROPERTIES:
:header-args: :tangle ~/bin/readbib :header-args: :tangle ~/bin/readbib
@ -506,6 +507,7 @@ mode=bookmarks main
#+begin_src bash #+begin_src bash
cd ~/MEGA/These/Ressources/pdfs/ && ls | dmenu -l 20 | xargs -I {} zathura {} cd ~/MEGA/These/Ressources/pdfs/ && ls | dmenu -l 20 | xargs -I {} zathura {}
#+end_src #+end_src
* askpass * askpass
:PROPERTIES: :PROPERTIES:
:header-args: :tangle ~/bin/askpass-rofi :header-args: :tangle ~/bin/askpass-rofi
@ -520,3 +522,74 @@ The sed piece just removes the colon from the provided prompt: =rofi -p= already
-no-fixed-num-lines \ -no-fixed-num-lines \
-p "$(printf "$1" | sed s/://)" -p "$(printf "$1" | sed s/://)"
#+END_SRC #+END_SRC
* buku-dmenu
:PROPERTIES:
:header-args: :tangle ~/bin/buku-dmenu
:header-args+: :comments both :mkdirp yes
:header-args+: :shebang "#!/usr/bin/env bash"
:END:
#+BEGIN_SRC bash
if [ "$1" == "--help" ] ; then
echo "Run the script, start typing until the desired bookmark is selected."
echo "buku and dmenu must be installed."
exit 0
fi
#get all bmks | swap tabs for spaces | run dmenu | cut to ID | run buku if not empty
buku -p -f 3 | sed 's/\t/ /g' | dmenu -i -l 20 | cut -d ' ' -f 1 | xargs --no-run-if-empty buku -o
#+END_SRC
* notifToggle
:PROPERTIES:
:header-args: :tangle ~/bin/notifToggle
:header-args+: :comments both :mkdirp yes
:header-args+: :shebang "#!/usr/bin/env bash"
:END:
#+begin_src bash
tmpfile="/tmp/dunststatus";
if [ -f $tmpfile ]; then
if grep -q "on" $tmpfile; then
killall -SIGUSR1 dunst && echo "off" > $tmpfile;
elif grep -q "off" $tmpfile; then
killall -SIGUSR2 dunst && echo "on" > $tmpfile;
fi
else
killall -SIGUSR1 dunst && echo "off" > $tmpfile;
fi
#+end_src
* Take Screenshot
:PROPERTIES:
:header-args: :tangle ~/bin/screenshot
:header-args+: :comments both :mkdirp yes
:header-args+: :shebang "#!/usr/bin/env bash"
:END:
#+begin_src bash
status=$(echo -e "All\nSelection\nCropped\nCopy\nShadow\nActive" | rofi -i -dmenu)
if [ -z "$status" ]; then
exit;
fi
name=$(echo -e "screenshot-$(date +"%m-%d-%y_%H-%M-%S")" | rofi -i -dmenu)
if [ -z "$name" ]; then
exit;
fi
case "$status" in
"All")
maim ~/Pictures/$name.png ;;
"Selection")
maim -s ~/Pictures/$name.png ;;
"Cropped")
maim -s ~/Pictures/$name.png && convert -trim ~/Pictures/$name.png ~/Pictures/$name.png;;
"Copy")
maim -s | xclip -selection clipboard -t image/png ;;
"Shadow")
maim -st 9999999 | convert - \( +clone -background black -shadow 80x3+5+5 \) +swap -background none -layers merge +repage ~/Pictures/$name.png ;;
"Active")
maim -i $(xdotool getactivewindow) ~/Pictures/$name.png ;;
esac
#+end_src