Compare commits
5 commits
47dcda7d1a
...
cd6cf573dd
Author | SHA1 | Date | |
---|---|---|---|
cd6cf573dd | |||
5cf096d7eb | |||
85e1b7b2a1 | |||
5739d4c872 | |||
63a6cf22f2 |
13 changed files with 455 additions and 60 deletions
|
@ -7,6 +7,7 @@
|
||||||
./modules/programs/my-broot.nix
|
./modules/programs/my-broot.nix
|
||||||
./modules/programs/my-waybar.nix
|
./modules/programs/my-waybar.nix
|
||||||
./modules/programs/my-sway
|
./modules/programs/my-sway
|
||||||
|
./modules/programs/my-niri.nix
|
||||||
./modules/programs/my-kitty
|
./modules/programs/my-kitty
|
||||||
./modules/programs/openconnect-epfl.nix
|
./modules/programs/openconnect-epfl.nix
|
||||||
./common-linux.nix
|
./common-linux.nix
|
||||||
|
|
|
@ -13,6 +13,9 @@ let
|
||||||
if which sway &>/dev/null
|
if which sway &>/dev/null
|
||||||
set -a CHOICES "sway"
|
set -a CHOICES "sway"
|
||||||
end
|
end
|
||||||
|
if which niri-session &>/dev/null
|
||||||
|
set -a CHOICES "Niri"
|
||||||
|
end
|
||||||
if which startplasma-wayland &>/dev/null
|
if which startplasma-wayland &>/dev/null
|
||||||
set -a CHOICES "KDE Plasma"
|
set -a CHOICES "KDE Plasma"
|
||||||
end
|
end
|
||||||
|
@ -22,6 +25,8 @@ let
|
||||||
case "sway"
|
case "sway"
|
||||||
systemctl --user unset-environment NIXOS_OZONE_WL
|
systemctl --user unset-environment NIXOS_OZONE_WL
|
||||||
exec sway
|
exec sway
|
||||||
|
case "Niri"
|
||||||
|
exec niri-session
|
||||||
case "KDE Plasma"
|
case "KDE Plasma"
|
||||||
exec ${pkgs.kdePackages.plasma-workspace}/libexec/plasma-dbus-run-session-if-needed startplasma-wayland
|
exec ${pkgs.kdePackages.plasma-workspace}/libexec/plasma-dbus-run-session-if-needed startplasma-wayland
|
||||||
case '*'
|
case '*'
|
||||||
|
|
|
@ -37,12 +37,9 @@
|
||||||
# Enable X11 configuration
|
# Enable X11 configuration
|
||||||
linux.graphical.type = "wayland";
|
linux.graphical.type = "wayland";
|
||||||
linux.graphical.wallpaper = ./images/pixiv_18776904.png;
|
linux.graphical.wallpaper = ./images/pixiv_18776904.png;
|
||||||
linux.graphical.startup = with pkgs; [
|
linux.graphical.defaults.webBrowser.package = pkgs.zen-browser-bin;
|
||||||
zen-browser-bin
|
linux.graphical.defaults.webBrowser.desktopFile = "zen.desktop";
|
||||||
thunderbird
|
programs.my-niri.enable = true;
|
||||||
vesktop
|
|
||||||
];
|
|
||||||
linux.graphical.defaults.webBrowser = "zen.desktop";
|
|
||||||
programs.my-sway.enable = true;
|
programs.my-sway.enable = true;
|
||||||
programs.my-sway.fontSize = 15.0;
|
programs.my-sway.fontSize = 15.0;
|
||||||
programs.my-sway.enableLaptop = true;
|
programs.my-sway.enableLaptop = true;
|
||||||
|
@ -51,28 +48,13 @@
|
||||||
wayland.windowManager.sway.config.input."type:keyboard".xkb_layout = "jp";
|
wayland.windowManager.sway.config.input."type:keyboard".xkb_layout = "jp";
|
||||||
wayland.windowManager.sway.config.input."type:pointer".accel_profile = "flat";
|
wayland.windowManager.sway.config.input."type:pointer".accel_profile = "flat";
|
||||||
# 144hz adaptive refresh ON!
|
# 144hz adaptive refresh ON!
|
||||||
wayland.windowManager.sway.config.output =
|
|
||||||
let
|
|
||||||
scale = 1.5;
|
|
||||||
top_x = builtins.ceil (3840 / scale);
|
|
||||||
top_y = 0;
|
|
||||||
in
|
|
||||||
with config.common.monitors; {
|
|
||||||
${home_4k.name} = {
|
|
||||||
scale = toString scale;
|
|
||||||
position = "0 0";
|
|
||||||
};
|
|
||||||
${home_1440.name} = {
|
|
||||||
position = "${toString top_x} ${toString top_y}";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
nki.programs.kitty.enable = true;
|
nki.programs.kitty.enable = true;
|
||||||
nki.programs.kitty.fontSize = 14;
|
nki.programs.kitty.fontSize = 14;
|
||||||
programs.my-waybar.makeBars = with config.common.monitors; barWith: [
|
programs.my-waybar.makeBars = with config.common.monitors; barWith: [
|
||||||
# For primary
|
# For primary
|
||||||
(barWith { extraSettings = { output = [ home_4k.name ]; }; })
|
(barWith { extraSettings = { output = [ home_4k.meta.connection ]; }; })
|
||||||
# For secondary, hide mpd
|
# For secondary, hide mpd
|
||||||
(barWith { showMedia = false; showConnectivity = false; extraSettings = { output = [ home_1440.name ]; }; })
|
(barWith { showMedia = false; showConnectivity = false; extraSettings = { output = [ home_1440.meta.connection ]; }; })
|
||||||
];
|
];
|
||||||
|
|
||||||
# Yellow light!
|
# Yellow light!
|
||||||
|
|
|
@ -17,6 +17,24 @@ let
|
||||||
echo $wifi_output
|
echo $wifi_output
|
||||||
end
|
end
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
mkPackageWithDesktopOption = opts: mkOption ({
|
||||||
|
type = types.submodule {
|
||||||
|
options = {
|
||||||
|
package = mkOption {
|
||||||
|
type = types.package;
|
||||||
|
description = "The package for " + description;
|
||||||
|
};
|
||||||
|
desktopFile = mkOption {
|
||||||
|
type = types.nullOr types.str;
|
||||||
|
default = null;
|
||||||
|
description = "The desktop file name for " + description + ", defaults to [packagename].desktop";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
} // opts);
|
||||||
|
|
||||||
|
desktopFileOf = cfg: if cfg.desktopFile == null then "${cfg.package}/share/applications/${cfg.package.pname}.desktop" else cfg.desktopFile;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports = [ ./x11.nix ./wayland.nix ./alacritty.nix ];
|
imports = [ ./x11.nix ./wayland.nix ./alacritty.nix ];
|
||||||
|
@ -35,21 +53,23 @@ in
|
||||||
type = types.listOf types.package;
|
type = types.listOf types.package;
|
||||||
description = "List of packages to include in ~/.config/autostart";
|
description = "List of packages to include in ~/.config/autostart";
|
||||||
default = with pkgs; [
|
default = with pkgs; [
|
||||||
librewolf
|
cfg.defaults.webBrowser.package
|
||||||
thunderbird
|
thunderbird
|
||||||
vesktop
|
vesktop
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
defaults.webBrowser = mkOption {
|
defaults = {
|
||||||
type = types.str;
|
webBrowser = mkPackageWithDesktopOption { description = "default web browser"; };
|
||||||
default = "librewolf.desktop";
|
terminal = mkPackageWithDesktopOption { description = "default terminal"; default.package = pkgs.kitty; };
|
||||||
description = "Desktop file of the default web browser";
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
config = mkIf (cfg.type != null) {
|
config = mkIf (cfg.type != null) {
|
||||||
# Packages
|
# Packages
|
||||||
|
|
||||||
home.packages = (with pkgs; [
|
home.packages = (with pkgs; [
|
||||||
|
cfg.defaults.webBrowser.package
|
||||||
|
cfg.defaults.terminal.package
|
||||||
|
|
||||||
## GUI stuff
|
## GUI stuff
|
||||||
evince # PDF reader
|
evince # PDF reader
|
||||||
gparted
|
gparted
|
||||||
|
@ -148,14 +168,14 @@ in
|
||||||
"application/x-extension-rss" = [ "thunderbird.desktop" ];
|
"application/x-extension-rss" = [ "thunderbird.desktop" ];
|
||||||
|
|
||||||
# Default web browser stuff
|
# Default web browser stuff
|
||||||
"text/html" = [ cfg.defaults.webBrowser ];
|
"text/html" = [ (desktopFileOf cfg.defaults.webBrowser) ];
|
||||||
"x-scheme-handler/about" = [ cfg.defaults.webBrowser ];
|
"x-scheme-handler/about" = [ (desktopFileOf cfg.defaults.webBrowser) ];
|
||||||
"x-scheme-handler/unknown" = [ cfg.defaults.webBrowser ];
|
"x-scheme-handler/unknown" = [ (desktopFileOf cfg.defaults.webBrowser) ];
|
||||||
"x-scheme-handler/http" = [ cfg.defaults.webBrowser ];
|
"x-scheme-handler/http" = [ (desktopFileOf cfg.defaults.webBrowser) ];
|
||||||
"x-scheme-handler/https" = [ cfg.defaults.webBrowser ];
|
"x-scheme-handler/https" = [ (desktopFileOf cfg.defaults.webBrowser) ];
|
||||||
"x-scheme-handler/ftp" = [ cfg.defaults.webBrowser ];
|
"x-scheme-handler/ftp" = [ (desktopFileOf cfg.defaults.webBrowser) ];
|
||||||
"x-scheme-handler/ftps" = [ cfg.defaults.webBrowser ];
|
"x-scheme-handler/ftps" = [ (desktopFileOf cfg.defaults.webBrowser) ];
|
||||||
"x-scheme-handler/file" = [ cfg.defaults.webBrowser ];
|
"x-scheme-handler/file" = [ (desktopFileOf cfg.defaults.webBrowser) ];
|
||||||
|
|
||||||
# Torrent
|
# Torrent
|
||||||
"application/x-bittorrent" = [ "deluge.desktop" ];
|
"application/x-bittorrent" = [ "deluge.desktop" ];
|
||||||
|
|
|
@ -11,7 +11,7 @@ let
|
||||||
style = ./swaync.css;
|
style = ./swaync.css;
|
||||||
};
|
};
|
||||||
systemd.user.services.swaync.Install.WantedBy = lib.mkForce [ "sway-session.target" ];
|
systemd.user.services.swaync.Install.WantedBy = lib.mkForce [ "sway-session.target" ];
|
||||||
systemd.user.services.swaync.Unit.PartOf = lib.mkForce [ "sway-session.target" ];
|
systemd.user.services.swaync.Unit.PartOf = lib.mkForce [ "graphical-session.target" ];
|
||||||
|
|
||||||
programs.my-waybar = {
|
programs.my-waybar = {
|
||||||
extraSettings = [{
|
extraSettings = [{
|
||||||
|
@ -119,9 +119,6 @@ with lib;
|
||||||
|
|
||||||
# settings.experimental.per_monitor_dpi = "true";
|
# settings.experimental.per_monitor_dpi = "true";
|
||||||
# };
|
# };
|
||||||
|
|
||||||
# Forward wallpaper settings to sway
|
|
||||||
programs.my-sway.wallpaper = config.linux.graphical.wallpaper;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,32 +5,41 @@ let
|
||||||
# Internal
|
# Internal
|
||||||
"framework" = {
|
"framework" = {
|
||||||
name = "BOE 0x0BCA Unknown";
|
name = "BOE 0x0BCA Unknown";
|
||||||
mode = "2256x1504@60Hz";
|
meta.mode = { width = 2256; height = 1504; refresh = 60.0; };
|
||||||
scale = 1.25;
|
scale = 1.25;
|
||||||
};
|
};
|
||||||
# External
|
# External
|
||||||
## Work @ EPFL
|
## Work @ EPFL
|
||||||
"work" = {
|
"work" = {
|
||||||
name = "LG Electronics LG ULTRAFINE 301MAXSGHD10";
|
name = "LG Electronics LG ULTRAFINE 301MAXSGHD10";
|
||||||
mode = "3840x2160@60Hz";
|
meta.mode = { width = 3840; height = 2160; refresh = 60.0; };
|
||||||
scale = 1.25;
|
scale = 1.25;
|
||||||
};
|
};
|
||||||
"home_4k" = {
|
"home_4k" = {
|
||||||
name = "AOC U28G2G6B PPYP2JA000013";
|
name = "AOC U28G2G6B PPYP2JA000013";
|
||||||
mode = "3840x2160@60Hz";
|
|
||||||
scale = 1.5;
|
scale = 1.5;
|
||||||
adaptive_sync = "on";
|
adaptive_sync = "on";
|
||||||
# render_bit_depth = "10";
|
meta = {
|
||||||
|
connection = "DP-2";
|
||||||
|
mode = { width = 3840; height = 2160; refresh = 60.0; };
|
||||||
|
fixedPosition = { x = 0; y = 0; };
|
||||||
|
niriName = "PNP(AOC) U28G2G6B PPYP2JA000013";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
"home_1440" = {
|
"home_1440" = {
|
||||||
name = "AOC Q27G2G3R3B VXJP6HA000442";
|
name = "AOC Q27G2G3R3B VXJP6HA000442";
|
||||||
mode = "2560x1440@165Hz";
|
|
||||||
adaptive_sync = "on";
|
adaptive_sync = "on";
|
||||||
|
meta = {
|
||||||
|
connection = "DP-3";
|
||||||
|
mode = { width = 2560; height = 1440; refresh = 165.0; };
|
||||||
|
fixedPosition = { x = 2560; y = 0; };
|
||||||
|
niriName = "PNP(AOC) Q27G2G3R3B VXJP6HA000442";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
"viewsonic_1080" = {
|
"viewsonic_1080" = {
|
||||||
name = "ViewSonic Corporation XG2402 SERIES V4K182501054";
|
name = "ViewSonic Corporation XG2402 SERIES V4K182501054";
|
||||||
mode = "1920x1080@144Hz";
|
meta.mode = { width = 1920; height = 1080; refresh = 144.0; };
|
||||||
adaptive_sync = "on";
|
adaptive_sync = "on";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -38,9 +47,13 @@ let
|
||||||
|
|
||||||
eachMonitor = _name: monitor: {
|
eachMonitor = _name: monitor: {
|
||||||
name = monitor.name;
|
name = monitor.name;
|
||||||
value = builtins.removeAttrs monitor [ "scale" "name" ] // (if monitor ? scale then {
|
value = builtins.removeAttrs monitor [ "scale" "name" "meta" ] // (lib.optionalAttrs (monitor ? scale) {
|
||||||
scale = toString monitor.scale;
|
scale = toString monitor.scale;
|
||||||
} else { });
|
}) // {
|
||||||
|
mode = with monitor.meta.mode; "${toString width}x${toString height}@${toString refresh}Hz";
|
||||||
|
} // (lib.optionalAttrs (monitor.meta ? fixedPosition) {
|
||||||
|
position = with monitor.meta.fixedPosition; "${toString x} ${toString y}";
|
||||||
|
});
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
|
@ -19,6 +19,11 @@ with lib;
|
||||||
|
|
||||||
options.nki.programs.kitty = {
|
options.nki.programs.kitty = {
|
||||||
enable = mkEnableOption "Enable kitty";
|
enable = mkEnableOption "Enable kitty";
|
||||||
|
setDefault = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
description = "Set kitty as default terminal";
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
|
@ -51,6 +56,10 @@ with lib;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
config.linux.graphical = mkIf (cfg.enable && cfg.setDefault) {
|
||||||
|
defaults.terminal.package = cfg.package;
|
||||||
|
};
|
||||||
|
|
||||||
config.programs.kitty = mkIf cfg.enable {
|
config.programs.kitty = mkIf cfg.enable {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
|
@ -65,7 +74,7 @@ with lib;
|
||||||
# Background color and transparency
|
# Background color and transparency
|
||||||
background =
|
background =
|
||||||
if isNull cfg.background then {
|
if isNull cfg.background then {
|
||||||
background_opacity = "0.85";
|
background_opacity = "0.93";
|
||||||
dynamic_background_opacity = true;
|
dynamic_background_opacity = true;
|
||||||
} else {
|
} else {
|
||||||
background_image = "${cfg.background}";
|
background_image = "${cfg.background}";
|
||||||
|
|
328
home/modules/programs/my-niri.nix
Normal file
328
home/modules/programs/my-niri.nix
Normal file
|
@ -0,0 +1,328 @@
|
||||||
|
{ config, osConfig, lib, pkgs, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.programs.my-niri;
|
||||||
|
|
||||||
|
sh = config.lib.niri.actions.spawn "sh" "-c";
|
||||||
|
playerctl = lib.getExe pkgs.playerctl;
|
||||||
|
amixer = lib.getExe' pkgs.alsa-utils "amixer";
|
||||||
|
brightnessctl = lib.getExe pkgs.brightnessctl;
|
||||||
|
app-menu = "${pkgs.dmenu}/bin/dmenu_path | ${pkgs.bemenu}/bin/bemenu | ${pkgs.findutils}/bin/xargs swaymsg exec --";
|
||||||
|
|
||||||
|
wallpaper = config.linux.graphical.wallpaper;
|
||||||
|
|
||||||
|
workspaces = {
|
||||||
|
"01" = { name = "🌏 web"; };
|
||||||
|
"02" = { name = "💬 chat"; };
|
||||||
|
"03" = { name = "⚙️ code"; };
|
||||||
|
"04" = { name = "🎶 music"; };
|
||||||
|
"05" = { name = "🔧 extra"; };
|
||||||
|
"06" = { name = "🧰 6"; };
|
||||||
|
"07" = { name = "🔩 7"; };
|
||||||
|
"08" = { name = "🛠️ 8"; };
|
||||||
|
"09" = { name = "🔨 9"; };
|
||||||
|
"10" = { name = "🎲 misc"; };
|
||||||
|
"99" = { name = "📧 Email"; };
|
||||||
|
};
|
||||||
|
|
||||||
|
xwayland-display = ":12";
|
||||||
|
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.programs.my-niri = {
|
||||||
|
enable = lib.mkEnableOption "My own niri configuration";
|
||||||
|
|
||||||
|
enableLaptop = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Enable laptop options";
|
||||||
|
};
|
||||||
|
|
||||||
|
lock-command = lib.mkOption {
|
||||||
|
type = lib.types.listOf lib.types.str;
|
||||||
|
description = "The command to lock the screen";
|
||||||
|
default = [ "${pkgs.swaylock}/bin/swaylock" ]
|
||||||
|
++ (if wallpaper == "" then [ "" ] else [ "-i" "${wallpaper}" "-s" "fill" ])
|
||||||
|
++ [ "-l" "-k" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
programs.niri.settings = {
|
||||||
|
environment = {
|
||||||
|
QT_QPA_PLATFORM = "wayland";
|
||||||
|
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
|
||||||
|
QT_IM_MODULE = "fcitx";
|
||||||
|
GTK_IM_MODULE = "fcitx"; # Til text-input is merged
|
||||||
|
# export NIXOS_OZONE_WL=1 # Until text-input is merged
|
||||||
|
DISPLAY = xwayland-display;
|
||||||
|
} // lib.optionalAttrs osConfig.services.desktopManager.plasma6.enable {
|
||||||
|
XDG_MENU_PREFIX = "plasma-";
|
||||||
|
};
|
||||||
|
input.keyboard.xkb = { layout = "jp"; };
|
||||||
|
input.touchpad = lib.mkIf cfg.enableLaptop {
|
||||||
|
tap = true;
|
||||||
|
dwt = true;
|
||||||
|
natural-scroll = true;
|
||||||
|
middle-emulation = true;
|
||||||
|
};
|
||||||
|
input.mouse = {
|
||||||
|
accel-profile = "flat";
|
||||||
|
};
|
||||||
|
input.warp-mouse-to-focus = true;
|
||||||
|
input.focus-follows-mouse = {
|
||||||
|
enable = true;
|
||||||
|
max-scroll-amount = "0%";
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs =
|
||||||
|
let
|
||||||
|
eachMonitor = _: monitor: {
|
||||||
|
name = monitor.meta.niriName or monitor.name; # Niri might not find the monitor by name
|
||||||
|
value = {
|
||||||
|
mode = monitor.meta.mode;
|
||||||
|
position = monitor.meta.fixedPosition or null;
|
||||||
|
scale = monitor.scale or 1;
|
||||||
|
variable-refresh-rate = (monitor.adaptive_sync or "off") == "on";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in
|
||||||
|
lib.mapAttrs' eachMonitor config.common.monitors;
|
||||||
|
|
||||||
|
spawn-at-startup = [
|
||||||
|
# Wallpaper
|
||||||
|
{ command = [ (lib.getExe pkgs.swaybg) "-i" "${wallpaper}" "-m" "fill" ]; }
|
||||||
|
# IME
|
||||||
|
{ command = [ "fcitx5" ]; }
|
||||||
|
# XWayland
|
||||||
|
{ command = [ (lib.getExe pkgs.xwayland-satellite) xwayland-display ]; }
|
||||||
|
# Waybar
|
||||||
|
{ command = [ "systemctl" "--user" "start" "swaync.service" ]; }
|
||||||
|
{ command = [ "systemctl" "--user" "start" "xdg-desktop-portal-gtk.service" "xdg-desktop-portal.service" ]; }
|
||||||
|
{ command = [ "systemctl" "--user" "reset-failed" "waybar.service" "wlsunset.service" ]; }
|
||||||
|
# Startup
|
||||||
|
{ command = [ (lib.getExe pkgs.dex) "-ae" "niri" ]; }
|
||||||
|
];
|
||||||
|
|
||||||
|
layout = {
|
||||||
|
gaps = 16;
|
||||||
|
preset-column-widths = [
|
||||||
|
{ proportion = 1. / 3.; }
|
||||||
|
{ proportion = 1. / 2.; }
|
||||||
|
{ proportion = 2. / 3.; }
|
||||||
|
];
|
||||||
|
default-column-width.proportion = 1. / 2.;
|
||||||
|
|
||||||
|
focus-ring = {
|
||||||
|
width = 4;
|
||||||
|
active.gradient = { from = "#00447AFF"; to = "#71C4FFAA"; angle = 45; };
|
||||||
|
inactive.color = "#505050";
|
||||||
|
};
|
||||||
|
border.enable = false;
|
||||||
|
struts = let v = 8; in { left = v; right = v; bottom = v; top = v; };
|
||||||
|
};
|
||||||
|
|
||||||
|
prefer-no-csd = true;
|
||||||
|
|
||||||
|
inherit workspaces;
|
||||||
|
|
||||||
|
window-rules = [
|
||||||
|
# Rounded Corners
|
||||||
|
{
|
||||||
|
geometry-corner-radius = let v = 8.0; in { bottom-left = v; bottom-right = v; top-left = v; top-right = v; };
|
||||||
|
clip-to-geometry = true;
|
||||||
|
}
|
||||||
|
# Workspace assignments
|
||||||
|
{
|
||||||
|
open-on-workspace = workspaces."01".name;
|
||||||
|
open-maximized = true;
|
||||||
|
matches = [
|
||||||
|
{ at-startup = true; app-id = "^firefox$"; }
|
||||||
|
{ at-startup = true; app-id = "^librewolf$"; }
|
||||||
|
{ at-startup = true; app-id = "^zen$"; }
|
||||||
|
];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
open-on-workspace = workspaces."02".name;
|
||||||
|
open-maximized = true;
|
||||||
|
matches = [
|
||||||
|
{ title = "^((d|D)iscord|((A|a)rm(c|C)ord))$"; }
|
||||||
|
{ title = "VencordDesktop"; }
|
||||||
|
{ app-id = "VencordDesktop"; }
|
||||||
|
{ title = "vesktop"; }
|
||||||
|
{ app-id = "vesktop"; }
|
||||||
|
|
||||||
|
{ title = "Slack"; }
|
||||||
|
];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
open-on-workspace = workspaces."99".name;
|
||||||
|
open-maximized = true;
|
||||||
|
matches = [
|
||||||
|
{ app-id = "thunderbird"; }
|
||||||
|
{ app-id = "evolution"; }
|
||||||
|
];
|
||||||
|
}
|
||||||
|
# Floating
|
||||||
|
{
|
||||||
|
open-floating = true;
|
||||||
|
matches = [
|
||||||
|
{ app-id = ".*float.*"; }
|
||||||
|
{ app-id = "org\\.freedesktop\\.impl\\.portal\\.desktop\\..*"; }
|
||||||
|
{ title = ".*float.*"; }
|
||||||
|
{ title = "Extension: .*Bitwarden.*"; }
|
||||||
|
{ app-id = "Rofi"; }
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
# Kitty dimming
|
||||||
|
{
|
||||||
|
matches = [{ app-id = "kitty"; }];
|
||||||
|
excludes = [{ is-focused = true; }];
|
||||||
|
opacity = 0.95;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
layer-rules = [
|
||||||
|
{
|
||||||
|
matches = [{ namespace = "^swaync-.*"; }];
|
||||||
|
block-out-from = "screen-capture";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
binds = with config.lib.niri.actions; {
|
||||||
|
# Mod-Shift-/, which is usually the same as Mod-?,
|
||||||
|
# shows a list of important hotkeys.
|
||||||
|
"Mod+Shift+Slash".action = show-hotkey-overlay;
|
||||||
|
|
||||||
|
# Some basic spawns
|
||||||
|
"Mod+Return".action = spawn (lib.getExe config.linux.graphical.defaults.terminal.package);
|
||||||
|
"Mod+Space".action = spawn (lib.getExe pkgs.rofi) "-show" "drun";
|
||||||
|
"Mod+R".action = sh app-menu;
|
||||||
|
"Mod+Semicolon".action = spawn cfg.lock-command;
|
||||||
|
|
||||||
|
# Audio and Volume
|
||||||
|
"XF86AudioPrev" = { action = spawn playerctl "previous"; allow-when-locked = true; };
|
||||||
|
"XF86AudioPlay" = { action = spawn playerctl "play-pause"; allow-when-locked = true; };
|
||||||
|
"Shift+XF86AudioPlay" = { action = spawn playerctl "stop"; allow-when-locked = true; };
|
||||||
|
"XF86AudioNext" = { action = spawn playerctl "next"; allow-when-locked = true; };
|
||||||
|
"XF86AudioRecord" = { action = spawn amixer "-q" "set" "Capture" "toggle"; allow-when-locked = true; };
|
||||||
|
"XF86AudioMute" = { action = spawn amixer "-q" "set" "Master" "toggle"; allow-when-locked = true; };
|
||||||
|
"XF86AudioLowerVolume" = { action = spawn amixer "-q" "set" "Master" "3%-"; allow-when-locked = true; };
|
||||||
|
"XF86AudioRaiseVolume" = { action = spawn amixer "-q" "set" "Master" "3%+"; allow-when-locked = true; };
|
||||||
|
|
||||||
|
# Backlight
|
||||||
|
"XF86MonBrightnessDown".action = spawn brightnessctl "s" "10%-";
|
||||||
|
"XF86MonBrightnessUp".action = spawn brightnessctl "s" "10%+";
|
||||||
|
"Shift+XF86MonBrightnessDown".action = spawn brightnessctl "-d" "kbd_backlight" "s" "25%-";
|
||||||
|
"Shift+XF86MonBrightnessUp".action = spawn brightnessctl "-d" "kbd_backlight" "s" "25%+";
|
||||||
|
|
||||||
|
"Mod+Shift+Q".action = close-window;
|
||||||
|
|
||||||
|
"Mod+Left".action = focus-column-or-monitor-left;
|
||||||
|
"Mod+Right".action = focus-column-or-monitor-right;
|
||||||
|
"Mod+Up".action = focus-window-or-workspace-up;
|
||||||
|
"Mod+Down".action = focus-window-or-workspace-down;
|
||||||
|
"Mod+H".action = focus-column-or-monitor-left;
|
||||||
|
"Mod+L".action = focus-column-or-monitor-right;
|
||||||
|
"Mod+K".action = focus-window-or-workspace-up;
|
||||||
|
"Mod+J".action = focus-window-or-workspace-down;
|
||||||
|
|
||||||
|
"Mod+Shift+Left".action = move-column-left-or-to-monitor-left;
|
||||||
|
"Mod+Shift+Right".action = move-column-right-or-to-monitor-right;
|
||||||
|
"Mod+Shift+Up".action = move-window-up-or-to-workspace-up;
|
||||||
|
"Mod+Shift+Down".action = move-window-down-or-to-workspace-down;
|
||||||
|
"Mod+Shift+H".action = move-column-left-or-to-monitor-left;
|
||||||
|
"Mod+Shift+L".action = move-column-right-or-to-monitor-right;
|
||||||
|
"Mod+Shift+K".action = move-window-up-or-to-workspace-up;
|
||||||
|
"Mod+Shift+J".action = move-window-down-or-to-workspace-down;
|
||||||
|
|
||||||
|
"Mod+Bracketleft".action = focus-column-first;
|
||||||
|
"Mod+Bracketright".action = focus-column-last;
|
||||||
|
"Mod+Shift+Bracketleft".action = move-column-to-first;
|
||||||
|
"Mod+Shift+Bracketright".action = move-column-to-last;
|
||||||
|
|
||||||
|
# For compat with my current sway
|
||||||
|
"Mod+Ctrl+H".action = move-workspace-to-monitor-left;
|
||||||
|
"Mod+Ctrl+L".action = move-workspace-to-monitor-right;
|
||||||
|
|
||||||
|
"Mod+I".action = focus-workspace-down;
|
||||||
|
"Mod+O".action = focus-workspace-up;
|
||||||
|
"Mod+Shift+I".action = move-column-to-workspace-down;
|
||||||
|
"Mod+Shift+O".action = move-column-to-workspace-up;
|
||||||
|
"Mod+Ctrl+I".action = move-workspace-down;
|
||||||
|
"Mod+Ctrl+O".action = move-workspace-up;
|
||||||
|
|
||||||
|
# Mouse bindings
|
||||||
|
"Mod+WheelScrollDown" = { action = focus-workspace-down; cooldown-ms = 150; };
|
||||||
|
"Mod+WheelScrollUp" = { action = focus-workspace-up; cooldown-ms = 150; };
|
||||||
|
"Mod+Ctrl+WheelScrollDown" = { action = move-column-to-workspace-down; cooldown-ms = 150; };
|
||||||
|
"Mod+Ctrl+WheelScrollUp" = { action = move-column-to-workspace-up; cooldown-ms = 150; };
|
||||||
|
|
||||||
|
"Mod+WheelScrollRight".action = focus-column-right;
|
||||||
|
"Mod+WheelScrollLeft".action = focus-column-left;
|
||||||
|
"Mod+Ctrl+WheelScrollRight".action = move-column-right;
|
||||||
|
"Mod+Ctrl+WheelScrollLeft".action = move-column-left;
|
||||||
|
|
||||||
|
# You can refer to workspaces by index. However, keep in mind that
|
||||||
|
# niri is a dynamic workspace system, so these commands are kind of
|
||||||
|
# "best effort". Trying to refer to a workspace index bigger than
|
||||||
|
# the current workspace count will instead refer to the bottommost
|
||||||
|
# (empty) workspace.
|
||||||
|
#
|
||||||
|
# For example, with 2 workspaces + 1 empty, indices 3, 4, 5 and so on
|
||||||
|
# will all refer to the 3rd workspace.
|
||||||
|
"Mod+1".action = focus-workspace (workspaces."01".name);
|
||||||
|
"Mod+2".action = focus-workspace (workspaces."02".name);
|
||||||
|
"Mod+3".action = focus-workspace (workspaces."03".name);
|
||||||
|
"Mod+4".action = focus-workspace (workspaces."04".name);
|
||||||
|
"Mod+5".action = focus-workspace (workspaces."05".name);
|
||||||
|
"Mod+6".action = focus-workspace (workspaces."06".name);
|
||||||
|
"Mod+7".action = focus-workspace (workspaces."07".name);
|
||||||
|
"Mod+8".action = focus-workspace (workspaces."08".name);
|
||||||
|
"Mod+9".action = focus-workspace (workspaces."09".name);
|
||||||
|
"Mod+0".action = focus-workspace (workspaces."10".name);
|
||||||
|
"Mod+Shift+1".action = move-column-to-workspace (workspaces."01".name);
|
||||||
|
"Mod+Shift+2".action = move-column-to-workspace (workspaces."02".name);
|
||||||
|
"Mod+Shift+3".action = move-column-to-workspace (workspaces."03".name);
|
||||||
|
"Mod+Shift+4".action = move-column-to-workspace (workspaces."04".name);
|
||||||
|
"Mod+Shift+5".action = move-column-to-workspace (workspaces."05".name);
|
||||||
|
"Mod+Shift+6".action = move-column-to-workspace (workspaces."06".name);
|
||||||
|
"Mod+Shift+7".action = move-column-to-workspace (workspaces."07".name);
|
||||||
|
"Mod+Shift+8".action = move-column-to-workspace (workspaces."08".name);
|
||||||
|
"Mod+Shift+9".action = move-column-to-workspace (workspaces."09".name);
|
||||||
|
"Mod+Shift+0".action = move-column-to-workspace (workspaces."10".name);
|
||||||
|
|
||||||
|
"Mod+asciicircum".action = focus-workspace (workspaces."99".name);
|
||||||
|
"Mod+Shift+asciicircum".action = move-column-to-workspace (workspaces."99".name);
|
||||||
|
|
||||||
|
"Mod+Tab".action = focus-workspace-previous;
|
||||||
|
|
||||||
|
"Mod+Comma".action = consume-or-expel-window-left;
|
||||||
|
"Mod+Period".action = consume-or-expel-window-right;
|
||||||
|
|
||||||
|
"Mod+W".action = switch-preset-column-width;
|
||||||
|
"Mod+Shift+W".action = switch-preset-window-height;
|
||||||
|
"Mod+Ctrl+W".action = reset-window-height;
|
||||||
|
"Mod+F".action = maximize-column;
|
||||||
|
"Mod+Shift+F".action = fullscreen-window;
|
||||||
|
"Mod+E".action = center-column;
|
||||||
|
|
||||||
|
"Mod+Minus".action = set-column-width "-10%";
|
||||||
|
"Mod+At".action = set-column-width "+10%";
|
||||||
|
"Mod+Shift+Minus".action = set-window-height "-10%";
|
||||||
|
"Mod+Shift+At".action = set-window-height "+10%";
|
||||||
|
|
||||||
|
"Mod+V".action = switch-focus-between-floating-and-tiling;
|
||||||
|
"Mod+Shift+V".action = toggle-window-floating;
|
||||||
|
"Mod+Shift+Space".action = toggle-window-floating; # Sway compat
|
||||||
|
|
||||||
|
"Print".action = screenshot;
|
||||||
|
"Ctrl+Print".action = screenshot-screen;
|
||||||
|
"Shift+Print".action = screenshot-window;
|
||||||
|
|
||||||
|
"Mod+Shift+E".action = quit;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
|
@ -63,17 +63,17 @@ in
|
||||||
wallpaper = mkOption {
|
wallpaper = mkOption {
|
||||||
type = types.oneOf [ types.path types.str ];
|
type = types.oneOf [ types.path types.str ];
|
||||||
description = "Path to the wallpaper to be used";
|
description = "Path to the wallpaper to be used";
|
||||||
default = "";
|
default = config.linux.graphical.wallpaper;
|
||||||
};
|
};
|
||||||
terminal = mkOption {
|
terminal = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
description = "The command to the terminal emulator to be used";
|
description = "The command to the terminal emulator to be used";
|
||||||
default = "${config.programs.kitty.package}/bin/kitty";
|
default = lib.getExe config.linux.graphical.defaults.terminal.package;
|
||||||
};
|
};
|
||||||
browser = mkOption {
|
browser = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
description = "The command for the browser";
|
description = "The command for the browser";
|
||||||
default = "${pkgs.firefox-wayland}/bin/firefox";
|
default = lib.getExe config.linux.graphical.defaults.webBrowser.package;
|
||||||
};
|
};
|
||||||
|
|
||||||
enableLaptop = lib.mkOption {
|
enableLaptop = lib.mkOption {
|
||||||
|
@ -276,6 +276,7 @@ in
|
||||||
"${builtins.elemAt workspaces 0}" = [
|
"${builtins.elemAt workspaces 0}" = [
|
||||||
{ app_id = "^firefox$"; }
|
{ app_id = "^firefox$"; }
|
||||||
{ app_id = "^librewolf$"; }
|
{ app_id = "^librewolf$"; }
|
||||||
|
{ app_id = "^zen$"; }
|
||||||
];
|
];
|
||||||
"${builtins.elemAt workspaces 1}" = [
|
"${builtins.elemAt workspaces 1}" = [
|
||||||
{ class = "^((d|D)iscord|((A|a)rm(c|C)ord))$"; }
|
{ class = "^((d|D)iscord|((A|a)rm(c|C)ord))$"; }
|
||||||
|
|
|
@ -45,11 +45,14 @@ in
|
||||||
config.programs.waybar =
|
config.programs.waybar =
|
||||||
let
|
let
|
||||||
barWith = { showMedia ? true, showConnectivity ? true, extraSettings ? { }, ... }: lib.mkMerge ([{
|
barWith = { showMedia ? true, showConnectivity ? true, extraSettings ? { }, ... }: lib.mkMerge ([{
|
||||||
|
layer = "top";
|
||||||
position = "top";
|
position = "top";
|
||||||
modules-left = [
|
modules-left = [
|
||||||
"sway/workspaces"
|
"sway/workspaces"
|
||||||
"sway/mode"
|
"sway/mode"
|
||||||
"sway/window"
|
"sway/window"
|
||||||
|
"niri/workspaces"
|
||||||
|
"niri/window"
|
||||||
];
|
];
|
||||||
modules-center = [
|
modules-center = [
|
||||||
];
|
];
|
||||||
|
@ -91,6 +94,19 @@ in
|
||||||
"\\((\\d+)\\) Discord \\| (.*)" = "[🗨️] {$1} $2";
|
"\\((\\d+)\\) Discord \\| (.*)" = "[🗨️] {$1} $2";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
"niri/window" = {
|
||||||
|
format = "{title}";
|
||||||
|
"rewrite" = {
|
||||||
|
"(.*) — Mozilla Firefox" = "[🌎] $1";
|
||||||
|
"(.*) - Mozilla Thunderbird" = "[📧] $1";
|
||||||
|
"(.*) - Kakoune" = "[⌨️] $1";
|
||||||
|
"(.*) - fish" = "[>_] $1";
|
||||||
|
"(.*) - Discord" = "[🗨️] $1";
|
||||||
|
# ArmCord thing
|
||||||
|
"• Discord \\| (.*)" = "[🗨️] $1";
|
||||||
|
"\\((\\d+)\\) Discord \\| (.*)" = "[🗨️] {$1} $2";
|
||||||
|
};
|
||||||
|
};
|
||||||
"tray" = {
|
"tray" = {
|
||||||
icon-size = 21;
|
icon-size = 21;
|
||||||
spacing = 10;
|
spacing = 10;
|
||||||
|
@ -240,7 +256,7 @@ in
|
||||||
lib.mkIf cfg.enable {
|
lib.mkIf cfg.enable {
|
||||||
enable = true;
|
enable = true;
|
||||||
systemd.enable = true;
|
systemd.enable = true;
|
||||||
systemd.target = "sway-session.target";
|
systemd.target = "graphical-session.target";
|
||||||
settings = cfg.makeBars barWith;
|
settings = cfg.makeBars barWith;
|
||||||
style = ''
|
style = ''
|
||||||
* {
|
* {
|
||||||
|
|
|
@ -29,12 +29,10 @@
|
||||||
# Graphical set up
|
# Graphical set up
|
||||||
linux.graphical.type = "wayland";
|
linux.graphical.type = "wayland";
|
||||||
linux.graphical.wallpaper = ./images/wallpaper_0.png;
|
linux.graphical.wallpaper = ./images/wallpaper_0.png;
|
||||||
linux.graphical.defaults.webBrowser = "librewolf.desktop";
|
linux.graphical.defaults.webBrowser.package = pkgs.librewolf;
|
||||||
# Enable sway
|
# Enable sway
|
||||||
programs.my-sway.enable = true;
|
programs.my-sway.enable = true;
|
||||||
programs.my-sway.fontSize = 14.0;
|
programs.my-sway.fontSize = 14.0;
|
||||||
programs.my-sway.terminal = "${config.programs.kitty.package}/bin/kitty";
|
|
||||||
programs.my-sway.browser = "librewolf";
|
|
||||||
wayland.windowManager.sway.config = {
|
wayland.windowManager.sway.config = {
|
||||||
# Keyboard support
|
# Keyboard support
|
||||||
input."*".xkb_layout = "jp";
|
input."*".xkb_layout = "jp";
|
||||||
|
|
|
@ -30,12 +30,11 @@
|
||||||
linux.graphical.type = "wayland";
|
linux.graphical.type = "wayland";
|
||||||
linux.graphical.wallpaper = ./images/wallpaper_0.png;
|
linux.graphical.wallpaper = ./images/wallpaper_0.png;
|
||||||
linux.graphical.startup = with pkgs; [ zen-browser-bin thunderbird vesktop slack ];
|
linux.graphical.startup = with pkgs; [ zen-browser-bin thunderbird vesktop slack ];
|
||||||
linux.graphical.defaults.webBrowser = "zen.desktop";
|
linux.graphical.defaults.webBrowser.package = pkgs.zen-browser-bin;
|
||||||
|
linux.graphical.defaults.webBrowser.desktopFile = "zen.desktop";
|
||||||
# Enable sway
|
# Enable sway
|
||||||
programs.my-sway.enable = true;
|
programs.my-sway.enable = true;
|
||||||
programs.my-sway.fontSize = 14.0;
|
programs.my-sway.fontSize = 14.0;
|
||||||
programs.my-sway.terminal = "${config.programs.kitty.package}/bin/kitty";
|
|
||||||
programs.my-sway.browser = "librewolf";
|
|
||||||
wayland.windowManager.sway.config = {
|
wayland.windowManager.sway.config = {
|
||||||
# Keyboard support
|
# Keyboard support
|
||||||
input."*".xkb_layout = "jp";
|
input."*".xkb_layout = "jp";
|
||||||
|
|
|
@ -45,12 +45,31 @@ let
|
||||||
# services.gnome.evolution-data-server.plugins = with pkgs; [ evolution-ews ];
|
# services.gnome.evolution-data-server.plugins = with pkgs; [ evolution-ews ];
|
||||||
};
|
};
|
||||||
|
|
||||||
wlr = { ... }: mkIf config.common.linux.enable {
|
wlr = { lib, config, ... }: mkIf config.common.linux.enable {
|
||||||
# swaync disable notifications on screencast
|
# swaync disable notifications on screencast
|
||||||
xdg.portal.wlr.settings.screencast = {
|
xdg.portal.wlr.settings.screencast = {
|
||||||
exec_before = ''which swaync-client && swaync-client --inhibitor-add "xdg-desktop-portal-wlr" || true'';
|
exec_before = ''which swaync-client && swaync-client --inhibitor-add "xdg-desktop-portal-wlr" || true'';
|
||||||
exec_after = ''which swaync-client && swaync-client --inhibitor-remove "xdg-desktop-portal-wlr" || true'';
|
exec_after = ''which swaync-client && swaync-client --inhibitor-remove "xdg-desktop-portal-wlr" || true'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Niri stuff
|
||||||
|
# https://github.com/sodiboo/niri-flake/blob/main/docs.md
|
||||||
|
programs.niri.enable = true;
|
||||||
|
programs.niri.package = pkgs.niri-stable;
|
||||||
|
systemd.user.services.niri = {
|
||||||
|
description = "A scrollable-tiling Wayland compositor";
|
||||||
|
bindsTo = [ "graphical-session.target" ];
|
||||||
|
before = [ "graphical-session.target" ];
|
||||||
|
wants = [ "graphical-session-pre.target" ];
|
||||||
|
after = [ "graphical-session-pre.target" ];
|
||||||
|
|
||||||
|
serviceConfig.Slice = "session.slice";
|
||||||
|
serviceConfig.Type = "notify";
|
||||||
|
serviceConfig.ExecStart = "${lib.getExe config.programs.niri.package} --session";
|
||||||
|
path = mkForce [ ];
|
||||||
|
};
|
||||||
|
# Override gnome-keyring disabling
|
||||||
|
services.gnome.gnome-keyring.enable = lib.mkForce false;
|
||||||
};
|
};
|
||||||
|
|
||||||
logitech = { pkgs, ... }: mkIf cfg.enable {
|
logitech = { pkgs, ... }: mkIf cfg.enable {
|
||||||
|
@ -343,6 +362,13 @@ in
|
||||||
extraPortals = [ pkgs.kdePackages.xdg-desktop-portal-kde pkgs.xdg-desktop-portal-gtk ];
|
extraPortals = [ pkgs.kdePackages.xdg-desktop-portal-kde pkgs.xdg-desktop-portal-gtk ];
|
||||||
|
|
||||||
config.sway.default = [ "wlr" "kde" "kwallet" ];
|
config.sway.default = [ "wlr" "kde" "kwallet" ];
|
||||||
|
config.niri = {
|
||||||
|
default = [ "gnome" "gtk" ];
|
||||||
|
"org.freedesktop.impl.portal.Access" = "gtk";
|
||||||
|
"org.freedesktop.impl.portal.Notification" = "gtk";
|
||||||
|
"org.freedesktop.impl.portal.Secret" = "kwallet";
|
||||||
|
"org.freedesktop.impl.portal.FileChooser" = "kde";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
# D-Bus
|
# D-Bus
|
||||||
services.dbus.packages = with pkgs; [ gcr ];
|
services.dbus.packages = with pkgs; [ gcr ];
|
||||||
|
|
Loading…
Add table
Reference in a new issue