nixos/home/common/optional/desktop/dwm/default.nix

53 lines
1.4 KiB
Nix
Raw Normal View History

2024-06-13 23:33:14 +01:00
{ pkgs, ... }:
2024-06-13 17:31:49 +01:00
{
2024-06-13 23:33:14 +01:00
2024-06-13 17:31:49 +01:00
imports = [
../common
2024-06-13 23:39:22 +01:00
../x11
2024-06-13 23:33:14 +01:00
];
home.packages = [
pkgs.dwmblocks
# Status bar
(pkgs.writeShellScriptBin "sb-cpu-pct" (builtins.readFile ./scripts/sb-cpu-pct.sh))
(pkgs.writeShellScriptBin "sb-mem-pct" (builtins.readFile ./scripts/sb-mem-pct.sh))
(pkgs.writeShellScriptBin "sb-volume" (builtins.readFile ./scripts/sb-volume.sh))
(pkgs.writeShellScriptBin "sb-network-status" (builtins.readFile ./scripts/sb-network-status.sh))
(pkgs.writeShellScriptBin "sb-updates" (builtins.readFile ./scripts/sb-updates.sh))
2024-06-13 17:31:49 +01:00
];
# TODO configure x11 to look in .config/x11
#home.file."${config.xdg.configHome}/x11/xinitrc" = {
home.file.".xinitrc" = {
recursive = true;
text = ''
2024-06-13 23:33:14 +01:00
2024-06-14 17:31:17 +01:00
picom -b --config ~/.config/picom/picom.conf
xrdb ~/.Xresources
2024-06-14 00:39:02 +01:00
autostart="dwmblocks feh-wallpaper-changer"
2024-06-13 23:33:14 +01:00
for program in $autostart; do
pidof -sx "$program" || "$program" &
done >/dev/null 2>&1
2024-06-13 17:31:49 +01:00
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
'';
};
}