Automatic fixes from shfmt

This commit is contained in:
Tom Willemse 2020-04-15 00:55:03 -07:00
parent 8681e8a0da
commit a410d8ef6f

View file

@ -12,7 +12,7 @@ function hc() { herbstclient "$@"; }
# This function picks a random wallpaper from a list collection. # This function picks a random wallpaper from a list collection.
function random-wallpaper() { function random-wallpaper() {
find ~/pictures/wallpapers -type f \ find ~/pictures/wallpapers -type f \
-wholename '*/3840x1080/*' -o -wholename '*/patterns/*' \ -wholename '*/3840x1080/*' -o -wholename '*/patterns/*' \
| shuf -n 1 | shuf -n 1
} }
@ -23,8 +23,8 @@ function random-wallpaper() {
# switched. # switched.
function lock-tag-to-monitor() { function lock-tag-to-monitor() {
herbstclient chain \ herbstclient chain \
, new_attr string tags.by-name."$1".my_monitor \ , new_attr string tags.by-name."$1".my_monitor \
, set_attr tags.by-name."$1".my_monitor "$2" , set_attr tags.by-name."$1".my_monitor "$2"
} }
## Reload hook: ## Reload hook:
@ -74,7 +74,7 @@ hc keybind $Mod-b spawn hlwm-run-or-raise '\(Conkeror\|[Ff]irefox\|Chromium\)' f
# Switch to a running instance of Emacs, or create an Emacs client # Switch to a running instance of Emacs, or create an Emacs client
# frame. Start an Emacs daemon if necessary. # frame. Start an Emacs daemon if necessary.
hc keybind $Mod-t spawn hlwm-run-or-raise Emacs \ hc keybind $Mod-t spawn hlwm-run-or-raise Emacs \
emacsclient --create-frame --alternate-editor='' emacsclient --create-frame --alternate-editor=''
# Lock the screen with C-M-l. # Lock the screen with C-M-l.
hc keybind Control-Mod1-l spawn i3lock --color 000000 hc keybind Control-Mod1-l spawn i3lock --color 000000
# Swap visible tags # Swap visible tags
@ -86,24 +86,24 @@ hc keybind $Mod-x spawn hlwm-switch-tags
# as much as I can, and have the layouts set-up correctly already, but # as much as I can, and have the layouts set-up correctly already, but
# sometimes I still need to move around, resize and move clients. # sometimes I still need to move around, resize and move clients.
resizestep=0.05 resizestep=0.05
hc keybind $Mod-Shift-h shift left hc keybind $Mod-Shift-h shift left
hc keybind $Mod-Shift-j shift down hc keybind $Mod-Shift-j shift down
hc keybind $Mod-Shift-k shift up hc keybind $Mod-Shift-k shift up
hc keybind $Mod-Shift-l shift right hc keybind $Mod-Shift-l shift right
hc keybind $Mod-Control-h resize left +$resizestep hc keybind $Mod-Control-h resize left +$resizestep
hc keybind $Mod-Control-j resize down +$resizestep hc keybind $Mod-Control-j resize down +$resizestep
hc keybind $Mod-Control-k resize up +$resizestep hc keybind $Mod-Control-k resize up +$resizestep
hc keybind $Mod-Control-l resize right +$resizestep hc keybind $Mod-Control-l resize right +$resizestep
# I usually try to have my layouts set-up programmatically, but this # I usually try to have my layouts set-up programmatically, but this
# isn't always possible or practical. # isn't always possible or practical.
hc keybind $Mod-s split bottom 0.5 hc keybind $Mod-s split bottom 0.5
hc keybind $Mod-Shift-s split right 0.5 hc keybind $Mod-Shift-s split right 0.5
# Switching tags by number (key) isn't always practical, sometimes # Switching tags by number (key) isn't always practical, sometimes
# switching to next/previous tag is easiest. # switching to next/previous tag is easiest.
hc keybind $Mod-period use_index +1 --skip-visible hc keybind $Mod-period use_index +1 --skip-visible
hc keybind $Mod-comma use_index -1 --skip-visible hc keybind $Mod-comma use_index -1 --skip-visible
# Games and sometimes other applications don't always like being # Games and sometimes other applications don't always like being
# forced into a strangely sized box, floating mode helps. # forced into a strangely sized box, floating mode helps.
@ -119,10 +119,10 @@ hc keybind $Mod-p pseudotile toggle
# The following cycles through the available layouts within a frame, but skips # The following cycles through the available layouts within a frame, but skips
# layouts, if the layout change wouldn't affect the actual window positions. # layouts, if the layout change wouldn't affect the actual window positions.
# I.e. if there are two windows within a frame, the grid layout is skipped. # I.e. if there are two windows within a frame, the grid layout is skipped.
hc keybind $Mod-space \ hc keybind $Mod-space \
or , and . compare tags.focus.curframe_wcount = 2 \ or , and . compare tags.focus.curframe_wcount = 2 \
. cycle_layout +1 vertical horizontal max vertical grid \ . cycle_layout +1 vertical horizontal max vertical grid \
, cycle_layout +1 , cycle_layout +1
# mouse # mouse
hc mouseunbind --all hc mouseunbind --all
@ -131,7 +131,7 @@ hc mousebind $Mod-Button2 zoom
hc mousebind $Mod-Button3 resize hc mousebind $Mod-Button3 resize
# focus # focus
hc keybind $Mod-BackSpace cycle_monitor hc keybind $Mod-BackSpace cycle_monitor
# Use u because i is already used by by navigation commands. # Use u because i is already used by by navigation commands.
hc keybind $Mod-u jumpto urgent hc keybind $Mod-u jumpto urgent
@ -143,14 +143,14 @@ hc keybind XF86AudioPrev spawn mpc prev
# Add a screenshot button. # Add a screenshot button.
hc keybind Print spawn scrot \ hc keybind Print spawn scrot \
"${HOME}/pictures/screenshots/desktop/%Y%m%d_\$wx\$h_scrot.png" "${HOME}/pictures/screenshots/desktop/%Y%m%d_\$wx\$h_scrot.png"
if which lumeus >/dev/null 2>&1; then if which lumeus > /dev/null 2>&1; then
hc keybind XF86MonBrightnessUp spawn lumeus +10% hc keybind XF86MonBrightnessUp spawn lumeus +10%
hc keybind XF86MonBrightnessDown spawn lumeus -10% hc keybind XF86MonBrightnessDown spawn lumeus -10%
fi fi
if which ponymix >/dev/null 2>&1; then if which ponymix > /dev/null 2>&1; then
hc keybind XF86AudioMute spawn ponymix toggle hc keybind XF86AudioMute spawn ponymix toggle
hc keybind XF86AudioLowerVolume spawn ponymix decrease 10 hc keybind XF86AudioLowerVolume spawn ponymix decrease 10
hc keybind XF86AudioRaiseVolume spawn ponymix increase 10 hc keybind XF86AudioRaiseVolume spawn ponymix increase 10
@ -160,24 +160,24 @@ fi
hc set default_frame_layout 2 hc set default_frame_layout 2
## Tags: ## Tags:
tag_names=( dev web {3..10} ) tag_names=(dev web {3..10})
tag_indexes=( {1..${#tag_names}} ) tag_indexes=({1..${#tag_names}})
tag_keys=( bracketleft braceleft braceright parenleft equal tag_keys=(bracketleft braceleft braceright parenleft equal
asterisk parenright plus bracketright exclam ) asterisk parenright plus bracketright exclam)
hc rename default "${tag_names[1]}" || true hc rename default "${tag_names[1]}" || true
for i in $tag_indexes; do for i in $tag_indexes; do
hc add "${tag_names[$i]}" hc add "${tag_names[$i]}"
key="${tag_keys[$i]}" key="${tag_keys[$i]}"
if ! [ -z "$key" ] ; then if ! [ -z "$key" ]; then
# ZSH array indexes start at 1, herbstluftwm tag indexes start # ZSH array indexes start at 1, herbstluftwm tag indexes start
# at zero, so subtract one to match them. # at zero, so subtract one to match them.
j=$(( $i - 1 )) j=$((i - 1))
# first check if the tag is locked to some monitor. # first check if the tag is locked to some monitor.
# if so, first focus the monitor # if so, first focus the monitor
hc keybind "$Mod-$key" chain \ hc keybind "$Mod-$key" chain \
, silent substitute M tags."$j".my-monitor focus_monitor M \ , silent substitute M tags."$j".my-monitor focus_monitor M \
, use_index "$j" , use_index "$j"
hc keybind "$Mod-Shift-$key" move_index "$j" hc keybind "$Mod-Shift-$key" move_index "$j"
fi fi
done done