2020-01-11 22:04:45 +01:00
<?xml version="1.0" encoding="utf-8"?>
< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
< html xmlns = "http://www.w3.org/1999/xhtml" lang = "en" xml:lang = "en" >
< head >
2020-11-03 16:27:09 +01:00
<!-- 2020 - 11 - 03 mar. 16:26 -->
2020-01-11 22:04:45 +01:00
< meta http-equiv = "Content-Type" content = "text/html;charset=utf-8" / >
< title > Binaries< / title >
< meta name = "generator" content = "Org mode" / >
< meta name = "author" content = "Dehaeze Thomas" / >
2020-01-11 22:22:46 +01:00
< link rel = "stylesheet" type = "text/css" href = "./css/htmlize.css" / >
< link rel = "stylesheet" type = "text/css" href = "./css/readtheorg.css" / >
< script type = "text/javascript" src = "./js/jquery.min.js" > < / script >
< script type = "text/javascript" src = "./js/bootstrap.min.js" > < / script >
< script type = "text/javascript" src = "./js/jquery.stickytableheaders.min.js" > < / script >
< script type = "text/javascript" src = "./js/readtheorg.js" > < / script >
2020-01-11 22:04:45 +01:00
< / head >
< body >
< div id = "org-div-home-and-up" >
< a accesskey = "h" href = "./index.html" > UP < / a >
|
< a accesskey = "H" href = "./index.html" > HOME < / a >
< / div > < div id = "content" >
< h1 class = "title" > Binaries< / h1 >
< div id = "table-of-contents" >
< h2 > Table of Contents< / h2 >
< div id = "text-table-of-contents" >
< ul >
2020-04-05 11:30:26 +02:00
< li > < a href = "#org28d68eb" > < code > displayselect< / code > - Select Screen< / a > < / li >
2020-11-03 16:27:09 +01:00
< li > < a href = "#org8139955" > < code > dmenumount< / code > - Mount USB and Android< / a > < / li >
< li > < a href = "#orgbff2106" > < code > dmenuumount< / code > - Unmount USB and Android devices< / a > < / li >
2020-04-05 11:30:26 +02:00
< li > < a href = "#orgd951db9" > < code > vpntoggle< / code > - Connect to VPN using NordVPN< / a > < / li >
< li > < a href = "#org39f3bdf" > < code > bukurun< / code > - Open link from Buku< / a > < / li >
< li > < a href = "#org1ce653d" > < code > i3exit< / code > - Manage lock, suspend, reboot, … < / a > < / li >
2020-05-26 08:40:15 +02:00
< li > < a href = "#org91bab59" > < code > askpass-rofi< / code > - GUI prompt for passwords< / a > < / li >
2020-04-05 11:30:26 +02:00
< li > < a href = "#org2d85447" > < code > screenshot< / code > - Take Screenshot< / a > < / li >
< li > < a href = "#org8a00ba3" > < code > network-toggle< / code > - Toggle Network< / a > < / li >
< li > < a href = "#orgd568e72" > < code > make-gif< / code > - Make GIF< / a > < / li >
< li > < a href = "#orgd7e49ff" > < code > yt-audio< / code > - Download-Audio from youtube< / a > < / li >
< li > < a href = "#org89810de" > < code > yt-video< / code > - Download-Video from youtube< / a > < / li >
< li > < a href = "#org539efcb" > < code > setbg< / code > - Set Background< / a > < / li >
2020-05-26 08:40:15 +02:00
< li > < a href = "#org229006d" > < code > insert-unicode< / code > - Insert Unicode Icon< / a > < / li >
< li > < a href = "#orgf4064e2" > < code > insert-nerd-fonts< / code > - Insert Nerd Font Icon< / a > < / li >
< li > < a href = "#org2796c9b" > < code > linkhandler< / code > - Open with Default application< / a > < / li >
< li > < a href = "#org56e0cc2" > < code > lockscreen< / code > - LockScreen< / a > < / li >
< li > < a href = "#orgbe881e3" > < code > mopidy-restart< / code > - Restart Mopidy< / a > < / li >
< li > < a href = "#orgffe5d25" > < code > upload< / code > - Upload Script< / a > < / li >
< li > < a href = "#orgcd16f91" > < code > weather< / code > - Display Weather in terminal< / a > < / li >
< li > < a href = "#org17ef4d2" > < code > readbib< / code > - Open Bibliography File< / a > < / li >
< li > < a href = "#orgda667bb" > < code > readnotes< / code > - Open Note File< / a > < / li >
< li > < a href = "#orge45135c" > < code > pdf2bib< / code > - Extract bibtex entry from PDF file< / a > < / li >
< li > < a href = "#org70ec456" > < code > pdf2png< / code > - Convert a PDF to PNG< / a > < / li >
< li > < a href = "#org7601ca9" > < code > pdf-shrink< / code > - Pdf Shrink< / a > < / li >
< li > < a href = "#org4041717" > < code > pdf-delete-annotations< / code > - Delete Annotations from PDFs< / a > < / li >
< li > < a href = "#orge18f381" > < code > pdf-delete-first-page< / code > - Delete first page of PDF< / a > < / li >
2020-11-03 16:27:09 +01:00
< li > < a href = "#org7ae8164" > < code > rofi-calc< / code > - Simple Calculation using Rofi< / a > < / li >
< li > < a href = "#orge7a6e2d" > < code > pass-gen< / code > - Generate Random Alphanumeric Password< / a > < / li >
2020-01-11 22:04:45 +01:00
< / ul >
< / div >
< / div >
2020-04-05 11:30:26 +02:00
< div id = "outline-container-org28d68eb" class = "outline-2" >
< h2 id = "org28d68eb" > < code > displayselect< / code > - Select Screen< / h2 >
< div class = "outline-text-2" id = "text-org28d68eb" >
2020-01-11 22:04:45 +01:00
< p >
Script taken from Luke Smith.
< / p >
< div class = "org-src-container" >
2020-11-03 16:27:09 +01:00
< pre class = "src src-bash" > < span class = "org-function-name" > twoscreen< / span > < span class = "org-rainbow-delimiters-depth-1" > ()< / span > < span class = "org-rainbow-delimiters-depth-1" > {< / span > < span class = "org-comment-delimiter" > # < / span > < span class = "org-comment" > If multi-monitor is selected and there are two screens.< / span >
< span class = "org-variable-name" > mirror< / span > =$< span class = "org-rainbow-delimiters-depth-2" > (< / span > < span class = "org-sh-quoted-exec" > printf< / span > < span class = "org-string" > "no\\nyes"< / span > | dmenu -i -p < span class = "org-string" > "Mirror displays?"< / span > < span class = "org-rainbow-delimiters-depth-2" > )< / span >
< span class = "org-comment-delimiter" > # < / span > < span class = "org-comment" > Mirror displays using native resolution of external display and a scaled< / span >
< span class = "org-comment-delimiter" > # < / span > < span class = "org-comment" > version for the internal display< / span >
< span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > mirror< / span > < / span > < span class = "org-string" > "< / span > = < span class = "org-string" > "yes"< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-variable-name" > external< / span > =$< span class = "org-rainbow-delimiters-depth-2" > (< / span > < span class = "org-sh-quoted-exec" > echo< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > screens< / span > < / span > < span class = "org-string" > "< / span > | dmenu -i -p < span class = "org-string" > "Optimize resolution for:"< / span > < span class = "org-rainbow-delimiters-depth-2" > )< / span >
< span class = "org-variable-name" > internal< / span > =$< span class = "org-rainbow-delimiters-depth-2" > (< / span > < span class = "org-sh-quoted-exec" > echo< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > screens< / span > < / span > < span class = "org-string" > "< / span > | < span class = "org-type" > grep< / span > -v < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > external< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-rainbow-delimiters-depth-2" > )< / span >
< span class = "org-variable-name" > res_external< / span > =$< span class = "org-rainbow-delimiters-depth-2" > (< / span > < span class = "org-sh-quoted-exec" > xrandr< / span > --query | sed -n < span class = "org-string" > "/^< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > external< / span > < / span > < span class = "org-string" > /,/\+/p"< / span > | < span class = "org-sh-escaped-newline" > \< / span >
tail -n < span class = "org-highlight-numbers-number" > 1< / span > | awk < span class = "org-string" > '{print $1}'< / span > < span class = "org-rainbow-delimiters-depth-2" > )< / span >
< span class = "org-variable-name" > res_internal< / span > =$< span class = "org-rainbow-delimiters-depth-2" > (< / span > < span class = "org-sh-quoted-exec" > xrandr< / span > --query | sed -n < span class = "org-string" > "/^< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > internal< / span > < / span > < span class = "org-string" > /,/\+/p"< / span > | < span class = "org-sh-escaped-newline" > \< / span >
tail -n < span class = "org-highlight-numbers-number" > 1< / span > | awk < span class = "org-string" > '{print $1}'< / span > < span class = "org-rainbow-delimiters-depth-2" > )< / span >
< span class = "org-variable-name" > res_ext_x< / span > =$< span class = "org-rainbow-delimiters-depth-2" > (< / span > < span class = "org-sh-quoted-exec" > echo< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > res_external< / span > < / span > < span class = "org-string" > "< / span > | sed < span class = "org-string" > 's/x.*//'< / span > < span class = "org-rainbow-delimiters-depth-2" > )< / span >
< span class = "org-variable-name" > res_ext_y< / span > =$< span class = "org-rainbow-delimiters-depth-2" > (< / span > < span class = "org-sh-quoted-exec" > echo< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > res_external< / span > < / span > < span class = "org-string" > "< / span > | sed < span class = "org-string" > 's/.*x//'< / span > < span class = "org-rainbow-delimiters-depth-2" > )< / span >
< span class = "org-variable-name" > res_int_x< / span > =$< span class = "org-rainbow-delimiters-depth-2" > (< / span > < span class = "org-sh-quoted-exec" > echo< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > res_internal< / span > < / span > < span class = "org-string" > "< / span > | sed < span class = "org-string" > 's/x.*//'< / span > < span class = "org-rainbow-delimiters-depth-2" > )< / span >
< span class = "org-variable-name" > res_int_y< / span > =$< span class = "org-rainbow-delimiters-depth-2" > (< / span > < span class = "org-sh-quoted-exec" > echo< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > res_internal< / span > < / span > < span class = "org-string" > "< / span > | sed < span class = "org-string" > 's/.*x//'< / span > < span class = "org-rainbow-delimiters-depth-2" > )< / span >
< span class = "org-variable-name" > scale_x< / span > =$< span class = "org-rainbow-delimiters-depth-2" > (< / span > < span class = "org-sh-quoted-exec" > echo< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > res_ext_x< / span > < / span > < span class = "org-string" > / < / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > res_int_x< / span > < / span > < span class = "org-string" > "< / span > | bc -l< span class = "org-rainbow-delimiters-depth-2" > )< / span >
< span class = "org-variable-name" > scale_y< / span > =$< span class = "org-rainbow-delimiters-depth-2" > (< / span > < span class = "org-sh-quoted-exec" > echo< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > res_ext_y< / span > < / span > < span class = "org-string" > / < / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > res_int_y< / span > < / span > < span class = "org-string" > "< / span > | bc -l< span class = "org-rainbow-delimiters-depth-2" > )< / span >
xrandr --output < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > external< / span > < / span > < span class = "org-string" > "< / span > --auto --scale 1.0x1.0 < span class = "org-sh-escaped-newline" > \< / span >
--output < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > internal< / span > < / span > < span class = "org-string" > "< / span > --auto --same-as < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > external< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-sh-escaped-newline" > \< / span >
--scale < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > scale_x< / span > < / span > < span class = "org-string" > "< / span > x< span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > scale_y< / span > < / span > < span class = "org-string" > "< / span >
< span class = "org-keyword" > else< / span >
< span class = "org-variable-name" > primary< / span > =$< span class = "org-rainbow-delimiters-depth-2" > (< / span > < span class = "org-sh-quoted-exec" > echo< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > screens< / span > < / span > < span class = "org-string" > "< / span > | dmenu -i -p < span class = "org-string" > "Select primary display:"< / span > < span class = "org-rainbow-delimiters-depth-2" > )< / span >
< span class = "org-variable-name" > secondary< / span > =$< span class = "org-rainbow-delimiters-depth-2" > (< / span > < span class = "org-sh-quoted-exec" > echo< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > screens< / span > < / span > < span class = "org-string" > "< / span > | < span class = "org-type" > grep< / span > -v < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > primary< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-rainbow-delimiters-depth-2" > )< / span >
< span class = "org-variable-name" > direction< / span > =$< span class = "org-rainbow-delimiters-depth-2" > (< / span > < span class = "org-sh-quoted-exec" > printf< / span > < span class = "org-string" > "left\\nright"< / span > | dmenu -i -p < span class = "org-string" > "What side of < / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > primary< / span > < / span > < span class = "org-string" > should < / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > secondary< / span > < / span > < span class = "org-string" > be on?"< / span > < span class = "org-rainbow-delimiters-depth-2" > )< / span >
xrandr --output < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > primary< / span > < / span > < span class = "org-string" > "< / span > --auto --scale 1.0x1.0 --output < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > secondary< / span > < / span > < span class = "org-string" > "< / span > --< span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > direction< / span > < / span > < span class = "org-string" > "< / span > -of < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > primary< / span > < / span > < span class = "org-string" > "< / span > --auto --scale 1.0x1.0
< span class = "org-keyword" > fi< / span >
< span class = "org-rainbow-delimiters-depth-1" > }< / span >
< span class = "org-function-name" > morescreen< / span > < span class = "org-rainbow-delimiters-depth-1" > ()< / span > < span class = "org-rainbow-delimiters-depth-1" > {< / span > < span class = "org-comment-delimiter" > # < / span > < span class = "org-comment" > If multi-monitor is selected and there are more than two screens.< / span >
< span class = "org-variable-name" > primary< / span > =$< span class = "org-rainbow-delimiters-depth-2" > (< / span > < span class = "org-sh-quoted-exec" > echo< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > screens< / span > < / span > < span class = "org-string" > "< / span > | dmenu -i -p < span class = "org-string" > "Select primary display:"< / span > < span class = "org-rainbow-delimiters-depth-2" > )< / span >
< span class = "org-variable-name" > secondary< / span > =$< span class = "org-rainbow-delimiters-depth-2" > (< / span > < span class = "org-sh-quoted-exec" > echo< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > screens< / span > < / span > < span class = "org-string" > "< / span > | < span class = "org-type" > grep< / span > -v < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > primary< / span > < / span > < span class = "org-string" > "< / span > | dmenu -i -p < span class = "org-string" > "Select secondary display:"< / span > < span class = "org-rainbow-delimiters-depth-2" > )< / span >
< span class = "org-variable-name" > direction< / span > =$< span class = "org-rainbow-delimiters-depth-2" > (< / span > < span class = "org-sh-quoted-exec" > printf< / span > < span class = "org-string" > "left\\nright"< / span > | dmenu -i -p < span class = "org-string" > "What side of < / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > primary< / span > < / span > < span class = "org-string" > should < / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > secondary< / span > < / span > < span class = "org-string" > be on?"< / span > < span class = "org-rainbow-delimiters-depth-2" > )< / span >
< span class = "org-variable-name" > tertiary< / span > =$< span class = "org-rainbow-delimiters-depth-2" > (< / span > < span class = "org-sh-quoted-exec" > echo< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > screens< / span > < / span > < span class = "org-string" > "< / span > | < span class = "org-type" > grep< / span > -v < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > primary< / span > < / span > < span class = "org-string" > "< / span > | < span class = "org-type" > grep< / span > -v < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > secondary< / span > < / span > < span class = "org-string" > "< / span > | dmenu -i -p < span class = "org-string" > "Select third display:"< / span > < span class = "org-rainbow-delimiters-depth-2" > )< / span >
xrandr --output < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > primary< / span > < / span > < span class = "org-string" > "< / span > --auto --output < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > secondary< / span > < / span > < span class = "org-string" > "< / span > --< span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > direction< / span > < / span > < span class = "org-string" > "< / span > -of < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > primary< / span > < / span > < span class = "org-string" > "< / span > --auto --output < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > tertiary< / span > < / span > < span class = "org-string" > "< / span > --< span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > $(< / span > < / span > < span class = "org-sh-quoted-exec" > printf< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > "left\\nright" | < / span > < / span > < span class = "org-type" > < span class = "org-string" > < span class = "org-sh-quoted-exec" > grep< / span > < / span > < / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > -v "< / span > < / span > < span class = "org-string" > < span class = "org-constant" > < span class = "org-sh-quoted-exec" > $< / span > < / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > < span class = "org-sh-quoted-exec" > direction< / span > < / span > < / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > ")< / span > < / span > < span class = "org-string" > "< / span > -of < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > primary< / span > < / span > < span class = "org-string" > "< / span > --auto
< span class = "org-rainbow-delimiters-depth-1" > }< / span >
< span class = "org-function-name" > multimon< / span > < span class = "org-rainbow-delimiters-depth-1" > ()< / span > < span class = "org-rainbow-delimiters-depth-1" > {< / span > < span class = "org-comment-delimiter" > # < / span > < span class = "org-comment" > Multi-monitor handler.< / span >
< span class = "org-keyword" > case< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > $(< / span > < / span > < span class = "org-sh-quoted-exec" > echo< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > "< / span > < / span > < span class = "org-string" > < span class = "org-constant" > < span class = "org-sh-quoted-exec" > $< / span > < / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > < span class = "org-sh-quoted-exec" > screens< / span > < / span > < / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > " | wc -l)< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-keyword" > in< / span >
< span class = "org-highlight-numbers-number" > 2< / span > ) twoscreen ;;
2020-01-11 22:04:45 +01:00
*) morescreen ;;
2020-11-03 16:27:09 +01:00
< span class = "org-keyword" > esac< / span > ;< span class = "org-rainbow-delimiters-depth-1" > }< / span >
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
< span class = "org-function-name" > onescreen< / span > < span class = "org-rainbow-delimiters-depth-1" > ()< / span > < span class = "org-rainbow-delimiters-depth-1" > {< / span > < span class = "org-comment-delimiter" > # < / span > < span class = "org-comment" > If only one output available or chosen.< / span >
xrandr --output < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 1< / span > < / span > < span class = "org-string" > "< / span > --auto --scale 1.0x1.0 < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > $(< / span > < / span > < span class = "org-sh-quoted-exec" > echo< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > "< / span > < / span > < span class = "org-string" > < span class = "org-constant" > < span class = "org-sh-quoted-exec" > $< / span > < / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > < span class = "org-sh-quoted-exec" > allposs< / span > < / span > < / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > " | < / span > < / span > < span class = "org-type" > < span class = "org-string" > < span class = "org-sh-quoted-exec" > grep< / span > < / span > < / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > -v "< / span > < / span > < span class = "org-string" > < span class = "org-constant" > < span class = "org-sh-quoted-exec" > $< / span > < / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > < span class = "org-sh-quoted-exec" > 1< / span > < / span > < / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > " | awk '{print "--output", < / span > < / span > < span class = "org-string" > < span class = "org-constant" > < span class = "org-sh-quoted-exec" > $< / span > < / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > < span class = "org-sh-quoted-exec" > 1< / span > < / span > < / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > , "--off"}' | paste -sd ' ')< / span > < / span > < span class = "org-string" > "< / span >
< span class = "org-rainbow-delimiters-depth-1" > }< / span >
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
< span class = "org-function-name" > postrun< / span > < span class = "org-rainbow-delimiters-depth-1" > ()< / span > < span class = "org-rainbow-delimiters-depth-1" > {< / span > < span class = "org-comment-delimiter" > # < / span > < span class = "org-comment" > Stuff to run to clean up.< / span >
setbg < span class = "org-comment-delimiter" > # < / span > < span class = "org-comment" > Fix background if screen size/arangement has changed.< / span >
$< span class = "org-variable-name" > HOME< / span > /.config/polybar/scripts/launch.sh < span class = "org-comment-delimiter" > # < / span > < span class = "org-comment" > restart polybar< / span >
< span class = "org-rainbow-delimiters-depth-2" > {< / span > killall dunst ; setsid -f dunst ;< span class = "org-rainbow-delimiters-depth-2" > }< / span > > /dev/null < span class = "org-highlight-numbers-number" > 2< / span > > & < span class = "org-highlight-numbers-number" > 1< / span > < span class = "org-comment-delimiter" > # < / span > < span class = "org-comment" > Restart dunst to ensure proper location on screen< / span >
< span class = "org-rainbow-delimiters-depth-1" > }< / span >
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
< span class = "org-comment-delimiter" > # < / span > < span class = "org-comment" > Get all possible displays< / span >
< span class = "org-variable-name" > allposs< / span > =$< span class = "org-rainbow-delimiters-depth-1" > (< / span > < span class = "org-sh-quoted-exec" > xrandr< / span > -q | < span class = "org-type" > grep< / span > < span class = "org-string" > "connected"< / span > < span class = "org-rainbow-delimiters-depth-1" > )< / span >
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
< span class = "org-comment-delimiter" > # < / span > < span class = "org-comment" > Get all connected screens.< / span >
< span class = "org-variable-name" > screens< / span > =$< span class = "org-rainbow-delimiters-depth-1" > (< / span > < span class = "org-sh-quoted-exec" > echo< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > allposs< / span > < / span > < span class = "org-string" > "< / span > | awk < span class = "org-string" > '/ connected/ {print $1}'< / span > < span class = "org-rainbow-delimiters-depth-1" > )< / span >
< span class = "org-comment-delimiter" > # < / span > < span class = "org-comment" > If there's only one screen< / span >
< span class = "org-rainbow-delimiters-depth-1" > [< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > $(< / span > < / span > < span class = "org-sh-quoted-exec" > echo< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > "< / span > < / span > < span class = "org-string" > < span class = "org-constant" > < span class = "org-sh-quoted-exec" > $< / span > < / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > < span class = "org-sh-quoted-exec" > screens< / span > < / span > < / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > " | wc -l)< / span > < / span > < span class = "org-string" > "< / span > -lt < span class = "org-highlight-numbers-number" > 2< / span > < span class = "org-rainbow-delimiters-depth-1" > ]< / span > & &
< span class = "org-rainbow-delimiters-depth-1" > {< / span > onescreen < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > screens< / span > < / span > < span class = "org-string" > "< / span > ; postrun; notify-send < span class = "org-string" > "💻 Only one screen detected."< / span > < span class = "org-string" > "Using it in its optimal settings..."< / span > ; < span class = "org-keyword" > exit< / span > ;< span class = "org-rainbow-delimiters-depth-1" > }< / span >
< span class = "org-comment-delimiter" > # < / span > < span class = "org-comment" > Get user choice including multi-monitor and manual selection:< / span >
< span class = "org-variable-name" > chosen< / span > =$< span class = "org-rainbow-delimiters-depth-1" > (< / span > < span class = "org-sh-quoted-exec" > printf< / span > < span class = "org-string" > "%s\\nmulti-monitor\\nmanual selection"< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > screens< / span > < / span > < span class = "org-string" > "< / span > | dmenu -i -p < span class = "org-string" > "Select display arangement:"< / span > < span class = "org-rainbow-delimiters-depth-1" > )< / span > & &
< span class = "org-keyword" > case< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > chosen< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-keyword" > in< / span >
< span class = "org-string" > "manual selection"< / span > ) arandr ; < span class = "org-keyword" > exit< / span > ;;
< span class = "org-string" > "multi-monitor"< / span > ) multimon ;;
*) onescreen < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > chosen< / span > < / span > < span class = "org-string" > "< / span > ;;
< span class = "org-keyword" > esac< / span >
postrun
< / pre >
< / div >
< / div >
< / div >
< div id = "outline-container-org8139955" class = "outline-2" >
< h2 id = "org8139955" > < code > dmenumount< / code > - Mount USB and Android< / h2 >
< div class = "outline-text-2" id = "text-org8139955" >
< p >
Script taken from Luke Smith.
< / p >
< div class = "org-src-container" >
< pre class = "src src-bash" > < span class = "org-function-name" > getmount< / span > < span class = "org-rainbow-delimiters-depth-1" > ()< / span > < span class = "org-rainbow-delimiters-depth-1" > {< / span > < span class = "org-sh-escaped-newline" > \< / span >
< span class = "org-rainbow-delimiters-depth-2" > [< / span > -z < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > chosen< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > & & < span class = "org-keyword" > exit< / span > < span class = "org-highlight-numbers-number" > 1< / span >
< span class = "org-comment-delimiter" > # < / span > < span class = "org-comment" > shellcheck disable=SC2086< / span >
< span class = "org-variable-name" > mp< / span > =< span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > $(< / span > < / span > < span class = "org-sh-quoted-exec" > find< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > < / span > < / span > < span class = "org-string" > < span class = "org-constant" > < span class = "org-sh-quoted-exec" > $< / span > < / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > < span class = "org-sh-quoted-exec" > 1< / span > < / span > < / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > 2> /dev/null | dmenu -i -p "Type in mount point.")< / span > < / span > < span class = "org-string" > "< / span > || < span class = "org-keyword" > exit< / span > < span class = "org-highlight-numbers-number" > 1< / span >
< span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > mp< / span > < / span > < span class = "org-string" > "< / span > = < span class = "org-string" > ""< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > & & < span class = "org-keyword" > exit< / span > < span class = "org-highlight-numbers-number" > 1< / span >
< span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-negation-char" > !< / span > -d < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > mp< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-variable-name" > mkdiryn< / span > =$< span class = "org-rainbow-delimiters-depth-2" > (< / span > < span class = "org-sh-quoted-exec" > printf< / span > < span class = "org-string" > "No\\nYes"< / span > | dmenu -i -p < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > mp< / span > < / span > < span class = "org-string" > does not exist. Create it?"< / span > < span class = "org-rainbow-delimiters-depth-2" > )< / span > || < span class = "org-keyword" > exit< / span > < span class = "org-highlight-numbers-number" > 1< / span >
< span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > mkdiryn< / span > < / span > < span class = "org-string" > "< / span > = < span class = "org-string" > "Yes"< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > & & < span class = "org-rainbow-delimiters-depth-2" > (< / span > < span class = "org-type" > mkdir< / span > -p < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > mp< / span > < / span > < span class = "org-string" > "< / span > || < span class = "org-type" > sudo< / span > -A < span class = "org-type" > mkdir< / span > -p < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > mp< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-rainbow-delimiters-depth-2" > )< / span >
< span class = "org-keyword" > fi< / span >
< span class = "org-rainbow-delimiters-depth-1" > }< / span >
< span class = "org-function-name" > mountusb< / span > < span class = "org-rainbow-delimiters-depth-1" > ()< / span > < span class = "org-rainbow-delimiters-depth-1" > {< / span > < span class = "org-sh-escaped-newline" > \< / span >
< span class = "org-variable-name" > chosen< / span > =< span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > $(< / span > < / span > < span class = "org-sh-quoted-exec" > echo< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > "< / span > < / span > < span class = "org-string" > < span class = "org-constant" > < span class = "org-sh-quoted-exec" > $< / span > < / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > < span class = "org-sh-quoted-exec" > usbdrives< / span > < / span > < / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > " | dmenu -i -p "Mount which drive?")< / span > < / span > < span class = "org-string" > "< / span > || < span class = "org-keyword" > exit< / span > < span class = "org-highlight-numbers-number" > 1< / span >
< span class = "org-variable-name" > chosen< / span > =< span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > $(< / span > < / span > < span class = "org-sh-quoted-exec" > echo< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > "< / span > < / span > < span class = "org-string" > < span class = "org-constant" > < span class = "org-sh-quoted-exec" > $< / span > < / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > < span class = "org-sh-quoted-exec" > chosen< / span > < / span > < / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > " | awk '{print < / span > < / span > < span class = "org-string" > < span class = "org-constant" > < span class = "org-sh-quoted-exec" > $< / span > < / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > < span class = "org-sh-quoted-exec" > 1< / span > < / span > < / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > }')< / span > < / span > < span class = "org-string" > "< / span >
< span class = "org-type" > sudo< / span > -A mount < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > chosen< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-highlight-numbers-number" > 2< / span > > /dev/null & & notify-send < span class = "org-string" > "💻 USB mounting"< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > chosen< / span > < / span > < span class = "org-string" > mounted."< / span > & & < span class = "org-keyword" > exit< / span > < span class = "org-highlight-numbers-number" > 0< / span >
< span class = "org-variable-name" > alreadymounted< / span > =$< span class = "org-rainbow-delimiters-depth-2" > (< / span > < span class = "org-sh-quoted-exec" > lsblk< / span > -nrpo < span class = "org-string" > "name,type,mountpoint"< / span > | awk < span class = "org-string" > '$3!~/\/boot|\/home$|SWAP/& & length($3)> 1{printf "-not ( -path *%s -prune ) ",$3}'< / span > < span class = "org-rainbow-delimiters-depth-2" > )< / span >
getmount < span class = "org-string" > "/mnt /media /mount /home -maxdepth 5 -type d < / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > alreadymounted< / span > < / span > < span class = "org-string" > "< / span >
< span class = "org-variable-name" > partitiontype< / span > =< span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > $(< / span > < / span > < span class = "org-sh-quoted-exec" > lsblk< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > -no "fstype" "< / span > < / span > < span class = "org-string" > < span class = "org-constant" > < span class = "org-sh-quoted-exec" > $< / span > < / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > < span class = "org-sh-quoted-exec" > chosen< / span > < / span > < / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > ")< / span > < / span > < span class = "org-string" > "< / span >
< span class = "org-keyword" > case< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > partitiontype< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-keyword" > in< / span >
< span class = "org-string" > "vfat"< / span > ) < span class = "org-type" > sudo< / span > -A mount -t vfat < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > chosen< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > mp< / span > < / span > < span class = "org-string" > "< / span > -o rw,< span class = "org-variable-name" > umask< / span > =< span class = "org-highlight-numbers-number" > 0000< / span > ;;
*) < span class = "org-type" > sudo< / span > -A mount < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > chosen< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > mp< / span > < / span > < span class = "org-string" > "< / span > ; < span class = "org-variable-name" > user< / span > =< span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > $(< / span > < / span > < span class = "org-sh-quoted-exec" > whoami< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > )< / span > < / span > < span class = "org-string" > "< / span > ; < span class = "org-variable-name" > ug< / span > =< span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > $(< / span > < / span > < span class = "org-sh-quoted-exec" > groups< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > | awk '{print < / span > < / span > < span class = "org-string" > < span class = "org-constant" > < span class = "org-sh-quoted-exec" > $< / span > < / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > < span class = "org-sh-quoted-exec" > 1< / span > < / span > < / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > }')< / span > < / span > < span class = "org-string" > "< / span > ; < span class = "org-type" > sudo< / span > -A < span class = "org-type" > chown< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > user< / span > < / span > < span class = "org-string" > "< / span > :< span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > ug< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > mp< / span > < / span > < span class = "org-string" > "< / span > ;;
< span class = "org-keyword" > esac< / span >
notify-send < span class = "org-string" > "💻 USB mounting"< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > chosen< / span > < / span > < span class = "org-string" > mounted to < / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > mp< / span > < / span > < span class = "org-string" > ."< / span >
< span class = "org-rainbow-delimiters-depth-1" > }< / span >
< span class = "org-function-name" > mountandroid< / span > < span class = "org-rainbow-delimiters-depth-1" > ()< / span > < span class = "org-rainbow-delimiters-depth-1" > {< / span > < span class = "org-sh-escaped-newline" > \< / span >
< span class = "org-variable-name" > chosen< / span > =< span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > $(< / span > < / span > < span class = "org-sh-quoted-exec" > echo< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > "< / span > < / span > < span class = "org-string" > < span class = "org-constant" > < span class = "org-sh-quoted-exec" > $< / span > < / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > < span class = "org-sh-quoted-exec" > anddrives< / span > < / span > < / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > " | dmenu -i -p "Which Android device?")< / span > < / span > < span class = "org-string" > "< / span > || < span class = "org-keyword" > exit< / span > < span class = "org-highlight-numbers-number" > 1< / span >
< span class = "org-variable-name" > chosen< / span > =< span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > $(< / span > < / span > < span class = "org-sh-quoted-exec" > echo< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > "< / span > < / span > < span class = "org-string" > < span class = "org-constant" > < span class = "org-sh-quoted-exec" > $< / span > < / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > < span class = "org-sh-quoted-exec" > chosen< / span > < / span > < / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > " | cut -d : -f 1)< / span > < / span > < span class = "org-string" > "< / span >
getmount < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > HOME< / span > < / span > < span class = "org-string" > -maxdepth 3 -type d"< / span >
simple-mtpfs --device < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > chosen< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > mp< / span > < / span > < span class = "org-string" > "< / span >
< span class = "org-type" > echo< / span > < span class = "org-string" > "OK"< / span > | dmenu -i -p < span class = "org-string" > "Tap Allow on your phone if it asks for permission and then press enter"< / span > || < span class = "org-keyword" > exit< / span > < span class = "org-highlight-numbers-number" > 1< / span >
simple-mtpfs --device < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > chosen< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > mp< / span > < / span > < span class = "org-string" > "< / span >
notify-send < span class = "org-string" > "🤖 Android Mounting"< / span > < span class = "org-string" > "Android device mounted to < / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > mp< / span > < / span > < span class = "org-string" > ."< / span >
< span class = "org-rainbow-delimiters-depth-1" > }< / span >
< span class = "org-function-name" > asktype< / span > < span class = "org-rainbow-delimiters-depth-1" > ()< / span > < span class = "org-rainbow-delimiters-depth-1" > {< / span > < span class = "org-sh-escaped-newline" > \< / span >
< span class = "org-variable-name" > choice< / span > =< span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > $(< / span > < / span > < span class = "org-sh-quoted-exec" > printf< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > "USB\\nAndroid" | dmenu -i -p "Mount a USB drive or Android device?")< / span > < / span > < span class = "org-string" > "< / span > || < span class = "org-keyword" > exit< / span > < span class = "org-highlight-numbers-number" > 1< / span >
< span class = "org-keyword" > case< / span > $< span class = "org-variable-name" > choice< / span > < span class = "org-keyword" > in< / span >
USB) mountusb ;;
Android) mountandroid ;;
< span class = "org-keyword" > esac< / span >
< span class = "org-rainbow-delimiters-depth-1" > }< / span >
< span class = "org-variable-name" > anddrives< / span > =$< span class = "org-rainbow-delimiters-depth-1" > (< / span > < span class = "org-sh-quoted-exec" > simple-mtpfs< / span > -l < span class = "org-highlight-numbers-number" > 2< / span > > /dev/null< span class = "org-rainbow-delimiters-depth-1" > )< / span >
< span class = "org-variable-name" > usbdrives< / span > =< span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > $(< / span > < / span > < span class = "org-sh-quoted-exec" > lsblk< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > -rpo "name,type,size,mountpoint" | awk '< / span > < / span > < span class = "org-string" > < span class = "org-constant" > < span class = "org-sh-quoted-exec" > $< / span > < / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > < span class = "org-sh-quoted-exec" > 4< / span > < / span > < / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > ==""{printf "%s (%s)< / span > < / span > < span class = "org-string" > \n",< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 1< / span > < / span > < span class = "org-string" > ,< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 3< / span > < / span > < span class = "org-string" > }')"< / span >
< span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-1" > [< / span > -z < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > usbdrives< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-rainbow-delimiters-depth-1" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-rainbow-delimiters-depth-1" > [< / span > -z < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > anddrives< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-rainbow-delimiters-depth-1" > ]< / span > & & < span class = "org-type" > echo< / span > < span class = "org-string" > "No USB drive or Android device detected"< / span > & & < span class = "org-keyword" > exit< / span >
< span class = "org-type" > echo< / span > < span class = "org-string" > "Android device(s) detected."< / span >
mountandroid
< span class = "org-keyword" > else< / span >
< span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-1" > [< / span > -z < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > anddrives< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-rainbow-delimiters-depth-1" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-type" > echo< / span > < span class = "org-string" > "USB drive(s) detected."< / span >
mountusb
< span class = "org-keyword" > else< / span >
< span class = "org-type" > echo< / span > < span class = "org-string" > "Mountable USB drive(s) and Android device(s) detected."< / span >
asktype
< span class = "org-keyword" > fi< / span >
< span class = "org-keyword" > fi< / span >
< / pre >
< / div >
< / div >
< / div >
< div id = "outline-container-orgbff2106" class = "outline-2" >
< h2 id = "orgbff2106" > < code > dmenuumount< / code > - Unmount USB and Android devices< / h2 >
< div class = "outline-text-2" id = "text-orgbff2106" >
< p >
Script taken from Luke Smith.
< / p >
< div class = "org-src-container" >
< pre class = "src src-bash" > < span class = "org-function-name" > unmountusb< / span > < span class = "org-rainbow-delimiters-depth-1" > ()< / span > < span class = "org-rainbow-delimiters-depth-1" > {< / span >
< span class = "org-rainbow-delimiters-depth-2" > [< / span > -z < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > drives< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > & & < span class = "org-keyword" > exit< / span >
< span class = "org-variable-name" > chosen< / span > =< span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > $(< / span > < / span > < span class = "org-sh-quoted-exec" > echo< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > "< / span > < / span > < span class = "org-string" > < span class = "org-constant" > < span class = "org-sh-quoted-exec" > $< / span > < / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > < span class = "org-sh-quoted-exec" > drives< / span > < / span > < / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > " | dmenu -i -p "Unmount which drive?")< / span > < / span > < span class = "org-string" > "< / span > || < span class = "org-keyword" > exit< / span > < span class = "org-highlight-numbers-number" > 1< / span >
< span class = "org-variable-name" > chosen< / span > =< span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > $(< / span > < / span > < span class = "org-sh-quoted-exec" > echo< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > "< / span > < / span > < span class = "org-string" > < span class = "org-constant" > < span class = "org-sh-quoted-exec" > $< / span > < / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > < span class = "org-sh-quoted-exec" > chosen< / span > < / span > < / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > " | awk '{print < / span > < / span > < span class = "org-string" > < span class = "org-constant" > < span class = "org-sh-quoted-exec" > $< / span > < / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > < span class = "org-sh-quoted-exec" > 1< / span > < / span > < / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > }')< / span > < / span > < span class = "org-string" > "< / span >
< span class = "org-rainbow-delimiters-depth-2" > [< / span > -z < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > chosen< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > & & < span class = "org-keyword" > exit< / span >
< span class = "org-type" > sudo< / span > -A umount < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > chosen< / span > < / span > < span class = "org-string" > "< / span > & & notify-send < span class = "org-string" > "💻 USB unmounting"< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > chosen< / span > < / span > < span class = "org-string" > unmounted."< / span >
< span class = "org-rainbow-delimiters-depth-1" > }< / span >
< span class = "org-function-name" > unmountandroid< / span > < span class = "org-rainbow-delimiters-depth-1" > ()< / span > < span class = "org-rainbow-delimiters-depth-1" > {< / span > < span class = "org-sh-escaped-newline" > \< / span >
< span class = "org-variable-name" > chosen< / span > =< span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > $(< / span > < / span > < span class = "org-sh-quoted-exec" > awk< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > '/simple-mtpfs/ {print < / span > < / span > < span class = "org-string" > < span class = "org-constant" > < span class = "org-sh-quoted-exec" > $< / span > < / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > < span class = "org-sh-quoted-exec" > 2< / span > < / span > < / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > }' /etc/mtab | dmenu -i -p "Unmount which device?")< / span > < / span > < span class = "org-string" > "< / span > || < span class = "org-keyword" > exit< / span > < span class = "org-highlight-numbers-number" > 1< / span >
< span class = "org-rainbow-delimiters-depth-2" > [< / span > -z < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > chosen< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > & & < span class = "org-keyword" > exit< / span >
< span class = "org-type" > sudo< / span > -A umount -l < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > chosen< / span > < / span > < span class = "org-string" > "< / span > & & notify-send < span class = "org-string" > "🤖 Android unmounting"< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > chosen< / span > < / span > < span class = "org-string" > unmounted."< / span >
< span class = "org-rainbow-delimiters-depth-1" > }< / span >
< span class = "org-function-name" > asktype< / span > < span class = "org-rainbow-delimiters-depth-1" > ()< / span > < span class = "org-rainbow-delimiters-depth-1" > {< / span > < span class = "org-sh-escaped-newline" > \< / span >
< span class = "org-variable-name" > choice< / span > =< span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > $(< / span > < / span > < span class = "org-sh-quoted-exec" > printf< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > "USB\\nAndroid" | dmenu -i -p "Unmount a USB drive or Android device?")< / span > < / span > < span class = "org-string" > "< / span > || < span class = "org-keyword" > exit< / span > < span class = "org-highlight-numbers-number" > 1< / span >
< span class = "org-keyword" > case< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > choice< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-keyword" > in< / span >
USB) unmountusb ;;
Android) unmountandroid ;;
< span class = "org-keyword" > esac< / span >
< span class = "org-rainbow-delimiters-depth-1" > }< / span >
< span class = "org-variable-name" > drives< / span > =$< span class = "org-rainbow-delimiters-depth-1" > (< / span > < span class = "org-sh-quoted-exec" > lsblk< / span > -nrpo < span class = "org-string" > "name,type,size,mountpoint"< / span > | awk < span class = "org-string" > '$4!~/\/boot|\/home$|SWAP/& & length($4)> 1{printf "%s (%s)\n",$4,$3}'< / span > < span class = "org-rainbow-delimiters-depth-1" > )< / span >
< span class = "org-keyword" > if< / span > < span class = "org-negation-char" > !< / span > < span class = "org-type" > grep< / span > simple-mtpfs /etc/mtab; < span class = "org-keyword" > then< / span >
< span class = "org-rainbow-delimiters-depth-1" > [< / span > -z < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > drives< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-rainbow-delimiters-depth-1" > ]< / span > & & < span class = "org-type" > echo< / span > < span class = "org-string" > "No drives to unmount."< / span > & & < span class = "org-keyword" > exit< / span >
< span class = "org-type" > echo< / span > < span class = "org-string" > "Unmountable USB drive detected."< / span >
unmountusb
< span class = "org-keyword" > else< / span >
< span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-1" > [< / span > -z < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > drives< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-rainbow-delimiters-depth-1" > ]< / span >
< span class = "org-keyword" > then< / span >
< span class = "org-type" > echo< / span > < span class = "org-string" > "Unmountable Android device detected."< / span >
unmountandroid
< span class = "org-keyword" > else< / span >
< span class = "org-type" > echo< / span > < span class = "org-string" > "Unmountable USB drive(s) and Android device(s) detected."< / span >
asktype
< span class = "org-keyword" > fi< / span >
< span class = "org-keyword" > fi< / span >
2020-01-11 22:04:45 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-04-05 11:30:26 +02:00
< div id = "outline-container-orgd951db9" class = "outline-2" >
< h2 id = "orgd951db9" > < code > vpntoggle< / code > - Connect to VPN using NordVPN< / h2 >
< div class = "outline-text-2" id = "text-orgd951db9" >
2020-01-11 22:04:45 +01:00
< div class = "org-src-container" >
2020-11-03 16:27:09 +01:00
< pre class = "src src-bash" > < span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-1" > [< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > $< span class = "org-rainbow-delimiters-depth-3" > (< / span > < span class = "org-sh-quoted-exec" > nordvpn< / span > status< span class = "org-rainbow-delimiters-depth-3" > )< / span > == *< span class = "org-string" > "Connected"< / span > * < span class = "org-rainbow-delimiters-depth-2" > ]< / span > < span class = "org-rainbow-delimiters-depth-1" > ]< / span > ; < span class = "org-keyword" > then< / span >
nordvpn disconnect & & dunstify --replace=< span class = "org-highlight-numbers-number" > 23198< / span > < span class = "org-string" > "VPN"< / span > < span class = "org-string" > "Disconnected"< / span > ;
< span class = "org-keyword" > else< / span >
< span class = "org-variable-name" > country< / span > =< span class = "org-sh-quoted-exec" > `< / span > < span class = "org-type" > < span class = "org-sh-quoted-exec" > cat< / span > < / span > < span class = "org-sh-quoted-exec" > ~/.local/data/nordvpn_countries.txt | sed 's/\s*\t\s*/ /g ; s/\s/\n/g ; s/_/ /g ; /^[a-zA-Z]/!d ; s/\(.*\)/\L\1/' | rofi -i -dmenu | sed 's/\s/_/g'`< / span > ;
dunstify --replace=< span class = "org-highlight-numbers-number" > 23198< / span > < span class = "org-string" > "VPN"< / span > < span class = "org-string" > "Connecting to < / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > country< / span > < / span > < span class = "org-string" > ..."< / span > ;
nordvpn connect $< span class = "org-variable-name" > country< / span > & & dunstify --replace=< span class = "org-highlight-numbers-number" > 23198< / span > < span class = "org-string" > "VPN"< / span > < span class = "org-string" > "Connected to < / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > country< / span > < / span > < span class = "org-string" > "< / span > ;
< span class = "org-keyword" > fi< / span >
2020-01-11 22:04:45 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-04-05 11:30:26 +02:00
< div id = "outline-container-org39f3bdf" class = "outline-2" >
< h2 id = "org39f3bdf" > < code > bukurun< / code > - Open link from Buku< / h2 >
< div class = "outline-text-2" id = "text-org39f3bdf" >
2020-01-11 22:04:45 +01:00
< div class = "org-src-container" >
2020-11-03 16:27:09 +01:00
< pre class = "src src-bash" > < span class = "org-function-name" > _rofi< / span > < span class = "org-rainbow-delimiters-depth-1" > ()< / span > < span class = "org-rainbow-delimiters-depth-1" > {< / span >
rofi -dmenu -i -no-levenshtein-sort -width < span class = "org-highlight-numbers-number" > 1000< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > @< / span > < / span > < span class = "org-string" > "< / span >
< span class = "org-rainbow-delimiters-depth-1" > }< / span >
< span class = "org-comment-delimiter" > # < / span > < span class = "org-comment" > display settings< / span >
< span class = "org-variable-name" > display_type< / span > =< span class = "org-highlight-numbers-number" > 1< / span >
< span class = "org-variable-name" > max_str_width< / span > =< span class = "org-highlight-numbers-number" > 80< / span >
< span class = "org-comment-delimiter" > # < / span > < span class = "org-comment" > keybindings< / span >
< span class = "org-variable-name" > switch_view< / span > =< span class = "org-string" > "Alt+Tab"< / span >
< span class = "org-variable-name" > new_bookmark< / span > =< span class = "org-string" > "Alt+n"< / span >
< span class = "org-variable-name" > actions< / span > =< span class = "org-string" > "Alt+a"< / span >
< span class = "org-variable-name" > edit< / span > =< span class = "org-string" > "Alt+e"< / span >
< span class = "org-variable-name" > delete< / span > =< span class = "org-string" > "Alt+d"< / span >
< span class = "org-comment-delimiter" > # < / span > < span class = "org-comment" > colors< / span >
< span class = "org-variable-name" > help_color< / span > =< span class = "org-string" > "#334433"< / span >
< span class = "org-comment-delimiter" > # < / span > < span class = "org-comment" > source global config< / span >
< span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-1" > [< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > -f /etc/buku_run.config < span class = "org-rainbow-delimiters-depth-2" > ]< / span > < span class = "org-rainbow-delimiters-depth-1" > ]< / span >
< span class = "org-keyword" > then< / span >
< span class = "org-builtin" > source< / span > /etc/buku_run.config
< span class = "org-keyword" > fi< / span >
< span class = "org-comment-delimiter" > # < / span > < span class = "org-comment" > source local config:< / span >
< span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-1" > [< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > -z $< span class = "org-variable-name" > XDG_CONFIG_DIR< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > < span class = "org-rainbow-delimiters-depth-1" > ]< / span >
< span class = "org-keyword" > then< / span >
< span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-1" > [< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > -f $< span class = "org-variable-name" > HOME< / span > /.config/buku_run/config < span class = "org-rainbow-delimiters-depth-2" > ]< / span > < span class = "org-rainbow-delimiters-depth-1" > ]< / span >
< span class = "org-keyword" > then< / span >
< span class = "org-builtin" > source< / span > $< span class = "org-variable-name" > HOME< / span > /.config/buku_run/config
< span class = "org-keyword" > else< / span >
< span class = "org-type" > echo< / span > < span class = "org-string" > "User config file \'~/.config/buku_run/config\' not found. using global config"< / span >
< span class = "org-keyword" > fi< / span >
< span class = "org-keyword" > else< / span >
< span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-1" > [< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > -f < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > {XDG_CONFIG_DIR}< / span > < / span > < span class = "org-string" > /buku_run/config"< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > < span class = "org-rainbow-delimiters-depth-1" > ]< / span >
< span class = "org-keyword" > then< / span >
< span class = "org-builtin" > source< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > {XDG_CONFIG_DIR}< / span > < / span > < span class = "org-string" > /buku_run/config"< / span >
< span class = "org-keyword" > else< / span >
< span class = "org-type" > echo< / span > < span class = "org-string" > "User config file \'~/.config/buku_run/config\' not found. using global config"< / span >
< span class = "org-keyword" > fi< / span >
< span class = "org-keyword" > fi< / span >
< span class = "org-function-name" > main< / span > < span class = "org-rainbow-delimiters-depth-1" > ()< / span > < span class = "org-rainbow-delimiters-depth-1" > {< / span >
< span class = "org-variable-name" > HELP< / span > =< span class = "org-string" > "Welcome to Buku. Use < span color='< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > {help_color}< / span > < / span > < span class = "org-string" > '> < / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > {new_bookmark}< / span > < / span > < span class = "org-string" > < /span> to add a new Bookmark< / span >
< span class = "org-string" > Use < span color='< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > {help_color}< / span > < / span > < span class = "org-string" > '> < / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > {switch_view}< / span > < / span > < span class = "org-string" > < /span> to switch View. < span color='< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > {help_color}< / span > < / span > < span class = "org-string" > '> < / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > {actions}< / span > < / span > < span class = "org-string" > < /span> for actions"< / span >
< span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > mode< / span > == < span class = "org-string" > "bookmarks"< / span > < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-variable-name" > content< / span > =$< span class = "org-rainbow-delimiters-depth-2" > (< / span > < span class = "org-sh-quoted-exec" > parseBuku< / span > < span class = "org-rainbow-delimiters-depth-2" > )< / span >
< span class = "org-variable-name" > menu< / span > =$< span class = "org-rainbow-delimiters-depth-2" > (< / span > < span class = "org-sh-quoted-exec" > echo< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > {content}< / span > < / span > < span class = "org-string" > "< / span > | _rofi -p < span class = "org-string" > '> '< / span > -filter < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > {filter}< / span > < / span > < span class = "org-string" > "< / span > -mesg < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > {HELP}< / span > < / span > < span class = "org-string" > "< / span > -kb-custom-1 < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > {new_bookmark}< / span > < / span > < span class = "org-string" > "< / span > -kb-custom-2 < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > {switch_view}< / span > < / span > < span class = "org-string" > "< / span > -kb-custom-3 < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > {actions}< / span > < / span > < span class = "org-string" > "< / span > -kb-custom-4 < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > {edit}< / span > < / span > < span class = "org-string" > "< / span > -kb-custom-5 < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > {delete}< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-rainbow-delimiters-depth-2" > )< / span >
< span class = "org-keyword" > elif< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > mode< / span > == < span class = "org-string" > "tags"< / span > < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-variable-name" > menu< / span > =$< span class = "org-rainbow-delimiters-depth-2" > (< / span > < span class = "org-sh-quoted-exec" > buku< / span > --np --st | awk < span class = "org-string" > '{$NF=""; print $0}'< / span > | cut -d < span class = "org-string" > ' '< / span > -f2- | _rofi -p < span class = "org-string" > '> '< / span > -mesg < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > {HELP}< / span > < / span > < span class = "org-string" > "< / span > -kb-custom-1 < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > {new_bookmark}< / span > < / span > < span class = "org-string" > "< / span > -kb-custom-2 < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > {switch_view}< / span > < / span > < span class = "org-string" > "< / span > -kb-custom-3 < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > {actions}< / span > < / span > < span class = "org-string" > "< / span > -kb-custom-4 < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > {edit}< / span > < / span > < span class = "org-string" > "< / span > -kb-custom-5 < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > {delete}< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-rainbow-delimiters-depth-2" > )< / span >
< span class = "org-keyword" > fi< / span >
< span class = "org-variable-name" > val< / span > =$< span class = "org-variable-name" > ?< / span >
< span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > val< / span > -eq < span class = "org-highlight-numbers-number" > 1< / span > < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-keyword" > exit< / span >
< span class = "org-keyword" > elif< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > val< / span > -eq < span class = "org-highlight-numbers-number" > 12< / span > < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
2020-01-11 22:04:45 +01:00
optionsMenu
2020-11-03 16:27:09 +01:00
< span class = "org-keyword" > elif< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > val< / span > -eq < span class = "org-highlight-numbers-number" > 10< / span > < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
2020-01-11 22:04:45 +01:00
addMark
2020-11-03 16:27:09 +01:00
< span class = "org-keyword" > elif< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > val< / span > -eq < span class = "org-highlight-numbers-number" > 14< / span > < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
2020-01-11 22:04:45 +01:00
deleteMenu
2020-11-03 16:27:09 +01:00
< span class = "org-keyword" > elif< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > val< / span > -eq < span class = "org-highlight-numbers-number" > 13< / span > < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
2020-01-11 22:04:45 +01:00
editMenu
2020-11-03 16:27:09 +01:00
< span class = "org-keyword" > elif< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > val< / span > -eq < span class = "org-highlight-numbers-number" > 11< / span > < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > mode< / span > == < span class = "org-string" > "bookmarks"< / span > < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-builtin" > export< / span > < span class = "org-variable-name" > mode< / span > =< span class = "org-string" > "tags"< / span >
< span class = "org-variable-name" > mode< / span > =tags main
< span class = "org-keyword" > elif< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > mode< / span > == < span class = "org-string" > "tags"< / span > < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-builtin" > export< / span > < span class = "org-variable-name" > mode< / span > =< span class = "org-string" > "bookmarks"< / span >
< span class = "org-variable-name" > mode< / span > =bookmarks main
< span class = "org-keyword" > fi< / span >
< span class = "org-keyword" > elif< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > val< / span > -eq < span class = "org-highlight-numbers-number" > 0< / span > < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > mode< / span > == < span class = "org-string" > "bookmarks"< / span > < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-variable-name" > id< / span > =$< span class = "org-rainbow-delimiters-depth-2" > (< / span > < span class = "org-sh-quoted-exec" > getId< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > content< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > menu< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-rainbow-delimiters-depth-2" > )< / span >
< span class = "org-keyword" > for< / span > bm< span class = "org-keyword" > in< / span > $< span class = "org-rainbow-delimiters-depth-2" > {< / span > < span class = "org-variable-name" > id< / span > < span class = "org-rainbow-delimiters-depth-2" > }< / span > ; < span class = "org-keyword" > do< / span >
buku -o < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > {bm}< / span > < / span > < span class = "org-string" > "< / span >
< span class = "org-keyword" > done< / span >
< span class = "org-keyword" > elif< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > mode< / span > == < span class = "org-string" > "tags"< / span > < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-variable-name" > filter< / span > =< span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > {menu}< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-variable-name" > mode< / span > =< span class = "org-string" > "bookmarks"< / span > main
< span class = "org-keyword" > fi< / span >
< span class = "org-keyword" > fi< / span >
< span class = "org-rainbow-delimiters-depth-1" > }< / span >
< span class = "org-function-name" > optionsMenu< / span > < span class = "org-rainbow-delimiters-depth-1" > ()< / span > < span class = "org-rainbow-delimiters-depth-1" > {< / span >
< span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > mode< / span > == < span class = "org-string" > "bookmarks"< / span > < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-variable-name" > askmenu< / span > =$< span class = "org-rainbow-delimiters-depth-2" > (< / span > < span class = "org-sh-quoted-exec" > echo< / span > -e < span class = "org-string" > "< Return\n---\n1. Edit\n2. Delete"< / span > | _rofi -p < span class = "org-string" > '> '< / span > -mesg < span class = "org-string" > "Choose Action for bookmark"< / span > < span class = "org-rainbow-delimiters-depth-2" > )< / span >
< span class = "org-variable-name" > val< / span > =$< span class = "org-variable-name" > ?< / span >
< span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > val< / span > -eq < span class = "org-highlight-numbers-number" > 1< / span > < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-keyword" > exit< / span >
< span class = "org-keyword" > elif< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > val< / span > -eq < span class = "org-highlight-numbers-number" > 0< / span > < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > askmenu< / span > == < span class = "org-string" > "< Return"< / span > < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-builtin" > export< / span > < span class = "org-variable-name" > mode< / span > =bookmarks
2020-01-11 22:04:45 +01:00
main
2020-11-03 16:27:09 +01:00
< span class = "org-keyword" > elif< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > askmenu< / span > == < span class = "org-string" > "1. Edit"< / span > < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
2020-01-11 22:04:45 +01:00
editMenu
2020-11-03 16:27:09 +01:00
< span class = "org-keyword" > elif< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > askmenu< / span > == < span class = "org-string" > "2. Delete"< / span > < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
2020-01-11 22:04:45 +01:00
deleteMenu
2020-11-03 16:27:09 +01:00
< span class = "org-keyword" > fi< / span >
< span class = "org-keyword" > fi< / span >
< span class = "org-keyword" > elif< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > mode< / span > == < span class = "org-string" > "tags"< / span > < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-variable-name" > askmenu< / span > =$< span class = "org-rainbow-delimiters-depth-2" > (< / span > < span class = "org-sh-quoted-exec" > echo< / span > -e < span class = "org-string" > "< Return\n---\n1. Replace Tag\n2. Delete Tag"< / span > | _rofi -p < span class = "org-string" > '> '< / span > -mesg < span class = "org-string" > "Choose Action for tag \"< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > {menu}< / span > < / span > < span class = "org-string" > \""< / span > < span class = "org-rainbow-delimiters-depth-2" > )< / span >
< span class = "org-variable-name" > val< / span > =$< span class = "org-variable-name" > ?< / span >
< span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > val< / span > -eq < span class = "org-highlight-numbers-number" > 1< / span > < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-keyword" > exit< / span >
< span class = "org-keyword" > elif< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > val< / span > -eq < span class = "org-highlight-numbers-number" > 0< / span > < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > askmenu< / span > == < span class = "org-string" > "< Return"< / span > < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-builtin" > export< / span > < span class = "org-variable-name" > mode< / span > =tags
2020-01-11 22:04:45 +01:00
main
2020-11-03 16:27:09 +01:00
< span class = "org-keyword" > elif< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > askmenu< / span > == < span class = "org-string" > "1. Replace Tag"< / span > < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-variable-name" > newtag< / span > =$< span class = "org-rainbow-delimiters-depth-2" > (< / span > < span class = "org-sh-quoted-exec" > echo< / span > | _rofi -p < span class = "org-string" > '> '< / span > -mesg < span class = "org-string" > "Enter new tag name for tag \"< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > {menu}< / span > < / span > < span class = "org-string" > \""< / span > < span class = "org-rainbow-delimiters-depth-2" > )< / span >
< span class = "org-variable-name" > val< / span > =$< span class = "org-variable-name" > ?< / span >
< span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > val< / span > -eq < span class = "org-highlight-numbers-number" > 1< / span > < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-keyword" > exit< / span >
< span class = "org-keyword" > elif< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > val< / span > -eq < span class = "org-highlight-numbers-number" > 0< / span > < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > newtag< / span > == < span class = "org-string" > ""< / span > < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-variable-name" > mode< / span > =tags main
< span class = "org-keyword" > else< / span >
buku -r < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > {menu}< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > {newtag}< / span > < / span > < span class = "org-string" > "< / span >
< span class = "org-variable-name" > mode< / span > =tags main
< span class = "org-keyword" > fi< / span >
< span class = "org-keyword" > fi< / span >
< span class = "org-keyword" > elif< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > askmenu< / span > == < span class = "org-string" > "2. Delete Tag"< / span > < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-variable-name" > delask< / span > =$< span class = "org-rainbow-delimiters-depth-2" > (< / span > < span class = "org-sh-quoted-exec" > echo< / span > -e < span class = "org-string" > "1. Yes\n2. No"< / span > | _rofi -p < span class = "org-string" > '> '< / span > -mesg < span class = "org-string" > "Really delete tag?"< / span > < span class = "org-rainbow-delimiters-depth-2" > )< / span >
< span class = "org-variable-name" > val< / span > =$< span class = "org-variable-name" > ?< / span >
< span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > val< / span > -eq < span class = "org-highlight-numbers-number" > 1< / span > < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-keyword" > exit< / span >
< span class = "org-keyword" > elif< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > val< / span > -eq < span class = "org-highlight-numbers-number" > 0< / span > < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > delask< / span > == < span class = "org-string" > "1. Yes"< / span > < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
buku -r < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > {menu}< / span > < / span > < span class = "org-string" > "< / span >
< span class = "org-variable-name" > mode< / span > =tags main
< span class = "org-keyword" > elif< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > delask< / span > == < span class = "org-string" > "2. No"< / span > < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-variable-name" > mode< / span > =tags main
< span class = "org-keyword" > fi< / span >
< span class = "org-keyword" > fi< / span >
< span class = "org-keyword" > fi< / span >
< span class = "org-keyword" > fi< / span >
< span class = "org-keyword" > fi< / span >
< span class = "org-rainbow-delimiters-depth-1" > }< / span >
< span class = "org-function-name" > deleteMenu< / span > < span class = "org-rainbow-delimiters-depth-1" > ()< / span > < span class = "org-rainbow-delimiters-depth-1" > {< / span >
< span class = "org-variable-name" > id< / span > =$< span class = "org-rainbow-delimiters-depth-2" > (< / span > < span class = "org-sh-quoted-exec" > getId< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > content< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > menu< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-rainbow-delimiters-depth-2" > )< / span >
< span class = "org-variable-name" > delask< / span > =$< span class = "org-rainbow-delimiters-depth-2" > (< / span > < span class = "org-sh-quoted-exec" > echo< / span > -e < span class = "org-string" > "1. Yes\n2. No"< / span > | _rofi -p < span class = "org-string" > '> '< / span > -mesg < span class = "org-string" > "Really delete bookmark?"< / span > < span class = "org-rainbow-delimiters-depth-2" > )< / span >
< span class = "org-variable-name" > val< / span > =$< span class = "org-variable-name" > ?< / span >
< span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > val< / span > -eq < span class = "org-highlight-numbers-number" > 1< / span > < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-keyword" > exit< / span >
< span class = "org-keyword" > elif< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > val< / span > -eq < span class = "org-highlight-numbers-number" > 0< / span > < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > delask< / span > == < span class = "org-string" > "1. Yes"< / span > < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
buku -d $< span class = "org-rainbow-delimiters-depth-2" > {< / span > < span class = "org-variable-name" > id< / span > < span class = "org-rainbow-delimiters-depth-2" > }< / span > --tacit
< span class = "org-variable-name" > mode< / span > =bookmarks main
< span class = "org-keyword" > elif< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > delask< / span > == < span class = "org-string" > "2. No"< / span > < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
2020-01-11 22:04:45 +01:00
optionsMenu
2020-11-03 16:27:09 +01:00
< span class = "org-keyword" > fi< / span >
< span class = "org-keyword" > fi< / span >
< span class = "org-rainbow-delimiters-depth-1" > }< / span >
< span class = "org-function-name" > editMenu< / span > < span class = "org-rainbow-delimiters-depth-1" > ()< / span > < span class = "org-rainbow-delimiters-depth-1" > {< / span >
< span class = "org-variable-name" > id< / span > =$< span class = "org-rainbow-delimiters-depth-2" > (< / span > < span class = "org-sh-quoted-exec" > getId< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > content< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > menu< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-rainbow-delimiters-depth-2" > )< / span >
< span class = "org-variable-name" > title< / span > =< span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > $(< / span > < / span > < span class = "org-sh-quoted-exec" > getTitleFromId< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > < / span > < / span > < span class = "org-string" > < span class = "org-constant" > < span class = "org-sh-quoted-exec" > $< / span > < / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > < span class = "org-sh-quoted-exec" > id< / span > < / span > < / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > )< / span > < / span > < span class = "org-string" > "< / span >
< span class = "org-variable-name" > bookmark< / span > =< span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > $(< / span > < / span > < span class = "org-sh-quoted-exec" > getUrlFromId< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > < / span > < / span > < span class = "org-string" > < span class = "org-constant" > < span class = "org-sh-quoted-exec" > $< / span > < / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > < span class = "org-sh-quoted-exec" > id< / span > < / span > < / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > )< / span > < / span > < span class = "org-string" > "< / span >
< span class = "org-variable-name" > tags< / span > =< span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > $(< / span > < / span > < span class = "org-sh-quoted-exec" > getTagsFromId< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > < / span > < / span > < span class = "org-string" > < span class = "org-constant" > < span class = "org-sh-quoted-exec" > $< / span > < / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > < span class = "org-sh-quoted-exec" > id< / span > < / span > < / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > )< / span > < / span > < span class = "org-string" > "< / span >
< span class = "org-variable-name" > content< / span > =$< span class = "org-rainbow-delimiters-depth-2" > (< / span > < span class = "org-sh-quoted-exec" > echo< / span > -e < span class = "org-string" > "1. title: < / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > title< / span > < / span > < span class = "org-string" > \n2. url: < / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > bookmark< / span > < / span > < span class = "org-string" > \n3. tags: < / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > tags< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-rainbow-delimiters-depth-2" > )< / span >
< span class = "org-variable-name" > editmenu< / span > =$< span class = "org-rainbow-delimiters-depth-2" > (< / span > < span class = "org-sh-quoted-exec" > echo< / span > -e < span class = "org-string" > "< Return\n---\n< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > {content}< / span > < / span > < span class = "org-string" > "< / span > | _rofi -p < span class = "org-string" > '> '< / span > < span class = "org-rainbow-delimiters-depth-2" > )< / span >
< span class = "org-variable-name" > val< / span > =$< span class = "org-variable-name" > ?< / span >
< span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > val< / span > -eq < span class = "org-highlight-numbers-number" > 1< / span > < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-keyword" > exit< / span >
< span class = "org-keyword" > elif< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > val< / span > -eq < span class = "org-highlight-numbers-number" > 0< / span > < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > editmenu< / span > == < span class = "org-string" > "< Return"< / span > < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
2020-01-11 22:04:45 +01:00
main
2020-11-03 16:27:09 +01:00
< span class = "org-keyword" > elif< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > editmenu< / span > == < span class = "org-string" > "tags: NOTAG"< / span > < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
2020-01-11 22:04:45 +01:00
addTags --update
2020-11-03 16:27:09 +01:00
< span class = "org-keyword" > elif< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > editmenu< / span > =~ tags:* < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-variable-name" > tags< / span > =< span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > {tags}< / span > < / span > < span class = "org-string" > "< / span > editTags
< span class = "org-keyword" > elif< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > editmenu< / span > =~ url:* < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
2020-01-11 22:04:45 +01:00
editBookmark
2020-11-03 16:27:09 +01:00
< span class = "org-keyword" > elif< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > editmenu< / span > =~ title:* < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
2020-01-11 22:04:45 +01:00
editTitle
2020-11-03 16:27:09 +01:00
< span class = "org-keyword" > fi< / span >
< span class = "org-keyword" > fi< / span >
< span class = "org-rainbow-delimiters-depth-1" > }< / span >
< span class = "org-function-name" > editTags< / span > < span class = "org-rainbow-delimiters-depth-1" > ()< / span > < span class = "org-rainbow-delimiters-depth-1" > {< / span >
< span class = "org-variable-name" > edittagsmenu< / span > =$< span class = "org-rainbow-delimiters-depth-2" > (< / span > < span class = "org-sh-quoted-exec" > echo< / span > | _rofi -filter < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > {tags}< / span > < / span > < span class = "org-string" > "< / span > -p < span class = "org-string" > '> '< / span > -mesg < span class = "org-string" > "Edit Tags and hit Enter"< / span > < span class = "org-rainbow-delimiters-depth-2" > )< / span >
< span class = "org-variable-name" > val< / span > =$< span class = "org-variable-name" > ?< / span >
< span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > val< / span > -eq < span class = "org-highlight-numbers-number" > 1< / span > < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-keyword" > exit< / span >
< span class = "org-keyword" > elif< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > val< / span > -eq < span class = "org-highlight-numbers-number" > 0< / span > < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
buku -u $< span class = "org-rainbow-delimiters-depth-2" > {< / span > < span class = "org-variable-name" > id< / span > < span class = "org-rainbow-delimiters-depth-2" > }< / span > --tag < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > {edittagsmenu}< / span > < / span > < span class = "org-string" > "< / span >
< span class = "org-keyword" > fi< / span >
< span class = "org-variable-name" > mode< / span > =bookmarks main
< span class = "org-rainbow-delimiters-depth-1" > }< / span >
< span class = "org-function-name" > editBookmark< / span > < span class = "org-rainbow-delimiters-depth-1" > ()< / span > < span class = "org-rainbow-delimiters-depth-1" > {< / span >
< span class = "org-variable-name" > bmarkmenu< / span > =$< span class = "org-rainbow-delimiters-depth-2" > (< / span > < span class = "org-sh-quoted-exec" > echo< / span > < span class = "org-string" > ""< / span > | _rofi -p < span class = "org-string" > "> "< / span > -filter < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > {bookmark}< / span > < / span > < span class = "org-string" > "< / span > -mesg < span class = "org-string" > "Edit Bookmark and hit Enter"< / span > < span class = "org-rainbow-delimiters-depth-2" > )< / span >
< span class = "org-variable-name" > val< / span > =$< span class = "org-variable-name" > ?< / span >
< span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > val< / span > -eq < span class = "org-highlight-numbers-number" > 1< / span > < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-keyword" > exit< / span >
< span class = "org-keyword" > elif< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > val< / span > -eq < span class = "org-highlight-numbers-number" > 0< / span > < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > bmarkmenu< / span > == < span class = "org-string" > "http"< / span > * < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
buku -u < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > {id}< / span > < / span > < span class = "org-string" > "< / span > --url < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > {bmarkmenu}< / span > < / span > < span class = "org-string" > "< / span >
< span class = "org-keyword" > else< / span >
< span class = "org-type" > echo< / span > < span class = "org-string" > ""< / span > | rofi -e < span class = "org-string" > "Not a valid URI, Make sure URLs start with http"< / span >
2020-01-11 22:04:45 +01:00
editBookmark
2020-11-03 16:27:09 +01:00
< span class = "org-keyword" > fi< / span >
< span class = "org-keyword" > fi< / span >
< span class = "org-variable-name" > mode< / span > =bookmarks main
< span class = "org-rainbow-delimiters-depth-1" > }< / span >
< span class = "org-function-name" > editTitle< / span > < span class = "org-rainbow-delimiters-depth-1" > ()< / span > < span class = "org-rainbow-delimiters-depth-1" > {< / span >
< span class = "org-variable-name" > titlemenu< / span > =$< span class = "org-rainbow-delimiters-depth-2" > (< / span > < span class = "org-sh-quoted-exec" > echo< / span > < span class = "org-string" > ""< / span > | _rofi -p < span class = "org-string" > "> "< / span > -filter < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > {title}< / span > < / span > < span class = "org-string" > "< / span > -mesg < span class = "org-string" > "Edit Title and hit Enter"< / span > < span class = "org-rainbow-delimiters-depth-2" > )< / span >
< span class = "org-variable-name" > val< / span > =$< span class = "org-variable-name" > ?< / span >
< span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > val< / span > -eq < span class = "org-highlight-numbers-number" > 1< / span > < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-keyword" > exit< / span >
< span class = "org-keyword" > elif< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > val< / span > -eq < span class = "org-highlight-numbers-number" > 0< / span > < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
buku -u < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > {id}< / span > < / span > < span class = "org-string" > "< / span > --title < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > {titlemenu}< / span > < / span > < span class = "org-string" > "< / span >
< span class = "org-keyword" > fi< / span >
< span class = "org-variable-name" > mode< / span > =bookmarks main
< span class = "org-rainbow-delimiters-depth-1" > }< / span >
< span class = "org-function-name" > addMark< / span > < span class = "org-rainbow-delimiters-depth-1" > ()< / span > < span class = "org-rainbow-delimiters-depth-1" > {< / span >
< span class = "org-variable-name" > inserturl< / span > =< span class = "org-sh-quoted-exec" > $< / span > < span class = "org-sh-quoted-exec" > < span class = "org-rainbow-delimiters-depth-2" > (< / span > < / span > < span class = "org-sh-quoted-exec" > echo -e < / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > "$(< / span > < / span > < span class = "org-sh-quoted-exec" > xclip< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > -o)< / span > < / span > < span class = "org-string" > "< / span > | _rofi -p < span class = "org-string" > '> '< / span > -mesg < span class = "org-string" > "Use URL below or type manually"< / span > < span class = "org-rainbow-delimiters-depth-2" > )< / span >
< span class = "org-variable-name" > val< / span > =$< span class = "org-variable-name" > ?< / span >
< span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > val< / span > -eq < span class = "org-highlight-numbers-number" > 1< / span > < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-keyword" > exit< / span >
< span class = "org-keyword" > elif< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > val< / span > -eq < span class = "org-highlight-numbers-number" > 0< / span > < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
2020-01-11 22:04:45 +01:00
addTags
2020-11-03 16:27:09 +01:00
< span class = "org-keyword" > fi< / span >
< span class = "org-rainbow-delimiters-depth-1" > }< / span >
< span class = "org-function-name" > addTags< / span > < span class = "org-rainbow-delimiters-depth-1" > ()< / span > < span class = "org-rainbow-delimiters-depth-1" > {< / span >
< span class = "org-variable-name" > inserttags< / span > =$< span class = "org-rainbow-delimiters-depth-2" > (< / span > < span class = "org-sh-quoted-exec" > buku< / span > --np --st | awk < span class = "org-string" > '{$NF=""; print $0}'< / span > | cut -d < span class = "org-string" > ' '< / span > -f2- | _rofi -p < span class = "org-string" > '> '< / span > -mesg < span class = "org-string" > "Add some tags. Separate tags with ', '"< / span > < span class = "org-rainbow-delimiters-depth-2" > )< / span >
< span class = "org-variable-name" > val< / span > =$< span class = "org-variable-name" > ?< / span >
< span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > val< / span > -eq < span class = "org-highlight-numbers-number" > 1< / span > < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-keyword" > exit< / span >
< span class = "org-keyword" > elif< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-variable-name" > val< / span > -eq < span class = "org-highlight-numbers-number" > 0< / span > < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-rainbow-delimiters-depth-1" > (< / span > < span class = "org-sh-quoted-exec" > echo< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > {inserttags}< / span > < / span > < span class = "org-string" > "< / span > | wc -l< span class = "org-rainbow-delimiters-depth-1" > )< / span > -gt < span class = "org-highlight-numbers-number" > 1< / span > < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-variable-name" > taglist< / span > =$< span class = "org-rainbow-delimiters-depth-2" > (< / span > < span class = "org-sh-quoted-exec" > echo< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > {inserttags}< / span > < / span > < span class = "org-string" > "< / span > | tr < span class = "org-string" > '\n'< / span > < span class = "org-string" > ','< / span > < span class = "org-rainbow-delimiters-depth-2" > )< / span >
< span class = "org-variable-name" > tags< / span > =< span class = "org-rainbow-delimiters-depth-2" > ()< / span >
< span class = "org-keyword" > for< / span > tag< span class = "org-keyword" > in< / span > $< span class = "org-variable-name" > taglist< / span > ; < span class = "org-keyword" > do< / span >
< span class = "org-variable-name" > tags< / span > +=< span class = "org-rainbow-delimiters-depth-2" > (< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > tag< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-rainbow-delimiters-depth-2" > )< / span >
< span class = "org-keyword" > done< / span >
< span class = "org-keyword" > else< / span >
< span class = "org-variable-name" > tags< / span > =$< span class = "org-rainbow-delimiters-depth-2" > {< / span > < span class = "org-variable-name" > inserttags< / span > < span class = "org-rainbow-delimiters-depth-2" > }< / span >
< span class = "org-keyword" > fi< / span >
< span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-rainbow-delimiters-depth-3" > [< / span > $< span class = "org-highlight-numbers-number" > 1< / span > == < span class = "org-string" > "--update"< / span > < span class = "org-rainbow-delimiters-depth-3" > ]< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
buku -u < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > {id}< / span > < / span > < span class = "org-string" > "< / span > --tag $< span class = "org-rainbow-delimiters-depth-2" > {< / span > < span class = "org-variable-name" > tags< / span > < span class = "org-rainbow-delimiters-depth-2" > }< / span >
< span class = "org-keyword" > else< / span >
buku -a $< span class = "org-rainbow-delimiters-depth-2" > {< / span > < span class = "org-variable-name" > inserturl< / span > < span class = "org-rainbow-delimiters-depth-2" > }< / span > $< span class = "org-rainbow-delimiters-depth-2" > {< / span > < span class = "org-variable-name" > tags< / span > < span class = "org-rainbow-delimiters-depth-2" > }< / span >
< span class = "org-keyword" > fi< / span >
< span class = "org-keyword" > fi< / span >
< span class = "org-rainbow-delimiters-depth-1" > }< / span >
< span class = "org-function-name" > parseBuku< / span > < span class = "org-rainbow-delimiters-depth-1" > ()< / span > < span class = "org-rainbow-delimiters-depth-1" > {< / span >
< span class = "org-type" > echo< / span > < span class = "org-string" > "$(< / span > < span class = "org-sh-quoted-exec" > buku< / span > < span class = "org-string" > --nc -p | gawk -v max="< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > max_str_width< / span > < / span > < span class = "org-string" > " -v type="< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > display_type< / span > < / span > < span class = "org-string" > " '< / span >
< span class = "org-string" > BEGIN {< / span >
< span class = "org-string" > RS=""< / span >
< span class = "org-string" > FS="\n"< / span >
< span class = "org-string" > }< / span >
< span class = "org-string" > {< / span >
< span class = "org-string" > if (< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 3< / span > < / span > < span class = "org-string" > == "")< / span >
< span class = "org-string" > < / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 3< / span > < / span > < span class = "org-string" > = " # NOTAG"< / span >
< span class = "org-string" > id = gensub(/([0-9]+)\.(.*)/, "\\1", "g", < / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 1< / span > < / span > < span class = "org-string" > )< / span >
< span class = "org-string" > url = substr(gensub(/\s+> (.*)/, "\\1", "g", < / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 2< / span > < / span > < span class = "org-string" > ),0,max)< / span >
< span class = "org-string" > tags = gensub(/\s+# (.*)/, "\\1", "g", < / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 3< / span > < / span > < span class = "org-string" > )< / span >
< span class = "org-string" > title = substr(gensub(/[0-9]+\.\s*(.*)/, "\\1", "g", < / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 1< / span > < / span > < span class = "org-string" > ),0,max)< / span >
< span class = "org-string" > if (type == 1)< / span >
< span class = "org-string" > print id "\t" url "\t" tags< / span >
< span class = "org-string" > else< / span >
< span class = "org-string" > print id "\t" title "\t" tags< / span >
< span class = "org-string" > if (type == 3)< / span >
< span class = "org-string" > print " \t" url "\t "< / span >
< span class = "org-string" > print ""< / span >
< span class = "org-string" > }< / span >
< span class = "org-string" > ' | column -t -s $'\t')"< / span >
< span class = "org-rainbow-delimiters-depth-1" > }< / span >
< span class = "org-function-name" > getId< / span > < span class = "org-rainbow-delimiters-depth-1" > ()< / span > < span class = "org-rainbow-delimiters-depth-1" > {< / span >
< span class = "org-variable-name" > id< / span > =$< span class = "org-rainbow-delimiters-depth-2" > (< / span > < span class = "org-sh-quoted-exec" > echo< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > {2%% *}< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-rainbow-delimiters-depth-2" > )< / span >
< span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > -z < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > id< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-variable-name" > prev< / span > =< span class = "org-string" > ""< / span >
< span class = "org-variable-name" > IFS< / span > =$< span class = "org-string" > '\n'< / span >
< span class = "org-keyword" > for< / span > line< span class = "org-keyword" > in< / span > $< span class = "org-highlight-numbers-number" > 1< / span > ; < span class = "org-keyword" > do< / span >
< span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 2< / span > < / span > < span class = "org-string" > "< / span > = < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > line< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-variable-name" > id< / span > =$< span class = "org-rainbow-delimiters-depth-2" > (< / span > < span class = "org-sh-quoted-exec" > echo< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > {prev%% *}< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-rainbow-delimiters-depth-2" > )< / span >
< span class = "org-keyword" > break< / span >
< span class = "org-keyword" > else< / span >
< span class = "org-variable-name" > prev< / span > =< span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > line< / span > < / span > < span class = "org-string" > "< / span >
< span class = "org-keyword" > fi< / span >
< span class = "org-keyword" > done< / span >
< span class = "org-keyword" > fi< / span >
< span class = "org-type" > echo< / span > $< span class = "org-variable-name" > id< / span >
< span class = "org-rainbow-delimiters-depth-1" > }< / span >
< span class = "org-function-name" > getTitleFromId< / span > < span class = "org-rainbow-delimiters-depth-1" > ()< / span > < span class = "org-rainbow-delimiters-depth-1" > {< / span >
< span class = "org-type" > echo< / span > < span class = "org-string" > "$(< / span > < span class = "org-sh-quoted-exec" > buku< / span > < span class = "org-string" > --nc -p < / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 1< / span > < / span > < span class = "org-string" > | gawk '< / span >
< span class = "org-string" > BEGIN {< / span >
< span class = "org-string" > RS=""< / span >
< span class = "org-string" > FS="\n"< / span >
< span class = "org-string" > }< / span >
< span class = "org-string" > {< / span >
< span class = "org-string" > print gensub(/[0-9]+\.\s*(.*)/, "\\1", "g", < / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 1< / span > < / span > < span class = "org-string" > )< / span >
< span class = "org-string" > }< / span >
< span class = "org-string" > ')"< / span >
< span class = "org-rainbow-delimiters-depth-1" > }< / span >
< span class = "org-function-name" > getUrlFromId< / span > < span class = "org-rainbow-delimiters-depth-1" > ()< / span > < span class = "org-rainbow-delimiters-depth-1" > {< / span >
< span class = "org-type" > echo< / span > < span class = "org-string" > "$(< / span > < span class = "org-sh-quoted-exec" > buku< / span > < span class = "org-string" > --nc -p < / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 1< / span > < / span > < span class = "org-string" > | gawk '< / span >
< span class = "org-string" > BEGIN {< / span >
< span class = "org-string" > RS=""< / span >
< span class = "org-string" > FS="\n"< / span >
< span class = "org-string" > }< / span >
< span class = "org-string" > {< / span >
< span class = "org-string" > print gensub(/\s+> (.*)/, "\\1", "g", < / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 2< / span > < / span > < span class = "org-string" > )< / span >
< span class = "org-string" > }< / span >
< span class = "org-string" > ')"< / span >
< span class = "org-rainbow-delimiters-depth-1" > }< / span >
< span class = "org-function-name" > getTagsFromId< / span > < span class = "org-rainbow-delimiters-depth-1" > ()< / span > < span class = "org-rainbow-delimiters-depth-1" > {< / span >
< span class = "org-type" > echo< / span > < span class = "org-string" > "$(< / span > < span class = "org-sh-quoted-exec" > buku< / span > < span class = "org-string" > --nc -p < / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 1< / span > < / span > < span class = "org-string" > | gawk '< / span >
< span class = "org-string" > BEGIN {< / span >
< span class = "org-string" > RS=""< / span >
< span class = "org-string" > FS="\n"< / span >
< span class = "org-string" > }< / span >
< span class = "org-string" > {< / span >
< span class = "org-string" > print gensub(/\s+# (.*)/, "\\1", "g", < / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 3< / span > < / span > < span class = "org-string" > )< / span >
< span class = "org-string" > }< / span >
< span class = "org-string" > ')"< / span >
< span class = "org-rainbow-delimiters-depth-1" > }< / span >
< span class = "org-variable-name" > mode< / span > =bookmarks main
2020-01-11 22:04:45 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-26 08:40:15 +02:00
2020-04-05 11:30:26 +02:00
< div id = "outline-container-org1ce653d" class = "outline-2" >
< h2 id = "org1ce653d" > < code > i3exit< / code > - Manage lock, suspend, reboot, … < / h2 >
< div class = "outline-text-2" id = "text-org1ce653d" >
2020-01-11 22:04:45 +01:00
< div class = "org-src-container" >
2020-11-03 16:27:09 +01:00
< pre class = "src src-bash" > < span class = "org-variable-name" > option< / span > =$< span class = "org-rainbow-delimiters-depth-1" > (< / span > < span class = "org-sh-quoted-exec" > echo< / span > -e < span class = "org-string" > "Lock\nExit\nLogout\nSuspend\nHibernate\nReboot\nShutdown"< / span > | rofi -i -dmenu< span class = "org-rainbow-delimiters-depth-1" > )< / span >
2020-05-26 08:40:15 +02:00
2020-11-03 16:27:09 +01:00
< span class = "org-keyword" > case< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > option< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-keyword" > in< / span >
< span class = "org-string" > "Lock"< / span > )
2020-05-26 08:40:15 +02:00
~/.local/bin/lockscreen
2020-01-11 22:04:45 +01:00
;;
2020-11-03 16:27:09 +01:00
< span class = "org-string" > "Exit"< / span > )
2020-01-11 22:04:45 +01:00
dm-tool switch-to-greeter
;;
2020-11-03 16:27:09 +01:00
< span class = "org-string" > "Logout"< / span > )
loginctl terminate-session < span class = "org-sh-quoted-exec" > `loginctl session-status | head -n 1 | awk '{print $1}'`< / span >
2020-05-26 08:40:15 +02:00
;;
2020-11-03 16:27:09 +01:00
< span class = "org-string" > "Suspend"< / span > )
2020-05-26 08:40:15 +02:00
systemctl suspend & & ~/.local/bin/lockscreen
2020-01-11 22:04:45 +01:00
;;
2020-11-03 16:27:09 +01:00
< span class = "org-string" > "Hibernate"< / span > )
2020-05-26 08:40:15 +02:00
systemctl hibernate & & ~/.local/bin/lockscreen
2020-01-11 22:04:45 +01:00
;;
2020-11-03 16:27:09 +01:00
< span class = "org-string" > "Reboot"< / span > )
< span class = "org-variable-name" > confirmation< / span > =$< span class = "org-rainbow-delimiters-depth-1" > (< / span > < span class = "org-sh-quoted-exec" > echo< / span > -e < span class = "org-string" > "Yes\nNo"< / span > | rofi -i -p < span class = "org-string" > "Are you sure you want to Reboot?"< / span > -dmenu< span class = "org-rainbow-delimiters-depth-1" > )< / span >
< span class = "org-keyword" > case< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > confirmation< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-keyword" > in< / span >
< span class = "org-string" > "Yes"< / span > )
systemctl reboot
;;
< span class = "org-keyword" > esac< / span >
2020-01-11 22:04:45 +01:00
;;
2020-11-03 16:27:09 +01:00
< span class = "org-string" > "Shutdown"< / span > )
< span class = "org-variable-name" > confirmation< / span > =$< span class = "org-rainbow-delimiters-depth-1" > (< / span > < span class = "org-sh-quoted-exec" > echo< / span > -e < span class = "org-string" > "Yes\nNo"< / span > | rofi -i -p < span class = "org-string" > "Are you sure you want to Shutdown?"< / span > -dmenu< span class = "org-rainbow-delimiters-depth-1" > )< / span >
< span class = "org-keyword" > case< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > confirmation< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-keyword" > in< / span >
< span class = "org-string" > "Yes"< / span > )
systemctl poweroff
;;
< span class = "org-keyword" > esac< / span >
2020-01-11 22:04:45 +01:00
;;
*)
2020-11-03 16:27:09 +01:00
< span class = "org-type" > echo< / span > < span class = "org-string" > "== ! i3exit: missing or invalid argument ! =="< / span >
< span class = "org-keyword" > exit< / span > < span class = "org-highlight-numbers-number" > 2< / span >
< span class = "org-keyword" > esac< / span >
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
< span class = "org-keyword" > exit< / span > < span class = "org-highlight-numbers-number" > 0< / span >
2020-01-11 22:04:45 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-26 08:40:15 +02:00
< div id = "outline-container-org91bab59" class = "outline-2" >
< h2 id = "org91bab59" > < code > askpass-rofi< / code > - GUI prompt for passwords< / h2 >
< div class = "outline-text-2" id = "text-org91bab59" >
< p >
Take password prompt from STDIN, print password to STDOUT.
The sed piece just removes the colon from the provided prompt: < code > rofi -p< / code > already gives us a colon
< / p >
2020-01-11 22:04:45 +01:00
< div class = "org-src-container" >
2020-11-03 16:27:09 +01:00
< pre class = "src src-bash" > rofi -dmenu < span class = "org-sh-escaped-newline" > \< / span >
-password < span class = "org-sh-escaped-newline" > \< / span >
-no-fixed-num-lines < span class = "org-sh-escaped-newline" > \< / span >
-p < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > $(< / span > < / span > < span class = "org-sh-quoted-exec" > printf< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > "< / span > < / span > < span class = "org-string" > < span class = "org-constant" > < span class = "org-sh-quoted-exec" > $< / span > < / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > < span class = "org-sh-quoted-exec" > 1< / span > < / span > < / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > " | sed s/://)< / span > < / span > < span class = "org-string" > "< / span >
2020-01-11 22:04:45 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-26 08:40:15 +02:00
< div id = "outline-container-org2d85447" class = "outline-2" >
< h2 id = "org2d85447" > < code > screenshot< / code > - Take Screenshot< / h2 >
< div class = "outline-text-2" id = "text-org2d85447" >
2020-01-11 22:04:45 +01:00
< div class = "org-src-container" >
2020-11-03 16:27:09 +01:00
< pre class = "src src-bash" > < span class = "org-variable-name" > status< / span > =$< span class = "org-rainbow-delimiters-depth-1" > (< / span > < span class = "org-sh-quoted-exec" > echo< / span > -e < span class = "org-string" > "All\nGUI\nSelection\nCropped\nCopy\nShadow\nActive"< / span > | rofi -i -dmenu -p < span class = "org-string" > "Type"< / span > < span class = "org-rainbow-delimiters-depth-1" > )< / span >
< span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-1" > [< / span > -z < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > status< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-rainbow-delimiters-depth-1" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-keyword" > exit< / span > ;
< span class = "org-keyword" > fi< / span >
< span class = "org-variable-name" > name< / span > =< span class = "org-sh-quoted-exec" > $< / span > < span class = "org-sh-quoted-exec" > < span class = "org-rainbow-delimiters-depth-1" > (< / span > < / span > < span class = "org-sh-quoted-exec" > echo -e < / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > "screenshot-$(< / span > < / span > < span class = "org-sh-quoted-exec" > date< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > +"%m-%d-%y_%H-%M-%S")< / span > < / span > < span class = "org-string" > "< / span > | rofi -i -dmenu -p < span class = "org-string" > "Filename"< / span > < span class = "org-rainbow-delimiters-depth-1" > )< / span >
< span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-1" > [< / span > -z < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > name< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-rainbow-delimiters-depth-1" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-keyword" > exit< / span > ;
< span class = "org-keyword" > fi< / span >
< span class = "org-keyword" > case< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > status< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-keyword" > in< / span >
< span class = "org-string" > "All"< / span > )
maim ~/Pictures/$< span class = "org-variable-name" > name< / span > .png ;;
< span class = "org-string" > "GUI"< / span > )
flameshot gui -r > ~/Pictures/$< span class = "org-variable-name" > name< / span > .png ;;
< span class = "org-string" > "Selection"< / span > )
maim -s ~/Pictures/$< span class = "org-variable-name" > name< / span > .png ;;
< span class = "org-string" > "Cropped"< / span > )
maim -s ~/Pictures/$< span class = "org-variable-name" > name< / span > .png & & convert -trim ~/Pictures/$< span class = "org-variable-name" > name< / span > .png ~/Pictures/$< span class = "org-variable-name" > name< / span > .png;;
< span class = "org-string" > "Copy"< / span > )
2020-05-26 08:40:15 +02:00
maim -s | xclip -selection clipboard -t image/png ;;
2020-11-03 16:27:09 +01:00
< span class = "org-string" > "Shadow"< / span > )
maim -st < span class = "org-highlight-numbers-number" > 9999999< / span > | convert - < span class = "org-string" > \(< / span > +clone -background black -shadow 80x3+5+5 < span class = "org-string" > \)< / span > +swap -background none -layers merge +repage ~/Pictures/$< span class = "org-variable-name" > name< / span > .png ;;
< span class = "org-string" > "Active"< / span > )
maim -i $< span class = "org-rainbow-delimiters-depth-1" > (< / span > < span class = "org-sh-quoted-exec" > xdotool< / span > getactivewindow< span class = "org-rainbow-delimiters-depth-1" > )< / span > ~/Pictures/$< span class = "org-variable-name" > name< / span > .png ;;
< span class = "org-keyword" > esac< / span >
2020-01-11 22:04:45 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-26 08:40:15 +02:00
< div id = "outline-container-org8a00ba3" class = "outline-2" >
< h2 id = "org8a00ba3" > < code > network-toggle< / code > - Toggle Network< / h2 >
< div class = "outline-text-2" id = "text-org8a00ba3" >
< div class = "org-src-container" >
2020-11-03 16:27:09 +01:00
< pre class = "src src-bash" > < span class = "org-variable-name" > result< / span > =$< span class = "org-rainbow-delimiters-depth-1" > (< / span > < span class = "org-sh-quoted-exec" > nmcli< / span > device | sed < span class = "org-string" > '1d'< / span > | dmenu -l < span class = "org-highlight-numbers-number" > 20< / span > < span class = "org-rainbow-delimiters-depth-1" > )< / span > ;
2020-04-05 11:30:26 +02:00
2020-11-03 16:27:09 +01:00
< span class = "org-variable-name" > interface< / span > =$< span class = "org-rainbow-delimiters-depth-1" > (< / span > < span class = "org-sh-quoted-exec" > echo< / span > $< span class = "org-variable-name" > result< / span > | awk -F < span class = "org-string" > ' '< / span > < span class = "org-string" > '{print $1}'< / span > < span class = "org-rainbow-delimiters-depth-1" > )< / span > ;
< span class = "org-variable-name" > status< / span > =$< span class = "org-rainbow-delimiters-depth-1" > (< / span > < span class = "org-sh-quoted-exec" > echo< / span > $< span class = "org-variable-name" > result< / span > | awk -F < span class = "org-string" > ' '< / span > < span class = "org-string" > '{print $3}'< / span > < span class = "org-rainbow-delimiters-depth-1" > )< / span > ;
2020-05-26 08:40:15 +02:00
2020-11-03 16:27:09 +01:00
< span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-1" > [< / span > $< span class = "org-variable-name" > status< / span > == < span class = "org-string" > 'disconnected'< / span > < span class = "org-rainbow-delimiters-depth-1" > ]< / span > ; < span class = "org-keyword" > then< / span >
nmcli device connect $< span class = "org-variable-name" > interface< / span >
< span class = "org-keyword" > else< / span >
nmcli device disconnect $< span class = "org-variable-name" > interface< / span >
< span class = "org-keyword" > fi< / span >
2020-05-26 08:40:15 +02:00
< / pre >
< / div >
< / div >
< / div >
< div id = "outline-container-orgd568e72" class = "outline-2" >
< h2 id = "orgd568e72" > < code > make-gif< / code > - Make GIF< / h2 >
< div class = "outline-text-2" id = "text-orgd568e72" >
2020-01-11 22:04:45 +01:00
< div class = "org-src-container" >
2020-11-03 16:27:09 +01:00
< pre class = "src src-bash" > < span class = "org-variable-name" > palette< / span > =< span class = "org-string" > "/tmp/palette.png"< / span >
2020-05-26 08:40:15 +02:00
2020-11-03 16:27:09 +01:00
< span class = "org-variable-name" > filters< / span > =< span class = "org-string" > "fps=15,scale=320:-1:flags=lanczos"< / span >
2020-05-26 08:40:15 +02:00
2020-11-03 16:27:09 +01:00
ffmpeg -v warning -i $< span class = "org-highlight-numbers-number" > 1< / span > -vf < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > filters< / span > < / span > < span class = "org-string" > ,palettegen"< / span > -y $< span class = "org-variable-name" > palette< / span >
ffmpeg -v warning -i $< span class = "org-highlight-numbers-number" > 1< / span > -i $< span class = "org-variable-name" > palette< / span > -lavfi < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > filters< / span > < / span > < span class = "org-string" > [x]; [x][1:v] paletteuse"< / span > -y $< span class = "org-highlight-numbers-number" > 2< / span >
2020-01-11 22:04:45 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-26 08:40:15 +02:00
< div id = "outline-container-orgd7e49ff" class = "outline-2" >
< h2 id = "orgd7e49ff" > < code > yt-audio< / code > - Download-Audio from youtube< / h2 >
< div class = "outline-text-2" id = "text-orgd7e49ff" >
2020-01-11 22:04:45 +01:00
< div class = "org-src-container" >
2020-11-03 16:27:09 +01:00
< pre class = "src src-bash" > < span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-1" > [< / span > $< span class = "org-variable-name" > TMUX< / span > < span class = "org-rainbow-delimiters-depth-1" > ]< / span > ; < span class = "org-keyword" > then< / span >
tmux split -v -l < span class = "org-highlight-numbers-number" > 5< / span > < span class = "org-string" > "< / span > < span class = "org-type" > < span class = "org-string" > cd< / span > < / span > < span class = "org-string" > ~/Downloads/ & & youtube-dl --add-metadata -xic -f bestaudio/best < / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 1< / span > < / span > < span class = "org-string" > "< / span > & & tmux select-pane -U
< span class = "org-keyword" > else< / span >
< span class = "org-type" > cd< / span > ~/Downloads/;
setsid nohup youtube-dl --add-metadata -xic -f bestaudio/best $< span class = "org-highlight-numbers-number" > 1< / span > & > /dev/null &
< span class = "org-keyword" > fi< / span >
2020-01-11 22:04:45 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-26 08:40:15 +02:00
< div id = "outline-container-org89810de" class = "outline-2" >
< h2 id = "org89810de" > < code > yt-video< / code > - Download-Video from youtube< / h2 >
< div class = "outline-text-2" id = "text-org89810de" >
2020-01-11 22:04:45 +01:00
< div class = "org-src-container" >
2020-11-03 16:27:09 +01:00
< pre class = "src src-bash" > < span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-1" > [< / span > $< span class = "org-variable-name" > TMUX< / span > < span class = "org-rainbow-delimiters-depth-1" > ]< / span > ; < span class = "org-keyword" > then< / span >
tmux split -v -l < span class = "org-highlight-numbers-number" > 5< / span > < span class = "org-string" > "< / span > < span class = "org-type" > < span class = "org-string" > cd< / span > < / span > < span class = "org-string" > ~/Downloads/ & & youtube-dl --add-metadata -ic < / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 1< / span > < / span > < span class = "org-string" > "< / span > & & tmux select-pane -U
< span class = "org-keyword" > else< / span >
< span class = "org-type" > cd< / span > ~/Downloads/;
setsid nohup youtube-dl --add-metadata -ic $< span class = "org-highlight-numbers-number" > 1< / span > & > /dev/null &
< span class = "org-keyword" > fi< / span >
2020-01-11 22:04:45 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-26 08:40:15 +02:00
< div id = "outline-container-org539efcb" class = "outline-2" >
< h2 id = "org539efcb" > < code > setbg< / code > - Set Background< / h2 >
< div class = "outline-text-2" id = "text-org539efcb" >
< div class = "org-src-container" >
2020-11-03 16:27:09 +01:00
< pre class = "src src-bash" > < span class = "org-variable-name" > bgloc< / span > =< span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > {XDG_CACHE_HOME:-$HOME/.cache/}< / span > < / span > < span class = "org-string" > /bg"< / span >
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
< span class = "org-rainbow-delimiters-depth-1" > [< / span > -f < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 1< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-rainbow-delimiters-depth-1" > ]< / span > & & < span class = "org-type" > ln< / span > -sf < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > $(< / span > < / span > < span class = "org-sh-quoted-exec" > readlink< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > -f "< / span > < / span > < span class = "org-string" > < span class = "org-constant" > < span class = "org-sh-quoted-exec" > $< / span > < / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > < span class = "org-sh-quoted-exec" > 1< / span > < / span > < / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > ")< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > bgloc< / span > < / span > < span class = "org-string" > "< / span >
2020-05-26 08:40:15 +02:00
2020-11-03 16:27:09 +01:00
< span class = "org-rainbow-delimiters-depth-1" > [< / span > -d < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 1< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-rainbow-delimiters-depth-1" > ]< / span > & & < span class = "org-type" > ln< / span > -sf < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > $(< / span > < / span > < span class = "org-sh-quoted-exec" > find< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > "$(< / span > < / span > < span class = "org-sh-quoted-exec" > readlink< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > -f "< / span > < / span > < span class = "org-string" > < span class = "org-constant" > < span class = "org-sh-quoted-exec" > $< / span > < / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > < span class = "org-sh-quoted-exec" > 1< / span > < / span > < / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > ")< / span > < / span > < span class = "org-string" > " -iregex '.*.\(jpg\|jpeg\|png\|gif\)' -type f | shuf -n 1)"< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > bgloc< / span > < / span > < span class = "org-string" > "< / span >
2020-05-26 08:40:15 +02:00
2020-11-03 16:27:09 +01:00
xwallpaper --zoom < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > bgloc< / span > < / span > < span class = "org-string" > "< / span >
2020-05-26 08:40:15 +02:00
< / pre >
< / div >
< / div >
< / div >
2020-11-03 16:27:09 +01:00
2020-05-26 08:40:15 +02:00
< div id = "outline-container-org229006d" class = "outline-2" >
< h2 id = "org229006d" > < code > insert-unicode< / code > - Insert Unicode Icon< / h2 >
< div class = "outline-text-2" id = "text-org229006d" >
2020-01-11 22:04:45 +01:00
< div class = "org-src-container" >
2020-11-03 16:27:09 +01:00
< pre class = "src src-bash" > < span class = "org-comment-delimiter" > # < / span > < span class = "org-comment" > Must have xclip installed to even show menu.< / span >
xclip -h < span class = "org-highlight-numbers-number" > 2< / span > > /dev/null || < span class = "org-keyword" > exit< / span > < span class = "org-highlight-numbers-number" > 1< / span >
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
< span class = "org-variable-name" > chosen< / span > =$< span class = "org-rainbow-delimiters-depth-1" > (< / span > < span class = "org-sh-quoted-exec" > cut< / span > -d < span class = "org-string" > ';'< / span > -f1 ~/.local/data/emojis | rofi -dmenu -i -l < span class = "org-highlight-numbers-number" > 20< / span > | sed < span class = "org-string" > "s/ .*//"< / span > < span class = "org-rainbow-delimiters-depth-1" > )< / span >
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
< span class = "org-rainbow-delimiters-depth-1" > [< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > chosen< / span > < / span > < span class = "org-string" > "< / span > != < span class = "org-string" > ""< / span > < span class = "org-rainbow-delimiters-depth-1" > ]< / span > || < span class = "org-keyword" > exit< / span >
2020-05-26 08:40:15 +02:00
2020-11-03 16:27:09 +01:00
< span class = "org-comment-delimiter" > # < / span > < span class = "org-comment" > If you run this command with an argument, it will automatically insert the character.< / span >
< span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-1" > [< / span > -n < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 1< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-rainbow-delimiters-depth-1" > ]< / span > ; < span class = "org-keyword" > then< / span >
2020-05-26 08:40:15 +02:00
xdotool key Shift+Insert
2020-11-03 16:27:09 +01:00
< span class = "org-keyword" > else< / span >
< span class = "org-type" > echo< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > chosen< / span > < / span > < span class = "org-string" > "< / span > | tr -d < span class = "org-string" > '\n'< / span > | xsel -ib
dunstify < span class = "org-string" > "'< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > chosen< / span > < / span > < span class = "org-string" > ' copied to clipboard."< / span > &
< span class = "org-keyword" > fi< / span >
2020-01-11 22:04:45 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-26 08:40:15 +02:00
< div id = "outline-container-orgf4064e2" class = "outline-2" >
< h2 id = "orgf4064e2" > < code > insert-nerd-fonts< / code > - Insert Nerd Font Icon< / h2 >
< div class = "outline-text-2" id = "text-orgf4064e2" >
2020-01-11 22:04:45 +01:00
< div class = "org-src-container" >
2020-11-03 16:27:09 +01:00
< pre class = "src src-bash" > < span class = "org-comment-delimiter" > # < / span > < span class = "org-comment" > Must have xsel installed to even show menu.< / span >
xsel -h < span class = "org-highlight-numbers-number" > 2< / span > > /dev/null || < span class = "org-keyword" > exit< / span > < span class = "org-highlight-numbers-number" > 1< / span >
2020-05-26 08:40:15 +02:00
2020-11-03 16:27:09 +01:00
< span class = "org-variable-name" > chosen< / span > =$< span class = "org-rainbow-delimiters-depth-1" > (< / span > < span class = "org-sh-quoted-exec" > cat< / span > ~/.local/data/nerd-fonts | rofi -dmenu -i -l < span class = "org-highlight-numbers-number" > 20< / span > | sed < span class = "org-string" > "s/ .*//"< / span > < span class = "org-rainbow-delimiters-depth-1" > )< / span >
2020-05-26 08:40:15 +02:00
2020-11-03 16:27:09 +01:00
< span class = "org-rainbow-delimiters-depth-1" > [< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > chosen< / span > < / span > < span class = "org-string" > "< / span > != < span class = "org-string" > ""< / span > < span class = "org-rainbow-delimiters-depth-1" > ]< / span > || < span class = "org-keyword" > exit< / span >
2020-05-26 08:40:15 +02:00
2020-11-03 16:27:09 +01:00
< span class = "org-comment-delimiter" > # < / span > < span class = "org-comment" > If you run this command with an argument, it will automatically insert the character.< / span >
< span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-1" > [< / span > -n < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 1< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-rainbow-delimiters-depth-1" > ]< / span > ; < span class = "org-keyword" > then< / span >
2020-05-26 08:40:15 +02:00
xdotool key Shift+Insert
2020-11-03 16:27:09 +01:00
< span class = "org-keyword" > else< / span >
< span class = "org-type" > echo< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > chosen< / span > < / span > < span class = "org-string" > "< / span > | tr -d < span class = "org-string" > '\n'< / span > | xsel -ib
dunstify < span class = "org-string" > "'< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > chosen< / span > < / span > < span class = "org-string" > ' copied to clipboard."< / span > &
< span class = "org-keyword" > fi< / span >
2020-01-11 22:04:45 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-26 08:40:15 +02:00
< div id = "outline-container-org2796c9b" class = "outline-2" >
< h2 id = "org2796c9b" > < code > linkhandler< / code > - Open with Default application< / h2 >
< div class = "outline-text-2" id = "text-org2796c9b" >
< p >
Inspired from < code > linkhandler< / code > < a href = "https://github.com/LukeSmithxyz/voidrice/" > https://github.com/LukeSmithxyz/voidrice/< / a >
This is used in < code > newsboat< / code > to handle links
< / p >
2020-04-05 11:30:26 +02:00
2020-01-11 22:04:45 +01:00
< div class = "org-src-container" >
2020-11-03 16:27:09 +01:00
< pre class = "src src-bash" > < span class = "org-rainbow-delimiters-depth-1" > [< / span > -z < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 1< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-rainbow-delimiters-depth-1" > ]< / span > & & < span class = "org-rainbow-delimiters-depth-1" > {< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > BROWSER< / span > < / span > < span class = "org-string" > "< / span > ; < span class = "org-keyword" > exit< / span > ; < span class = "org-rainbow-delimiters-depth-1" > }< / span >
2020-05-26 08:40:15 +02:00
2020-11-03 16:27:09 +01:00
< span class = "org-keyword" > case< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 1< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-keyword" > in< / span >
2020-05-26 08:40:15 +02:00
*mkv|*webm|*mp4|*youtube.com/watch*|*youtube.com/playlist*|*youtu.be*|*hooktube.com*|*bitchute.com*)
2020-11-03 16:27:09 +01:00
setsid mpv --input-ipc-server=/tmp/mpvsoc$< span class = "org-rainbow-delimiters-depth-1" > (< / span > < span class = "org-sh-quoted-exec" > date< / span > +%s< span class = "org-rainbow-delimiters-depth-1" > )< / span > -quiet < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 1< / span > < / span > < span class = "org-string" > "< / span > > /dev/null < span class = "org-highlight-numbers-number" > 2< / span > > & < span class = "org-highlight-numbers-number" > 1< / span > & ;;
2020-05-26 08:40:15 +02:00
*png|*jpg|*jpe|*jpeg|*gif)
2020-11-03 16:27:09 +01:00
< span class = "org-type" > curl< / span > -sL < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 1< / span > < / span > < span class = "org-string" > "< / span > > < span class = "org-string" > "/tmp/< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > $(< / span > < / span > < span class = "org-sh-quoted-exec" > echo< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > "< / span > < / span > < span class = "org-string" > < span class = "org-constant" > < span class = "org-sh-quoted-exec" > $< / span > < / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > < span class = "org-sh-quoted-exec" > 1< / span > < / span > < / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > " | sed "s/.*\///")< / span > < / span > < span class = "org-string" > "< / span > & & sxiv -a < span class = "org-string" > "/tmp/< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > $(< / span > < / span > < span class = "org-sh-quoted-exec" > echo< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > "< / span > < / span > < span class = "org-string" > < span class = "org-constant" > < span class = "org-sh-quoted-exec" > $< / span > < / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > < span class = "org-sh-quoted-exec" > 1< / span > < / span > < / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > " | sed "s/.*\///")< / span > < / span > < span class = "org-string" > "< / span > > /dev/null < span class = "org-highlight-numbers-number" > 2< / span > > & < span class = "org-highlight-numbers-number" > 1< / span > & ;;
2020-05-26 08:40:15 +02:00
*mp3|*flac|*opus|*mp3?source*)
2020-11-03 16:27:09 +01:00
setsid tsp < span class = "org-type" > curl< / span > -LO < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 1< / span > < / span > < span class = "org-string" > "< / span > > /dev/null < span class = "org-highlight-numbers-number" > 2< / span > > & < span class = "org-highlight-numbers-number" > 1< / span > & ;;
2020-05-26 08:40:15 +02:00
*)
2020-11-03 16:27:09 +01:00
< span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-1" > [< / span > -f < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 1< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-rainbow-delimiters-depth-1" > ]< / span > ; < span class = "org-keyword" > then< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > TERMINAL< / span > < / span > < span class = "org-string" > "< / span > -e < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > EDITOR< / span > < / span > < span class = "org-string" > < / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 1< / span > < / span > < span class = "org-string" > "< / span >
< span class = "org-keyword" > else< / span > setsid $< span class = "org-variable-name" > BROWSER< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 1< / span > < / span > < span class = "org-string" > "< / span > > /dev/null < span class = "org-highlight-numbers-number" > 2< / span > > & < span class = "org-highlight-numbers-number" > 1< / span > & < span class = "org-keyword" > fi< / span > ;;
< span class = "org-keyword" > esac< / span >
2020-01-11 22:04:45 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-26 08:40:15 +02:00
< div id = "outline-container-org56e0cc2" class = "outline-2" >
< h2 id = "org56e0cc2" > < code > lockscreen< / code > - LockScreen< / h2 >
< div class = "outline-text-2" id = "text-org56e0cc2" >
< p >
First, turn off dunst
< / p >
< div class = "org-src-container" >
2020-11-03 16:27:09 +01:00
< pre class = "src src-bash" > killall -SIGUSR1 dunst & & < span class = "org-type" > echo< / span > < span class = "org-string" > "off"< / span > > /tmp/dunststatus;
2020-05-26 08:40:15 +02:00
< / pre >
< / div >
2020-03-01 22:51:16 +01:00
< p >
2020-05-26 08:40:15 +02:00
Turn off the music if it is playing.
2020-03-01 22:51:16 +01:00
< / p >
2020-05-26 08:40:15 +02:00
< div class = "org-src-container" >
2020-11-03 16:27:09 +01:00
< pre class = "src src-bash" > < span class = "org-variable-name" > MPC_STATE< / span > =$< span class = "org-rainbow-delimiters-depth-1" > (< / span > < span class = "org-sh-quoted-exec" > mpc< / span > | sed -n < span class = "org-string" > '2p'< / span > | cut -d < span class = "org-string" > "["< / span > -f2 | cut -d < span class = "org-string" > "]"< / span > -f1< span class = "org-rainbow-delimiters-depth-1" > )< / span >
< span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-1" > [< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > $< span class = "org-variable-name" > MPC_STATE< / span > == < span class = "org-string" > "playing"< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > < span class = "org-rainbow-delimiters-depth-1" > ]< / span > ; < span class = "org-keyword" > then< / span >
2020-05-26 08:40:15 +02:00
mpc pause
2020-11-03 16:27:09 +01:00
< span class = "org-keyword" > fi< / span >
2020-05-26 08:40:15 +02:00
< / pre >
< / div >
2020-03-01 22:51:16 +01:00
2020-05-26 08:40:15 +02:00
< p >
Then take a screenshot and process it.
< / p >
2020-03-01 22:51:16 +01:00
< div class = "org-src-container" >
2020-11-03 16:27:09 +01:00
< pre class = "src src-bash" > < span class = "org-variable-name" > temp_file< / span > =< span class = "org-string" > "/tmp/screen.png"< / span >
2020-03-01 22:51:16 +01:00
2020-11-03 16:27:09 +01:00
< span class = "org-type" > rm< / span > -f $< span class = "org-variable-name" > temp_file< / span >
2020-03-01 22:51:16 +01:00
2020-11-03 16:27:09 +01:00
maim $< span class = "org-variable-name" > temp_file< / span >
convert $< span class = "org-variable-name" > temp_file< / span > -scale 10% -scale 1000% $< span class = "org-variable-name" > temp_file< / span >
2020-03-01 22:51:16 +01:00
< / pre >
< / div >
2020-05-26 08:40:15 +02:00
< p >
Finally, lock the screen using < code > i3lock< / code > .
< / p >
< div class = "org-src-container" >
2020-11-03 16:27:09 +01:00
< pre class = "src src-bash" > i3lock --no-unlock-indicator --ignore-empty-password --nofork --image=$< span class = "org-variable-name" > temp_file< / span > & & killall -SIGUSR2 dunst & & < span class = "org-type" > echo< / span > < span class = "org-string" > "on"< / span > > /tmp/dunststatus
2020-05-26 08:40:15 +02:00
< / pre >
2020-03-01 22:51:16 +01:00
< / div >
2020-05-26 08:40:15 +02:00
< div class = "org-src-container" >
2020-11-03 16:27:09 +01:00
< pre class = "src src-bash" > < span class = "org-function-name" > revert< / span > < span class = "org-rainbow-delimiters-depth-1" > ()< / span > < span class = "org-rainbow-delimiters-depth-1" > {< / span >
xset dpms < span class = "org-highlight-numbers-number" > 0< / span > < span class = "org-highlight-numbers-number" > 0< / span > < span class = "org-highlight-numbers-number" > 0< / span >
< span class = "org-rainbow-delimiters-depth-1" > }< / span >
< span class = "org-keyword" > trap< / span > revert HUP INT TERM
< span class = "org-comment-delimiter" > # < / span > < span class = "org-comment" > turn off screen after 5 seconds< / span >
xset +dpms dpms < span class = "org-highlight-numbers-number" > 5< / span > < span class = "org-highlight-numbers-number" > 5< / span > < span class = "org-highlight-numbers-number" > 5< / span >
< span class = "org-comment-delimiter" > # < / span > < span class = "org-comment" > Parameters< / span >
< span class = "org-variable-name" > temp_file< / span > =< span class = "org-string" > "/tmp/screen.png"< / span >
< span class = "org-variable-name" > icon< / span > =< span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > HOME< / span > < / span > < span class = "org-string" > /Pictures/Evil_Rick_Sprite.png"< / span >
< span class = "org-variable-name" > width< / span > =< span class = "org-highlight-numbers-number" > 1920< / span >
< span class = "org-variable-name" > height< / span > =< span class = "org-highlight-numbers-number" > 1080< / span >
< span class = "org-variable-name" > blur_factor< / span > =< span class = "org-highlight-numbers-number" > 6< / span >
< span class = "org-variable-name" > lock_blur_factor< / span > =< span class = "org-highlight-numbers-number" > 0< / span >
< span class = "org-comment-delimiter" > # < / span > < span class = "org-comment" > Take the screen shot, blur the image and add the icon< / span >
ffmpeg -f x11grab -video_size < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > {width}< / span > < / span > < span class = "org-string" > x< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > {height}< / span > < / span > < span class = "org-string" > "< / span > -y -i $< span class = "org-variable-name" > DISPLAY< / span > -i $< span class = "org-variable-name" > icon< / span > -filter_complex < span class = "org-string" > "boxblur=< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > blur_factor< / span > < / span > < span class = "org-string" > :< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > blur_factor< / span > < / span > < span class = "org-string" > ,overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2,boxblur=< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > lock_blur_factor< / span > < / span > < span class = "org-string" > :< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > lock_blur_factor< / span > < / span > < span class = "org-string" > "< / span > -vframes < span class = "org-highlight-numbers-number" > 1< / span > $< span class = "org-variable-name" > temp_file< / span >
< span class = "org-comment-delimiter" > # < / span > < span class = "org-comment" > Alternative< / span >
< span class = "org-comment-delimiter" > # < / span > < span class = "org-comment" > maim -d 1 $temp_file< / span >
< span class = "org-comment-delimiter" > # < / span > < span class = "org-comment" > convert -blur 0x8 $temp_file $temp_file< / span >
< span class = "org-comment-delimiter" > # < / span > < span class = "org-comment" > convert -composite $temp_file $icon -gravity South -geometry -20x1200 $temp_file< / span >
< span class = "org-comment-delimiter" > # < / span > < span class = "org-comment" > Lock the screen with the image< / span >
i3lock --no-unlock-indicator --ignore-empty-password --show-failed-attempts --nofork --image=$< span class = "org-variable-name" > temp_file< / span >
< span class = "org-comment-delimiter" > # < / span > < span class = "org-comment" > Remove the screenshot< / span >
< span class = "org-type" > rm< / span > $< span class = "org-variable-name" > temp_file< / span >
< span class = "org-comment-delimiter" > # < / span > < span class = "org-comment" > Don't turn off screen when back from lock< / span >
2020-05-26 08:40:15 +02:00
revert
< / pre >
2020-03-01 22:51:16 +01:00
< / div >
2020-05-26 08:40:15 +02:00
< / div >
< / div >
< div id = "outline-container-orgbe881e3" class = "outline-2" >
< h2 id = "orgbe881e3" > < code > mopidy-restart< / code > - Restart Mopidy< / h2 >
< div class = "outline-text-2" id = "text-orgbe881e3" >
2020-03-01 22:51:16 +01:00
< div class = "org-src-container" >
2020-11-03 16:27:09 +01:00
< pre class = "src src-bash" > < span class = "org-variable-name" > pids< / span > =< span class = "org-rainbow-delimiters-depth-1" > (< / span > $< span class = "org-rainbow-delimiters-depth-2" > (< / span > < span class = "org-sh-quoted-exec" > pgrep< / span > -f mopidy< span class = "org-rainbow-delimiters-depth-2" > )< / span > < span class = "org-rainbow-delimiters-depth-1" > )< / span >
< span class = "org-keyword" > for< / span > pid< span class = "org-keyword" > in< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > {pids[@]}< / span > < / span > < span class = "org-string" > "< / span > ; < span class = "org-keyword" > do< / span >
< span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-1" > [< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > $< span class = "org-variable-name" > pid< / span > != $< span class = "org-variable-name" > $< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > < span class = "org-rainbow-delimiters-depth-1" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-type" > kill< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > pid< / span > < / span > < span class = "org-string" > "< / span >
< span class = "org-keyword" > fi< / span >
< span class = "org-keyword" > done< / span >
< span class = "org-type" > echo< / span > < span class = "org-string" > "Killed mopidy."< / span >
< span class = "org-type" > echo< / span > < span class = "org-string" > "Restarting mopidy..."< / span >
mopidy --config ~/.config/mopidy/mopidy.conf > /dev/null < span class = "org-highlight-numbers-number" > 2< / span > > & < span class = "org-highlight-numbers-number" > 1< / span > &
< span class = "org-type" > echo< / span > < span class = "org-string" > "Done"< / span >
2020-03-01 22:51:16 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-26 08:40:15 +02:00
< div id = "outline-container-orgffe5d25" class = "outline-2" >
< h2 id = "orgffe5d25" > < code > upload< / code > - Upload Script< / h2 >
< div class = "outline-text-2" id = "text-orgffe5d25" >
2020-03-01 22:51:16 +01:00
< div class = "org-src-container" >
2020-11-03 16:27:09 +01:00
< pre class = "src src-bash" > < span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-1" > [< / span > $< span class = "org-variable-name" > TMUX< / span > < span class = "org-rainbow-delimiters-depth-1" > ]< / span > ; < span class = "org-keyword" > then< / span >
tmux split -v -l < span class = "org-highlight-numbers-number" > 1< / span > < span class = "org-string" > "< / span > < span class = "org-type" > < span class = "org-string" > curl< / span > < / span > < span class = "org-string" > --progress-bar -F\"file=@< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 1< / span > < / span > < span class = "org-string" > \" https://0x0.st | xsel -ib;"< / span > & & tmux select-pane -U
< span class = "org-keyword" > else< / span >
< span class = "org-type" > curl< / span > --progress-bar -F< span class = "org-string" > "file=@< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 1< / span > < / span > < span class = "org-string" > "< / span > https://0x0.st | xsel -ib & & < span class = "org-sh-escaped-newline" > \< / span >
dunstify < span class = "org-string" > 'Upload'< / span > < span class = "org-string" > 'Successful'< / span > || < span class = "org-sh-escaped-newline" > \< / span >
dunstify --urgency=critical < span class = "org-string" > 'Upload'< / span > < span class = "org-string" > 'Failed'< / span >
< span class = "org-keyword" > fi< / span >
2020-03-01 22:51:16 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-05-26 08:40:15 +02:00
< div id = "outline-container-orgcd16f91" class = "outline-2" >
< h2 id = "orgcd16f91" > < code > weather< / code > - Display Weather in terminal< / h2 >
< div class = "outline-text-2" id = "text-orgcd16f91" >
2020-03-01 22:51:16 +01:00
< div class = "org-src-container" >
2020-11-03 16:27:09 +01:00
< pre class = "src src-bash" > < span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-1" > [< / span > -n < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > *< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-rainbow-delimiters-depth-1" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-variable-name" > address< / span > =< span class = "org-string" > "wttr.in/"< / span >
< span class = "org-variable-name" > address< / span > +=$< span class = "org-variable-name" > *< / span >
< span class = "org-keyword" > else< / span >
< span class = "org-variable-name" > address< / span > =< span class = "org-string" > "wttr.in/"< / span >
< span class = "org-keyword" > fi< / span >
2020-05-26 08:40:15 +02:00
2020-11-03 16:27:09 +01:00
< span class = "org-keyword" > if < / span > < span class = "org-builtin" > type< / span > sxiv > /dev/null < span class = "org-highlight-numbers-number" > 2< / span > > & < span class = "org-highlight-numbers-number" > 1< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-variable-name" > address< / span > +=< span class = "org-string" > ".png"< / span >
2020-05-26 08:40:15 +02:00
2020-11-03 16:27:09 +01:00
wget -qO- < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > address< / span > < / span > < span class = "org-string" > "< / span > > /tmp/weather.png & & < span class = "org-sh-escaped-newline" > \< / span >
2020-05-26 08:40:15 +02:00
sxiv -b /tmp/weather.png
2020-11-03 16:27:09 +01:00
< span class = "org-keyword" > elif < / span > < span class = "org-builtin" > type< / span > feh > /dev/null < span class = "org-highlight-numbers-number" > 2< / span > > & < span class = "org-highlight-numbers-number" > 1< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-variable-name" > address< / span > +=< span class = "org-string" > ".png"< / span >
2020-05-26 08:40:15 +02:00
2020-11-03 16:27:09 +01:00
wget -qO- < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > address< / span > < / span > < span class = "org-string" > "< / span > | feh -
< span class = "org-keyword" > else< / span >
< span class = "org-type" > curl< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > address< / span > < / span > < span class = "org-string" > "< / span >
< span class = "org-keyword" > fi< / span >
2020-03-01 22:51:16 +01:00
< / pre >
< / div >
< / div >
< / div >
2020-11-03 16:27:09 +01:00
2020-05-26 08:40:15 +02:00
< div id = "outline-container-org17ef4d2" class = "outline-2" >
< h2 id = "org17ef4d2" > < code > readbib< / code > - Open Bibliography File< / h2 >
< div class = "outline-text-2" id = "text-org17ef4d2" >
2020-04-05 11:30:26 +02:00
< div class = "org-src-container" >
2020-11-03 16:27:09 +01:00
< pre class = "src src-bash" > < span class = "org-type" > cd< / span > ~/Cloud/pdfs/ & & < span class = "org-type" > ls< / span > | rofi -dmenu -lines < span class = "org-highlight-numbers-number" > 20< / span > | xargs -I < span class = "org-rainbow-delimiters-depth-1" > {}< / span > zathura < span class = "org-rainbow-delimiters-depth-1" > {}< / span >
2020-05-26 08:40:15 +02:00
< / pre >
< / div >
< / div >
< / div >
2020-04-05 11:30:26 +02:00
2020-05-26 08:40:15 +02:00
< div id = "outline-container-orgda667bb" class = "outline-2" >
< h2 id = "orgda667bb" > < code > readnotes< / code > - Open Note File< / h2 >
< div class = "outline-text-2" id = "text-orgda667bb" >
< div class = "org-src-container" >
2020-11-03 16:27:09 +01:00
< pre class = "src src-bash" > < span class = "org-type" > cd< / span > ~/Cloud/thesis/ressources/notes/pdfs/ & & < span class = "org-type" > ls< / span > *.pdf | rofi -dmenu -lines < span class = "org-highlight-numbers-number" > 20< / span > | xargs -I < span class = "org-rainbow-delimiters-depth-1" > {}< / span > zathura < span class = "org-rainbow-delimiters-depth-1" > {}< / span >
2020-05-26 08:40:15 +02:00
< / pre >
< / div >
< / div >
< / div >
2020-04-05 11:30:26 +02:00
2020-05-26 08:40:15 +02:00
< div id = "outline-container-orge45135c" class = "outline-2" >
< h2 id = "orge45135c" > < code > pdf2bib< / code > - Extract bibtex entry from PDF file< / h2 >
< div class = "outline-text-2" id = "text-orge45135c" >
< div class = "org-src-container" >
2020-11-03 16:27:09 +01:00
< pre class = "src src-bash" > < span class = "org-function-name" > pdf2doi< / span > < span class = "org-rainbow-delimiters-depth-1" > ()< / span > < span class = "org-rainbow-delimiters-depth-1" > {< / span >
pdfinfo < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 1< / span > < / span > < span class = "org-string" > "< / span > | < span class = "org-type" > grep< / span > -io < span class = "org-string" > "doi:.*"< / span > | < span class = "org-type" > grep< / span > -Poi < span class = "org-string" > "10.\d+/[^\s]+"< / span > || < span class = "org-sh-escaped-newline" > \< / span >
pdftotext < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 1< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-highlight-numbers-number" > 2< / span > > /dev/null - | < span class = "org-type" > grep< / span > -io < span class = "org-string" > "doi:.*"< / span > -m < span class = "org-highlight-numbers-number" > 1< / span > | < span class = "org-type" > grep< / span > -Poi < span class = "org-string" > "10.\d+/[^\s]+"< / span > || < span class = "org-sh-escaped-newline" > \< / span >
pdftotext < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 1< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-highlight-numbers-number" > 2< / span > > /dev/null - | < span class = "org-type" > grep< / span > -Poi < span class = "org-string" > "10.\d+/[^\s]+"< / span >
< span class = "org-rainbow-delimiters-depth-1" > }< / span >
< span class = "org-function-name" > doi2bib< / span > < span class = "org-rainbow-delimiters-depth-1" > ()< / span > < span class = "org-rainbow-delimiters-depth-1" > {< / span >
< span class = "org-comment-delimiter" > # < / span > < span class = "org-type" > < span class = "org-comment" > curl< / span > < / span > < span class = "org-comment" > -LHs "Accept: application/x-bibtex" http://dx.doi.org/$1 -w "\\n"< / span >
< span class = "org-type" > curl< / span > -s < span class = "org-string" > "http://api.crossref.org/works/< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 1< / span > < / span > < span class = "org-string" > /transform/application/x-bibtex"< / span > -w < span class = "org-string" > "\\n"< / span >
< span class = "org-rainbow-delimiters-depth-1" > }< / span >
< span class = "org-comment-delimiter" > # < / span > < span class = "org-comment" > If a file is specified, try to extract DOI from the file< / span >
< span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-1" > [< / span > -f < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 1< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-rainbow-delimiters-depth-1" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-variable-name" > doi< / span > =$< span class = "org-rainbow-delimiters-depth-1" > (< / span > < span class = "org-sh-quoted-exec" > pdf2doi< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 1< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-rainbow-delimiters-depth-1" > )< / span >
< span class = "org-keyword" > fi< / span >
< span class = "org-keyword" > if < / span > < span class = "org-builtin" > hash< / span > rofi < span class = "org-highlight-numbers-number" > 2< / span > > /dev/null; < span class = "org-keyword" > then< / span >
< span class = "org-variable-name" > doi< / span > =$< span class = "org-rainbow-delimiters-depth-1" > (< / span > < span class = "org-sh-quoted-exec" > echo< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > doi< / span > < / span > < span class = "org-string" > "< / span > | rofi -i -dmenu -p < span class = "org-string" > "DOI"< / span > < span class = "org-rainbow-delimiters-depth-1" > )< / span >
< span class = "org-keyword" > else< / span >
< span class = "org-variable-name" > doi< / span > =$< span class = "org-rainbow-delimiters-depth-1" > (< / span > < span class = "org-sh-quoted-exec" > echo< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > doi< / span > < / span > < span class = "org-string" > "< / span > | dmenu -i -p < span class = "org-string" > "DOI"< / span > < span class = "org-rainbow-delimiters-depth-1" > )< / span >
< span class = "org-keyword" > fi< / span >
< span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-1" > [< / span > -n < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 1< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-rainbow-delimiters-depth-1" > ]< / span > ; < span class = "org-keyword" > then< / span >
doi2bib $< span class = "org-variable-name" > doi< / span > | xsel -ib & & < span class = "org-sh-escaped-newline" > \< / span >
dunstify < span class = "org-string" > 'BibTeX'< / span > < span class = "org-string" > 'Copied to Clipboard'< / span > || < span class = "org-sh-escaped-newline" > \< / span >
dunstify --urgency=critical < span class = "org-string" > 'BibTeX'< / span > < span class = "org-string" > 'Failed'< / span >
< span class = "org-keyword" > fi< / span >
2020-05-26 08:40:15 +02:00
< / pre >
< / div >
< / div >
< / div >
2020-04-05 11:30:26 +02:00
2020-05-26 08:40:15 +02:00
< div id = "outline-container-org70ec456" class = "outline-2" >
< h2 id = "org70ec456" > < code > pdf2png< / code > - Convert a PDF to PNG< / h2 >
< div class = "outline-text-2" id = "text-org70ec456" >
< div class = "org-src-container" >
2020-11-03 16:27:09 +01:00
< pre class = "src src-bash" > < span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-1" > [< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > -f < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 1< / span > < / span > < span class = "org-string" > "< / span > & & < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 1< / span > < / span > < span class = "org-string" > "< / span > == *.pdf < span class = "org-rainbow-delimiters-depth-2" > ]< / span > < span class = "org-rainbow-delimiters-depth-1" > ]< / span > ; < span class = "org-keyword" > then< / span >
pdftoppm -png < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 1< / span > < / span > < span class = "org-string" > "< / span > > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > $(< / span > < / span > < span class = "org-sh-quoted-exec" > echo< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > "< / span > < / span > < span class = "org-string" > < span class = "org-constant" > < span class = "org-sh-quoted-exec" > $< / span > < / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > < span class = "org-sh-quoted-exec" > 1< / span > < / span > < / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > " | cut -f 1 -d '.' | sed 's/$/.png/')< / span > < / span > < span class = "org-string" > "< / span >
< span class = "org-keyword" > fi< / span >
2020-04-05 11:30:26 +02:00
< / pre >
< / div >
< / div >
< / div >
2020-11-03 16:27:09 +01:00
2020-05-26 08:40:15 +02:00
< div id = "outline-container-org7601ca9" class = "outline-2" >
< h2 id = "org7601ca9" > < code > pdf-shrink< / code > - Pdf Shrink< / h2 >
< div class = "outline-text-2" id = "text-org7601ca9" >
2020-04-05 11:30:26 +02:00
< div class = "org-src-container" >
2020-11-03 16:27:09 +01:00
< pre class = "src src-bash" > < span class = "org-function-name" > shrink< / span > < span class = "org-rainbow-delimiters-depth-1" > ()< / span >
< span class = "org-rainbow-delimiters-depth-1" > {< / span >
gs < span class = "org-sh-escaped-newline" > \< / span >
-q -dNOPAUSE -dBATCH -dSAFER < span class = "org-sh-escaped-newline" > \< / span >
-sDEVICE=pdfwrite < span class = "org-sh-escaped-newline" > \< / span >
-dCompatibilityLevel=< span class = "org-highlight-numbers-number" > 1.3< / span > < span class = "org-sh-escaped-newline" > \< / span >
-dPDFSETTINGS=/screen < span class = "org-sh-escaped-newline" > \< / span >
-dEmbedAllFonts=true < span class = "org-sh-escaped-newline" > \< / span >
-dSubsetFonts=true < span class = "org-sh-escaped-newline" > \< / span >
-dAutoRotatePages=/None < span class = "org-sh-escaped-newline" > \< / span >
-dColorImageDownsampleType=/Bicubic < span class = "org-sh-escaped-newline" > \< / span >
-dColorImageResolution=$< span class = "org-highlight-numbers-number" > 3< / span > < span class = "org-sh-escaped-newline" > \< / span >
-dGrayImageDownsampleType=/Bicubic < span class = "org-sh-escaped-newline" > \< / span >
-dGrayImageResolution=$< span class = "org-highlight-numbers-number" > 3< / span > < span class = "org-sh-escaped-newline" > \< / span >
-dMonoImageDownsampleType=/Subsample < span class = "org-sh-escaped-newline" > \< / span >
-dMonoImageResolution=$< span class = "org-highlight-numbers-number" > 3< / span > < span class = "org-sh-escaped-newline" > \< / span >
-sOutputFile=< span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 2< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-sh-escaped-newline" > \< / span >
< span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 1< / span > < / span > < span class = "org-string" > "< / span >
< span class = "org-rainbow-delimiters-depth-1" > }< / span >
< span class = "org-function-name" > check_smaller< / span > < span class = "org-rainbow-delimiters-depth-1" > ()< / span >
< span class = "org-rainbow-delimiters-depth-1" > {< / span >
< span class = "org-comment-delimiter" > # < / span > < span class = "org-comment" > If $1 and $2 are regular files, we can compare file sizes to< / span >
< span class = "org-comment-delimiter" > # < / span > < span class = "org-comment" > see if we succeeded in shrinking. If not, we copy $1 over $2:< / span >
< span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-negation-char" > !< / span > -f < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 1< / span > < / span > < span class = "org-string" > "< / span > -o < span class = "org-negation-char" > !< / span > -f < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 2< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-keyword" > return< / span > < span class = "org-highlight-numbers-number" > 0< / span > ;
< span class = "org-keyword" > fi< / span >
< span class = "org-variable-name" > ISIZE< / span > =< span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > $(< / span > < / span > < span class = "org-sh-quoted-exec" > echo< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > $(< / span > < / span > < span class = "org-sh-quoted-exec" > wc< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > -c "< / span > < / span > < span class = "org-string" > < span class = "org-constant" > < span class = "org-sh-quoted-exec" > $< / span > < / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > < span class = "org-sh-quoted-exec" > 1< / span > < / span > < / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > ")< / span > < / span > < span class = "org-string" > | cut -f1 -d\ )"< / span >
< span class = "org-variable-name" > OSIZE< / span > =< span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > $(< / span > < / span > < span class = "org-sh-quoted-exec" > echo< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > $(< / span > < / span > < span class = "org-sh-quoted-exec" > wc< / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > -c "< / span > < / span > < span class = "org-string" > < span class = "org-constant" > < span class = "org-sh-quoted-exec" > $< / span > < / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > < span class = "org-sh-quoted-exec" > 2< / span > < / span > < / span > < span class = "org-string" > < span class = "org-sh-quoted-exec" > ")< / span > < / span > < span class = "org-string" > | cut -f1 -d\ )"< / span >
< span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > ISIZE< / span > < / span > < span class = "org-string" > "< / span > -lt < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > OSIZE< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-type" > echo< / span > < span class = "org-string" > "Input smaller than output, doing straight copy"< / span > > & < span class = "org-highlight-numbers-number" > 2< / span >
< span class = "org-type" > cp< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 1< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 2< / span > < / span > < span class = "org-string" > "< / span >
< span class = "org-keyword" > fi< / span >
< span class = "org-rainbow-delimiters-depth-1" > }< / span >
< span class = "org-function-name" > usage< / span > < span class = "org-rainbow-delimiters-depth-1" > ()< / span >
< span class = "org-rainbow-delimiters-depth-1" > {< / span >
< span class = "org-type" > echo< / span > < span class = "org-string" > "Reduces PDF filesize by lossy recompressing with Ghostscript."< / span >
< span class = "org-type" > echo< / span > < span class = "org-string" > "Not guaranteed to succeed, but usually works."< / span >
< span class = "org-type" > echo< / span > < span class = "org-string" > " Usage: < / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 1< / span > < / span > < span class = "org-string" > infile [outfile] [resolution_in_dpi]"< / span >
< span class = "org-rainbow-delimiters-depth-1" > }< / span >
< span class = "org-variable-name" > IFILE< / span > =< span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 1< / span > < / span > < span class = "org-string" > "< / span >
< span class = "org-comment-delimiter" > # < / span > < span class = "org-comment" > Need an input file:< / span >
< span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-1" > [< / span > -z < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > IFILE< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-rainbow-delimiters-depth-1" > ]< / span > ; < span class = "org-keyword" > then< / span >
usage < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 0< / span > < / span > < span class = "org-string" > "< / span >
< span class = "org-keyword" > exit< / span > < span class = "org-highlight-numbers-number" > 1< / span >
< span class = "org-keyword" > fi< / span >
< span class = "org-comment-delimiter" > # < / span > < span class = "org-comment" > Output filename defaults to "-" (stdout) unless given:< / span >
< span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-1" > [< / span > < span class = "org-negation-char" > !< / span > -z < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 2< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-rainbow-delimiters-depth-1" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-variable-name" > OFILE< / span > =< span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 2< / span > < / span > < span class = "org-string" > "< / span >
< span class = "org-keyword" > else< / span >
< span class = "org-variable-name" > OFILE< / span > =< span class = "org-string" > "-"< / span >
< span class = "org-keyword" > fi< / span >
< span class = "org-comment-delimiter" > # < / span > < span class = "org-comment" > Output resolution defaults to 72 unless given:< / span >
< span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-1" > [< / span > < span class = "org-negation-char" > !< / span > -z < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 3< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-rainbow-delimiters-depth-1" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-variable-name" > res< / span > =< span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 3< / span > < / span > < span class = "org-string" > "< / span >
< span class = "org-keyword" > else< / span >
< span class = "org-variable-name" > res< / span > =< span class = "org-string" > "90"< / span >
< span class = "org-keyword" > fi< / span >
shrink < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > IFILE< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > OFILE< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > res< / span > < / span > < span class = "org-string" > "< / span > || < span class = "org-keyword" > exit< / span > $< span class = "org-variable-name" > ?< / span >
check_smaller < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > IFILE< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > OFILE< / span > < / span > < span class = "org-string" > "< / span >
2020-04-05 11:30:26 +02:00
< / pre >
< / div >
< / div >
< / div >
2020-05-26 08:40:15 +02:00
< div id = "outline-container-org4041717" class = "outline-2" >
< h2 id = "org4041717" > < code > pdf-delete-annotations< / code > - Delete Annotations from PDFs< / h2 >
< div class = "outline-text-2" id = "text-org4041717" >
< p >
From: < a href = "https://gist.github.com/stefanschmidt/5248592" > https://gist.github.com/stefanschmidt/5248592< / a >
< / p >
2020-04-05 11:30:26 +02:00
< div class = "org-src-container" >
2020-11-03 16:27:09 +01:00
< pre class = "src src-bash" > pdftk $< span class = "org-highlight-numbers-number" > 1< / span > output /tmp/uncompressed.pdf uncompress
< span class = "org-variable-name" > LANG< / span > =C sed -n < span class = "org-string" > '/^\/Annots/!p'< / span > /tmp/uncompressed.pdf > /tmp/stripped.pdf
pdftk /tmp/stripped.pdf output $< span class = "org-highlight-numbers-number" > 1< / span > compress
2020-05-26 08:40:15 +02:00
< / pre >
< / div >
< / div >
< / div >
2020-04-05 11:30:26 +02:00
2020-05-26 08:40:15 +02:00
< div id = "outline-container-orge18f381" class = "outline-2" >
< h2 id = "orge18f381" > < code > pdf-delete-first-page< / code > - Delete first page of PDF< / h2 >
< div class = "outline-text-2" id = "text-orge18f381" >
< p >
The requirement is to have < code > pdftk< / code > or < code > stapler< / code > installed.
< / p >
2020-04-05 11:30:26 +02:00
2020-05-26 08:40:15 +02:00
< div class = "org-src-container" >
2020-11-03 16:27:09 +01:00
< pre class = "src src-bash" > < span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-1" > [< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > -f $< span class = "org-highlight-numbers-number" > 1< / span > & & $< span class = "org-highlight-numbers-number" > 1< / span > == *.pdf < span class = "org-rainbow-delimiters-depth-2" > ]< / span > < span class = "org-rainbow-delimiters-depth-1" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-comment-delimiter" > # < / span > < span class = "org-comment" > Argument if a file< / span >
< span class = "org-keyword" > if < / span > < span class = "org-builtin" > type< / span > stapler > /dev/null < span class = "org-highlight-numbers-number" > 2< / span > > & < span class = "org-highlight-numbers-number" > 1< / span > ; < span class = "org-keyword" > then< / span >
stapler del < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 1< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-highlight-numbers-number" > 1< / span > /tmp/pdftk_out.pdf & & < span class = "org-type" > mv< / span > /tmp/pdftk_out.pdf < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 1< / span > < / span > < span class = "org-string" > "< / span >
< span class = "org-keyword" > elif < / span > < span class = "org-builtin" > type< / span > pdftk > /dev/null < span class = "org-highlight-numbers-number" > 2< / span > > & < span class = "org-highlight-numbers-number" > 1< / span > ; < span class = "org-keyword" > then< / span >
pdftk < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 1< / span > < / span > < span class = "org-string" > "< / span > < span class = "org-type" > cat< / span > 2-end output /tmp/pdftk_out.pdf & & < span class = "org-type" > mv< / span > /tmp/pdftk_out.pdf < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > 1< / span > < / span > < span class = "org-string" > "< / span >
< span class = "org-keyword" > else< / span >
< span class = "org-type" > echo< / span > < span class = "org-string" > "Neither pdftk nor stapler are installed"< / span >
< span class = "org-keyword" > fi< / span >
< span class = "org-keyword" > fi< / span >
< / pre >
< / div >
< / div >
< / div >
< div id = "outline-container-org7ae8164" class = "outline-2" >
< h2 id = "org7ae8164" > < code > rofi-calc< / code > - Simple Calculation using Rofi< / h2 >
< div class = "outline-text-2" id = "text-org7ae8164" >
< div class = "org-src-container" >
< pre class = "src src-bash" > rofi -show calc -mode calc -no-show-match -no-sort
< / pre >
< / div >
< / div >
< / div >
< div id = "outline-container-orge7a6e2d" class = "outline-2" >
< h2 id = "orge7a6e2d" > < code > pass-gen< / code > - Generate Random Alphanumeric Password< / h2 >
< div class = "outline-text-2" id = "text-orge7a6e2d" >
< div class = "org-src-container" >
< pre class = "src src-bash" > < span class = "org-variable-name" > num< / span > =$< span class = "org-rainbow-delimiters-depth-1" > (< / span > < span class = "org-sh-quoted-exec" > rofi< / span > -dmenu -p < span class = "org-string" > "Number of caracters"< / span > < span class = "org-rainbow-delimiters-depth-1" > )< / span >
< span class = "org-variable-name" > pass< / span > =$< span class = "org-rainbow-delimiters-depth-1" > (< / span > < span class = "org-sh-quoted-exec" > cat< / span > /dev/urandom | tr -dc < span class = "org-string" > 'a-zA-Z0-9'< / span > | fold -w < span class = "org-highlight-numbers-number" > 32< / span > | head -n < span class = "org-highlight-numbers-number" > 1< / span > < span class = "org-rainbow-delimiters-depth-1" > )< / span >
< span class = "org-variable-name" > re< / span > =< span class = "org-string" > '^[0-9]+$'< / span >
< span class = "org-keyword" > if< / span > < span class = "org-rainbow-delimiters-depth-1" > [< / span > < span class = "org-rainbow-delimiters-depth-2" > [< / span > $< span class = "org-variable-name" > num< / span > =~ $< span class = "org-variable-name" > re< / span > < span class = "org-rainbow-delimiters-depth-2" > ]< / span > < span class = "org-rainbow-delimiters-depth-1" > ]< / span > ; < span class = "org-keyword" > then< / span >
< span class = "org-variable-name" > pass< / span > =$< span class = "org-rainbow-delimiters-depth-1" > {< / span > < span class = "org-variable-name" > pass< / span > :0:$< span class = "org-variable-name" > num< / span > < span class = "org-rainbow-delimiters-depth-1" > }< / span >
< span class = "org-keyword" > fi< / span >
< span class = "org-builtin" > printf< / span > < span class = "org-string" > "< / span > < span class = "org-string" > < span class = "org-constant" > $< / span > < / span > < span class = "org-string" > < span class = "org-variable-name" > pass< / span > < / span > < span class = "org-string" > "< / span > | xclip -sel clip & & < span class = "org-sh-escaped-newline" > \< / span >
dunstify < span class = "org-string" > 'Password'< / span > < span class = "org-string" > 'Generated'< / span >
2020-04-05 11:30:26 +02:00
< / pre >
< / div >
< / div >
< / div >
2020-01-11 22:04:45 +01:00
< / div >
< div id = "postamble" class = "status" >
< p class = "author" > Author: Dehaeze Thomas< / p >
2020-11-03 16:27:09 +01:00
< p class = "date" > Created: 2020-11-03 mar. 16:26< / p >
2020-01-11 22:04:45 +01:00
< / div >
< / body >
< / html >