From 8ca9a58345a4837560d267d2b52a888787c218fd Mon Sep 17 00:00:00 2001 From: Andrew Scott Date: Tue, 10 Jan 2023 16:25:06 -0500 Subject: [PATCH] Update for dual monitor system --- dot_bashrc | 2 +- dot_config/bspwm/executable_bspwmrc.tmpl | 19 +++++++----- .../polybar/{config.ini => config.ini.tmpl} | 31 +++++++++++++++---- .../bin/executable_dual-polybar-launcher | 13 ++++++++ ...outputs => executable_mirror-outputs.tmpl} | 4 +++ dot_xinitrc.tmpl | 3 ++ 6 files changed, 58 insertions(+), 14 deletions(-) rename dot_config/polybar/{config.ini => config.ini.tmpl} (83%) create mode 100644 dot_local/bin/executable_dual-polybar-launcher rename dot_local/bin/{executable_mirror-outputs => executable_mirror-outputs.tmpl} (77%) diff --git a/dot_bashrc b/dot_bashrc index 2d6d7f5..749e92e 100644 --- a/dot_bashrc +++ b/dot_bashrc @@ -9,7 +9,7 @@ alias ls='ls --color=auto' PS1='[\u@\h \W]\$ ' export GPG_TTY=$(tty) -export EDITOR=emacs +export EDITOR=nvim alias nv=nvim alias r="urxvt -name Ranger -e ranger & disown" diff --git a/dot_config/bspwm/executable_bspwmrc.tmpl b/dot_config/bspwm/executable_bspwmrc.tmpl index 4f19d4b..d157e08 100644 --- a/dot_config/bspwm/executable_bspwmrc.tmpl +++ b/dot_config/bspwm/executable_bspwmrc.tmpl @@ -1,8 +1,7 @@ #!/bin/bash -{{ if (or (eq .chezmoi.hostname "helix") (eq .chezmoi.hostname "triangulum")) }} +{{ if ne .chezmoi.hostname "hydrus" }} bspc monitor eDP-1 -d 1 2 3 4 5 6 7 8 9 10 -{{- end }} -{{ if eq .chezmoi.hostname "hydrus"}} +{{ else }} bspc monitor DP-0 -d 1 2 3 4 5 bspc monitor DVI-I-1 -d 6 7 8 9 10 {{ end }} @@ -10,11 +9,17 @@ bspc config border_width 2 {{- if eq .chezmoi.hostname "helix" }} bspc config window_gap 10 bspc config top_padding 70 -{{ else }} -bspc config window_gap 5 -bspc config top_padding 38 -{{- end}} bspc config bottom_padding 0 +{{ else if eq .chezmoi.hostname "hydrus"}} +bspc config window_gap 5 +bspc config top_padding 0 +bspc config bottom_padding 32 +{{ else }} +bspc config window_gap 5 +bspc config top_padding 38 +bspc config bottom_padding 0 +{{- end}} + bspc config split_ratio 0.50 bspc config borderless_monocle true bspc config gapless_monocle true diff --git a/dot_config/polybar/config.ini b/dot_config/polybar/config.ini.tmpl similarity index 83% rename from dot_config/polybar/config.ini rename to dot_config/polybar/config.ini.tmpl index 204abb9..5feabf8 100644 --- a/dot_config/polybar/config.ini +++ b/dot_config/polybar/config.ini.tmpl @@ -7,19 +7,27 @@ margin-bottom = 0 margin-top = 0 [bar/one] +{{- if eq .chezmoi.hostname "hydrus"}} +monitor = DP-0 +height = 32 +bottom = true +{{- else }} monitor = eDP-1 +height = 72 +bottom = false +{{- end}} monitor-fallback = monitor-strict = false enable-ipc = true override-redirect = true -bottom = false fixed-center = true width = 100% -height = 72 offset-x = 0% offset-y = 0% +{{- if eq .chezmoi.hostname "helix" }} dpi-x = 216 dpi-y = 216 +{{- end }} background = ${color.background} foreground = ${color.foreground} radius-top = 0.0 @@ -42,11 +50,18 @@ font-3 = Font Awesome 6 Brands:style=Regular:size=12;3 modules-left = workspaces sep title modules-center = spotify +{{- if eq .chezmoi.hostname "helix"}} modules-right = keyboard sep pulseaudio-control sep battery0 sep date sep powermenu - +{{- else }} +modules-right = keyboard sep pulseaudio-control sep date sep powermenu +{{- end}} tray-position = right tray-detached = false +{{- if eq .chezmoi.hostname "helix" }} tray-maxsize = 40 +{{- else }} +tray-maxsize = 16 +{{- end }} tray-background = ${color.background} tray-offset-x = 0 tray-offset-y = 0 @@ -69,7 +84,11 @@ cursor-click = cursor-scroll = [bar/two] +{{- if eq .chezmoi.hostname "hydrus"}} +monitor = DVI-I-1 +{{- else }} monitor = eDP-1 +{{- end}} monitor-fallback = monitor-strict = false enable-ipc = true @@ -96,9 +115,9 @@ dim-value = 1.0 locale = en_US.UTF-8 font-0 = Hack:size=10;3 -font-1 = Font Awesome 5 Free:style=Solid:size=12;3 -font-2 = Font Awesome 5 Free:style=Regular:size=12;3 -font-3 = Font Awesome 5 Brands:style=Regular:size=12;3 +font-1 = Font Awesome 6 Free:style=Solid:size=12;3 +font-2 = Font Awesome 6 Free:style=Regular:size=12;3 +font-3 = Font Awesome 6 Brands:style=Regular:size=12;3 modules-left = workspaces sep title modules-center = spotify diff --git a/dot_local/bin/executable_dual-polybar-launcher b/dot_local/bin/executable_dual-polybar-launcher new file mode 100644 index 0000000..b5b3cab --- /dev/null +++ b/dot_local/bin/executable_dual-polybar-launcher @@ -0,0 +1,13 @@ +#!/bin/bash + +# Terminate already running bar instances +killall -q polybar + +# Wait until the processes have been shut down +while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done + +# Launch Polybar, using default config location ~/.config/polybar/config +polybar one -r --config=~/.config/polybar/config.ini & +polybar two -r --config=~/.config/polybar/config.ini & + +echo "Polybar launched..." diff --git a/dot_local/bin/executable_mirror-outputs b/dot_local/bin/executable_mirror-outputs.tmpl similarity index 77% rename from dot_local/bin/executable_mirror-outputs rename to dot_local/bin/executable_mirror-outputs.tmpl index 09d794a..3d358c2 100644 --- a/dot_local/bin/executable_mirror-outputs +++ b/dot_local/bin/executable_mirror-outputs.tmpl @@ -1,6 +1,10 @@ #!/bin/bash ## Simple script to mirror all connected displays for presentations +{{- if eq .chezmoi.hostname "helix" }} RESOLUTION=3840x2160 +{{ else }} +RESOLUTION=1920x1080 +{{- end }} xrandr --listmonitors | sed -n '1!p' | sed -e 's/\s[0-9].*\s\([a-zA-Z0-9\-]*\)$/\1/g' | xargs -n 1 -- bash -xc 'xrandr --output $0 --mode '$RESOLUTION' --pos 0x0 --rotate normal' diff --git a/dot_xinitrc.tmpl b/dot_xinitrc.tmpl index 3343d2b..99783e0 100644 --- a/dot_xinitrc.tmpl +++ b/dot_xinitrc.tmpl @@ -37,6 +37,9 @@ fi xinput set-prop 13 312 .8 & {{ else if eq .chezmoi.hostname "triangulum" -}} xinput set-prop 10 306 1 & +{{ else if eq .chezmoi.hostname "hydrus" -}} +xset m 10/10 100 r rate 500 30 b on & +numlockx on & {{- end }} xsetroot -cursor_name left_ptr & exec bspwm