[Shell] Personal dotfiles and scripts to deploy them.
{{{hl}}} configuration file
Table of Contents
# -*- mode: org; -*-
#+PROPERTY: header-args :tangle "~/.config/herbstluftwm/autostart" #+PROPERTY: header-args+ :shebang "#!/usr/bin/env bash"
#+SETUPFILE: /.emacs.d/resources/templates/documents/gnu-default.setup #+INCLUDE: /.emacs.d/resources/templates/documents/default.org_title
#+MACRO: hl Herbstluftwm
Introduction
This is my literate configuration for {{{hl}}} and other programs started at the beginning of a graphical session. {{{hl}}} is a manual tiling window manager and is configured via the herbstclient program.
#+begin_center \Huge\textbf{Herbstluft}\\ \normalsize\textit{autumn air} #+end_center
Early setup
Definitions
We begin by defining a shorthand name for the herbstclient program:
#+NAME: hc
hc(){herbstclient$@"
Basic
We make {{{hl}}} execute code associated with the reload hook.
hcemit_hookreload
We set the color of the default window bar.
xsetroot-solid'
Keybindings
We remove all existing keybindings.
hckeyunbind--all
Choice of Modkey. Mod1 is Alt, Mod4 is Super.
Mod=Mod4
Basic interaction with {{{hl}}}
hckeybind$Mod-Shift-qquit
hckeybind$Mod-Shift-rreload
hckeybind$Mod-Shift-cclose
Close focused window or remove frame
hckeybind$Mod-qclose_or_remove
Application shortcuts
Menu
{{{hl}}} wrapper around dmenu.
hckeybind$Mod-dspawn"
Terminal
We use st.
hckeybind$Mod-Returnspawn"
TODO Emacs
We assign shortcuts to commonly used applications.
hckeybind$Mod-espawn"
Movement
Basic movement in tiling and floating mode focusing clients.
hckeybind$Mod-Leftfocusleft
hckeybind$Mod-Downfocusdown
hckeybind$Mod-Upfocusup
hckeybind$Mod-Rightfocusright
hckeybind$Mod-hfocusleft
hckeybind$Mod-jfocusdown
hckeybind$Mod-kfocusup
hckeybind$Mod-lfocusright
Moving clients in tiling and floating mode.
hckeybind$Mod-Shift-Leftshiftleft
hckeybind$Mod-Shift-Downshiftdown
hckeybind$Mod-Shift-Upshiftup
hckeybind$Mod-Shift-Rightshiftright
hckeybind$Mod-Shift-hshiftleft
hckeybind$Mod-Shift-jshiftdown
hckeybind$Mod-Shift-kshiftup
hckeybind$Mod-Shift-lshiftright
Splitting frames
Create an empty frame at the specified direction.
hckeybind$Mod-usplitbottom0.5
hckeybind$Mod-osplitleft0.5
We let the current frame explode into subframes.
hckeybind$Mod-Control-spacesplitexplode
Resizing frames and clients
Resizing frames and floating clients.
resizestep=0.02
hckeybind$Mod-Control-hresizeleft+$resizestep
hckeybind$Mod-Control-jresizedown+$resizestep
hckeybind$Mod-Control-kresizeup+$resizestep
hckeybind$Mod-Control-lresizeright+$resizestep
hckeybind$Mod-Control-Leftresizeleft+$resizestep
hckeybind$Mod-Control-Downresizedown+$resizestep
hckeybind$Mod-Control-Upresizeup+$resizestep
hckeybind$Mod-Control-Rightresizeright+$resizestep
Tags
Basic definitions
tag_names=( {1..5} )
tag_keys=( {1..5} 0 )
hcrenamedefault${tag_names[]}""${!tag_names[]}""${tag_names[]}""${tag_keys[]}""$key""$Mod$key""$i""$Mod$key""$i"
Cycle tags
hckeybind$Mod-perioduse_index+1--skip-visible
hckeybind$Mod-commause_index-1--skip-visible
Layouting
hckeybind$Mod-rremove
hckeybind$Mod-sfloatingtoggle # Schwebend = floating!
hckeybind$Mod-ffullscreentoggle
hckeybind$Mod-Shift-fset_attrclients.focus.floatingtoggle
hckeybind$Mod-Shift-mset_attrclients.focus.minimizedtrue
hckeybind$Mod-Control-mjumptolast-minimized
hckeybind$Mod-ppseudotiletoggle
The following cycles through the available layouts within a frame, but skips 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.
hckeybind$Mod-space\or,and.comparetags.focus.curframe_wcount=2\.cycle_layout+1verticalhorizontalmaxverticalgrid\,cycle_layout+1
Mouse bindings
hcmouseunbind--all
hcmousebind$Mod-Button1move
hcmousebind$Mod-Button2zoom
hcmousebind$Mod-Button3resize
Cycle the active screens
hckeybind$Mod-Tabcycle_all+1
hckeybind$Mod-Shift-Tabcycle_all-1
This is a ``shorter'' shortcut.
hckeybind$Mod-ccycle_all+1
Jump to to next urgent program
Super useful when getting prompted for permissions in a browser on a different tag!
hckeybind$Mod-ijumptourgent
Theme
hcattrtheme.tiling.reset1
hcattrtheme.floating.reset1
Colors
color_main='#666611'
xsetroot-solid$color_main
Frames
hcsetframe_border_active_color'''''''
We have a grand total of 4 pixels dedicated to the frame borders, per frame---so six pixels wasted at most.
Gap between frames
We set no gap between frames and other frames/monitors.
hcsetframe_gap0
Windows
Basic
hcattrtheme.title_height24
hcattrtheme.title_font''''''''''''''''''''
Copy inner_color to outer_color.
forstateinactiveurgentnormal; do
hcsubstituteCtheme.${state}.inner_color\attrtheme.${state}.outer_colorC
done
hcattrtheme.active.outer_width1
hcattrtheme.background_color'
Appearance
Gap between windows, tiled in a frame.
hcsetwindow_gap24
We could reserve extra room on the edges common to all the tiled windows. (Despite being a frame parameter, it really applies to the sum total of tiled windows in a given frame, so it belongs to this section).
hcsetframe_padding0
If only one frame exists on a given monitor, no border gap is added to the unique frame. But since we set the frame gap to 0, this has no effect.
hcsetsmart_frame_surroundingsoff
If only one window exists in a given frame, the border gap between the window and the frame may be omitted.
hcsetsmart_window_surroundingsoff
hcsetmouse_recenter_gap0
Rules
First, we cancel all previously bound rules.
hcunrule-F
#hc rule class=XTerm tag=3 # move all xterms to tag 3
hcrulefocus=on # normally focus new clients
hcrulefloatplacement=smart
#hc rule focus=off # normally do not focus new clients
# give focus to most common terminals
#hc rule class~'(.*[Rr]xvt.*|.*[Tt]erm|Konsole)' focus=on
hcrulewindowtype~'''''''
Unlock monitors
hcunlock
Other programs
COMMENT Panel
# xset +fp /home/blendux/.fonts/
kill$(pgrep--full"
This panel is adapted from the one provided by default by {{{hl}}}, located at file:/etc/xdg/herbstluftwm/panel.sh.
I'm using lemonbar-xft, which provides XFT support.
font='-*-hack-medium-r-*-*-*-*-*-*-*-*-*-*'
font_xft='Hack'
# extract colors from hlwm and omit alpha-value
bgcolor=$(herbstclientgetframe_border_normal_color|sed'''''''''''''''''
#+RESULTS:
quote(){localq="$(printf''''''''''''''''''''''''''''''''''''''''''''''''''
COMMENT Dock
if[$(pgrepplank)]thenpkillplankelseplank&fi
System information
if[$(pgrepconky)]thenpkillconkyfi
conky&
Compositor
if[$(pgreppicom)]thenpkillpicomfi
picom&
TODO Desktop Background
~/.fehbg&