Compare commits

...

1 Commits

Author SHA1 Message Date
Nathan McCarty f2c602f6e4
Setup layman 2023-04-20 02:25:50 -04:00
1 changed files with 66 additions and 10 deletions

View File

@ -4,6 +4,7 @@ in with lib; {
config = mkIf nathan.programs.swaywm.enable (let config = mkIf nathan.programs.swaywm.enable (let
swaylock-command = '' swaylock-command = ''
${pkgs.swaylock-effects}/bin/swaylock --screenshots --grace 30 --indicator --clock --timestr "%-I:%M:%S %p" --datestr "%A %Y-%M-%d" --effect-blur 20x3''; ${pkgs.swaylock-effects}/bin/swaylock --screenshots --grace 30 --indicator --clock --timestr "%-I:%M:%S %p" --datestr "%A %Y-%M-%d" --effect-blur 20x3'';
layman-package = inputs.self.packages.${pkgs.system}.layman;
in { in {
home.packages = with pkgs; [ home.packages = with pkgs; [
# Locking and display management # Locking and display management
@ -45,11 +46,13 @@ in with lib; {
# sworkstyle - Automatic workspace renaming # sworkstyle - Automatic workspace renaming
swayest-workstyle swayest-workstyle
font-awesome font-awesome
layman-package
]; ];
######################### #########################
## Sway ## Sway
######################### #########################
wayland.windowManager.sway = { wayland.windowManager.sway = let modifier = "Mod4";
in {
enable = true; enable = true;
systemdIntegration = true; systemdIntegration = true;
wrapperFeatures = { wrapperFeatures = {
@ -145,19 +148,18 @@ in with lib; {
}; };
}; };
# Setup keybindings # Setup keybindings
keybindings = let modifer = "Mod4"; keybindings = lib.mkOptionDefault {
in lib.mkOptionDefault { "${modifier}+q" = "kill";
"${modifer}+q" = "kill"; "${modifier}+z" = "exec ${swaylock-command}";
"${modifer}+z" = "exec ${swaylock-command}";
## Sreenshot keybinds ## Sreenshot keybinds
# Copy area to clipboard # Copy area to clipboard
"${modifer}+x" = "${modifier}+x" =
"exec ${pkgs.sway-contrib.grimshot}/bin/grimshot copy area"; "exec ${pkgs.sway-contrib.grimshot}/bin/grimshot copy area";
# Copy window to clipboard # Copy window to clipboard
"${modifer}+Ctrl+x" = "${modifier}+Ctrl+x" =
"exec ${pkgs.sway-contrib.grimshot}/bin/grimshot copy window"; "exec ${pkgs.sway-contrib.grimshot}/bin/grimshot copy window";
# Clpy entire output to clipboard # Clpy entire output to clipboard
"${modifer}+Alt+x" = "${modifier}+Alt+x" =
"exec ${pkgs.sway-contrib.grimshot}/bin/grimshot copy output"; "exec ${pkgs.sway-contrib.grimshot}/bin/grimshot copy output";
# Make the mute key work # Make the mute key work
"XF86AudioMute" = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle"; "XF86AudioMute" = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle";
@ -170,11 +172,29 @@ in with lib; {
"XF86AudioPlay" = "exec mpc toggle"; "XF86AudioPlay" = "exec mpc toggle";
"XF86AudioNext" = "exec mpc next"; "XF86AudioNext" = "exec mpc next";
# Setup scratchpads # Setup scratchpads
"${modifer}+n" = "${modifier}+n" =
"exec sh -c 'swaymsg [app_id=\"emacs\"] scratchpad show'"; "exec sh -c 'swaymsg [app_id=\"emacs\"] scratchpad show'";
"${modifer}+m" = "${modifier}+m" =
"exec sh -c 'swaymsg [app_id=\"Alacritty\"] scratchpad show'"; "exec sh -c 'swaymsg [app_id=\"Alacritty\"] scratchpad show'";
# Rebind movement keys to use layman
"${modifier}+Shift+h" = "exec layman move left";
"${modifier}+Shift+j" = "exec layman move down";
"${modifier}+Shift+k" = "exec layman move up";
"${modifier}+Shift+l" = "exec layman move right";
# Switch to layman mode
"${modifier}+g" = "mode layout";
}; };
modes = lib.mkOptionDefault {
layout = {
h = "exec layman none";
j = "exec layman Autotiling";
k = "exec layman Grid";
l = "exec layman MasterStack";
Escape = "mode default";
Return = "mode default";
};
};
# Setup a custom mode for layman operations
# Turn on numlock by default # Turn on numlock by default
input = { input = {
"*" = { xkb_numlock = "enable"; }; "*" = { xkb_numlock = "enable"; };
@ -216,6 +236,42 @@ in with lib; {
'org.jellyfin.' = '' 'org.jellyfin.' = ''
''; '';
}; };
## layman
# First setup the service
systemd.user.services.layman = {
Unit = {
Description = "layman - sway layout manager";
After = [ "graphical-session.target" ];
};
Service = {
Type = "simple";
ExecStart = ''
${layman-package}/bin/layman
'';
Restart = "always";
};
Install = { WantedBy = [ "graphical-session.target" ]; };
};
# then setup the configuration
xdg.configFile."layman" = {
target = "layman/config.toml";
text = ''
# The `layman` section configures options that apply to the layman daemon, and any fallback
# values for options not set in a [workspace] or [output] section.
[layman]
defaultLayout = "none" # The default WLM to assign to a workspace
excludedWorkspaces = [] # Numbers of workspaces to be excuded
excludedOutputs = [] # Names of outputs to be excuded
debug = true # Enable logging debug messages globaly
depthLimit = 0 # Autotiling: Default depth limit (disabled) for all workspaces
stackLayout = "splitv" # MasterStack: Default stack layout for all workspaces
stackSidet = "left" # MasterStack: Default stack position for all workspaces
masterWidth = 65 # MasterStack: Default master width for all workspaces
'';
onChange = ''
${layman-package}/bin/layman || true
'';
};
######################### #########################
## Mako (notifications) ## Mako (notifications)
######################### #########################