sway: extract assigns

This commit is contained in:
Leonardo Eugênio 2023-02-25 19:29:33 -03:00
parent 8b3cdd756d
commit 6c56795c33
2 changed files with 122 additions and 104 deletions

View file

@ -9,6 +9,7 @@ in
./mako.nix ./mako.nix
./sway-binds.nix ./sway-binds.nix
./sway-modes.nix ./sway-modes.nix
./sway-assigns.nix
./swayidle.nix ./swayidle.nix
./swaylock.nix ./swaylock.nix
./theme.nix ./theme.nix
@ -18,118 +19,77 @@ in
services.swayidle.enable = true; services.swayidle.enable = true;
services.kanshi.enable = true; services.kanshi.enable = true;
wayland.windowManager.sway = wayland.windowManager.sway = {
let enable = true;
mod = "Mod4"; config = {
# menu = "wlauncher"; bars = [ ];
# terminal = "alacritty";
in floating.modifier = "Mod4";
{ terminal = pkgs.alacritty.executable;
enable = true;
config = { window.titlebar = false;
bars = [ ]; gaps = {
window.titlebar = false; smartGaps = true;
gaps = { smartBorders = "on";
smartGaps = true; inner = 5;
smartBorders = "on"; };
inner = 5; colors =
}; let
colors = acc = accent.color;
let fg_acc = accent.fg;
acc = accent.color; fg_color = color.txt;
fg_acc = accent.fg; bg_color = color.bg_dark;
fg_color = color.txt; alert = "#000000";
bg_color = color.bg_dark; client = border: background: text: indicator: childBorder: {
alert = "#000000"; inherit border background text indicator childBorder;
client = border: background: text: indicator: childBorder: {
inherit border background text indicator childBorder;
};
in
{
focused = client acc acc fg_acc acc acc;
focusedInactive = client bg_color bg_color fg_color bg_color bg_color;
unfocused = client bg_color bg_color fg_color bg_color bg_color;
urgent = client alert alert fg_color alert alert;
};
output = {
"*" = {
adaptive_sync = "on";
bg = "${theme.background} fill";
};
"DP-1" = {
mode = "1920x1080@144.000Hz";
}; };
in
{
focused = client acc acc fg_acc acc acc;
focusedInactive = client bg_color bg_color fg_color bg_color bg_color;
unfocused = client bg_color bg_color fg_color bg_color bg_color;
urgent = client alert alert fg_color alert alert;
}; };
fonts = { output = {
names = [ font.interface ]; "*" = {
size = font.size.medium * 1.0; adaptive_sync = "on";
bg = "${theme.background} fill";
}; };
input."type:touchpad" = { "DP-1" = {
# Disable While Typing mode = "1920x1080@144.000Hz";
dwt = "enabled";
natural_scroll = "enabled";
tap = "enabled";
}; };
input."*" = { };
xkb_layout = "us(colemak),br"; fonts = {
xkb_options = "lv3:lsgt_switch,grp:shifts_toggle"; names = [ font.interface ];
xkb_numlock = "enabled"; size = font.size.medium * 1.0;
repeat_rate = "30"; };
repeat_delay = "200"; input."type:touchpad" = {
}; # Disable While Typing
# setup cursor based on home.pointerCursor dwt = "enabled";
seat."*" = { natural_scroll = "enabled";
xcursor_theme = "${config.home.pointerCursor.name} ${ tap = "enabled";
};
input."*" = {
xkb_layout = "us(colemak),br";
xkb_options = "lv3:lsgt_switch,grp:shifts_toggle";
xkb_numlock = "enabled";
repeat_rate = "30";
repeat_delay = "200";
};
# setup cursor based on home.pointerCursor
seat."*" = {
xcursor_theme = "${config.home.pointerCursor.name} ${
toString config.home.pointerCursor.size toString config.home.pointerCursor.size
}"; }";
hide_cursor = "when-typing enable"; hide_cursor = "when-typing enable";
};
assigns = {
"2" = [
{ class = "qutebrowser"; }
{ app_id = "qutebrowser"; }
{ class = "firefox"; }
{ app_id = "firefox"; }
{ class = "Chromium"; }
{ app_id = "chromium"; }
];
"7" = [
{ app_id = "thunderbird"; }
{ app_id = "astroid"; }
];
"9" = [
{ class = ".*[Ss]team.*"; }
{ app_id = ".*[Ss]team.*"; }
{ app_id = "[Ll]utris"; }
];
"10" = [
{ app_id = ".*[Tt]elegram.*"; }
{ class = ".*[Tt]elegram.*"; }
{ class = "Jitsi Meet"; }
{ class = "discord"; }
{ title = "Discord"; }
{ class = "WebCord"; }
{ app_id = "WebCord"; }
];
};
floating = {
modifier = "Mod4";
criteria = [
{ class = "file_picker"; }
{ app_id = "file_picker"; }
{ app_id = "wdisplays"; }
{ app_id = "pavucontrol"; }
{ app_id = ".*[Hh]elvum.*"; }
];
};
terminal = pkgs.alacritty.executable;
}; };
extraConfig = ''
for_window [title=.*] inhibit_idle fullscreen
exec ${pkgs.dbus-sway-environment}/bin/dbus-sway-environment
exec swaymsg workspace 2
'';
}; };
extraConfig = ''
for_window [title=.*] inhibit_idle fullscreen
exec ${pkgs.dbus-sway-environment}/bin/dbus-sway-environment
exec swaymsg workspace 2
'';
};
services.gammastep = { services.gammastep = {
enable = true; enable = true;
provider = "geoclue2"; provider = "geoclue2";

View file

@ -0,0 +1,58 @@
{ config, pkgs, ... }:
let
# inherit (pkgs.uservars) key accent font theme;
# inherit (theme) color;
# inherit (pkgs) lib;
# mod = "Mod4";
# menu = "wlauncher";
# terminal = "alacritty";
# locked_binds =
# lib.mapAttrs' (k: v: lib.nameValuePair "--locked ${k}" v);
# code_binds =
# lib.mapAttrs' (k: v: lib.nameValuePair "--to-code ${k}" v);
# return_mode = lib.mapAttrs (k: v: "${v}; mode default");
# playerctl = "exec ${pkgs.playerctl}/bin/playerctl";
in
{
wayland.windowManager.sway.config = {
assigns = {
"2" = [
{ class = "qutebrowser"; }
{ app_id = "qutebrowser"; }
{ class = "firefox"; }
{ app_id = "firefox"; }
{ class = "Chromium"; }
{ app_id = "chromium"; }
];
"7" = [
{ app_id = "thunderbird"; }
{ app_id = "astroid"; }
];
"9" = [
{ class = ".*[Ss]team.*"; }
{ app_id = ".*[Ss]team.*"; }
{ app_id = "[Ll]utris"; }
];
"10" = [
{ app_id = ".*[Tt]elegram.*"; }
{ class = ".*[Tt]elegram.*"; }
{ class = "Jitsi Meet"; }
{ class = "discord"; }
{ title = "Discord"; }
{ class = "WebCord"; }
{ app_id = "WebCord"; }
];
};
floating = {
criteria = [
{ class = "file_picker"; }
{ app_id = "file_picker"; }
{ app_id = "wdisplays"; }
{ app_id = "pavucontrol"; }
{ app_id = ".*[Hh]elvum.*"; }
];
};
};
}