Update user home config files

This commit is contained in:
natemaia
2018-08-18 13:16:42 -07:00
parent fee0d19036
commit bc77924804
8 changed files with 176 additions and 233 deletions

View File

@ -1,7 +1,7 @@
#!/usr/bin/env bash
NAME=$(basename "$0")
VER="0.3"
VER="0.4"
usage() {
cat <<- EOF
@ -33,14 +33,8 @@ EOF
for arg in "$@"; do
case $arg in
-h|--help)
usage
exit 0
;;
-v|--version)
echo -e "$NAME -- Version $VER"
exit 0
;;
-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 \
@ -50,26 +44,24 @@ for arg in "$@"; do
rofi -modi window -show window -hide-scrollbar -padding 50 -line-padding 4
;;
-q|--qalculate)
! hash qalc &>/dev/null && { echo "Requires 'libqalculate' installed"; exit 1; }
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; }
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; }
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' |
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' \

View File

@ -1,7 +1,7 @@
#!/usr/bin/env bash
NAME=$(basename "$0")
VER="0.3"
VER="0.4"
usage() {
cat <<- EOF
@ -37,9 +37,8 @@ toggle_polybar() {
fi
}
toggle_compton() {
if (( $opt == 1 )); then
if (( opt == 1 )); then
if [[ $(pidof compton) ]]; then
al-compositor --stop
else
@ -59,9 +58,8 @@ toggle_compton() {
done
}
toggle_redshift() {
if (( $opt == 1 )); then
if (( opt == 1 )); then
if [[ $(pidof redshift) ]]; then
pkill redshift
else
@ -87,7 +85,6 @@ toggle_redshift() {
done
}
toggle_caffeine() {
if (( $opt == 1 )); then
if [[ $(pidof caffeine) ]]; then
@ -109,18 +106,11 @@ toggle_caffeine() {
done
}
# Catch command line options
case $1 in
-h|--help)
usage
;;
-v|--version)
echo -e "$NAME -- Version $VER"
;;
-p|--polybar)
toggle_polybar
;;
-h|--help) usage ;;
-v|--version) echo -e "$NAME -- Version $VER" ;;
-p|--polybar) toggle_polybar ;;
-c|--compton)
[[ $2 =~ (-t|--toggle) ]] && opt=1
toggle_compton
@ -133,8 +123,7 @@ case $1 in
[[ $2 =~ (-t|--toggle) ]] && opt=1
toggle_caffeine
;;
*)
echo -e "Option does not exist: $1" && usage && exit 1
*) echo -e "Option does not exist: $1" && usage && exit 1
esac
exit 0