wlogout returns, cosmic config probably finalised
This commit is contained in:
parent
05d0f6a949
commit
4ae5e113fe
8 changed files with 136 additions and 64 deletions
|
@ -42,6 +42,7 @@
|
|||
dates = "daily";
|
||||
options = "--delete-older-than 3d";
|
||||
};
|
||||
optimise.automatic = true;
|
||||
};
|
||||
|
||||
imports = [
|
||||
|
|
|
@ -1,31 +1,105 @@
|
|||
{...}: {
|
||||
{lib, ...}: let
|
||||
inherit (lib) range mapAttrsToList;
|
||||
inherit (builtins) toString;
|
||||
workspaceRange = range 1 6;
|
||||
makeWorkspaceBinding = modifiers: action:
|
||||
map (i: {
|
||||
inherit modifiers;
|
||||
key = toString i;
|
||||
action = {
|
||||
type = action;
|
||||
data = i;
|
||||
};
|
||||
})
|
||||
workspaceRange;
|
||||
focusWsBindings = makeWorkspaceBinding ["Super"] "Workspace";
|
||||
moveWsBindings = makeWorkspaceBinding ["Super" "Shift"] "SendToWorkspace";
|
||||
|
||||
hjkl = {
|
||||
"h" = "Left";
|
||||
"j" = "Down";
|
||||
"k" = "Up";
|
||||
"l" = "Right";
|
||||
};
|
||||
makeDirBinding = modifiers: action:
|
||||
mapAttrsToList (
|
||||
key: dir: {
|
||||
inherit key modifiers;
|
||||
action = {
|
||||
type = action;
|
||||
data = dir;
|
||||
};
|
||||
}
|
||||
)
|
||||
hjkl;
|
||||
focusBindings = makeDirBinding ["Super"] "Focus";
|
||||
moveBindings = makeDirBinding ["Super" "Shift"] "Move";
|
||||
winManagementBindings =
|
||||
focusWsBindings
|
||||
++ moveWsBindings
|
||||
++ focusBindings
|
||||
++ moveBindings;
|
||||
genBinding = key: modifiers: action: {
|
||||
inherit key modifiers action;
|
||||
};
|
||||
genSpawnBinding = key: modifiers: app: {
|
||||
inherit key modifiers;
|
||||
action = {
|
||||
type = "Spawn";
|
||||
data = app;
|
||||
};
|
||||
};
|
||||
in {
|
||||
imports = [
|
||||
../../util/cosmic.nix
|
||||
];
|
||||
services.desktopManager.cosmic = {
|
||||
enable = true;
|
||||
keybindings = [
|
||||
{
|
||||
modifiers = ["Super"];
|
||||
key = "a";
|
||||
action = {
|
||||
type = "Spawn";
|
||||
data = "echo ok!";
|
||||
};
|
||||
}
|
||||
{
|
||||
key = "b";
|
||||
action = {
|
||||
type = "Move";
|
||||
data = "Down";
|
||||
};
|
||||
}
|
||||
];
|
||||
otherSettings = {
|
||||
"com.system76.CosmicPanel.Dock" = {
|
||||
option.opacity = 0.8;
|
||||
};
|
||||
};
|
||||
keybindings =
|
||||
winManagementBindings
|
||||
++ [
|
||||
(genBinding "q" ["Super" "Shift"] "Close")
|
||||
(genBinding "w" ["Super"] "ToggleStacking")
|
||||
(genBinding "s" ["Super"] "ToggleOrientation")
|
||||
(genBinding "space" ["Super"] "ToggleWindowFloating")
|
||||
(genBinding "space" ["Super" "Shift"] "Maximize")
|
||||
(genBinding "minus" ["Super"] "Minimize")
|
||||
(genBinding "r" ["Super"] {
|
||||
type = "Resizing";
|
||||
data = "Outwards";
|
||||
})
|
||||
(genBinding "r" ["Super" "Shift"] {
|
||||
type = "Resizing";
|
||||
data = "Inwards";
|
||||
})
|
||||
(genBinding "period" ["Super"] "NextOutput")
|
||||
(genBinding "period" ["Super" "Shift"] "MoveToNextOutput")
|
||||
(genBinding "comma" ["Super"] "PreviousOutput")
|
||||
(genBinding "comma" ["Super" "Shift"] "MoveToPreviousOutput")
|
||||
(genSpawnBinding "f" ["Super"] "firefox")
|
||||
(genSpawnBinding "e" ["Super"] "nautilus")
|
||||
(genSpawnBinding "equal" ["Super"] "keepassxc")
|
||||
(genSpawnBinding "return" ["Super"] "kitty")
|
||||
(genSpawnBinding "s" ["Super" "Shift"] "cosmic-screenshot")
|
||||
(genSpawnBinding null ["Super"] "cosmic-launcher")
|
||||
(genSpawnBinding "d" ["Super"] "cosmic-app-library")
|
||||
(genSpawnBinding "XF86AudioRaiseVolume" [] "amixer sset Master 5%+")
|
||||
(genSpawnBinding "XF86AudioLowerVolume" [] "amixer sset Master 5%-")
|
||||
(genSpawnBinding "XF86AudioMute" [] "amixer sset Master toggle")
|
||||
(genSpawnBinding "XF86AudioNext" [] "playerctl next")
|
||||
(genSpawnBinding "XF86AudioPrev" [] "playerctl previous")
|
||||
(genSpawnBinding "XF86AudioPlay" [] "playerctl play-pause")
|
||||
(genSpawnBinding "XF86AudioStop" [] "playerctl stop")
|
||||
(
|
||||
genSpawnBinding "XF86MonBrightnessUp" []
|
||||
"busctl --user call com.system76.CosmicSettingsDaemon /com/system76/CosmicSettingsDaemon com.system76.CosmicSettingsDaemon IncreaseDisplayBrightness"
|
||||
)
|
||||
(
|
||||
genSpawnBinding "XF86MonBrightnessDown" []
|
||||
"busctl --user call com.system76.CosmicSettingsDaemon /com/system76/CosmicSettingsDaemon com.system76.CosmicSettingsDaemon DecreaseDisplayBrightness"
|
||||
)
|
||||
(genSpawnBinding "e" ["Super" "Shift"] "wlogout")
|
||||
];
|
||||
};
|
||||
services.displayManager.cosmic-greeter.enable = true;
|
||||
services.system76-scheduler.enable = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue