Update configs

This commit is contained in:
natemaia 2019-03-03 01:04:41 -08:00
parent a88bfb53b6
commit 5ebbd10bc8
2 changed files with 53 additions and 76 deletions

View File

@ -1,7 +1,7 @@
#!/usr/bin/env bash
NAME=$(basename "$0")
VER="0.5"
NAME="${0##*/}"
VER="0.6"
usage()
{
@ -33,75 +33,56 @@ usage()
EOF
}
for arg in "$@"; do
case $arg in
-h|--help)
usage
exit 0
;;
-v|--version)
echo -e "$NAME -- Version $VER"
exit 0
;;
-r|--run)
rofi -modi run,drun -show drun -line-padding 4 \
-columns 2 -padding 50 -hide-scrollbar \
-show-icons -drun-icon-theme "ArchLabs-Light"
;;
-w|--window)
rofi -modi window -show window -hide-scrollbar -padding 50 -line-padding 4
;;
-q|--qalculate)
hash qalc &>/dev/null ||
{ echo "Requires 'libqalculate' installed"; exit 1; }
rofi -modi "calc:qalc +u8 -nocurrencies" -padding 50 \
-show "calc:qalc +u8 -nocurrencies" -line-padding 4 \
-hide-scrollbar
;;
-c|--clipboard)
hash greenclip &>/dev/null ||
{ echo "Requires 'greenclip' installed"; exit 1; }
rofi -modi "clipboard:greenclip print" -padding 50 \
-line-padding 4 -show "clipboard:greenclip print" \
-hide-scrollbar
;;
-b|--browser)
hash surfraw &>/dev/null ||
{ echo "Requires 'surfraw' installed"; exit 1; }
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' -dmenu \
-mesg 'Tab for Autocomplete' -i -p 'Web Search' \
-padding 50 -line-padding 4)"
;;
-l|--logout)
if grep -q 'exec startx' $HOME/.*profile; then
ANS="$(rofi -sep "|" -dmenu -i -p 'System' -width 20 \
-hide-scrollbar -line-padding 4 -padding 20 \
-lines 3 <<< " Lock| Reboot| Shutdown")"
else
ANS="$(rofi -sep "|" -dmenu -i -p 'System' -width 20 \
-hide-scrollbar -line-padding 4 -padding 20 \
-lines 4 <<< " Lock| Logout| Reboot| Shutdown")"
fi
case "$ANS" in
*Lock) i3lock-fancy ;;
*Reboot) systemctl reboot ;;
*Shutdown) systemctl -i poweroff ;;
*Logout) session-logout || pkill -15 -t tty"$XDG_VTNR" Xorg ;;
esac
;;
*)
printf "\nOption does not exist: %s\n\n" "$arg"
exit 2
esac
done
(( $# == 0 )) && "$0" -r
if (( $# == 0 )); then
rofi -modi run,drun -show drun -line-padding 4 -columns 2 -padding 50 -hide-scrollbar -show-icons -drun-icon-theme "ArchLabs-Light"
else
for arg in "$@"; do
case $arg in
-h|--help)
usage
exit 0
;;
-v|--version)
echo -e "$NAME -- Version $VER"
exit 0
;;
-r|--run)
rofi -modi run,drun -show drun -line-padding 4 -columns 2 -padding 50 -hide-scrollbar -show-icons -drun-icon-theme "ArchLabs-Light"
;;
-w|--window)
rofi -modi window -show window -hide-scrollbar -padding 50 -line-padding 4
;;
-q|--qalculate)
hash qalc &>/dev/null || { echo "Requires 'libqalculate' installed"; exit 1; }
rofi -modi "calc:qalc +u8 -nocurrencies" -padding 50 -show "calc:qalc +u8 -nocurrencies" -line-padding 4 -hide-scrollbar
;;
-c|--clipboard)
hash greenclip &>/dev/null || { echo "Requires 'greenclip' installed"; exit 1; }
rofi -modi "clipboard:greenclip print" -padding 50 -line-padding 4 -show "clipboard:greenclip print" -hide-scrollbar
;;
-b|--browser)
hash surfraw &>/dev/null || { echo "Requires 'surfraw' installed"; exit 1; }
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' -dmenu -mesg 'Tab for Autocomplete' -i -p 'Web Search')"
;;
-l|--logout)
if grep -q 'exec startx' $HOME/.*profile; then
ANS="$(rofi -sep "|" -dmenu -i -p 'System' -width 20 -hide-scrollbar -line-padding 4 -padding 20 -lines 3 <<< " Lock| Reboot| Shutdown")"
else
ANS="$(rofi -sep "|" -dmenu -i -p 'System' -width 20 -hide-scrollbar -line-padding 4 -padding 20 -lines 4 <<< " Lock| Logout| Reboot| Shutdown")"
fi
case "$ANS" in
*Lock) i3lock-fancy ;;
*Reboot) systemctl reboot ;;
*Shutdown) systemctl -i poweroff ;;
*Logout) session-logout || pkill -15 -t tty"$XDG_VTNR" Xorg ;;
esac
;;
*)
printf "\nOption does not exist: %s\n\n" "$arg"
exit 2
esac
done
fi
exit 0

View File

@ -9,10 +9,6 @@ sxhkd &
# launch compton
al-compositor --start &
# xfce settings, commented out due to issues
# see: https://bitbucket.org/archlabslinux/skel/issues/1/bspwm-not-working-properly-with
# xfsettingsd &
# panel
al-polybar-session &