aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-x.config/herbstluftwm/autostart40
-rwxr-xr-x.config/herbstluftwm/panel.sh86
-rw-r--r--Makefile49
-rw-r--r--README.md4
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
5hc() {
6 herbstclient "$@"
7}
8
5#get colors from .Xresources 9#get colors from .Xresources
6get_xcolor(){ 10get_xcolor(){
7 xresources=$(\ 11 xresources=$(\
@@ -15,26 +19,23 @@ get_xcolor(){
15} 19}
16 20
17#Wallpaper 21#Wallpaper
18WALLPAPER=/home/tom/Pictures/ThDLxEW.jpg 22WALLPAPER=/home/tom/Pictures/rocks.jpg
19 23
20#Numix color palette 24#Numix color palette
21LIGHT=$(get_xcolor 15) 25LIGHT=$(get_xcolor 15)
22LLIGHT=$(get_xcolor 7) 26LLIGHT=$(get_xcolor 7)
23ACCENT=$(get_xcolor 9) 27ACCENT=$(get_xcolor 12)
24LDARK=$(get_xcolor 8) 28LDARK=$(get_xcolor 8)
25DARK=$(get_xcolor 0) 29DARK=$(get_xcolor 0)
26 30
27#Panel 31#Panel and padding
28PANEL_HEIGHT=24 32padding=20
29 33monitor_width=$(hc list_monitors | sed 's/^[0-9]: \([0-9]*\)x.*$/\1/')
30hc() { 34panel_height=24
31 herbstclient "$@" 35panel_width=$(echo "$monitor_width - (2 * $padding)" | bc)
32}
33 36
34hc emir_hook reload 37hc emir_hook reload
35 38
36xsetroot -solid $ACCENT
37
38# remove all existing keybindings 39# remove all existing keybindings
39hc keyunbind --all 40hc keyunbind --all
40 41
@@ -45,7 +46,7 @@ hc keybind $Mod-Shift-q quit
45hc keybind $Mod-Shift-r reload 46hc keybind $Mod-Shift-r reload
46hc keybind $Mod-Shift-c close 47hc keybind $Mod-Shift-c close
47hc keybind $Mod-Return spawn xterm 48hc keybind $Mod-Return spawn xterm
48hc keybind $Mod-grave spawn dmenu_run -h $PANEL_HEIGHT -p "Run:" -nb $DARK -nf $LIGHT -sb $ACCENT -sf $DARK 49hc 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
49hc keybind XF86AudioLowerVolume spawn amixer set Master 5%- 50hc keybind XF86AudioLowerVolume spawn amixer set Master 5%-
50hc keybind XF86AudioRaiseVolume spawn amixer set Master 5%+ 51hc 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
96hc keybind Alt-Control-Left use_index -1 97hc keybind Alt-Control-Left use_index -1
97hc keybind Alt-Control-Right use_index +1 98hc keybind Alt-Control-Right use_index +1
98hc rename default "${tag_names[0]}" || true 99hc rename default "${tag_names[0]}" || true
99for i in ${!tag_names[@]} ; do 100for 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
156hc attr theme.active.outer_color $DARK 157hc attr theme.active.outer_color $DARK
157hc attr theme.background_color $DARK 158hc attr theme.background_color $DARK
158 159
159hc set window_gap 20 160hc set window_gap $padding
160hc set frame_padding 0 161hc set frame_padding 0
161hc set smart_window_surroundings 0 162hc set smart_window_surroundings 0
162hc set smart_frame_surroundings 1 163hc 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
187start_panel() { 188start_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
202fi 203fi
203 204
204#Wallpaper 205#Wallpaper
205feh --bg-scale $WALLPAPER 206feh --bg-fill $WALLPAPER
206 207
207#Start compton if not running 208#Start compton if not running
208start_compton(){ compton -c -z & } 209start_compton(){ compton -c -z & }
@@ -225,3 +226,12 @@ then
225else 226else
226 pulseaudio --start 227 pulseaudio --start
227fi 228fi
229
230#Start xscreensaver
231if pgrep xscreensaver >> /dev/null
232then
233 kill $(pgrep xscreensaver)
234 xscreensaver -no-splash&
235else
236 xscreensaver -no-splash&
237fi
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
3hc() { "${herbstclient_command[@]:-herbstclient}" "$@" ;} 3hc() {
4monitor=${1:-0} 4 "${herbstclient_command[@]:-herbstclient}" "$@" ;
5geometry=( $(herbstclient monitor_rect "$monitor") ) 5}
6if [ -z "$geometry" ] ;then
7 echo "Invalid monitor $monitor"
8 exit 1
9fi
10# geometry has the format W H X Y
11x=${geometry[0]}
12y=${geometry[1]}
13panel_width=${geometry[2]}
14 6
15add_alpha_channel(){ 7add_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
12monitor=${1:-0}
20panel_height=$2 13panel_height=$2
21light=$(add_alpha_channel $3) 14padding=$3
22llight=$(add_alpha_channel $4) 15
23accent=$(add_alpha_channel $5) 16light=$(add_alpha_channel $4)
24ldark=$(add_alpha_channel $6) 17llight=$(add_alpha_channel $5)
25dark=$(add_alpha_channel $7) 18accent=$(add_alpha_channel $6)
19ldark=$(add_alpha_channel $7)
20dark=$(add_alpha_channel $8)
26 21
27font="-*-fixed-medium-*-*-*-14-*-*-*-*-*-*-*" 22font="-*-fixed-medium-*-*-*-14-*-*-*-*-*-*-*"
28#font="" 23#font=""
@@ -32,7 +27,17 @@ selected_txt=$dark
32normal_txt=$light 27normal_txt=$light
33inactive_txt=$llight 28inactive_txt=$llight
34 29
35hc pad $monitor $panel_height 30geometry=( $(herbstclient monitor_rect "$monitor") )
31if [ -z "$geometry" ] ;then
32 echo "Invalid monitor $monitor"
33 exit 1
34fi
35# geometry has the format W H X Y
36x=$(echo "${geometry[0]} + $padding" | bc)
37y=$(echo "${geometry[1]} + $padding" | bc)
38panel_width=$(echo "${geometry[2]} - (2 * $padding)" | bc)
39
40hc pad $monitor $(echo "$panel_height + $padding" | bc)
36 41
37if awk -Wv 2>/dev/null | head -1 | grep -q '^mawk'; then 42if 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 108 else
114 bat_color=$normal_txt 109 bat_color=$normal_txt
115 fi 110 fi
116 state=$(echo ${batinfo[2]} | tr -d ',') 111 state=$(cat /sys/class/power_supply/BAT1/status)
117 remaining=$(echo ${batinfo[4]}) 112 echo -e "battery\t%{F$normal_txt}$state: %{F$bat_color}$charge%{F$normal_txt}%% %{F-}"
118 echo -e "battery\t%{F$normal_txt}$state: %{F$bat_color}$charge%{F$normal_txt}%% %{F$inactive_txt}($remaining)%{F-}" 113 else
114 echo -e "battery\toff"
119 fi 115 fi
120 116
121 # Time 117 # Time
@@ -132,7 +128,7 @@ fi
132 date="" 128 date=""
133 volume="" 129 volume=""
134 battery="" 130 battery=""
135 wireless="" 131 net=""
136 windowtitle="" 132 windowtitle=""
137 while true ; do 133 while true ; do
138 separator="%{F$accent}|%{F-}" 134 separator="%{F$accent}|%{F-}"
@@ -159,9 +155,9 @@ fi
159 done 155 done
160 echo -n "$separator" 156 echo -n "$separator"
161 echo -n "%{B-}%{F-} ${windowtitle//^/^^}" 157 echo -n "%{B-}%{F-} ${windowtitle//^/^^}"
162 158
163 #Right part of panel 159 #Right part of panel
164 right="$volume$wireless$battery$date " 160 right="$volume$net$battery$date "
165 echo -n "%{r}$right" 161 echo -n "%{r}$right"
166 echo 162 echo
167 163
@@ -180,12 +176,12 @@ fi
180 volume="$volume $separator%{B-} " 176 volume="$volume $separator%{B-} "
181 fi 177 fi
182 ;; 178 ;;
183 wireless) 179 net)
184 wireless="${cmd[@]:1}" 180 net="${cmd[@]:1}"
185 if [ $wireless = "off" ] ; then 181 if [ $net = "off" ] ; then
186 wireless="" 182 net=""
187 else 183 else
188 wireless="$wireless $separator%{B-} " 184 net="$net $separator%{B-} "
189 fi 185 fi
190 ;; 186 ;;
191 battery) 187 battery)
diff --git a/Makefile b/Makefile
index 0e0dd70..1f21a25 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,11 @@
1NUMIX = .local/share/themes/numix-no-title 1PWD=$(shell pwd)
2
3THEMES_DIR = .local/share/themes
4CONFIG_DIR = .config
5NUMIX = numix-no-title
2BASHRC = .bashrc 6BASHRC = .bashrc
3VIMRC = .vimrc 7VIMRC = .vimrc
4HERBSTLUFT = .config/herbstluftwm 8HERBSTLUFT = herbstluftwm
5XRESOURCES = .Xresources 9XRESOURCES = .Xresources
6 10
7 11
@@ -9,42 +13,25 @@ install: all
9 13
10all: bash vim xresources numix-no-title herbstluftwm 14all: bash vim xresources numix-no-title herbstluftwm
11 15
12numix-no-title: 16numix-no-title:
13 #create wm theme dir if not exist 17 ln -sf $(PWD)/$(THEMES_DIR)/$(NUMIX) ~/$(THEMES_DIR)
14 mkdir -p ~/$(NUMIX)
15
16 #remove content if existing
17 -rm -rf ~/$(NUMIX)/*
18
19 #copy new contents in
20 cp -rf $(NUMIX)/* ~/$(NUMIX)/
21 18
22herbstluftwm: 19herbstluftwm:
23 #create herbstluftwm if not exist 20 ln -sf $(PWD)/$(CONFIG_DIR)/$(HERBSTLUFT) ~/$(CONFIG_DIR)
24 mkdir -p ~/$(HERBSTLUFT)
25
26 #remove content if existing
27 -rm -rf ~/$(HERBSTLUFT)/*
28
29 #copy new contents in
30 cp -rf $(HERBSTLUFT)/* ~/$(HERBSTLUFT)/
31 21
32bash: 22bash:
33 #copy bashrc to home 23 ln -sf $(PWD)/$(BASHRC) ~
34 cp -f $(BASHRC) ~
35 24
36vim: 25vim:
37 #copy vimrc to home 26 ln -sf $(PWD)/$(VIMRC) ~
38 cp -f $(VIMRC) ~
39 27
40xresources: 28xresources:
41 #copy Xresources to home 29 ln -sf $(PWD)/$(XRESOURCES) ~
42 cp -f $(XRESOURCES) ~
43 30
44uninstall: 31uninstall:
45 #remove all 32 #remove all
46 -rm -rf ~/$(WM-THEME-DIR) 33 -rm ~/$(THEMES_DIR)/$(NUMIX)
47 -rm -rf ~/$(HERBSTLUFT) 34 -rm ~/$(CONFIG_DIR)/$(HERBSTLUFT)
48 -rm -f ~/$(BASHRC) 35 -rm ~/$(BASHRC)
49 -rm -f ~/$(VIMRC) 36 -rm ~/$(VIMRC)
50 -rm -f ~/$(XRESOURCES) 37 -rm ~/$(XRESOURCES)
diff --git a/README.md b/README.md
index e2dd91d..a541fc9 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@ Toms Dotfiles
4Recently I've been discovering tiling window managers and how nice it is to customize my desktop. 4Recently I've been discovering tiling window managers and how nice it is to customize my desktop.
5This means I've got a "lot" of dotfiles wanting to share across my machines and with everyone who is interested. 5This means I've got a "lot" of dotfiles wanting to share across my machines and with everyone who is interested.
6###How to install 6###How to install
7You can 7You can
8 - copy the files to your home directory 8 - copy the files to your home directory
9 9
10or 10or
@@ -17,7 +17,7 @@ The makefile has multiple recepies:
17 - vim: Installs my vimrc file 17 - vim: Installs my vimrc file
18 - xresources: Installs my xresources file 18 - xresources: Installs my xresources file
19 - install: Does all of the above 19 - install: Does all of the above
20 - uninstall: uninstall all my makefiles 20 - uninstall: uninstall all my dotfiles
21 21
22###Disclaimer 22###Disclaimer
23I am not responsible for the loss of any of your files! You should make a backup before installing anything! 23I am not responsible for the loss of any of your files! You should make a backup before installing anything!