BSPWM configuration for Thor

This commit is contained in:
Filippo Berto 2022-05-09 01:46:24 +02:00
parent 0cbcfa9fa0
commit f37f46c65a
9 changed files with 114 additions and 113 deletions

View file

@ -1,9 +1,11 @@
{ pkgs, ... }:
{ pkgs, lib, ... }:
let
monitorPages = [ "I" "II" "III" "IV" "V" "VI" "VII" "VIII" "IX" "X" ];
monitorPagesString = lib.strings.concatStringsSep " " monitorPages;
strPalette = pkgs.rice.palette.toRGBHex pkgs.rice.colorPalette;
xrandr = "${pkgs.xorg.xrandr}/bin/xrandr";
xsetroot = "${pkgs.xorg.xsetroot}/bin/xsetroot";
in
{
xsession.windowManager.bspwm = {
@ -19,56 +21,19 @@ in
normal_border_color = strPalette.normal.blue;
focused_border_color = strPalette.bright.blue;
};
monitors = {
# Intel
"eDP1" = monitorPages;
"DP1" = monitorPages;
# Nvidia
"eDP-1-1" = monitorPages;
"HDMI-0" = monitorPages;
"DP-1-1" = monitorPages;
};
# monitors = builtins.foldl' (acc: monitor: acc // { ${monitor} = monitorPages; }) { } monitors;
extraConfig = ''
${pkgs.wmname}/bin/wmname LG3D
${pkgs.polybar}/bin/polybar-msg cmd restart
for monitor in $(${xrandr} --listactivemonitors | cut -d " " -f 6); do
bspc monitor $monitor -d ${monitorPagesString}
done
if grep DP-1-1 <(${xrandr} --listactivemonitors); then
${xrandr} --output DP-1-1 --auto --left-of HDMI-0 --rotate right ||
${xrandr} --output DP-1-1 --auto --left-of eDP-1-1 --rotate right
elif grep DP1 <(${xrandr} --listactivemonitors); then
${xrandr} --output DP-1-1 --auto --above eDP1;
fi
autorandr -c
${xsetroot} -solid black -cursor_name left_ptr
systemctl --user restart polybar.service update-background.service || true
systemctl --user restart \
polybar.service \
update-background.service
'';
startupPrograms = [];
startupPrograms = [ ];
};
# xdg.configFile."bspwm/bspwmrc" = {
# executable = true;
# text = ''
# #!/bin/sh
# bspc monitor DP1 -d I II III IV V VI VII VIII IX X
# bspc monitor HDMI-0 -d I II III IV V VI VII VIII IX X
# bspc monitor eDP-1-1 -d I II III IV V VI VII VIII IX X
# bspc monitor eDP1 -d I II III IV V VI VII VIII IX X
# bspc config border_radius 8
# bspc config border_width 2
# bspc config borderless_monocle true
# bspc config focused_border_color '#678EBD'
# bspc config gapless_monocle false
# bspc config normal_border_color '#5E81AC'
# bspc config split_ratio 0.500000
# bspc config top_padding 0
# bspc config window_gap 4
# # java gui fixes
# export _JAVA_AWT_WM_NONREPARENTING=1
# bspc rule -a sun-awt-X11-XDialogPeer state=floating
# sleep 2
# polybar-msg cmd restart
# '';
# };
}