dotfiles

*nix config files
git clone git://git.pyratebeard.net/dotfiles.git
Log | Files | Refs | README

autostart (7653B)


      1 #!/bin/sh
      2 #
      3 #  ██                     ██                ██    ██           ████   ██
      4 # ░██                    ░██               ░██   ░██          ░██░   ░██
      5 # ░██       █████  ██████░██       ██████ ██████ ░██ ██   ██ ██████ ██████
      6 # ░██████  ██░░░██░░██░░█░██████  ██░░░░ ░░░██░  ░██░██  ░██░░░██░ ░░░██░
      7 # ░██░░░██░███████ ░██ ░ ░██░░░██░░█████   ░██   ░██░██  ░██  ░██    ░██
      8 # ░██  ░██░██░░░░  ░██   ░██  ░██ ░░░░░██  ░██   ░██░██  ░██  ░██    ░██
      9 # ░██  ░██░░██████░███   ░██████  ██████   ░░██  ███░░██████  ░██    ░░██
     10 # ░░   ░░  ░░░░░░ ░░░    ░░░░░   ░░░░░░     ░░  ░░░  ░░░░░░   ░░      ░░
     11 
     12 hc() {
     13     herbstclient "$@"
     14 }
     15 
     16 hc emit_hook reload
     17 
     18 # remove all existing keybindings
     19 hc keyunbind --all
     20 
     21 # close tray if reloading
     22 killall stalonetray
     23 
     24 # gap counter
     25 echo 30 > /tmp/herbstluftwm-gap
     26 
     27 # keybindings
     28 Mod=Mod4
     29 Alt=Mod1
     30 
     31 # minimize and unminimise windows
     32 bash /home/pyratebeard/.local/bin/herbstluftwm-min_max
     33 
     34 hc keybind $Mod-Control-s spawn bash /home/pyratebeard/.local/bin/herbstluftwm-miniscratch
     35 
     36 # run menu
     37 hc keybind $Mod-w	spawn /usr/bin/zsh /home/pyratebeard/.local/bin/rundmc
     38 
     39 # lock screen
     40 hc keybind $Mod-z	spawn bash /home/pyratebeard/.local/bin/lock
     41 
     42 # dynamic window gap
     43 hc keybind $Mod-9	spawn bash /home/pyratebeard/.local/bin/herbstluftwm-remove-gap
     44 hc keybind $Mod-0	spawn bash /home/pyratebeard/.local/bin/herbstluftwm-add-gap
     45 
     46 # browser
     47 hc keybind $Mod-b spawn firefox
     48 
     49 # scrot
     50 hc keybind $Mod-q spawn scrot -e 'mv $f ~trove/images/misc/scrots/pyratebeard/'
     51 
     52 # generic actions
     53 hc keybind $Mod-Shift-q quit
     54 hc keybind $Mod-Shift-r reload
     55 hc keybind $Mod-Shift-c close
     56 hc keybind $Mod-Return spawn urxvtc
     57 
     58 # basic movement
     59 # focusing clients
     60 hc keybind $Mod-Left  focus left
     61 hc keybind $Mod-Down  focus down
     62 hc keybind $Mod-Up    focus up
     63 hc keybind $Mod-Right focus right
     64 hc keybind $Mod-h     focus left
     65 hc keybind $Mod-j     focus down
     66 hc keybind $Mod-k     focus up
     67 hc keybind $Mod-l     focus right
     68 
     69 # moving clients
     70 hc keybind $Mod-Shift-Left  shift left
     71 hc keybind $Mod-Shift-Down  shift down
     72 hc keybind $Mod-Shift-Up    shift up
     73 hc keybind $Mod-Shift-Right shift right
     74 hc keybind $Mod-Shift-h     shift left
     75 hc keybind $Mod-Shift-j     shift down
     76 hc keybind $Mod-Shift-k     shift up
     77 hc keybind $Mod-Shift-l     shift right
     78 
     79 # splitting frames
     80 # create an empty frame at the specified direction
     81 hc keybind $Mod-u       chain , split   bottom  0.5  , focus down #row
     82 hc keybind $Mod-o       chain , split   right   0.5  , focus right #column
     83 # let the current frame explode into subframes
     84 hc keybind $Mod-Control-space split explode
     85 
     86 # resizing frames
     87 resizestep=0.01
     88 hc keybind $Mod-Control-h       resize left +$resizestep
     89 hc keybind $Mod-Control-j       resize down +$resizestep
     90 hc keybind $Mod-Control-k       resize up +$resizestep
     91 hc keybind $Mod-Control-l       resize right +$resizestep
     92 hc keybind $Mod-Control-Left    resize left +$resizestep
     93 hc keybind $Mod-Control-Down    resize down +$resizestep
     94 hc keybind $Mod-Control-Up      resize up +$resizestep
     95 hc keybind $Mod-Control-Right   resize right +$resizestep
     96 
     97 # tags
     98 tag_names=( {0..4} )
     99 tag_keys=( {1..5} 0 )
    100 
    101 # set up normal tags
    102 hc rename default "${tag_names[0]}" || true
    103 for i in ${!tag_names[@]} ; do
    104     hc add "${tag_names[$i]}"
    105 	key="${tag_keys[$i]}"
    106 	layoutfile=/home/pyratebeard/dot/herbstluftwm/layout-${key}
    107     if ! [ -z "$key" ] ; then
    108         hc keybind "$Mod-$key" \
    109 			chain , silent substitute M tags."$i".my_monitor \
    110 					focus_monitor M \
    111 				, use_index "$i"
    112         hc keybind "$Mod-Shift-$key" move_index "$i"
    113 		if [ -f ${layoutfile} ] ; then
    114 			hc load ${i} "$(cat ${layoutfile})"
    115 		fi
    116     fi
    117 done
    118 
    119 hc keybind $Mod-t chain \
    120 	, new_attr string tags.focus.my_monitor \
    121 	, substitute M monitors.focus.indix set_attr tags.focus.my_monitor M \
    122 	, try and \
    123 		. compare monitors.focus.name != "" \
    124 		. substitute M monitors.focus.name \
    125 			set_attr tags.focus.my_monitor M
    126 
    127 hc keybind $Mod-Shift-t \
    128 	remove_attr tags.focus.my_monitor
    129 
    130 lock_tag_to_monitor() {
    131 	hc chain \
    132 		, new_attr string tags.by-name."$1".my_monitor \
    133 		, set_attr tags.by-name."$1".my_monitor "$2"
    134 }
    135 
    136 lock_tag_to_monitor 0 0
    137 lock_tag_to_monitor 1 1
    138 lock_tag_to_monitor 2 0
    139 lock_tag_to_monitor 3 1
    140 lock_tag_to_monitor 4 0
    141 
    142 # cycle through tags
    143 hc keybind $Mod-$Alt-Left use_index -1 --skip-visible
    144 hc keybind $Mod-$Alt-Right  use_index +1 --skip-visible
    145 
    146 # layouting
    147 hc keybind $Mod-x remove
    148 hc keybind $Mod-space cycle_layout 1
    149 hc keybind $Mod-Shift-space cycle_layout -1
    150 hc keybind $Mod-s set_attr clients.focus.floating toggle
    151 hc keybind $Mod-f fullscreen toggle
    152 hc keybind $Mod-p pseudotile toggle
    153 
    154 # mouse
    155 hc mouseunbind --all
    156 hc mousebind $Mod-Button1 move
    157 hc mousebind $Mod-Button2 zoom
    158 hc mousebind $Mod-Button3 resize
    159 
    160 # focus
    161 hc keybind $Mod-BackSpace   cycle_monitor
    162 hc keybind $Mod-Tab         cycle_all +1
    163 hc keybind $Mod-Shift-Tab   cycle_all -1
    164 hc keybind $Mod-n cycle
    165 hc keybind $Mod-i jumpto urgent
    166 
    167 # theme
    168 hc attr theme.tiling.reset 1
    169 hc attr theme.floating.reset 1
    170 hc set frame_border_active_color '#807b64'
    171 hc set frame_border_normal_color '#131313'
    172 hc set frame_bg_normal_color '#202020'
    173 hc set frame_bg_active_color '#131313'
    174 hc set frame_border_width 0
    175 hc set always_show_frame 0
    176 hc set frame_bg_transparent 1
    177 hc set frame_transparent_width 0
    178 hc set frame_gap 2
    179 
    180 hc attr theme.active.color '#62978c' #6A8C8C
    181 hc attr theme.normal.color '#222222'
    182 hc attr theme.urgent.color '#58333e'
    183 hc attr theme.inner_width 4
    184 hc attr theme.inner_color '#222222'
    185 hc attr theme.border_width 6
    186 hc attr theme.floating.border_width 3
    187 hc attr theme.floating.outer_width 1
    188 hc attr theme.floating.outer_color black
    189 hc attr theme.active.inner_color '#111'
    190 hc attr theme.active.outer_color '#111'
    191 hc attr theme.background_color '#1e1b1c'
    192 hc attr theme.padding_left 14
    193 
    194 hc set window_gap 30
    195 hc set frame_padding 0
    196 hc set smart_window_surroundings 0
    197 hc set smart_frame_surroundings 1
    198 hc set mouse_recenter_gap 0
    199 
    200 # rules
    201 hc unrule -F
    202 #hc rule class=XTerm tag=3 # move all xterms to tag 3
    203 hc rule focus=on # normally focus new clients
    204 #hc rule focus=off # normally do not focus new clients
    205 # give focus to most common terminals
    206 #hc rule class~'(.*[Rr]xvt.*|.*[Tt]erm|Konsole)' focus=on
    207 hc rule windowtype~'_NET_WM_WINDOW_TYPE_(DIALOG|UTILITY|SPLASH)' pseudotile=on
    208 hc rule windowtype='_NET_WM_WINDOW_TYPE_DIALOG' focus=on
    209 hc rule windowtype~'_NET_WM_WINDOW_TYPE_(NOTIFICATION|DOCK|DESKTOP)' manage=off
    210 
    211 # unlock, just to be sure
    212 hc unlock
    213 
    214 herbstclient set tree_style '╾│ ├└╼─┐'
    215 
    216 hc rule class=qutebrowser tag=1
    217 hc rule class=firefox tag=1
    218 hc rule class=Chromium tag=3
    219 hc rule class=teams-for-linux tag=3
    220 hc rule class=Gimp floating=true
    221 hc rule class="Tor Browser" floating=true
    222 hc rule class=xfreerdp floating=true
    223 hc rule class="Qemu-system-x86_64" floating=true
    224 hc rule title=scratchpad floating=true floatplacement=center
    225 hc rule title=dmenu floating=true
    226 
    227 # do multi monitor setup here, e.g.:
    228 # hc set_monitors 1280x1024+0+0 1280x1024+1280+0
    229 # or simply:
    230 hc detect_monitors