zenix: remove usbkey, add cosmic-manager

This commit is contained in:
tristan 2025-06-21 12:01:48 +01:00
parent cbe883dcc6
commit 96c92c7838
6 changed files with 165 additions and 146 deletions

View file

@ -2,101 +2,94 @@
pkgs,
config,
lib,
inputs,
...
}: let
inherit (config.lib.cosmic) Actions mapBinds;
SpawnTerminal = name: pkg:
Actions.Spawn (pkgs.writeShellScriptBin name "${lib.getExe config.programs.terminal} -e ${lib.getExe pkg}");
inherit (config.lib.cosmic) mkRON;
mkAction = variant: action: mkRON "enum" {
inherit variant;
value = [
(mkRON "enum" action)
];
};
in {
programs.cosmic = {
imports = [inputs.cosmic-manager.homeManagerModules.cosmic-manager];
wayland.desktopManager.cosmic = {
enable = true;
input.asDefaults = true;
input.binds = mapBinds {
# Navigation
Super. "h" = Actions.Focus "Left";
Super. "l" = Actions.Focus "Right";
Super. "j" = Actions.Focus "Down";
Super. "k" = Actions.Focus "Up";
Super. "u" = Actions.Focus "Out";
Super. "i" = Actions.Focus "In";
Super.Shift. "h" = Actions.Move "Left";
Super.Shift. "l" = Actions.Move "Right";
Super.Shift. "j" = Actions.Move "Down";
Super.Shift. "k" = Actions.Move "Up";
Super.Shift. "Right" = Actions.MoveToNextWorkspace;
Super.Shift. "Left" = Actions.MoveToPreviousWorkspace;
Super. "1" = Actions.Workspace 1;
Super. "2" = Actions.Workspace 2;
Super. "3" = Actions.Workspace 3;
Super. "4" = Actions.Workspace 4;
Super. "5" = Actions.Workspace 5;
Super.Shift. "1" = Actions.MoveToWorkspace 1;
Super.Shift. "2" = Actions.MoveToWorkspace 2;
Super.Shift. "3" = Actions.MoveToWorkspace 3;
Super.Shift. "4" = Actions.MoveToWorkspace 4;
Super.Shift. "5" = Actions.MoveToWorkspace 5;
Super. "Space" = Actions.ToggleWindowFloating;
Super. "f" = Actions.Maximize;
Super. "m" = Actions.Minimize;
Super.Shift. "x" = Actions.Close;
Super.Shift. "v" = Actions.ToggleStacking;
Super.Shift. "y" = Actions.ToggleSticky;
# System
Super. "d" = Actions.Spawn config.programs.menu.drunCommand;
Super. "Return" = Actions.Spawn config.programs.terminal;
Super. "e" = SpawnTerminal "aerc" config.programs.aerc.package;
Super. "o" = Actions.System "HomeFolder";
Super.Shift. "s" = Actions.System "Screenshot";
"XF86AudioRaiseVolume" = Actions.System "VolumeRaise";
"XF86AudioLowerVolume" = Actions.System "VolumeLower";
"XF86AudioPlay" = Actions.System "PlayPause";
"XF86AudioNext" = Actions.System "PlayNext";
"XF86AudioPrev" = Actions.System "PlayPrev";
"XF86MonBrightnessUp" = Actions.System "BrightnessUp";
"XF86MonBrightnessDown" = Actions.System "BrightnessDown";
};
background = {
displays = {
all = {
source = lib.mkDefault config.stylix.image;
systemActions = mkRON "map" [
{
key = mkRON "enum" "Terminal";
value = lib.getExe config.programs.terminal;
}
];
shortcuts = [
{
action = mkAction "System" "Terminal";
key = "Super+Return";
}
];
wallpapers = [
{
filter_by_theme = true;
filter_method = mkRON "enum" "Lanczos";
output = "all";
rotation_frequency = 600;
sampling_method = mkRON "enum" "Alphanumeric";
scaling_mode = mkRON "enum" {
value = [
(mkRON "tuple" [
0.5
1.0
(mkRON "raw" "0.345354352")
])
];
variant = "Fit";
};
};
};
panels = {
"Bar" = {
applets = {
start = [
source = mkRON "enum" {
value = [ (toString config.stylix.image) ];
variant = "Path";
};
}
];
panels = [
{
anchor = mkRON "enum" "Top";
anchor_gap = false;
autohide = mkRON "optional" null;
background = mkRON "enum" "Dark";
expand_to_edges = true;
name = "Panel";
opacity = 1.0;
output = mkRON "enum" "All";
plugins_center = mkRON "optional" [
"com.system76.CosmicAppletTime"
];
plugins_wings = mkRON "optional" (mkRON "tuple" [
[
"com.system76.CosmicPanelWorkspacesButton"
"com.system76.CosmicPanelAppButton"
"com.system76.CosmicAppletWorkspaces"
];
center = [
"com.system76.CosmicAppletMinimize"
];
end = [
"com.system76.CosmicAppletTime"
]
[
"com.system76.CosmicAppletInputSources"
"com.system76.CosmicAppletStatusArea"
"com.system76.CosmicAppletTiling"
"com.system76.CosmicAppletAudio"
"com.system76.CosmicAppletNetwork"
"com.system76.CosmicAppletBattery"
"com.system76.CosmicAppletNotifications"
"com.system76.CosmicAppletStatusArea"
"com.system76.CosmicAppletBluetooth"
"com.system76.CosmicAppletPower"
];
};
options = {
size = "XS";
border_radius = 0;
};
};
};
comp.settings = {
autotile = true;
active_hint = true;
focus_follows_cursor = true;
focus_follows_cursor_delay = 0;
cursor_follows_focus = true;
descale_xwayland = true;
workspaces = {
workspace_layout = "Horizontal";
};
};
]
]);
size = mkRON "enum" "XS";
}
];
};
}