Skip to content

Commit

Permalink
use systemd targets for picom and sxhkd
Browse files Browse the repository at this point in the history
yeet tmux
  • Loading branch information
Gerg-L committed Sep 29, 2024
1 parent 8836b2d commit b1e7737
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 52 deletions.
1 change: 0 additions & 1 deletion hosts/gerg-desktop/main.nix
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@
vesktop
gh
nixfmt-rfc-style
tmux
super-slicer-latest # 3D printer slicer
# QMK configuration
#via
Expand Down
87 changes: 36 additions & 51 deletions modules/DE/dwm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
config = lib.mkIf config.local.DE.dwm.enable {
systemd.user.services = {
sxhkd = {
wantedBy = [ "graphical-session.target" ];
partOf = [ "graphical-session.target" ];
serviceConfig = {
ExecStart = "${lib.getExe pkgs.sxhkd} -c /etc/sxhkd/sxhkdrc";
Restart = "always";
Expand All @@ -20,6 +22,8 @@
};

picom = {
wantedBy = [ "graphical-session.target" ];
partOf = [ "graphical-session.target" ];
serviceConfig = {
ExecStart = "${lib.getExe pkgs.picom} --backend egl";
Restart = "always";
Expand All @@ -28,63 +32,44 @@
};
};
};
services = {
gvfs.enable = true;
displayManager.defaultSession = "none+dwm";
xserver = {
enable = true;
displayManager = {
sessionCommands = ''
feh --bg-center "${self'.packages.images}/recursion.png"
numlockx
'';
};
windowManager.session = [
{
name = "dwm";
start = ''
update_time () {
while :
do
sleep 1
xsetroot -name "$(date +"%I:%M %p")"
done
}
services.gvfs.enable = true;

services.displayManager.defaultSession = "none+dwm";
dont_stop() {
while type dwm >/dev/null ; do dwm && continue || break ; done
}
services.xserver = {
enable = true;
displayManager = {
sessionCommands = ''
feh --bg-center "${self'.packages.images}/recursion.png"
numlockx
systemctl --user start sxhkd
systemctl --user start picom
'';
update_time &
dont_stop &
waitPID=$!
'';
}
];
};
windowManager.session = [
{
name = "dwm";
start = ''
update_time () {
while :
do
sleep 1
xsetroot -name "$(date +"%I:%M %p")"
done
}
dont_stop() {
while type dwm >/dev/null ; do dwm && continue || break ; done
}
update_time &
dont_stop &
waitPID=$!
'';
}
];
};
environment = {
systemPackages = builtins.attrValues {
inherit (suckless.packages) dmenu dwm;
st =
let
st = pkgs.writeShellScript "st" ''
ARGS="''${@:1}"
exec ${lib.getExe suckless.packages.st} "''${ARGS:-tmux}"
'';
in
pkgs.symlinkJoin {
name = "st";
paths = [ suckless.packages.st ];
nativeBuildInputs = [ pkgs.makeBinaryWrapper ];
postBuild = ''
unlink "$out/bin/st"
ln -s "${st}" "$out/bin/st"
'';
};
inherit (suckless.packages) dmenu dwm st;
inherit (pkgs)
maim
playerctl
Expand Down

0 comments on commit b1e7737

Please sign in to comment.