diff options
| author | 2014-09-29 11:32:59 +0200 | |
|---|---|---|
| committer | 2014-09-29 11:32:59 +0200 | |
| commit | 46fa9738887f81b3b1b08ccace52f9e63c3f54a5 (patch) | |
| tree | 97b9e3835bf35767e3d657f7ecac233f05b9f99b | |
| parent | c830864c63c362b58adec46121c459578fcead01 (diff) | |
| parent | 3336b67f7b1daff9fa4e0f8099947b43391e0f8f (diff) | |
| download | dotfiles-46fa9738887f81b3b1b08ccace52f9e63c3f54a5.tar.gz dotfiles-46fa9738887f81b3b1b08ccace52f9e63c3f54a5.tar.bz2 dotfiles-46fa9738887f81b3b1b08ccace52f9e63c3f54a5.zip | |
Added clickable areas
| -rwxr-xr-x | .config/herbstluftwm/autostart | 40 | ||||
| -rwxr-xr-x | .config/herbstluftwm/panel.sh | 86 | ||||
| -rw-r--r-- | Makefile | 49 | ||||
| -rw-r--r-- | README.md | 4 |
4 files changed, 86 insertions, 93 deletions
diff --git a/.config/herbstluftwm/autostart b/.config/herbstluftwm/autostart index 0fb9ea7..b8f8898 100755 --- a/.config/herbstluftwm/autostart +++ b/.config/herbstluftwm/autostart | |||
| @@ -2,6 +2,10 @@ | |||
| 2 | 2 | ||
| 3 | # this is a simple config for herbstluftwm | 3 | # this is a simple config for herbstluftwm |
| 4 | 4 | ||
| 5 | hc() { | ||
| 6 | herbstclient "$@" | ||
| 7 | } | ||
| 8 | |||
| 5 | #get colors from .Xresources | 9 | #get colors from .Xresources |
| 6 | get_xcolor(){ | 10 | get_xcolor(){ |
| 7 | xresources=$(\ | 11 | xresources=$(\ |
| @@ -15,26 +19,23 @@ get_xcolor(){ | |||
| 15 | } | 19 | } |
| 16 | 20 | ||
| 17 | #Wallpaper | 21 | #Wallpaper |
| 18 | WALLPAPER=/home/tom/Pictures/ThDLxEW.jpg | 22 | WALLPAPER=/home/tom/Pictures/rocks.jpg |
| 19 | 23 | ||
| 20 | #Numix color palette | 24 | #Numix color palette |
| 21 | LIGHT=$(get_xcolor 15) | 25 | LIGHT=$(get_xcolor 15) |
| 22 | LLIGHT=$(get_xcolor 7) | 26 | LLIGHT=$(get_xcolor 7) |
| 23 | ACCENT=$(get_xcolor 9) | 27 | ACCENT=$(get_xcolor 12) |
| 24 | LDARK=$(get_xcolor 8) | 28 | LDARK=$(get_xcolor 8) |
| 25 | DARK=$(get_xcolor 0) | 29 | DARK=$(get_xcolor 0) |
| 26 | 30 | ||
| 27 | #Panel | 31 | #Panel and padding |
| 28 | PANEL_HEIGHT=24 | 32 | padding=20 |
| 29 | 33 | monitor_width=$(hc list_monitors | sed 's/^[0-9]: \([0-9]*\)x.*$/\1/') | |
| 30 | hc() { | 34 | panel_height=24 |
| 31 | herbstclient "$@" | 35 | panel_width=$(echo "$monitor_width - (2 * $padding)" | bc) |
| 32 | } | ||
| 33 | 36 | ||
| 34 | hc emir_hook reload | 37 | hc emir_hook reload |
| 35 | 38 | ||
| 36 | xsetroot -solid $ACCENT | ||
| 37 | |||
| 38 | # remove all existing keybindings | 39 | # remove all existing keybindings |
| 39 | hc keyunbind --all | 40 | hc keyunbind --all |
| 40 | 41 | ||
| @@ -45,7 +46,7 @@ hc keybind $Mod-Shift-q quit | |||
| 45 | hc keybind $Mod-Shift-r reload | 46 | hc keybind $Mod-Shift-r reload |
| 46 | hc keybind $Mod-Shift-c close | 47 | hc keybind $Mod-Shift-c close |
| 47 | hc keybind $Mod-Return spawn xterm | 48 | hc keybind $Mod-Return spawn xterm |
| 48 | hc keybind $Mod-grave spawn dmenu_run -h $PANEL_HEIGHT -p "Run:" -nb $DARK -nf $LIGHT -sb $ACCENT -sf $DARK | 49 | hc keybind $Mod-grave spawn dmenu_run -h $panel_height -w $panel_width -x $padding -y $padding -p "Run:" -nb $DARK -nf $LIGHT -sb $ACCENT -sf $DARK |
| 49 | hc keybind XF86AudioLowerVolume spawn amixer set Master 5%- | 50 | hc keybind XF86AudioLowerVolume spawn amixer set Master 5%- |
| 50 | hc keybind XF86AudioRaiseVolume spawn amixer set Master 5%+ | 51 | hc keybind XF86AudioRaiseVolume spawn amixer set Master 5%+ |
| 51 | 52 | ||
| @@ -94,7 +95,7 @@ tag_keys=( {1..9} 0 ) | |||
| 94 | 95 | ||
| 95 | # Selecting workspaces | 96 | # Selecting workspaces |
| 96 | hc keybind Alt-Control-Left use_index -1 | 97 | hc keybind Alt-Control-Left use_index -1 |
| 97 | hc keybind Alt-Control-Right use_index +1 | 98 | hc keybind Alt-Control-Right use_index +1 |
| 98 | hc rename default "${tag_names[0]}" || true | 99 | hc rename default "${tag_names[0]}" || true |
| 99 | for i in ${!tag_names[@]} ; do | 100 | for i in ${!tag_names[@]} ; do |
| 100 | hc add "${tag_names[$i]}" | 101 | hc add "${tag_names[$i]}" |
| @@ -156,7 +157,7 @@ hc attr theme.active.inner_color $DARK | |||
| 156 | hc attr theme.active.outer_color $DARK | 157 | hc attr theme.active.outer_color $DARK |
| 157 | hc attr theme.background_color $DARK | 158 | hc attr theme.background_color $DARK |
| 158 | 159 | ||
| 159 | hc set window_gap 20 | 160 | hc set window_gap $padding |
| 160 | hc set frame_padding 0 | 161 | hc set frame_padding 0 |
| 161 | hc set smart_window_surroundings 0 | 162 | hc set smart_window_surroundings 0 |
| 162 | hc set smart_frame_surroundings 1 | 163 | hc set smart_frame_surroundings 1 |
| @@ -186,7 +187,7 @@ herbstclient set tree_style '╾│ ├└╼─┐' | |||
| 186 | #Start panel in all monitors | 187 | #Start panel in all monitors |
| 187 | start_panel() { | 188 | start_panel() { |
| 188 | for monitor in $(herbstclient list_monitors | cut -d: -f1) ; do | 189 | for monitor in $(herbstclient list_monitors | cut -d: -f1) ; do |
| 189 | "$1" $monitor $PANEL_HEIGHT $LIGHT $LLIGHT $ACCENT $LDARK $DARK $2& | 190 | "$1" $monitor $panel_height $padding $LIGHT $LLIGHT $ACCENT $LDARK $DARK $2& |
| 190 | done | 191 | done |
| 191 | } | 192 | } |
| 192 | 193 | ||
| @@ -202,7 +203,7 @@ else | |||
| 202 | fi | 203 | fi |
| 203 | 204 | ||
| 204 | #Wallpaper | 205 | #Wallpaper |
| 205 | feh --bg-scale $WALLPAPER | 206 | feh --bg-fill $WALLPAPER |
| 206 | 207 | ||
| 207 | #Start compton if not running | 208 | #Start compton if not running |
| 208 | start_compton(){ compton -c -z & } | 209 | start_compton(){ compton -c -z & } |
| @@ -225,3 +226,12 @@ then | |||
| 225 | else | 226 | else |
| 226 | pulseaudio --start | 227 | pulseaudio --start |
| 227 | fi | 228 | fi |
| 229 | |||
| 230 | #Start xscreensaver | ||
| 231 | if pgrep xscreensaver >> /dev/null | ||
| 232 | then | ||
| 233 | kill $(pgrep xscreensaver) | ||
| 234 | xscreensaver -no-splash& | ||
| 235 | else | ||
| 236 | xscreensaver -no-splash& | ||
| 237 | fi | ||
diff --git a/.config/herbstluftwm/panel.sh b/.config/herbstluftwm/panel.sh index 087158b..dd95bd4 100755 --- a/.config/herbstluftwm/panel.sh +++ b/.config/herbstluftwm/panel.sh | |||
| @@ -1,28 +1,23 @@ | |||
| 1 | #!/bin/bash | 1 | #!/bin/bash |
| 2 | 2 | ||
| 3 | hc() { "${herbstclient_command[@]:-herbstclient}" "$@" ;} | 3 | hc() { |
| 4 | monitor=${1:-0} | 4 | "${herbstclient_command[@]:-herbstclient}" "$@" ; |
| 5 | geometry=( $(herbstclient monitor_rect "$monitor") ) | 5 | } |
| 6 | if [ -z "$geometry" ] ;then | ||
| 7 | echo "Invalid monitor $monitor" | ||
| 8 | exit 1 | ||
| 9 | fi | ||
| 10 | # geometry has the format W H X Y | ||
| 11 | x=${geometry[0]} | ||
| 12 | y=${geometry[1]} | ||
| 13 | panel_width=${geometry[2]} | ||
| 14 | 6 | ||
| 15 | add_alpha_channel(){ | 7 | add_alpha_channel(){ |
| 16 | echo "$1" | \ | 8 | echo "$1" | \ |
| 17 | sed "s/.*#\([0-9a-fA-F]*\).*/#ff\1/" | 9 | sed "s/.*#\([0-9a-fA-F]*\).*/#ff\1/" |
| 18 | } | 10 | } |
| 19 | 11 | ||
| 12 | monitor=${1:-0} | ||
| 20 | panel_height=$2 | 13 | panel_height=$2 |
| 21 | light=$(add_alpha_channel $3) | 14 | padding=$3 |
| 22 | llight=$(add_alpha_channel $4) | 15 | |
| 23 | accent=$(add_alpha_channel $5) | 16 | light=$(add_alpha_channel $4) |
| 24 | ldark=$(add_alpha_channel $6) | 17 | llight=$(add_alpha_channel $5) |
| 25 | dark=$(add_alpha_channel $7) | 18 | accent=$(add_alpha_channel $6) |
| 19 | ldark=$(add_alpha_channel $7) | ||
| 20 | dark=$(add_alpha_channel $8) | ||
| 26 | 21 | ||
| 27 | font="-*-fixed-medium-*-*-*-14-*-*-*-*-*-*-*" | 22 | font="-*-fixed-medium-*-*-*-14-*-*-*-*-*-*-*" |
| 28 | #font="" | 23 | #font="" |
| @@ -32,7 +27,17 @@ selected_txt=$dark | |||
| 32 | normal_txt=$light | 27 | normal_txt=$light |
| 33 | inactive_txt=$llight | 28 | inactive_txt=$llight |
| 34 | 29 | ||
| 35 | hc pad $monitor $panel_height | 30 | geometry=( $(herbstclient monitor_rect "$monitor") ) |
| 31 | if [ -z "$geometry" ] ;then | ||
| 32 | echo "Invalid monitor $monitor" | ||
| 33 | exit 1 | ||
| 34 | fi | ||
| 35 | # geometry has the format W H X Y | ||
| 36 | x=$(echo "${geometry[0]} + $padding" | bc) | ||
| 37 | y=$(echo "${geometry[1]} + $padding" | bc) | ||
| 38 | panel_width=$(echo "${geometry[2]} - (2 * $padding)" | bc) | ||
| 39 | |||
| 40 | hc pad $monitor $(echo "$panel_height + $padding" | bc) | ||
| 36 | 41 | ||
| 37 | if awk -Wv 2>/dev/null | head -1 | grep -q '^mawk'; then | 42 | if awk -Wv 2>/dev/null | head -1 | grep -q '^mawk'; then |
| 38 | # mawk needs "-W interactive" to line-buffer stdout correctly | 43 | # mawk needs "-W interactive" to line-buffer stdout correctly |
| @@ -79,7 +84,7 @@ fi | |||
| 79 | # Network | 84 | # Network |
| 80 | iwconfig=$(iwconfig wlp3s0) | 85 | iwconfig=$(iwconfig wlp3s0) |
| 81 | if [ -z $iwconfig ] ; then | 86 | if [ -z $iwconfig ] ; then |
| 82 | echo -e "wireless\toff" | 87 | echo -e "net\toff" |
| 83 | else | 88 | else |
| 84 | ssid=$(\ | 89 | ssid=$(\ |
| 85 | echo $iwconfig | \ | 90 | echo $iwconfig | \ |
| @@ -89,33 +94,24 @@ fi | |||
| 89 | ) | 94 | ) |
| 90 | if [ $ssid = "off/any" ] ; then | 95 | if [ $ssid = "off/any" ] ; then |
| 91 | ifconf=$ | 96 | ifconf=$ |
| 92 | echo -e "wireless\t%{F$normal_txt}Wlan: No connection%{F-}" | 97 | echo -e "net\t%{F$normal_txt}Net: No connection%{F-}" |
| 93 | else | 98 | else |
| 94 | IFS=',' read -a quality_info <<< $(\ | 99 | echo -e "net\t%{F$normal_txt}Net: $ssid%{F-}" |
| 95 | echo $iwconfig | \ | ||
| 96 | sed "s/.*Link Quality=\([0-9]*\)\/\([0-9]*\).*/\1,\2/"\ | ||
| 97 | ) | ||
| 98 | cur_qual=${quality_info[0]} | ||
| 99 | max_qual=${quality_info[1]} | ||
| 100 | quality_p=$(echo "$cur_qual*100/$max_qual" | bc) | ||
| 101 | echo -e "wireless\t%{F$normal_txt}Wlan: $quality_p%% %{F$inactive_txt}($ssid)%{F-}" | ||
| 102 | fi | 100 | fi |
| 103 | fi | 101 | fi |
| 104 | 102 | ||
| 105 | # Battery | 103 | # Battery |
| 106 | IFS=' ' read -a batinfo <<< $(acpi -b) | 104 | if $(test -e /sys/class/power_supply/BAT1) ; then |
| 107 | if [ -z $batinfo ] ; then | 105 | charge=$(cat /sys/class/power_supply/BAT1/capacity) |
| 108 | echo -e "battery\toff" | ||
| 109 | else | ||
| 110 | charge=$(echo ${batinfo[3]} | tr -d '%,') | ||
| 111 | if [ $charge -lt 15 ] ; then | 106 | if [ $charge -lt 15 ] ; then |
| 112 | bat_color=$accent | 107 | bat_color=$accent |
| 113 | else | ||
