dotfiles

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

autostart (7514B)


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