From 4cd474411fe97cfd9a09471755f1e7dcd916db37 Mon Sep 17 00:00:00 2001 From: Marcel Kapfer Date: Mon, 14 Jun 2021 21:54:54 +0200 Subject: [PATCH] [HLWM] Refactored hlwm-display-switch.sh --- scripts/hlwm-display-switch.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/hlwm-display-switch.sh b/scripts/hlwm-display-switch.sh index e1bafc6..fcf3701 100755 --- a/scripts/hlwm-display-switch.sh +++ b/scripts/hlwm-display-switch.sh @@ -5,14 +5,17 @@ extern_2="DP-1" intern="eDP-1" polybar_top_padding=22 +common_adjustments() { + ~/.fehbg & + xmodmap ~/.Xmodmap +} + switch_internal() { xrandr --output "$extern_2" --off \ --output "$extern_1" --off \ --output "$intern" --auto --primary herbstclient detect_monitors herbstclient pad 0 "$polybar_top_padding" - ~/.fehbg & - xmodmap ~/.Xmodmap } switch_external() { @@ -23,16 +26,16 @@ switch_external() { herbstclient pad 0 0 herbstclient pad 2 0 herbstclient pad 1 "$polybar_top_padding" - ~/.fehbg & - xmodmap ~/.Xmodmap } case "$1" in i* ) switch_internal + common_adjustments ;; e* ) switch_external + common_adjustments ;; * ) echo "Specify new output configuration. Possibilities are: 'external' and 'internal'"