2018-02-05 21:31:56 -06:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
Name=$(basename "$0")
|
2018-06-17 01:17:43 -05:00
|
|
|
Version="0.2"
|
2018-02-20 07:55:53 -06:00
|
|
|
|
2018-02-05 21:31:56 -06:00
|
|
|
_usage() {
|
|
|
|
cat <<- EOF
|
2018-02-20 07:55:53 -06:00
|
|
|
Usage: $Name [options]
|
2018-02-05 21:31:56 -06:00
|
|
|
|
2018-02-20 07:55:53 -06:00
|
|
|
Options:
|
|
|
|
-h Display this message
|
|
|
|
-v Display script version
|
|
|
|
-q Persistant calculator dialog
|
|
|
|
-w Switch between open windows
|
|
|
|
-r Program launcher & run dialog
|
|
|
|
-c Select previous clipboard entries
|
|
|
|
-b Browser search by keyword
|
|
|
|
-l Session logout choice
|
2018-02-05 21:31:56 -06:00
|
|
|
|
|
|
|
EOF
|
|
|
|
}
|
|
|
|
|
|
|
|
# Handle command line arguments
|
|
|
|
while getopts ":hvqwcbrl" opt; do
|
|
|
|
case $opt in
|
|
|
|
h)
|
|
|
|
_usage
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
v)
|
|
|
|
echo -e "$Name -- Version $Version"
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
r)
|
|
|
|
rofi -modi run,drun -show drun -line-padding 4 \
|
|
|
|
-columns 2 -padding 50 -hide-scrollbar \
|
|
|
|
-show-icons -drun-icon-theme "ArchLabs-Light"
|
|
|
|
;;
|
|
|
|
w)
|
2018-06-17 01:17:43 -05:00
|
|
|
rofi -modi window -show window -hide-scrollbar -padding 50 -line-padding 4
|
2018-02-05 21:31:56 -06:00
|
|
|
;;
|
|
|
|
q)
|
|
|
|
rofi -modi "calc:qalc +u8 -nocurrencies" -padding 50 \
|
|
|
|
-show "calc:qalc +u8 -nocurrencies" -line-padding 4 \
|
|
|
|
-hide-scrollbar
|
|
|
|
;;
|
|
|
|
c)
|
|
|
|
rofi -modi "clipboard:greenclip print" -padding 50 \
|
|
|
|
-line-padding 4 -show "clipboard:greenclip print" \
|
|
|
|
-hide-scrollbar
|
|
|
|
;;
|
|
|
|
b)
|
|
|
|
surfraw -browser="$BROWSER" $(sr -elvi | awk -F'-' '{print $1}' \
|
|
|
|
| sed '/:/d' | awk '{$1=$1};1' | rofi -hide-scrollbar \
|
|
|
|
-kb-row-select 'Tab' -kb-row-tab 'Control+space' \
|
2018-06-17 01:17:43 -05:00
|
|
|
-dmenu -mesg 'Tab for Autocomplete' -i -p 'Web Search ' \
|
2018-02-05 21:31:56 -06:00
|
|
|
-padding 50 -line-padding 4)
|
|
|
|
;;
|
|
|
|
l)
|
2018-06-17 01:17:43 -05:00
|
|
|
ANS=$(rofi -sep "|" -dmenu -i -p 'System ' "" -width 20 -hide-scrollbar \
|
|
|
|
-line-padding 4 -padding 20 -lines 4 <<< " Lock| Logout| Reboot| Shutdown")
|
2018-02-05 21:31:56 -06:00
|
|
|
case "$ANS" in
|
|
|
|
*Lock) i3lock-fancy ;;
|
|
|
|
*Logout) session-logout ;;
|
|
|
|
*Reboot) systemctl reboot ;;
|
2018-05-18 22:36:34 -05:00
|
|
|
*Shutdown) systemctl -i poweroff
|
2018-02-05 21:31:56 -06:00
|
|
|
esac
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo -e "Option does not exist: -$OPTARG"
|
|
|
|
_usage
|
|
|
|
exit 1
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
shift $((OPTIND - 1))
|
|
|
|
|
|
|
|
|
|
|
|
exit 0
|