nixos-config/user/sway/default.nix

227 lines
6.8 KiB
Nix
Raw Normal View History

2022-08-05 11:20:13 -03:00
{ config, pkgs, lib, ... }:
let
inherit (pkgs.uservars) key accent font theme;
inherit (theme) color;
2023-01-22 18:12:04 -03:00
in
{
2023-02-25 18:04:58 -03:00
imports = [
./kanshi.nix
./mako.nix
./sway-binds.nix
./swayidle.nix
./swaylock.nix
./theme.nix
];
2022-08-05 11:20:13 -03:00
config = {
2023-02-25 17:12:53 -03:00
programs.mako.enable = true;
2023-02-25 17:19:48 -03:00
services.swayidle.enable = true;
2023-02-25 18:04:58 -03:00
services.kanshi.enable = true;
2023-02-25 17:19:48 -03:00
2023-01-22 18:12:04 -03:00
wayland.windowManager.sway =
let
mod = "Mod4";
2023-02-25 18:04:58 -03:00
# menu = "wlauncher";
# terminal = "alacritty";
2023-01-22 18:12:04 -03:00
in
{
enable = true;
config = {
bars = [ ];
window.titlebar = false;
gaps = {
smartGaps = true;
smartBorders = "on";
inner = 5;
2022-08-05 11:20:13 -03:00
};
2023-01-22 18:12:04 -03:00
colors =
let
acc = accent.color;
fg_acc = accent.fg;
fg_color = color.txt;
bg_color = color.bg_dark;
alert = "#000000";
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";
};
2022-11-29 20:39:41 -03:00
};
2023-01-22 18:12:04 -03:00
fonts = {
names = [ font.interface ];
size = font.size.medium * 1.0;
2022-11-29 20:39:41 -03:00
};
2023-01-22 18:12:04 -03:00
input."type:touchpad" = {
# Disable While Typing
dwt = "enabled";
natural_scroll = "enabled";
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} ${
2022-08-07 23:58:05 -03:00
toString config.home.pointerCursor.size
}";
2023-02-13 17:45:21 -03:00
hide_cursor = "when-typing enable";
2022-08-05 11:20:13 -03:00
};
2023-01-22 18:12:04 -03:00
assigns = {
"2" = [
{ class = "qutebrowser"; }
{ app_id = "qutebrowser"; }
{ class = "firefox"; }
{ app_id = "firefox"; }
{ class = "Chromium"; }
{ app_id = "chromium"; }
];
"7" = [
{ app_id = "thunderbird"; }
2023-01-31 23:43:36 -03:00
{ app_id = "astroid"; }
2022-08-07 15:54:56 -03:00
];
2023-01-22 18:12:04 -03:00
"9" = [
{ class = ".*[Ss]team.*"; }
{ app_id = ".*[Ss]team.*"; }
{ app_id = "[Ll]utris"; }
2022-08-07 16:02:21 -03:00
];
2023-01-22 18:12:04 -03:00
"10" = [
{ app_id = ".*[Tt]elegram.*"; }
{ class = ".*[Tt]elegram.*"; }
{ class = "Jitsi Meet"; }
{ class = "discord"; }
{ title = "Discord"; }
{ class = "WebCord"; }
{ app_id = "WebCord"; }
];
};
modes =
let
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");
2023-02-08 17:12:54 -03:00
playerctl = "exec ${pkgs.playerctl}/bin/playerctl";
2023-01-22 18:12:04 -03:00
in
{
audio = code_binds
(locked_binds {
${key.tabR} = "exec volumesh -i 10";
${key.tabL} = "exec volumesh -d 10";
${key.right} = "exec mpc next";
${key.left} = "exec mpc prev";
${key.up} = "exec volumesh --mpd -i 10";
${key.down} = "exec volumesh --mpd -d 10";
}) // return_mode {
"space" = "exec mpc toggle";
"escape" = "";
"q" = "";
"m" = "exec volumesh -t";
"s" = "exec ${pkgs.pulse_sink}/bin/pulse_sink";
2023-01-28 15:31:51 -03:00
"d" = "exec ${pkgs.musmenu}/bin/musmenu delete";
"f" = "exec ${pkgs.musmenu}/bin/musmenu search";
"Shift+y" = "exec ${pkgs.musmenu}/bin/musmenu yank";
"Ctrl+a" = "exec ${pkgs.musmenu}/bin/musmenu padd";
"Ctrl+s" = "exec ${pkgs.musmenu}/bin/musmenu psave";
"Ctrl+o" = "exec ${pkgs.musmenu}/bin/musmenu pload";
"Ctrl+d" = "exec ${pkgs.musmenu}/bin/musmenu pdelete";
2023-01-24 10:09:12 -03:00
} // {
"p" = "mode playerctl";
2023-01-28 15:31:51 -03:00
"Ctrl+c" = "exec musmenu pclear";
2023-01-22 18:12:04 -03:00
};
2023-01-24 10:09:12 -03:00
playerctl = code_binds
2023-02-08 17:12:54 -03:00
((locked_binds
{
${key.left} = "${playerctl} previous";
${key.right} = "${playerctl} next";
${key.up} = "${playerctl} volume 10+";
${key.down} = "${playerctl} volume 10-";
${key.tabR} = "${playerctl} volume 10+";
${key.tabL} = "${playerctl} volume 10-";
}) //
2023-01-24 10:09:12 -03:00
(return_mode {
2023-02-08 17:12:54 -03:00
"space" = "${playerctl} play-pause";
2023-01-24 10:09:12 -03:00
"escape" = "";
"q" = "";
2023-02-08 17:12:54 -03:00
}));
2023-01-22 18:12:04 -03:00
passthrough = {
"${mod}+escape" = "mode default;exec notify-send 'Passthrough off'";
};
};
floating = {
modifier = "Mod4";
2023-02-25 16:43:58 -03:00
criteria = [
{ class = "file_picker"; }
{ app_id = "file_picker"; }
{ app_id = "wdisplays"; }
{ app_id = "pavucontrol"; }
{ app_id = ".*[Hh]elvum.*"; }
];
2023-01-22 18:12:04 -03:00
};
terminal = pkgs.alacritty.executable;
};
extraConfig = ''
for_window [title=.*] inhibit_idle fullscreen
exec ${pkgs.dbus-sway-environment}/bin/dbus-sway-environment
exec swaymsg workspace 2
'';
2022-08-05 11:20:13 -03:00
};
services.gammastep = {
enable = true;
provider = "geoclue2";
};
2022-08-23 23:42:36 -03:00
home.packages = with pkgs; [
2022-12-02 16:13:10 -03:00
sway
swaybg
swaylock
2023-02-25 16:43:58 -03:00
wdisplays
2022-12-02 16:13:10 -03:00
2022-08-23 23:42:36 -03:00
waybar
dhist
2023-01-21 01:58:12 -03:00
demoji
2022-08-23 23:42:36 -03:00
bmenu
wdmenu
wlauncher
volumesh
2022-11-14 15:27:25 -03:00
showkeys
2022-08-23 23:42:36 -03:00
pamixer
libnotify
xdg-utils
screenshotsh
color_picker
2022-10-17 00:18:10 -03:00
wf-recorder
2022-10-18 23:30:35 -03:00
wl-clipboard
2022-10-17 00:18:10 -03:00
wtype
2022-10-24 08:02:22 -03:00
2022-11-14 15:02:18 -03:00
grim
2022-11-05 09:48:20 -03:00
swappy
2022-11-14 14:59:32 -03:00
tesseract5
2022-11-05 09:48:20 -03:00
2022-10-24 08:02:22 -03:00
mpvpaper
2022-08-23 23:42:36 -03:00
];
2023-02-25 16:43:58 -03:00
home.sessionVariables = {
LD_PRELOAD = "${pkgs.gtk3-nocsd}/lib/libgtk3-nocsd.so.0";
GTK_CSD = "0";
};
2022-08-05 11:20:13 -03:00
};
}