BSPWM configuration for Thor
This commit is contained in:
parent
0cbcfa9fa0
commit
f37f46c65a
9 changed files with 114 additions and 113 deletions
28
home_manager/modules/autorandr.nix
Normal file
28
home_manager/modules/autorandr.nix
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
programs.autorandr = {
|
||||
enable = true;
|
||||
profiles = {
|
||||
thor-two-screens = {
|
||||
fingerprint = {
|
||||
"DP-4" = "00ffffffffffff001e6d7f5ba1c60a00011f0104b53c22789f8cb5af4f43ab260e5054254b007140818081c0a9c0b300d1c08100d1cf09ec00a0a0a0675030203a0055502100001a000000fd0030901ee63c000a202020202020000000fc004c4720554c545241474541520a000000ff003130314e5454514c533230390a017102031a7123090607e305c000e606050160592846100403011f136fc200a0a0a0555030203a0055502100001a565e00a0a0a029503020350055502100001a5aa000a0a0a0465030203a005550210000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000da";
|
||||
"HDMI-0" = "00ffffffffffff004c2d2c0d443650302e19010380341d782a5295a556549d250e5054bb8c00b30081c0810081809500a9c001010101023a801871382d40582c450009252100001e000000fd0030481e5216000a202020202020000000fc00433234463339300a2020202020000000ff00485451483330353636370a20200163020324f14690041f131203230907078301000067030c001000802b681a00000101304800011d00bc52d01e20b828554009252100001e8c0ad090204031200c4055000925210000188c0ad08a20e02d10103e9600092521000018215280a07238304088c8350009252100001c00000000000000000000000000000000000000fa";
|
||||
};
|
||||
config = {
|
||||
"DP-4" = {
|
||||
primary = true;
|
||||
crtc = 0;
|
||||
mode = "2560x1440";
|
||||
position = "1080x162";
|
||||
};
|
||||
"HDMI-0" = {
|
||||
crtc = 1;
|
||||
mode = "1920x1080";
|
||||
position = "0x0";
|
||||
rotate = "right";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -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
|
||||
# '';
|
||||
# };
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
{ ... }:
|
||||
{
|
||||
programs.mangohud = {
|
||||
enable = true;
|
||||
enableSessionWide = true;
|
||||
settings = {
|
||||
toggle_hud = "Shift_R+F12";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,9 @@ let
|
|||
playerStatus = "${playerCtl} -f '{{emoji(status)}} {{title}} - {{artist}}' metadata | ${head} -c 60";
|
||||
alacritty = "${pkgs.alacritty}/bin/alacritty";
|
||||
btm = "${pkgs.bottom}/bin/btm";
|
||||
systemctl = "${pkgs.systemd}/bin/systemctl";
|
||||
loginctl = "${pkgs.systemd}/bin/loginctl";
|
||||
shutdown = "${pkgs.systemd}/bin/shutdown";
|
||||
colors = with pkgs.rice; palette.toARGBHex rec {
|
||||
|
||||
normal = {
|
||||
|
|
@ -157,13 +160,14 @@ in
|
|||
type = "internal/bspwm";
|
||||
format = "<label-state>";
|
||||
|
||||
label = let
|
||||
common = {
|
||||
padding = 1;
|
||||
separator = " ";
|
||||
text = "%name%";
|
||||
};
|
||||
in
|
||||
label =
|
||||
let
|
||||
common = {
|
||||
padding = 1;
|
||||
separator = " ";
|
||||
text = "%name%";
|
||||
};
|
||||
in
|
||||
{
|
||||
focused = colors.selected // common;
|
||||
occupied = colors.active // common;
|
||||
|
|
@ -307,16 +311,16 @@ in
|
|||
({ text = "Power off"; exec = "#powermenu.open.4"; })
|
||||
]
|
||||
[
|
||||
({ text = "Logout"; exec = "${pkgs.systemd}/bin/loginctl terminate-session self"; })
|
||||
({ text = "Logout"; exec = "${loginctl} terminate-session `loginctl session-status | head -n 1 | awk '{print $1}'`"; })
|
||||
]
|
||||
[
|
||||
({ text = "Reboot"; exec = "${pkgs.systemd}/bin/systemctl reboot"; })
|
||||
({ text = "Reboot"; exec = "${systemctl} reboot"; })
|
||||
]
|
||||
[
|
||||
({ text = "Hibernate"; exec = "${pkgs.systemd}/bin/systemctl hibernate"; })
|
||||
({ text = "Hibernate"; exec = "${systemctl} hibernate"; })
|
||||
]
|
||||
[
|
||||
({ text = "Power off"; exec = "${pkgs.systemd}/bin/shutdown now"; })
|
||||
({ text = "Power off"; exec = "${shutdown} now"; })
|
||||
]
|
||||
];
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,49 +1,48 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
services.sxhkd = let
|
||||
alacritty = "${pkgs.alacritty}/bin/alacritty";
|
||||
bspc = "${pkgs.bspwm}/bin/bspc";
|
||||
dunstify = "${pkgs.dunst}/bin/dunstify";
|
||||
playerctl = "${pkgs.playerctl}/bin/playerctl";
|
||||
pulseaudio-ctl = "${pkgs.pulseaudio-ctl}/bin/pulseaudio-ctl";
|
||||
rofi = "${pkgs.rofi}/bin/rofi";
|
||||
terminator = "${pkgs.terminator}/bin/terminator";
|
||||
nautilus = "${pkgs.gnome.nautilus}/bin/nautilus";
|
||||
pcmanfm = "${pkgs.pcmanfm}/bin/pcmanfm";
|
||||
update-backgroundCmd = "${pkgs.update-background}";
|
||||
xbacklight = "${pkgs.xorg.xbacklight}/bin/xbacklight";
|
||||
in
|
||||
services.sxhkd =
|
||||
let
|
||||
primaryTerminal = "kitty";
|
||||
secondaryTerminal = "terminator";
|
||||
primaryFileManager = "${pkgs.gnome.nautilus}/bin/nautilus";
|
||||
secondaryFileManager = "${pkgs.pcmanfm}/bin/pcmanfm";
|
||||
playerctl = "${pkgs.playerctl}/bin/playerctl";
|
||||
pulseaudio-ctl = "${pkgs.pulseaudio-ctl}/bin/pulseaudio-ctl";
|
||||
terminator = "${pkgs.terminator}/bin/terminator";
|
||||
update-backgroundCmd = "${pkgs.update-background}/bin/update-background";
|
||||
xbacklight = "${pkgs.xorg.xbacklight}/bin/xbacklight";
|
||||
in
|
||||
{
|
||||
enable = true;
|
||||
keybindings = {
|
||||
"super + b" = update-backgroundCmd;
|
||||
"super + alt + {h,j,k,l}" = "${bspc} node -z {left -20 0,bottom 0 20,top 0 -20,right 20 0}";
|
||||
"super + alt + {q,r}" = "${bspc} {quit,wm -r}";
|
||||
"super + alt + shift + {h,j,k,l}" = "${bspc} node -z {right -20 0,top 0 20,bottom 0 -20,left 20 0}";
|
||||
"super + alt + m" = "${pkgs.lockscreen}";
|
||||
"super + bracket{left,right}" = "${bspc} desktop -f {prev,next}.local";
|
||||
"super + ctrl + {1-9}" = "${bspc} node -o 0.{1-9}";
|
||||
"super + ctrl + {h,j,k,l}" = "${bspc} node -p {west,south,north,east}";
|
||||
"super + ctrl + {m,x,y,z}" = "${bspc} node -g {marked,locked,sticky,private}";
|
||||
"super + ctrl + shift + space" = "${bspc} query -N -d | xargs -I id -n 1 ${bspc} node id -p cancel";
|
||||
"super + ctrl + space" = "${bspc} node -p cancel";
|
||||
"super + {_,shift +} e" = "{${nautilus} -w, ${pcmanfm} -n}";
|
||||
"super + alt + {h,j,k,l}" = "bspc node -z {left -20 0,bottom 0 20,top 0 -20,right 20 0}";
|
||||
"super + alt + {q,r}" = "bspc {quit,wm -r}";
|
||||
"super + alt + shift + {h,j,k,l}" = "bspc node -z {right -20 0,top 0 20,bottom 0 -20,left 20 0}";
|
||||
"super + alt + m" = "${pkgs.lockscreen}/bin/lockscreen";
|
||||
"super + bracket{left,right}" = "bspc desktop -f {prev,next}.local";
|
||||
"super + ctrl + {1-9}" = "bspc node -o 0.{1-9}";
|
||||
"super + ctrl + {h,j,k,l}" = "bspc node -p {west,south,north,east}";
|
||||
"super + ctrl + {m,x,y,z}" = "bspc node -g {marked,locked,sticky,private}";
|
||||
"super + ctrl + shift + space" = "bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel";
|
||||
"super + ctrl + space" = "bspc node -p cancel";
|
||||
"super + {_,shift +} e" = "{${primaryFileManager} -w, ${secondaryFileManager} -n}";
|
||||
"super + Escape" = "pkill -USR1 -x sxhkd";
|
||||
"super + g" = "${bspc} node -s biggest";
|
||||
"super + {grave,Tab}" = "${bspc} {node,desktop} -f last";
|
||||
"super + {Left,Down,Up,Right}" = "${bspc} node -v {-20 0,0 20,0 -20,20 0}";
|
||||
"super + m" = "${bspc} desktop -l next";
|
||||
"super + {o,i}" = "${bspc} wm -h off;${bspc} node {older,newer} -f;${bspc} wm -h on";
|
||||
"super + {p,b,comma,period}" = "${bspc} node -f @{parent,brother,first,second}";
|
||||
"super + {_,shift + } Return" = "{${alacritty} , ${terminator}}";
|
||||
"super + {_,shift + }{1-9,0}" = "${bspc} {desktop -f,node -d} 'focused:^{1-9,10}'";
|
||||
"super + {_,shift + }c" = "${bspc} node -f {next,prev}.local";
|
||||
"super + {h,j,k,l}" = "${bspc} node -f {west,south,north,east}";
|
||||
"super + g" = "bspc node -s biggest";
|
||||
"super + {grave,Tab}" = "bspc {node,desktop} -f last";
|
||||
"super + {Left,Down,Up,Right}" = "bspc node -v {-20 0,0 20,0 -20,20 0}";
|
||||
"super + m" = "bspc desktop -l next";
|
||||
"super + {o,i}" = "bspc wm -h off;bspc node {older,newer} -f;bspc wm -h on";
|
||||
"super + {p,b,comma,period}" = "bspc node -f @{parent,brother,first,second}";
|
||||
"super + {_,shift + } Return" = "{${primaryTerminal} , ${secondaryTerminal}}";
|
||||
"super + {_,shift + }{1-9,0}" = "bspc {desktop -f,node -d} 'focused:^{1-9,10}'";
|
||||
"super + {_,shift + }c" = "bspc node -f {next,prev}.local";
|
||||
"super + {h,j,k,l}" = "bspc node -f {west,south,north,east}";
|
||||
"super + shift + {h,j,k,l}" = ''dir={west,south,north,east}; bspc node -s "$dir.local" --follow || bspc node -m "$dir" --follow'';
|
||||
"super + {_,shift + }w" = "${bspc} node -{c,k}";
|
||||
"super + {_,shift + }w" = "bspc node -{c,k}";
|
||||
"super + @space" = "rofi -show drun";
|
||||
"super + {t,shift + t,s,f}" = "${bspc} node -t {tiled,pseudo_tiled,floating,fullscreen}";
|
||||
"super + y" = "${bspc} node newest.marked.local -n newest.!automatic.local";
|
||||
"super + {t,shift + t,s,f}" = "bspc node -t {tiled,pseudo_tiled,floating,fullscreen}";
|
||||
"super + y" = "bspc node newest.marked.local -n newest.!automatic.local";
|
||||
"{XF86AudioLowerVolume,XF86AudioMute,XF86AudioRaiseVolume}" = "${pulseaudio-ctl} {down,mute,up}";
|
||||
"XF86Audio{Next,Play,Prev}" = "${playerctl} {next,play-pause,previous}";
|
||||
"XF86MonBrightness{Up,Down}" = "${xbacklight} {+,-}10%";
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ let
|
|||
update_time = "10m";
|
||||
in
|
||||
{
|
||||
home.packages = [ pkgs.update-background ];
|
||||
|
||||
systemd.user.services."update-background" = {
|
||||
Unit = {
|
||||
Description = "Set random desktop background using feh";
|
||||
|
|
@ -16,7 +18,7 @@ in
|
|||
Service = {
|
||||
Type = "oneshot";
|
||||
IOSchedulingClass = "idle";
|
||||
ExecStart = "${pkgs.update-background}";
|
||||
ExecStart = "${pkgs.update-background}/bin/update-background";
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ with lib;
|
|||
|
||||
let
|
||||
xscreensaverCmd = "${pkgs.xscreensaver}/bin/xscreensaver-command -activate";
|
||||
lockCmd = "${pkgs.lockscreen}";
|
||||
lockCmd = "${pkgs.lockscreen}/bin/lockscreen";
|
||||
in
|
||||
{
|
||||
services.xidlehook = {
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@
|
|||
# gnome.quadrapassel
|
||||
# gnome.seahorse
|
||||
# gnome.sushi
|
||||
google-chrome
|
||||
(google-chrome.override { commandLineArgs = [ "--password-store=gnome" ]; })
|
||||
gucharmap
|
||||
handbrake
|
||||
htop
|
||||
|
|
@ -127,6 +127,10 @@
|
|||
];
|
||||
};
|
||||
|
||||
services = {
|
||||
gnome-keyring.enable = true;
|
||||
};
|
||||
|
||||
imports = [
|
||||
./basic_env.nix
|
||||
|
||||
|
|
@ -139,7 +143,8 @@
|
|||
./modules/rust.nix
|
||||
|
||||
./modules/alacritty.nix
|
||||
# ./modules/bspwm.nix
|
||||
./modules/autorandr.nix
|
||||
./modules/bspwm.nix
|
||||
# ./modules/dunst.nix
|
||||
# ./modules/grobi.nix
|
||||
./modules/gtk_theme.nix
|
||||
|
|
@ -153,18 +158,18 @@
|
|||
./modules/obs-studio.nix
|
||||
./modules/office.nix
|
||||
./modules/onedrive.nix
|
||||
# ./modules/picom.nix
|
||||
# ./modules/polybar.nix
|
||||
./modules/picom.nix
|
||||
./modules/polybar.nix
|
||||
./modules/pro_audio.nix
|
||||
./modules/rofimoji.nix
|
||||
./modules/rofi.nix
|
||||
# ./modules/screen_locker.nix
|
||||
# ./modules/security.nix
|
||||
# ./modules/sxhkd.nix
|
||||
./modules/sxhkd.nix
|
||||
./modules/syncthing.nix
|
||||
./modules/terminator.nix
|
||||
# ./modules/update_background.nix
|
||||
./modules/update_background.nix
|
||||
./modules/webapp.nix
|
||||
# ./modules/xidlehook.nix
|
||||
./modules/xidlehook.nix
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
imports = [ ./hardware-configuration.nix ];
|
||||
|
||||
boot = {
|
||||
binfmt.emulatedSystems = [ "armv7l-linux" "aarch64-linux" ];
|
||||
kernelPackages = pkgs.linuxPackages_5_17;
|
||||
|
|
@ -132,12 +130,9 @@
|
|||
desktopManager = {
|
||||
# gnome.enable = true;
|
||||
# cinnamon.enable = true;
|
||||
plasma5 = {
|
||||
enable = true;
|
||||
runUsingSystemd = true;
|
||||
useQtScaling = true;
|
||||
};
|
||||
# plasma5 = { enable = true; runUsingSystemd = true; useQtScaling = true; };
|
||||
};
|
||||
windowManager.bspwm = { enable = true; };
|
||||
# displayManager.gdm = { enable = true; nvidiaWayland = true; };
|
||||
displayManager.sddm.enable = true;
|
||||
layout = "us";
|
||||
|
|
@ -152,6 +147,7 @@
|
|||
|
||||
security = {
|
||||
rtkit.enable = true;
|
||||
pam.services = { autounlock_gnome_keyring.enableGnomeKeyring = true; };
|
||||
sudo.extraConfig = ''
|
||||
Defaults pwfeedback
|
||||
'';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue