summaryrefslogtreecommitdiff
path: root/home/config/i3/startup.nix
diff options
context:
space:
mode:
authorQuentin Aristote <quentin@aristote.fr>2021-08-06 18:51:59 +0200
committerQuentin Aristote <quentin@aristote.fr>2021-08-06 18:51:59 +0200
commita1f7f43c95c049628e826856ec589b339cd4f5db (patch)
treea0f5bb10fc36f02ad6dbaebf1232ca2548f9ccfa /home/config/i3/startup.nix
initial commit
Diffstat (limited to 'home/config/i3/startup.nix')
-rw-r--r--home/config/i3/startup.nix36
1 files changed, 36 insertions, 0 deletions
diff --git a/home/config/i3/startup.nix b/home/config/i3/startup.nix
new file mode 100644
index 0000000..a6576da
--- /dev/null
+++ b/home/config/i3/startup.nix
@@ -0,0 +1,36 @@
+{ config, pkgs, ... }:
+
+let background-image = config.home.wallpaper;
+in {
+ xsession.windowManager.i3.config.startup = let
+ autostart = { command, always ? false, notification ? false }: {
+ inherit command always notification;
+ };
+ in (if (config.services.redshift.enable) then
+ [ (autostart { command = "systemctl --user start redshift"; }) ]
+ else
+ [ ]) ++ (if background-image != null then
+ [
+ (autostart {
+ command = "${pkgs.feh}/bin/feh --bg-scale ${background-image}";
+ })
+ ]
+ else
+ [ ]) ++ (if config.services.screen-locker.enable then
+ [
+ (autostart {
+ command =
+ "systemctl --user start xautolock-session.service xss-lock.service";
+ })
+ ]
+ else
+ [ ]) ++ (if config.services.emacs.enable then
+ [ (autostart { command = "systemctl --user start emacs.service"; }) ]
+ else
+ [ ]) ++ [
+ # Launch frequently used apps
+ (autostart { command = "thunderbird"; })
+ (autostart { command = "signal-desktop"; })
+ (autostart { command = ''i3-msg "workspace 10; exec keepassxc"''; })
+ ];
+}