modularise dwm

This commit is contained in:
Sam 2024-06-15 01:20:42 +01:00
parent 1d61c343d1
commit 75cdf136e3
12 changed files with 150 additions and 235 deletions

View File

@ -147,25 +147,7 @@
}, },
"flake-utils_3": { "flake-utils_3": {
"inputs": { "inputs": {
"systems": "systems_4" "systems": "systems_3"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_4": {
"inputs": {
"systems": "systems_5"
}, },
"locked": { "locked": {
"lastModified": 1710146030, "lastModified": 1710146030,
@ -327,27 +309,6 @@
} }
}, },
"nix-github-actions": { "nix-github-actions": {
"inputs": {
"nixpkgs": [
"poetry2nix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1703863825,
"narHash": "sha256-rXwqjtwiGKJheXB43ybM8NwWB8rO2dSRrEqes0S7F5Y=",
"owner": "nix-community",
"repo": "nix-github-actions",
"rev": "5163432afc817cf8bd1f031418d1869e4c9d5547",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nix-github-actions",
"type": "github"
}
},
"nix-github-actions_2": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"sqlfmt", "sqlfmt",
@ -445,22 +406,6 @@
} }
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": {
"lastModified": 1717926692,
"narHash": "sha256-THcv8qDqobZefHHluPjx/8n+MtVVb8ag/oJbKMqKNRo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "7d916e720af6b2ca355e4d0cfb8e4f742c172239",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable-small",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1718376599, "lastModified": 1718376599,
"narHash": "sha256-cTFGqLYTrIxORc673fUUCecQVXiXHDj6Z8vFQ5K4SDg=", "narHash": "sha256-cTFGqLYTrIxORc673fUUCecQVXiXHDj6Z8vFQ5K4SDg=",
@ -520,36 +465,14 @@
}, },
"poetry2nix": { "poetry2nix": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_2", "flake-utils": "flake-utils_3",
"nix-github-actions": "nix-github-actions", "nix-github-actions": "nix-github-actions",
"nixpkgs": "nixpkgs_2",
"systems": "systems_3",
"treefmt-nix": "treefmt-nix_2"
},
"locked": {
"lastModified": 1718285706,
"narHash": "sha256-DScsBM+kZvxOva7QegfdtleebMXh30XPxDQr/1IGKYo=",
"owner": "nix-community",
"repo": "poetry2nix",
"rev": "a5be1bbbe0af0266147a88e0ec43b18c722f2bb9",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "poetry2nix",
"type": "github"
}
},
"poetry2nix_2": {
"inputs": {
"flake-utils": "flake-utils_4",
"nix-github-actions": "nix-github-actions_2",
"nixpkgs": [ "nixpkgs": [
"sqlfmt", "sqlfmt",
"nixpkgs" "nixpkgs"
], ],
"systems": "systems_6", "systems": "systems_4",
"treefmt-nix": "treefmt-nix_3" "treefmt-nix": "treefmt-nix_2"
}, },
"locked": { "locked": {
"lastModified": 1718285706, "lastModified": 1718285706,
@ -576,7 +499,6 @@
"nixpkgs-unstable": "nixpkgs-unstable", "nixpkgs-unstable": "nixpkgs-unstable",
"nixvim": "nixvim", "nixvim": "nixvim",
"nur": "nur", "nur": "nur",
"poetry2nix": "poetry2nix",
"sops-nix": "sops-nix", "sops-nix": "sops-nix",
"sqlfmt": "sqlfmt" "sqlfmt": "sqlfmt"
} }
@ -604,9 +526,9 @@
}, },
"sqlfmt": { "sqlfmt": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_3", "flake-utils": "flake-utils_2",
"nixpkgs": "nixpkgs_3", "nixpkgs": "nixpkgs_2",
"poetry2nix": "poetry2nix_2" "poetry2nix": "poetry2nix"
}, },
"locked": { "locked": {
"dir": "sqlfmt", "dir": "sqlfmt",
@ -664,41 +586,12 @@
"type": "github" "type": "github"
}, },
"original": { "original": {
"id": "systems", "owner": "nix-systems",
"type": "indirect" "repo": "default",
"type": "github"
} }
}, },
"systems_4": { "systems_4": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_5": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_6": {
"locked": { "locked": {
"lastModified": 1681028828, "lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
@ -734,27 +627,6 @@
} }
}, },
"treefmt-nix_2": { "treefmt-nix_2": {
"inputs": {
"nixpkgs": [
"poetry2nix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1717850719,
"narHash": "sha256-npYqVg+Wk4oxnWrnVG7416fpfrlRhp/lQ6wQ4DHI8YE=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "4fc1c45a5f50169f9f29f6a98a438fb910b834ed",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
},
"treefmt-nix_3": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"sqlfmt", "sqlfmt",

View File

@ -1,6 +1,8 @@
{ {
imports = [ imports = [
../common ../common
../common/x11
./autostart.nix
# This doesn't seem to work in Cinnamon # This doesn't seem to work in Cinnamon
#./cinnamon-monitors.nix #./cinnamon-monitors.nix
]; ];

View File

@ -1,62 +1,14 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
imports = [ imports = [
./feh-wallpaper-changer.nix ./scripts/feh-wallpaper-changer.nix
./scripts/dunstify-volume-notification.nix
]; ];
home.packages = [ home.packages = [
pkgs.dunst
pkgs.flameshot pkgs.flameshot
pkgs.st pkgs.st
pkgs.dmenu
pkgs.picom
pkgs.xclip pkgs.xclip
pkgs.feh
]; ];
home.file.".Xresources" = {
recursive = true;
text = ''
!st terminal
st.alpha: 0.8
*.font: monospace:pixelsize=21:antialias=true:autohint=true;
*.font2: NotoColorEmoji:pixelsize=19:antialias=true:autohint=true;
! dwm
dwm.borderpx: 3
'';
};
home.file.".config/picom/picom.conf" = {
recursive = true;
text = ''
vsync = true;
backend = "xrender";
shadow = true;
shadow-radius = 10;
shadow-offset-x = -5;
shadow-offset-y = -5;
fading = true;
fade-in-step = 0.2;
fade-out-step = 0.2;
fade-delta = 50;
'';
};
home.file.".config/sxhkd/sxhkdrc" = {
recursive = true;
text = ''
vsync = true;
backend = "xrender";
shadow = true;
shadow-radius = 10;
shadow-offset-x = -5;
shadow-offset-y = -5;
fading = true;
fade-in-step = 0.2;
fade-out-step = 0.2;
fade-delta = 50;
'';
};
} }

View File

@ -4,6 +4,10 @@
imports = [ imports = [
../common ../common
../common/x11 ../common/x11
./xinitrc.nix
./sxhkdrc.nix
./picom.nix
./xresources.nix
# Status bar scripts # Status bar scripts
./scripts/sb-cpu-pct.nix ./scripts/sb-cpu-pct.nix
@ -11,42 +15,16 @@
./scripts/sb-volume.nix ./scripts/sb-volume.nix
./scripts/sb-network-status.nix ./scripts/sb-network-status.nix
./scripts/sb-updates.nix ./scripts/sb-updates.nix
# Notification scripts
./scripts/dunstify-volume-notification.nix
]; ];
home.packages = [ home.packages = [
pkgs.dwmblocks pkgs.dwmblocks
pkgs.dmenu
pkgs.dunst
pkgs.picom
pkgs.sxhkd
]; ];
# TODO configure x11 to look in .config/x11
#home.file."${config.xdg.configHome}/x11/xinitrc" = {
home.file.".xinitrc" = {
recursive = true;
text = ''
picom -b --config ~/.config/picom/picom.conf
xrdb ~/.Xresources
autostart="dwmblocks feh-wallpaper-changer"
for program in $autostart; do
pidof -sx "$program" || "$program" &
done >/dev/null 2>&1
if test -z "$DBUS_SESSION_BUS_ADDRESS"; then
eval $(dbus-launch --exit-with-session --sh-syntax)
fi
systemctl --user import-environment DISPLAY XAUTHORITY
if command -v dbus-update-activation-environment >/dev/null 2>&1; then
dbus-update-activation-environment DISPLAY XAUTHORITY
fi
export XSESSION_PID="$$"
exec dwm
'';
};
} }

View File

@ -0,0 +1,17 @@
{
home.file.".config/picom/picom.conf" = {
recursive = true;
text = ''
vsync = true;
backend = "xrender";
shadow = true;
shadow-radius = 10;
shadow-offset-x = -5;
shadow-offset-y = -5;
fading = true;
fade-in-step = 0.2;
fade-out-step = 0.2;
fade-delta = 50;
'';
};
}

View File

@ -0,0 +1,48 @@
{
home.file.".config/sxhkd/sxhkdrc" = {
recursive = true;
text = ''
XF86AudioRaiseVolume
pamixer --set-limit 150 --allow-boost -i 5 && dunstify-volume-notification && pkill -RTMIN+10 dwmblocks && exit 1
XF86AudioLowerVolume
pamixer --set-limit 150 --allow-boost -d 5 && dunstify-volume-notification && pkill -RTMIN+10 dwmblocks && exit 1
XF86AudioMute
pamixer --toggle-mute && dunstify-volume-notification && pkill -RTMIN+10 dwmblocks && exit 1
XF86AudioMicMute
pamixer --default-source --toggle-mute && dunstify-volume-notification && pkill -RTMIN+10 dwmblocks && exit 1
XF86MonBrightnessUp
light -A 5 && dunstify-brightness-notification
XF86MonBrightnessDown
light -U 5 && dunstify-brightness-notification
XF86Messenger
dunstify-battery-notification
control + Home
bookmark-add
control + Insert
bookmark-insert
control + F12
nsxiv-clipboard-copy /tmp/clipboard/images/
Print
flameshot gui
control + F11
dmenu-clipper
control + F8
dmenu-dict
control + F7
emoji-picker
'';
};
}

View File

@ -0,0 +1,32 @@
{
# TODO configure x11 to look in .config/x11
#home.file."${config.xdg.configHome}/x11/xinitrc" = {
home.file.".xinitrc" = {
recursive = true;
text = ''
picom -b --config ~/.config/picom/picom.conf
xrdb ~/.Xresources
autostart="dwmblocks feh-wallpaper-changer"
for program in $autostart; do
pidof -sx "$program" || "$program" &
done >/dev/null 2>&1
if test -z "$DBUS_SESSION_BUS_ADDRESS"; then
eval $(dbus-launch --exit-with-session --sh-syntax)
fi
systemctl --user import-environment DISPLAY XAUTHORITY
if command -v dbus-update-activation-environment >/dev/null 2>&1; then
dbus-update-activation-environment DISPLAY XAUTHORITY
fi
export XSESSION_PID="$$"
exec dwm
'';
};
}

View File

@ -0,0 +1,14 @@
{
home.file.".Xresources" = {
recursive = true;
text = ''
!st terminal
st.alpha: 0.8
*.font: monospace:pixelsize=21:antialias=true:autohint=true;
*.font2: NotoColorEmoji:pixelsize=19:antialias=true:autohint=true;
! dwm
dwm.borderpx: 3
'';
};
}

View File

@ -1,18 +1,18 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
sound.enable = true; sound.enable = true;
hardware.pulseaudio.enable = true; #hardware.pulseaudio.enable = true;
security.rtkit.enable = true; security.rtkit.enable = true;
hardware.pulseaudio.package = pkgs.pulseaudioFull; #hardware.pulseaudio.package = pkgs.pulseaudioFull;
# services.pipewire = { services.pipewire = {
# enable = true; enable = true;
# alsa.enable = true; alsa.enable = true;
# alsa.support32Bit = true; alsa.support32Bit = true;
# pulse.enable = true; pulse.enable = true;
# wireplumber.enable = true; wireplumber.enable = true;
# jack.enable = true; jack.enable = true;
#
# }; };
environment.systemPackages = [ environment.systemPackages = [
pkgs.pamixer pkgs.pamixer