From d9d9c28ed02611bdb2e37039fb62a19fc39815ad Mon Sep 17 00:00:00 2001 From: Tom van der Lee Date: Sun, 5 Oct 2014 21:41:33 +0200 Subject: Added notifications --- .config/herbstluftwm/autostart | 118 ++++++++++++++--------------------------- 1 file changed, 41 insertions(+), 77 deletions(-) (limited to '.config/herbstluftwm/autostart') diff --git a/.config/herbstluftwm/autostart b/.config/herbstluftwm/autostart index b5115cf..fb6d2e0 100755 --- a/.config/herbstluftwm/autostart +++ b/.config/herbstluftwm/autostart @@ -6,33 +6,30 @@ hc() { herbstclient "$@" } -#get colors from .Xresources -get_xcolor(){ - xresources=$(\ - cat ~/.Xresources\ - ) - color=$(\ - echo $xresources | \ - sed "s/.*\*color$1: \(#[0-9A-Fa-f]*\).*/\1/"\ - ) - echo $color +get_x_color() { + xresources=$(cat ~/.Xresources) + color=$(echo $xresources | sed "s/.*\*color$1: \(#[0-9A-Fa-f]*\).*/\1/") + echo $color } -#Wallpaper -WALLPAPER=/home/tom/Pictures/rocks.jpg +hlwm_scripts="$HOME/.config/herbstluftwm" + +#wallpaper +wallpaper=/home/tom/Pictures/rocks.jpg #Numix color palette -LIGHT=$(get_xcolor 15) -LLIGHT=$(get_xcolor 7) -ACCENT=$(get_xcolor 12) -LDARK=$(get_xcolor 8) -DARK=$(get_xcolor 0) - -#Panel and padding -padding=20 -monitor_width=$(hc list_monitors | sed 's/^[0-9]: \([0-9]*\)x.*$/\1/') -panel_height=24 -panel_width=$(echo "$monitor_width - (2 * $padding)" | bc) +export WM_LIGHT=$(get_x_color 15) +export WM_LLIGHT=$(get_x_color 7) +export WM_ACCENT=$(get_x_color 12) +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 @@ -46,7 +43,7 @@ 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 -h $panel_height -w $panel_width -x $padding -y $padding -p "Run:" -nb $DARK -nf $LIGHT -sb $ACCENT -sf $DARK +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%+ @@ -134,30 +131,30 @@ 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 $LDARK -hc set frame_border_normal_color $DARK -hc set frame_bg_normal_color $LDARK -hc set frame_bg_active_color $DARK +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 $ACCENT -hc attr theme.normal.color $DARK +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 $DARK +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 $DARk -hc attr theme.active.inner_color $DARK -hc attr theme.active.outer_color $DARK -hc attr theme.background_color $DARK +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 $padding +hc set window_gap $window_p hc set frame_padding 0 hc set smart_window_surroundings 0 hc set smart_frame_surroundings 1 @@ -179,20 +176,15 @@ hc unlock herbstclient set tree_style '╾│ ├└╼─┐' -# do multi monitor setup here, e.g.: -# hc set_monitors 1280x1024+0+0 1280x1024+1280+0 -# or simply: -# hc detect_monitors - #Start panel in all monitors start_panel() { for monitor in $(herbstclient list_monitors | cut -d: -f1) ; do - "$1" $monitor $panel_height $padding $LIGHT $LLIGHT $ACCENT $LDARK $DARK $2& + "$1" $monitor $panel_h $window_p & done } # find the panel -panel=~/.config/herbstluftwm/panel.sh +panel=$hlwm_scripts/panel.sh [ -x "$panel" ] || panel=/etc/xdg/herbstluftwm/panel.sh if pgrep panel.sh >> /dev/null then @@ -202,37 +194,9 @@ else start_panel $panel fi -#Wallpaper -feh --bg-fill $WALLPAPER - -#Start compton if not running -start_compton(){ compton --config ~/.compton & } -if pgrep compton >> /dev/null -then - kill $(pgrep compton) - start_compton -else - start_compton -fi - -#Load .Xresources -xrdb -load ~/.Xresources - -#Start pulseaudio -if pgrep pulseaudio >> /dev/null -then - kill $(pgrep pulseaudio) - pulseaudio --start -else - pulseaudio --start -fi - -#Start xscreensaver -if pgrep xscreensaver >> /dev/null -then - kill $(pgrep xscreensaver) - xscreensaver -no-splash& -else - xscreensaver -no-splash& -fi - +$hlwm_scripts/start.sh feh --bg-fill $wallpaper +$hlwm_scripts/start.sh compton --config ~/.compton +$hlwm_scripts/start.sh xrdb -load ~/.Xresources +$hlwm_scripts/start.sh pulseaudio --start +$hlwm_scripts/start.sh xscreensaver -no-splash +$hlwm_scripts/start.sh $hlwm_scripts/notify.sh $monitor_w $window_p $panel_h $hlwm_scripts/popup.sh -- cgit v1.2.3