From fcb04d2fc88f2353dfade289f82f8e63800a7574 Mon Sep 17 00:00:00 2001 From: Tom van der Lee Date: Sun, 6 Sep 2015 19:41:06 +0200 Subject: Added more configurations options to hlwm panel in expense of dmenu only running on the main monitor --- herbstluftwm/.config/herbstluftwm/autostart | 15 +++++++--- herbstluftwm/.config/herbstluftwm/hlwm-keybindings | 2 +- herbstluftwm/.config/herbstluftwm/start_panel.sh | 32 +++++++++++++++++---- .../.config/herbstluftwm/themes/mountain-forest | 32 +++++++++++++++++++++ herbstluftwm/.config/herbstluftwm/themes/purpur | 1 + herbstluftwm/.config/herbstluftwm/themes/template | 32 +++++++++++++++++++++ .../herbstluftwm/wallpapers/mountain-forest.jpg | Bin 0 -> 933489 bytes 7 files changed, 104 insertions(+), 10 deletions(-) create mode 100644 herbstluftwm/.config/herbstluftwm/themes/mountain-forest create mode 100644 herbstluftwm/.config/herbstluftwm/themes/template create mode 100644 herbstluftwm/.config/herbstluftwm/wallpapers/mountain-forest.jpg (limited to 'herbstluftwm') diff --git a/herbstluftwm/.config/herbstluftwm/autostart b/herbstluftwm/.config/herbstluftwm/autostart index a436283..6d39725 100755 --- a/herbstluftwm/.config/herbstluftwm/autostart +++ b/herbstluftwm/.config/herbstluftwm/autostart @@ -11,10 +11,17 @@ export HLWM_CONF_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) source "$HLWM_CONF_DIR/hlwm-theming" -#Panel and HLWM_WINDOW_PADDING -monitor_w=($(hc list_monitors | sed 's/^[0-9]: \([0-9]*\)x.*$/\1/')) -panel_w=$(echo "$monitor_w - (2 * $HLWM_WINDOW_PADDING)" | bc) -dmenu_opts="-h $HLWM_PANEL_HEIGHT -w $panel_w -x $HLWM_WINDOW_PADDING -y $HLWM_WINDOW_PADDING -p Run: -nb $HLWM_BG_COLOR -nf $HLWM_FG_COLOR -sb $HLWM_ACCENT_COLOR -sf $HLWM_BG_COLOR" +#Dmenu opts +dmenu_screen=0 +dmenu_width=400 +dmenu_height=30 +dmenu_lines=9 +dmenu_title="Run:" + +geometry=($(hc monitor_rect $dmenu_screen)) + +dmenu_x=$(echo "(${geometry[2]} / 2) - ($dmenu_width / 2)" | bc) +dmenu_y="${geometry[1]}" # Tags tag_names=() diff --git a/herbstluftwm/.config/herbstluftwm/hlwm-keybindings b/herbstluftwm/.config/herbstluftwm/hlwm-keybindings index cc40515..2843a89 100644 --- a/herbstluftwm/.config/herbstluftwm/hlwm-keybindings +++ b/herbstluftwm/.config/herbstluftwm/hlwm-keybindings @@ -10,7 +10,7 @@ hc keybind $Mod-Shift-q quit hc keybind $Mod-Shift-r chain , spawn echo "!! HLWM reload config !!" , reload hc keybind $Mod-Shift-c close hc keybind $Mod-Return spawn xterm -hc keybind $Mod-grave spawn dmenu_run $dmenu_opts +hc keybind $Mod-grave spawn dmenu_run -h $dmenu_height -w $dmenu_width -x $dmenu_x -y $dmenu_y -p $dmenu_title -s $dmenu_screen -l $dmenu_lines -fn "$HLWM_PANEL_FONT" -nb $HLWM_BG_COLOR -nf $HLWM_FG_COLOR -sb $HLWM_ACCENT_COLOR -sf $HLWM_BG_COLOR hc keybind XF86AudioLowerVolume spawn amixer set Master 1%- hc keybind XF86AudioRaiseVolume spawn amixer set Master 1%+ diff --git a/herbstluftwm/.config/herbstluftwm/start_panel.sh b/herbstluftwm/.config/herbstluftwm/start_panel.sh index 13ea6e2..4ec4f72 100755 --- a/herbstluftwm/.config/herbstluftwm/start_panel.sh +++ b/herbstluftwm/.config/herbstluftwm/start_panel.sh @@ -10,6 +10,11 @@ if [ -z "$geometry" ] ;then exit 1 fi +monitor_x=${geometry[0]} +monitor_y=${geometry[1]} +monitor_w=${geometry[2]} +monitor_h=${geometry[3]} + # Make sure only one instanve per monitor is running pids=$(ps x | grep "$0 $monitor" | awk '{print $1}') for pid in $pids; do @@ -18,13 +23,30 @@ for pid in $pids; do fi done -# Geometry has the format W H X Y -x=$(echo "${geometry[0]} + $HLWM_WINDOW_PADDING" | bc) -y=$(echo "${geometry[1]} + $HLWM_WINDOW_PADDING" | bc) -panel_width=$(echo "${geometry[2]} - (2 * $HLWM_WINDOW_PADDING)" | bc) +padding=(0 0 0 0) + +if [ -n "$HLWM_PANEL_MARGIN" ]; then + margins=($HLWM_PANEL_MARGIN) + panel_td_margin=$([ ${margins[0]} -eq -1 ] && echo $HLWM_WINDOW_PADDING || echo ${margins[0]}) + panel_lr_margin=$([ ${margins[1]} -eq -1 ] && echo $HLWM_WINDOW_PADDING || echo ${margins[1]}) +else + panel_td_margin=$HLWM_WINDOW_PADDING + panel_lr_margin=$HLWM_WINDOW_PADDING +fi + +x=$(echo "$monitor_x + $panel_lr_margin" | bc) +panel_width=$(echo "$monitor_w - (2 * $panel_lr_margin)" | bc) + +if $HLWM_PANEL_BOTTOM; then + y=$(echo "$monitor_h - $HLWM_PANEL_HEIGHT - $panel_td_margin" | bc) + padding[2]=$(echo "$HLWM_PANEL_HEIGHT + $panel_td_margin" | bc) +else + y=$(echo "$monitor_y + $panel_td_margin" | bc) + padding[0]=$(echo "$HLWM_PANEL_HEIGHT + $panel_td_margin" | bc) +fi # Apply padding to make room for the panel -hc pad $monitor $(echo "$HLWM_PANEL_HEIGHT + $HLWM_WINDOW_PADDING" | bc) +hc pad $monitor ${padding[@]} # Start the panel $HLWM_CONF_DIR/populate_panel.sh $monitor | diff --git a/herbstluftwm/.config/herbstluftwm/themes/mountain-forest b/herbstluftwm/.config/herbstluftwm/themes/mountain-forest new file mode 100644 index 0000000..6e02eca --- /dev/null +++ b/herbstluftwm/.config/herbstluftwm/themes/mountain-forest @@ -0,0 +1,32 @@ +#!/usr/bin/env bash + +declare -A colors +colors=(["background"]="#1d1f21" ["foreground"]="#c5c8c6" # Fore- and Background + ["color0"]="#282a2e" ["color8"]="#373b41" # Blacks + ["color1"]="#a54242" ["color9"]="#cc6666" # Reds + ["color2"]="#8c9440" ["color10"]="#b5bd68" # Greens + ["color3"]="#de935f" ["color11"]="#f0c674" # Yellows + ["color4"]="#5f819d" ["color12"]="#81a2be" # Blues + ["color5"]="#85678f" ["color13"]="#b294bb" # Magentas + ["color6"]="#5e8d87" ["color14"]="#8abeb7" # Cyanes + ["color7"]="#707880" ["color15"]="#c5c8c6") # Whites + +# Wallpaper +export HLWM_WALLPAPER="$HLWM_CONF_DIR/wallpapers/mountain-forest.jpg" + +# Shadow +export HLWM_COMPOSITING=true + +# Padding +export HLWM_WINDOW_PADDING=20 + +# Panel +export HLWM_PANEL_HEIGHT=25 +export HLWM_PANEL_FONT="DejaVu Sans Mono-10" +export HLWM_PANEL_BOTTOM=true +export HLWM_PANEL_MARGIN="0 0" # Up/Down Left/Right (-1 is respects $HLWM_WINDOW_PADDING) + +# Colors +export HLWM_FG_COLOR=${colors["foreground"]} +export HLWM_ACCENT_COLOR=${colors["color6"]} +export HLWM_BG_COLOR=${colors["background"]} diff --git a/herbstluftwm/.config/herbstluftwm/themes/purpur b/herbstluftwm/.config/herbstluftwm/themes/purpur index ee55cb7..a050fcd 100644 --- a/herbstluftwm/.config/herbstluftwm/themes/purpur +++ b/herbstluftwm/.config/herbstluftwm/themes/purpur @@ -23,6 +23,7 @@ export HLWM_WINDOW_PADDING=20 # Panel export HLWM_PANEL_HEIGHT=25 export HLWM_PANEL_FONT="DejaVu Sans Mono-10" +export HLWM_PANEL_BOTTOM=false # Colors export HLWM_FG_COLOR=${colors["foreground"]} diff --git a/herbstluftwm/.config/herbstluftwm/themes/template b/herbstluftwm/.config/herbstluftwm/themes/template new file mode 100644 index 0000000..f38520d --- /dev/null +++ b/herbstluftwm/.config/herbstluftwm/themes/template @@ -0,0 +1,32 @@ +#!/usr/bin/env bash + +declare -A colors +colors=(["background"]="#1d1f21" ["foreground"]="#c5c8c6" # Fore- and Background + ["color0"]="#282a2e" ["color8"]="#373b41" # Blacks + ["color1"]="#a54242" ["color9"]="#cc6666" # Reds + ["color2"]="#8c9440" ["color10"]="#b5bd68" # Greens + ["color3"]="#de935f" ["color11"]="#f0c674" # Yellows + ["color4"]="#5f819d" ["color12"]="#81a2be" # Blues + ["color5"]="#85678f" ["color13"]="#b294bb" # Magentas + ["color6"]="#5e8d87" ["color14"]="#8abeb7" # Cyanes + ["color7"]="#707880" ["color15"]="#c5c8c6") # Whites + +# Wallpaper +export HLWM_WALLPAPER="$HLWM_CONF_DIR/wallpapers/wallpaper.png" + +# Shadow +export HLWM_COMPOSITING=true + +# Padding +export HLWM_WINDOW_PADDING=20 + +# Panel +export HLWM_PANEL_HEIGHT=25 +export HLWM_PANEL_FONT="DejaVu Sans Mono-10" +export HLWM_PANEL_BOTTOM=false +export HLWM_PANEL_MARGIN="-1 -1" # Up/Down Left/Right (-1 is respects $HLWM_WINDOW_PADDING) + +# Colors +export HLWM_FG_COLOR=${colors["foreground"]} +export HLWM_ACCENT_COLOR=${colors["color6"]} +export HLWM_BG_COLOR=${colors["background"]} diff --git a/herbstluftwm/.config/herbstluftwm/wallpapers/mountain-forest.jpg b/herbstluftwm/.config/herbstluftwm/wallpapers/mountain-forest.jpg new file mode 100644 index 0000000..f44753f Binary files /dev/null and b/herbstluftwm/.config/herbstluftwm/wallpapers/mountain-forest.jpg differ -- cgit v1.2.3