From 8716ab491538b8538e8f1d94b9d604280c5d5847 Mon Sep 17 00:00:00 2001 From: shmibs Date: Fri, 19 Oct 2018 05:54:57 -0700 Subject: script cleaning migrate autostart to zsh and simplify, among other things --- .config/herbstluftwm/autostart | 30 +++++++++++++----------------- .config/herbstluftwm/panel.sh | 2 +- .zshrc | 10 ++++------ 3 files changed, 18 insertions(+), 24 deletions(-) diff --git a/.config/herbstluftwm/autostart b/.config/herbstluftwm/autostart index ffc9e10..dfb6f56 100755 --- a/.config/herbstluftwm/autostart +++ b/.config/herbstluftwm/autostart @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/zsh source ~/.config/init/vars @@ -82,16 +82,12 @@ hc keybind Mod4-Control-l resize right +$resizestep # tags tag_names=( {1..5} ) -tag_keys=( {1..5} 0 ) - -hc rename default "${tag_names[0]}" || true -for i in ${!tag_names[@]} ; do - hc add "${tag_names[$i]}" - key="${tag_keys[$i]}" - if ! [ -z "$key" ] ; then - hc keybind "Mod4-$key" use_index "$i" - hc keybind "Mod4-Control-$key" move_index "$i" - fi + +hc rename default $tag_names[1] || true +for ((i=1; i <= $#tag_names; i++)) do + hc add $tag_names[$i] + hc keybind "Mod4-$i" use_index $(($i-1)) + hc keybind "Mod4-Control-$i" move_index $(($i-1)) done # cycle through tags @@ -161,14 +157,14 @@ hc keybind Mod4-Shift-m spawn mathematica hc keybind Mod4-Shift-n spawn urxvt -name "notes" -e $EDITOR ~/notes hc keybind Mod4-Shift-o spawn ~/stuffs/tor/start-tor-browser hc keybind Mod4-Shift-t spawn transmission-gtk -hc keybind Mod4-Shift-v spawn urxvt -name "$EDITOR" -e $EDITOR +hc keybind Mod4-Shift-v spawn urxvt -name $EDITOR -e $EDITOR hc keybind Mod4-Shift-w spawn urxvt -name "weechat" -e weechat # dmenu hc keybind Mod4-r spawn dmenu_run -fn "${bfont}:size=${bfont_size}" \ - -p "Run:" -h "$bheight" \ - -nb "$bar_bg" -nf "$bar_fg" \ - -sb "$bg_focus" -sf "$fg_focus" + -p "Run:" -h $bheight \ + -nb $bar_bg -nf $bar_fg \ + -sb $bg_focus -sf $fg_focus hc keybind Mod4-g spawn ~/.config/herbstluftwm/switcher.sh # hc keybind Mod4-8 spawn ~/.config/herbstluftwm/calc.sh @@ -205,7 +201,7 @@ hc rule class~'(mednafen)' pseudotile=on focus=on # TABLET MODE # ################# -if [[ $tablet_mode ]]; then +if [[ $tablet_mode != "" ]]; then hc rule class~'(onboard|Onboard)' manage=off hc keybind XF86AudioLowerVolume spawn onboard -m @@ -228,7 +224,7 @@ hc unlock # run the panel panel=~/.config/herbstluftwm/panel.sh [ -x "$panel" ] || panel=/etc/xdg/herbstluftwm/panel.sh -for monitor in $(hc list_monitors | cut -d: -f1) ; do +for monitor in $(hc list_monitors | cut -d: -f1); do # start it on each monitor "$panel" $monitor & done diff --git a/.config/herbstluftwm/panel.sh b/.config/herbstluftwm/panel.sh index 0f92899..3c3d178 100755 --- a/.config/herbstluftwm/panel.sh +++ b/.config/herbstluftwm/panel.sh @@ -1,4 +1,4 @@ -!/bin/bash +#!/bin/bash ########### # SETUP # diff --git a/.zshrc b/.zshrc index 0d9ae09..eea1fac 100644 --- a/.zshrc +++ b/.zshrc @@ -146,17 +146,15 @@ alias :q='exit' alias less='less -R' export PAGER="less -R" -if [[ ! -z $(whence vim) ]] then - export EDITOR='vim' - alias svim='sudo -E vim' - alias svimdiff='sudo -E vim -d' -fi - if [[ ! -z $(whence nvim) ]] then alias svim='sudo -E nvim' alias svimdiff='sudo -E nvim -d' alias vim='nvim' export EDITOR='nvim' +elif [[ ! -z $(whence vim) ]] then + export EDITOR='vim' + alias svim='sudo -E vim' + alias svimdiff='sudo -E vim -d' fi [[ ! -z $(whence sdcv) ]] && alias def='sdcv' -- cgit v1.2.3