From e592d4b3dd40eea0d3b0f7e11d2dc9c8409e3dcf Mon Sep 17 00:00:00 2001 From: Louis Vallat Date: Sat, 13 Nov 2021 23:25:54 +0100 Subject: [PATCH] Added configuration for two monitors in bspwmrc and polybar config Signed-off-by: Louis Vallat --- .config/bspwm/bspwmrc | 24 ++++++++++++++--- .config/polybar/config | 58 +++++++++++++++++++++++++++++++++++++++--- 2 files changed, 75 insertions(+), 7 deletions(-) diff --git a/.config/bspwm/bspwmrc b/.config/bspwm/bspwmrc index f61ca45..f55e042 100755 --- a/.config/bspwm/bspwmrc +++ b/.config/bspwm/bspwmrc @@ -7,13 +7,31 @@ dunst -conf $HOME/.config/dunst/dunstrc & picom & feh --bg-fill ~/Pictures/nordic-obsession.png & killall -q polybar -polybar example 2>&1 | tee -a /tmp/polybar.log & disown + +# xrandr --output DisplayPort-2 --primary --mode 1920x1080 --rotate normal --output eDP --mode 1920x1080 --rotate normal --right-of DisplayPort-2 xset -b -bspc monitor -d I II III IV V +DISPLAYS=$(bspc query -M --names) +EXT_PRIMARY="" + +for DISP in ${DISPLAYS}; do + if [ ${DISP} != 'eDP' ]; then + EXT_PRIMARY=${DISP} + fi +done + +if [ -n ${EXT_PRIMARY} ]; then + xrandr --output ${EXT_PRIMARY} --primary --output eDP --right-of ${EXT_PRIMARY} + bspc monitor ${EXT_PRIMARY} -d I II III IV V + bspc monitor eDP -d VI VII VIII IX X + MONITOR="eDP" polybar main 2>&1 | tee -a /tmp/polybar.log & disown + MONITOR=${EXT_PRIMARY} polybar ext 2>&1 | tee -a /tmp/polybar.log & disown +else + bspc monitor eDP -d I II III IV V VI VII VIII IX X + MONITOR="eDP" polybar main 2>&1 | tee -a /tmp/polybar.log & disown +fi -bspc wm -O eDP HDMI-A-0 bspc config border_width 0 bspc config top_padding 34 bspc config window_gap 16 diff --git a/.config/polybar/config b/.config/polybar/config index 3df62b5..29210cc 100644 --- a/.config/polybar/config +++ b/.config/polybar/config @@ -27,8 +27,9 @@ primary = #ffb52a secondary = #e60053 alert = #bd2c40 -[bar/example] -;monitor = ${env:MONITOR:HDMI-1} + +[bar/main] +monitor = ${env:MONITOR:eDP} width = 100% height = 27 ;offset-x = 1% @@ -55,7 +56,55 @@ font-1 = siji:pixelsize=10;1 modules-left = bspwm modules-center = xwindow -modules-right = filesystem xbacklight pulseaudio xkeyboard memory cpu wlan eth battery temperature date powermenu +modules-right = filesystem backlight-acpi pulseaudio xkeyboard memory cpu wlan eth battery temperature date powermenu + +tray-position = right +tray-padding = 2 +;tray-background = #0063ff + +;wm-restack = bspwm +;wm-restack = i3 + +;override-redirect = true + +;scroll-up = bspwm-desknext +;scroll-down = bspwm-deskprev + +;scroll-up = i3wm-wsnext +;scroll-down = i3wm-wsprev + +cursor-click = pointer +cursor-scroll = ns-resize + +[bar/ext] +monitor = ${env:MONITOR:DisplayPort-2} +width = 100% +height = 27 +;offset-x = 1% +;offset-y = 1% +radius = 6.0 +fixed-center = false + +background = ${colors.background} +foreground = ${colors.foreground} + +line-size = 3 +line-color = #f00 + +border-size = 4 +border-color = #00000000 + +padding-left = 0 +padding-right = 2 +module-margin-left = 1 +module-margin-right = 2 + +font-0 = FiraCode Nerd Font:style=medium:size=10 +font-1 = siji:pixelsize=10;1 + +modules-left = bspwm +modules-center = xwindow +modules-right = filesystem backlight-acpi pulseaudio xkeyboard memory cpu wlan eth battery temperature date powermenu tray-position = right tray-padding = 2 @@ -147,7 +196,8 @@ bar-empty-foreground = ${colors.foreground-alt} [module/backlight-acpi] inherit = module/xbacklight type = internal/backlight -card = intel_backlight +card = amdgpu_bl0 +enable-scroll = true [module/cpu] type = internal/cpu