Better BSPWM binding
This commit is contained in:
parent
8ad70a9ada
commit
1f8c424512
7 changed files with 43 additions and 37 deletions
|
|
@ -1,11 +1,16 @@
|
|||
{ pkgs, lib, ... }:
|
||||
|
||||
let
|
||||
xsetroot = "${pkgs.xorg.xsetroot}/bin/xsetroot";
|
||||
monitorPages = [ "Ⅰ" "Ⅱ" "Ⅲ" "Ⅳ" "Ⅴ" "Ⅵ" "Ⅶ" "Ⅷ" "Ⅸ" "Ⅹ" ];
|
||||
monitorPagesString = lib.strings.concatStringsSep " " monitorPages;
|
||||
monitorSetupScript = pkgs.writeShellScript "monitorSetupScript" ''
|
||||
autorand -c || true
|
||||
for monitor in $(bspc query -M --names); do
|
||||
bspc monitor $monitor -d ${monitorPagesString}
|
||||
done
|
||||
'';
|
||||
strPalette = pkgs.lib.rice.palette.toRGBHex pkgs.rice.colorPalette;
|
||||
xrandr = "${pkgs.xorg.xrandr}/bin/xrandr";
|
||||
xsetroot = "${pkgs.xorg.xsetroot}/bin/xsetroot";
|
||||
in
|
||||
{
|
||||
xsession.windowManager.bspwm = {
|
||||
|
|
@ -27,19 +32,12 @@ in
|
|||
"Zathura" = { state = "tiled"; };
|
||||
"Yad" = { state = "floating"; };
|
||||
};
|
||||
extraConfig = ''
|
||||
${xsetroot} -solid black -cursor_name left_ptr
|
||||
autorandr -c
|
||||
|
||||
for monitor in $(${xrandr} --listactivemonitors | cut -d " " -f 6); do
|
||||
bspc monitor $monitor -d ${monitorPagesString}
|
||||
done
|
||||
|
||||
systemctl --user restart \
|
||||
polybar.service \
|
||||
update-background.service
|
||||
'';
|
||||
startupPrograms = [ ];
|
||||
startupPrograms = [
|
||||
"${monitorSetupScript}" # Setup monitors
|
||||
"systemctl --user restart polybar" # Restart polybar
|
||||
"${xsetroot} -solid black -cursor_name left_ptr" # Set cursor
|
||||
"${pkgs.update-background}/bin/update-background" # Set background
|
||||
];
|
||||
};
|
||||
services = {
|
||||
network-manager-applet.enable = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue