From 3e94a3e724c36267fa2e4039e3759473c59e8510 Mon Sep 17 00:00:00 2001 From: Tom van der Lee Date: Sat, 25 Oct 2014 22:26:54 +0200 Subject: Restructured dotfile repo to take advantage of GNU Stow --- .config/herbstluftwm/autostart | 203 --------------------------------- .config/herbstluftwm/dependencylist | 12 -- .config/herbstluftwm/lock.sh | 7 -- .config/herbstluftwm/notify.sh | 30 ----- .config/herbstluftwm/panel.sh | 219 ------------------------------------ .config/herbstluftwm/popup.sh | 60 ---------- .config/herbstluftwm/start.sh | 13 --- 7 files changed, 544 deletions(-) delete mode 100755 .config/herbstluftwm/autostart delete mode 100644 .config/herbstluftwm/dependencylist delete mode 100755 .config/herbstluftwm/lock.sh delete mode 100755 .config/herbstluftwm/notify.sh delete mode 100755 .config/herbstluftwm/panel.sh delete mode 100755 .config/herbstluftwm/popup.sh delete mode 100755 .config/herbstluftwm/start.sh (limited to '.config/herbstluftwm') diff --git a/.config/herbstluftwm/autostart b/.config/herbstluftwm/autostart deleted file mode 100755 index 109ea43..0000000 --- a/.config/herbstluftwm/autostart +++ /dev/null @@ -1,203 +0,0 @@ -#!/bin/bash - -# this is a simple config for herbstluftwm - -hc() { - herbstclient "$@" -} - -get_x_color() { - xresources=$(cat ~/.Xresources) - color=$(echo $xresources | sed "s/.*\*color$1: \(#[0-9A-Fa-f]*\).*/\1/") - echo $color -} - -hlwm_scripts="$HOME/.config/herbstluftwm" - -#wallpaper -wallpaper=/home/tom/Pictures/fall1.jpg - -#Numix color palette -export WM_LIGHT=$(get_x_color 15) -export WM_LLIGHT=$(get_x_color 7) -export WM_ACCENT=$(get_x_color 9) -export WM_LDARK=$(get_x_color 8) -export WM_DARK=$(get_x_color 0) - -#Panel and window_p -window_p=20 -monitor_w=$(hc list_monitors | sed 's/^[0-9]: \([0-9]*\)x.*$/\1/') -panel_h=24 -panel_w=$(echo "$monitor_w - (2 * $window_p)" | bc) -dmenu_opts="-h $panel_h -w $panel_w -x $window_p -y $window_p -p Run: -nb $WM_DARK -nf $WM_LIGHT -sb $WM_ACCENT -sf $WM_DARK" - -hc emir_hook reload - -# remove all existing keybindings -hc keyunbind --all - -# keybindings -Mod=Mod4 # Use the super key as the main modifier - -hc keybind $Mod-Shift-q quit -hc keybind $Mod-Shift-r reload -hc keybind $Mod-Shift-c close -hc keybind $Mod-Return spawn xterm -hc keybind $Mod-grave spawn dmenu_run $dmenu_opts -hc keybind XF86AudioLowerVolume spawn amixer set Master 5%- -hc keybind XF86AudioRaiseVolume spawn amixer set Master 5%+ - -# basic movement -# focusing clients -hc keybind $Mod-Left focus left -hc keybind $Mod-Down focus down -hc keybind $Mod-Up focus up -hc keybind $Mod-Right focus right -hc keybind $Mod-h focus left -hc keybind $Mod-j focus down -hc keybind $Mod-k focus up -hc keybind $Mod-l focus right - -# moving clients -hc keybind $Mod-Shift-Left shift left -hc keybind $Mod-Shift-Down shift down -hc keybind $Mod-Shift-Up shift up -hc keybind $Mod-Shift-Right shift right -hc keybind $Mod-Shift-h shift left -hc keybind $Mod-Shift-j shift down -hc keybind $Mod-Shift-k shift up -hc keybind $Mod-Shift-l shift right - -# splitting frames -# create an empty frame at the specified direction -hc keybind $Mod-u split bottom 0.5 -hc keybind $Mod-o split right 0.5 -# let the current frame explode into subframes -hc keybind $Mod-Control-space split explode - -# resizing frames -resizestep=0.05 -hc keybind $Mod-Control-h resize left +$resizestep -hc keybind $Mod-Control-j resize down +$resizestep -hc keybind $Mod-Control-k resize up +$resizestep -hc keybind $Mod-Control-l resize right +$resizestep -hc keybind $Mod-Control-Left resize left +$resizestep -hc keybind $Mod-Control-Down resize down +$resizestep -hc keybind $Mod-Control-Up resize up +$resizestep -hc keybind $Mod-Control-Right resize right +$resizestep - -# tags -tag_names=( I II III IV V VI VII VIII IX X ) -tag_keys=( {1..9} 0 ) - -# Selecting workspaces -hc keybind Alt-Control-Left use_index -1 -hc keybind Alt-Control-Right use_index +1 -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 "$Mod-$key" use_index "$i" - hc keybind "$Mod-Shift-$key" move_index "$i" - fi -done - -# cycle through tags -hc keybind $Mod-period use_index +1 --skip-visible -hc keybind $Mod-comma use_index -1 --skip-visible - -# layouting -hc keybind $Mod-r remove -hc keybind $Mod-space cycle_layout 1 -hc keybind $Mod-s floating toggle -hc keybind $Mod-f fullscreen toggle -hc keybind $Mod-p pseudotile toggle - -# mouse -hc mouseunbind --all -hc mousebind $Mod-Button1 move -hc mousebind $Mod-Button2 zoom -hc mousebind $Mod-Button3 resize - -# focus -hc keybind $Mod-BackSpace cycle_monitor -hc keybind $Mod-Tab cycle_all +1 -hc keybind $Mod-Shift-Tab cycle_all -1 -hc keybind $Mod-c cycle -hc keybind $Mod-i jumpto urgent -hc set focus_follows_mouse 1 - -# theme -hc attr theme.tiling.reset 1 -hc attr theme.floating.reset 1 -hc set frame_border_active_color $WM_LDARK -hc set frame_border_normal_color $WM_DARK -hc set frame_bg_normal_color $WM_LDARK -hc set frame_bg_active_color $WM_DARK -hc set frame_border_width 0 -hc set always_show_frame 0 -hc set frame_bg_transparent 1 -hc set frame_transparent_width 0 -hc set frame_gap 0 - -hc attr theme.active.color $WM_ACCENT -hc attr theme.normal.color $WM_DARK -hc attr theme.urgent.color orange -hc attr theme.inner_width 1 -hc attr theme.inner_color $WM_DARK -hc attr theme.border_width 3 -hc attr theme.floating.border_width 4 -hc attr theme.floating.outer_width 1 -hc attr theme.floating.outer_color $WM_DARK -hc attr theme.active.inner_color $WM_DARK -hc attr theme.active.outer_color $WM_DARK -hc attr theme.background_color $WM_DARK - -hc set window_gap $window_p -hc set frame_padding 0 -hc set smart_window_surroundings 0 -hc set smart_frame_surroundings 1 -hc set mouse_recenter_gap 1 - -# rules -hc unrule -F -#hc rule class=XTerm tag=3 # move all xterms to tag 3 -hc rule focus=on # normally focus new clients -#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 -hc rule windowtype~'_NET_WM_WINDOW_TYPE_(DIALOG|UTILITY|SPLASH)' pseudotile=on -hc rule windowtype='_NET_WM_WINDOW_TYPE_DIALOG' focus=on -hc rule windowtype~'_NET_WM_WINDOW_TYPE_(NOTIFICATION|DOCK|DESKTOP)' manage=off - -# unlock, just to be sure -hc unlock - -herbstclient set tree_style '╾│ ├└╼─┐' - -#Start panel in all monitors -start_panel() { - for monitor in $(herbstclient list_monitors | cut -d: -f1) ; do - "$1" $monitor $panel_h $window_p & - done -} - -# find the panel -panel=$hlwm_scripts/panel.sh -[ -x "$panel" ] || panel=/etc/xdg/herbstluftwm/panel.sh -if pgrep panel.sh >> /dev/null -then - kill $(pgrep panel.sh) - start_panel $panel -else - start_panel $panel -fi - -$hlwm_scripts/start.sh "xautolock -time 5 -locker $hlwm_scripts/lock.sh" -$hlwm_scripts/start.sh "feh --bg-fill $wallpaper" -$hlwm_scripts/start.sh "compton --config $HOME/.compton" -$hlwm_scripts/start.sh "xrdb -load $HOME/.Xresources" -$hlwm_scripts/start.sh "pulseaudio --start" -$hlwm_scripts/start.sh "dropboxd" -$hlwm_scripts/start.sh "$hlwm_scripts/notify.sh $monitor_w $window_p $panel_h $hlwm_scripts/popup.sh" diff --git a/.config/herbstluftwm/dependencylist b/.config/herbstluftwm/dependencylist deleted file mode 100644 index a18055d..0000000 --- a/.config/herbstluftwm/dependencylist +++ /dev/null @@ -1,12 +0,0 @@ -compton -bar-aint-recursive -bc -wireless_tools -dmenu2 -feh -pulseaudio -alsa-utils -sed -i3lock -scrot -xautolock diff --git a/.config/herbstluftwm/lock.sh b/.config/herbstluftwm/lock.sh deleted file mode 100755 index 04c4638..0000000 --- a/.config/herbstluftwm/lock.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -SCREENCAP="/tmp/lock.png" -scrot $SCREENCAP -convert -gaussian-blur "12x3" $SCREENCAP $SCREENCAP -i3lock -i $SCREENCAP -rm $SCREENCAP diff --git a/.config/herbstluftwm/notify.sh b/.config/herbstluftwm/notify.sh deleted file mode 100755 index 190d496..0000000 --- a/.config/herbstluftwm/notify.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash - -monitor_w=$1 -window_p=$2 -panel_h=$3 - -popup_w=$(echo "$monitor_w - (2 * $window_p)" | bc) -popup_h=$panel_h -popup_x=$window_p -popup_y=$window_p - -popup_opts="-w $popup_w -h $popup_h -x $popup_x -y $popup_y" - -while true; do - - bat_lvl=$(cat /sys/class/power_supply/BAT1/capacity) - bat_stat=$(cat /sys/class/power_supply/BAT1/status) - - if [[ $bat_lvl -le 5 && $bat_stat == "Discharging" ]]; then - $4 -m "Battery level critical: $bat_lvl%%" -u "high" $popup_opts - elif [[ $bat_lvl -eq 10 && $bat_stat == "Discharging" ]]; then - $4 -m "Battery level low: $bat_lvl%%" $popup_opts - elif [[ $bat_lvl -eq 50 && $bat_stat == "Discharging" ]]; then - $4 -m "Battery level at $bat_lvl%%" $popup_opts - elif [[ $bat_lvl -eq 100 && $bat_stat == "Charging" ]]; then - $4 -m "Battery fully charged" - fi - - sleep 60; -done diff --git a/.config/herbstluftwm/panel.sh b/.config/herbstluftwm/panel.sh deleted file mode 100755 index 24d0e12..0000000 --- a/.config/herbstluftwm/panel.sh +++ /dev/null @@ -1,219 +0,0 @@ -#!/bin/bash - -hc() { - "${herbstclient_command[@]:-herbstclient}" "$@" ; -} - -add_alpha_channel(){ - echo "$1" | \ - sed "s/.*#\([0-9a-fA-F]*\).*/#ff\1/" -} - -monitor=${1:-0} -panel_height=$2 -padding=$3 - -light=$(add_alpha_channel $WM_LIGHT) -llight=$(add_alpha_channel $WM_LLIGHT) -accent=$(add_alpha_channel $WM_ACCENT) -ldark=$(add_alpha_channel $WM_LDARK) -dark=$(add_alpha_channel $WM_DARK) - -font="-*-fixed-medium-*-*-*-14-*-*-*-*-*-*-*" -#font="" -selected_bg=$accent -normal_bg=$dark -selected_txt=$dark -normal_txt=$light -inactive_txt=$llight - -geometry=( $(herbstclient monitor_rect "$monitor") ) -if [ -z "$geometry" ] ;then - echo "Invalid monitor $monitor" - exit 1 -fi -# geometry has the format W H X Y -x=$(echo "${geometry[0]} + $padding" | bc) -y=$(echo "${geometry[1]} + $padding" | bc) -panel_width=$(echo "${geometry[2]} - (2 * $padding)" | bc) -bar_opts="-g ${panel_width}x${panel_height}+${x}+${y} -f ${font} -u 2 -B ${normal_bg} -F ${normal_txt}" - -hc pad $monitor $(echo "$panel_height + $padding" | bc) - -if awk -Wv 2>/dev/null | head -1 | grep -q '^mawk'; then - # mawk needs "-W interactive" to line-buffer stdout correctly - # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=593504 - uniq_linebuffered() { - awk -W interactive '$0 != l { print ; l=$0 ; fflush(); }' "$@" - } -else - # other awk versions (e.g. gawk) issue a warning with "-W interactive", so - # we don't want to use it there. - uniq_linebuffered() { - awk '$0 != l { print ; l=$0 ; fflush(); }' "$@" - } -fi - -{ - ### Event generator ### - # \t [...] - # e.g. - # date ^fg(#efefef)18:33^fg(#909090), 2013-10-^fg(#efefef)29 - - while true ; do - # Volume - if pgrep pulseaudio > /dev/null ; then - volumes=$(\ - amixer get Master | \ - grep "Mono: Playback"\ - ) - vol=$(\ - echo $volumes | \ - sed "s/.*\[\([0-9]*\)%\].*/\1/"\ - ) - if [ -z $vol ] ; then - echo -e "volume\toff" - elif [ $vol -le 0 ] ; then - echo -e "volume\t%{F$normal_txt}Volume muted" - else - echo -e "volume\t%{F$normal_txt}Volume: $vol%%%{F-}" - fi - else - echo -e "volume\toff" - fi - - # Network - iwconfig=$(iwconfig wlp3s0) - if [ -z $iwconfig ] ; then - echo -e "net\toff" - else - ssid=$(\ - echo $iwconfig | \ - sed "s/.*ESSID:\(\".*\"\).*/\1/" | \ - sed "s/.*\(off\/any\).*/\"\1\"/" | \ - sed "s/.*\"\(.*\)\".*/\1/"\ - ) - if [ $ssid = "off/any" ] ; then - ifconf=$ - echo -e "net\t%{F$normal_txt}Net: No connection%{F-}" - else - echo -e "net\t%{F$normal_txt}Net: $ssid%{F-}" - fi - fi - - # Battery - if $(test -e /sys/class/power_supply/BAT1) ; then - bat_lvl=$(cat /sys/class/power_supply/BAT1/capacity) - if [ $bat_lvl -lt 15 ] ; then - bat_color=$accent - else - bat_color=$normal_txt - fi - state=$(cat /sys/class/power_supply/BAT1/status) - echo -e "battery\t%{F$normal_txt}$state: %{F$bat_color}$bat_lvl%{F$normal_txt}%%%{F-}" - else - echo -e "battery\toff" - fi - - # Time - echo -e $(date +$"date\t%{F$normal_txt}%H:%M:%S %{F$inactive_txt}(%d-%m-%Y)%{F-}") - sleep 1 || break - done > >(uniq_linebuffered) & - childpid=$! - hc --idle - kill $childpid -} 2> /dev/null | { - - IFS=$'\t' read -ra tags <<< "$(hc tag_status $monitor)" - visible=true - date="" - volume="" - battery="" - net="" - windowtitle="" - while true ; do - separator="%{F$accent}|%{F-}" - # draw tags - for i in "${tags[@]}" ; do - case ${i:0:1} in - '#') - echo -n "%{U$accent+u}%{B-}%{F$normal_txt}" - ;; - '+') - echo -n "%{B$accent}%{F$normal_bg}" - ;; - ':') - echo -n "%{B-}%{F$normal_txt}" - ;; - '!') - echo -n "%{B$normal_txt}%{F$normal_bg}" - ;; - *) - echo -n "%{B-}%{F$inactive_txt}" - ;; - esac - echo -n "%{A:tag,${i:1}:} ${i:1} %{A}%{F-}%{B-}%{U-u}" - done - echo -n "$separator" - echo -n "%{B-}%{F-} ${windowtitle//^/^^}" - - #Right part of panel - right="$volume$net$battery$date " - echo -n "%{r}$right" - echo - - # wait for next event - IFS=$'\t' read -ra cmd || break - case "${cmd[0]}" in - tag*) - #echo "resetting tags" >&2 - IFS=$'\t' read -ra tags <<< "$(hc tag_status $monitor)" - ;; - volume) - volume="${cmd[@]:1}" - if [ $volume == "off" ] ; then - volume="" - else - volume="$volume $separator%{B-} " - fi - ;; - net) - net="${cmd[@]:1}" - if [ $net = "off" ] ; then - net="" - else - net="$net $separator%{B-} " - fi - ;; - battery) - battery="${cmd[@]:1}" - if [ $battery == "off" ] ; then - battery="" - else - battery="$battery $separator%{B-} " - fi - ;; - date) - #echo "resetting date" >&2 - date="${cmd[@]:1}" - ;; - focus_changed|window_title_changed) - windowtitle="${cmd[@]:2}" - ;; - esac - done -} 2> /dev/null | bar $bar_opts | { - #Handle clickable areas - while read line; do - IFS=',' read -a c <<< $(echo $line) - case "${c[0]}" in - tag) - herbstclient use "${c[1]}" - echo "herbstclient use \"${c[1]}\"" - ;; - *) - echo "${c[0]}: not valid command" - ;; - esac - done -} diff --git a/.config/herbstluftwm/popup.sh b/.config/herbstluftwm/popup.sh deleted file mode 100755 index 41c5e9c..0000000 --- a/.config/herbstluftwm/popup.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash - -help () { - echo -e "Usage: popup.sh [OPTIONS]" - echo -e "Spawns a popup for a certain amount of time" - echo -e "" - echo -e "Options:" - echo -e " -m MESSAGE\t\tSpecifies message to be displayed" - echo -e " -t TIMEOUT\t\tAmount of time in seconds the popup is displayed" -} - -add_alpha_channel(){ - echo "$1" | \ - sed "s/.*#\([0-9a-fA-F]*\).*/#ff\1/" -} - -timeout=10 -message="" -x=0 -y=0 -width=120 -height=90 -urgency="info" - -while getopts ":m:t:x:y:w:h:u:" opt; do - case $opt in - m) message=$OPTARG ;; - t) timeout=$OPTARG ;; - x) x=$OPTARG ;; - y) y=$OPTARG ;; - w) width=$OPTARG ;; - h) height=$OPTARG ;; - u) urgency=$OPTARG ;; - esac -done - -if test ! $message; then - help -else - light=$(add_alpha_channel $WM_LIGHT) - llight=$(add_alpha_channel $WM_LLIGHT) - accent=$(add_alpha_channel $WM_ACCENT) - ldark=$(add_alpha_channel $WM_LDARK) - dark=$(add_alpha_channel $WM_DARK) - font="-*-fixed-medium-*-*-*-$(echo "$height - 10" | bc)-*-*-*-*-*-*-*" - bar_opts="-f ${font} -B $dark -F $light -g ${width}x${height}+${x}+${y} -u 2" - - t=$(date +%T) - - if [ $urgency == "info" ]; then - prefix="Info:" - elif [ $urgency == "high" ]; then - prefix="!!WARNING:" - fi - - { - echo "%{F$accent} $prefix %{F$light}$message %{F$llight}($t)%{F-}" - sleep $timeout - } | bar $bar_opts -fi diff --git a/.config/herbstluftwm/start.sh b/.config/herbstluftwm/start.sh deleted file mode 100755 index f10fca6..0000000 --- a/.config/herbstluftwm/start.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -opts=($@) - -program=$(echo ${opts[0]} | sed 's/^.*\/\(.*\)/\1/') - -if pgrep $program >> /dev/null -then - killall $program - ${opts[@]} & -else - ${opts[@]} & -fi -- cgit v1.2.3