sway/kanshi: Make it functional on miku

This commit is contained in:
2021-10-22 21:43:41 +02:00
parent 2bdb6d7f76
commit 299763ceaf
2 changed files with 73 additions and 62 deletions

View File

@@ -1,15 +1,18 @@
{
config
, lib
, writeShellScript
, kanshi
, wallpapersPath ? "/home/${config.system.singleUser}/Data/Wallpapers"
, pkgs
, ...
}:
let
kanshi = pkgs.kanshi;
writeShellScript = pkgs.writeShellScript;
wallpapersPath = "/home/${config.system.singleUser}/Data/Wallpaper";
wallpapersHorizontal = "${wallpapersPath}/horizontal";
wallpapersVertical = "${wallpapersPath}/vertical";
wallpaperScript = writeShellScript "wallpaper.sh" ''
set -x
[[ $# -lt 1 ]] && echo "No profile specified" && exit 1
random_file() {
@@ -26,8 +29,8 @@ let
horiz=$(random_file ${wallpapersHorizontal})
vert=$(random_file ${wallpapersVertical})
setbg "eDP-1" $horiz
setbg "HDMI-A-1" $vert
setbg "DP-2" $horiz
setbg "HDMI-A-3" $vert
;;
genericMultihead)
horiz1=$(random_file ${wallpapersHorizontal})
@@ -51,62 +54,52 @@ let
in {
environment.systemPackages = [ kanshi ];
systemd.user.services.kanshi = {
description = "Dynamic display configuration tool";
wantedBy = [ "default.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${kanshi}/bin/kanshi";
Restart = "on-failure";
};
};
home-manager.users."${config.system.singleUser}".services.kanshi = {
enable = true;
profiles = let
horizontal = "Samsung Electric Company C27F398 H4ZN200596";
vertical = "Goldstar Company Ltd IPS235 Serial Number";
horizontal = "Samsung Electric Company C27F398 H4ZR101145";
vertical = "Goldstar Company Ltd IPS235 305NDPHKN600";
in {
homeMultihead = mkProfile "homeMultihead" [
{
criteria = vertical;
status = "enable";
mode = "1920x1080";
transform = "270";
position = "1920,-1080";
transform = "90";
position = "-1080,0";
}
{
criteria = horizontal;
status = "enable";
mode = "1920x1080";
position = "1920,-1080";
}
{
criteria = "eDP-1";
status = "enable";
mode = "1920x1080";
position = "0,0";
}
];
genericMultihead = mkProfile "genericMultihead" [
{
criteria = "eDP-1";
mode = "1920x1080";
status = "enable";
}
{
criteria = "HDMI-A-1";
status = "enable";
}
];
laptop = mkProfile "laptop" [
{
criteria = "eDP-1";
status = "enable";
mode = "1920x1080";
position = "0,0";
}
#{
# criteria = "eDP-1";
# status = "enable";
# mode = "1920x1080";
# position = "0,0";
#}
];
#genericMultihead = mkProfile "genericMultihead" [
# {
# criteria = "eDP-1";
# mode = "1920x1080";
# status = "enable";
# }
# {
# criteria = "HDMI-A-1";
# status = "enable";
# }
#];
#laptop = mkProfile "laptop" [
# {
# criteria = "eDP-1";
# status = "enable";
# mode = "1920x1080";
# position = "0,0";
# }
#];
};
};
}