From a3cb2c863230a95d4e0b163fb9ab67c0a54be728 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Thu, 9 Jan 2025 18:04:44 -0500 Subject: [PATCH] Add kanshi. --- nix/configuration/roles/kanshi/default.nix | 24 +++++++++++++++++++ .../roles/kanshi/files/config_kanshi | 7 ++++++ nix/configuration/roles/sway/default.nix | 14 +++++++++-- 3 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 nix/configuration/roles/kanshi/default.nix create mode 100644 nix/configuration/roles/kanshi/files/config_kanshi diff --git a/nix/configuration/roles/kanshi/default.nix b/nix/configuration/roles/kanshi/default.nix new file mode 100644 index 0000000..0ffecd2 --- /dev/null +++ b/nix/configuration/roles/kanshi/default.nix @@ -0,0 +1,24 @@ +{ + config, + lib, + pkgs, + ... +}: + +{ + imports = [ ]; + + environment.systemPackages = with pkgs; [ + kanshi + ]; + + home-manager.users.talexander = + { pkgs, ... }: + { + home.file = { + ".config/kanshi/config" = { + source = ./files/config_kanshi; + }; + }; + }; +} diff --git a/nix/configuration/roles/kanshi/files/config_kanshi b/nix/configuration/roles/kanshi/files/config_kanshi new file mode 100644 index 0000000..abcc739 --- /dev/null +++ b/nix/configuration/roles/kanshi/files/config_kanshi @@ -0,0 +1,7 @@ +profile docked { + output eDP-1 disable + output "Dell Inc. DELL U3014 P1V6N35M329L" enable +} +profile laptop { + output eDP-1 enable +} diff --git a/nix/configuration/roles/sway/default.nix b/nix/configuration/roles/sway/default.nix index ab35393..c3f6e30 100644 --- a/nix/configuration/roles/sway/default.nix +++ b/nix/configuration/roles/sway/default.nix @@ -46,6 +46,7 @@ let include ${touchpad_input} include ${waybar} include ${announce_sway_start} + include ${exec_kanshi} ''; }; base-hotkeys = pkgs.writeTextFile { @@ -261,6 +262,13 @@ let ''; }; + exec_kanshi = pkgs.writeTextFile { + name = "exec_kanshi.conf"; + text = '' + exec kanshi + ''; + }; + start_screen_share = pkgs.writeShellScriptBin "start_screen_share" '' # Disable displaying notifications. This is useful for video conference screen sharing. set -euo pipefail @@ -283,7 +291,9 @@ let ''; in { - imports = [ ]; + imports = [ + ../kanshi + ]; environment.systemPackages = with pkgs; [ alacritty @@ -359,11 +369,11 @@ in }; }; - # Configure default programs (for example, default browser) home-manager.users.talexander = { pkgs, ... }: { home.file = { + # Configure default programs (for example, default browser) ".config/mimeapps.list" = { source = ./files/mimeapps.list; };