diff options
| -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 | 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) |
| @@ -1,7 +1,11 @@ | |||
| 1 | NUMIX = .local/share/themes/numix-no-title | 1 | PWD=$(shell pwd) |
| 2 | |||
| 3 | THEMES_DIR = .local/share/themes | ||
| 4 | CONFIG_DIR = .config | ||
| 5 | NUMIX = numix-no-title | ||
| 2 | BASHRC = .bashrc | 6 | BASHRC = .bashrc |
| 3 | VIMRC = .vimrc | 7 | VIMRC = .vimrc |
| 4 | HERBSTLUFT = .config/herbstluftwm | 8 | HERBSTLUFT = herbstluftwm |
| 5 | XRESOURCES = .Xresources | 9 | XRESOURCES = .Xresources |
| 6 | 10 | ||
| 7 | 11 | ||
| @@ -9,42 +13,25 @@ install: all | |||
| 9 | 13 | ||
| 10 | all: bash vim xresources numix-no-title herbstluftwm | 14 | all: bash vim xresources numix-no-title herbstluftwm |
| 11 | 15 | ||
| 12 | numix-no-title: | 16 | numix-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 | ||
| 22 | herbstluftwm: | 19 | herbstluftwm: |
| 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 | ||
| 32 | bash: | 22 | bash: |
| 33 | #copy bashrc to home | 23 | ln -sf $(PWD)/$(BASHRC) ~ |
| 34 | cp -f $(BASHRC) ~ | ||
| 35 | 24 | ||
| 36 | vim: | 25 | vim: |
| 37 | #copy vimrc to home | 26 | ln -sf $(PWD)/$(VIMRC) ~ |
| 38 | cp -f $(VIMRC) ~ | ||
| 39 | 27 | ||
| 40 | xresources: | 28 | xresources: |
| 41 | #copy Xresources to home | 29 | ln -sf $(PWD)/$(XRESOURCES) ~ |
| 42 | cp -f $(XRESOURCES) ~ | ||
| 43 | 30 | ||
| 44 | uninstall: | 31 | uninstall: |
| 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) |
| @@ -4,7 +4,7 @@ Toms Dotfiles | |||
| 4 | Recently I've been discovering tiling window managers and how nice it is to customize my desktop. | 4 | Recently I've been discovering tiling window managers and how nice it is to customize my desktop. |
| 5 | This means I've got a "lot" of dotfiles wanting to share across my machines and with everyone who is interested. | 5 | This 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 |
| 7 | You can | 7 | You can |
| 8 | - copy the files to your home directory | 8 | - copy the files to your home directory |
| 9 | 9 | ||
| 10 | or | 10 | or |
| @@ -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 |
| 23 | I am not responsible for the loss of any of your files! You should make a backup before installing anything! | 23 | I am not responsible for the loss of any of your files! You should make a backup before installing anything! |
