Compare commits
4 commits
2373123158
...
41b89be9f9
Author | SHA1 | Date | |
---|---|---|---|
|
41b89be9f9 | ||
|
4801641fd0 | ||
|
0cab8c378d | ||
|
66f045bb6e |
22
flake.lock
22
flake.lock
|
@ -1092,11 +1092,11 @@
|
|||
},
|
||||
"nixpkgs_10": {
|
||||
"locked": {
|
||||
"lastModified": 1734083684,
|
||||
"narHash": "sha256-5fNndbndxSx5d+C/D0p/VF32xDiJCJzyOqorOYW4JEo=",
|
||||
"lastModified": 1736916166,
|
||||
"narHash": "sha256-puPDoVKxkuNmYIGMpMQiK8bEjaACcCksolsG36gdaNQ=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "314e12ba369ccdb9b352a4db26ff419f7c49fa84",
|
||||
"rev": "e24b4c09e963677b1beea49d411cd315a024ad3a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -1250,22 +1250,6 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_9": {
|
||||
"locked": {
|
||||
"lastModified": 1723856861,
|
||||
"narHash": "sha256-OTDg91+Zzs2SpU3csK4xVdSQFoG8cK1lNUwKmTqERyE=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "cd7b95ee3725af7113bacbce91dd6549cee58ca5",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixpkgs-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_9": {
|
||||
"locked": {
|
||||
"lastModified": 1736549401,
|
||||
|
|
|
@ -8,6 +8,12 @@ let
|
|||
meta.mode = { width = 2256; height = 1504; refresh = 60.0; };
|
||||
scale = 1.25;
|
||||
};
|
||||
"yoga" = {
|
||||
name = "AU Optronics 0xD291 Unknown";
|
||||
meta.connection = "eDP-1";
|
||||
meta.mode = { width = 1920; height = 1080; refresh = 60.026; };
|
||||
scale = 1;
|
||||
};
|
||||
# External
|
||||
## Work @ EPFL
|
||||
"work" = {
|
||||
|
|
|
@ -10,20 +10,6 @@ let
|
|||
|
||||
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
|
||||
|
@ -44,9 +30,38 @@ in
|
|||
++ (if wallpaper == "" then [ "" ] else [ "-i" "${wallpaper}" "-s" "fill" ])
|
||||
++ [ "-l" "-k" ];
|
||||
};
|
||||
|
||||
workspaces = lib.mkOption {
|
||||
type = lib.types.attrsOf
|
||||
(lib.types.submodule {
|
||||
options = {
|
||||
name = lib.mkOption { type = lib.types.str; description = "workspace name"; };
|
||||
fixed = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = "whether workspace always exists";
|
||||
};
|
||||
};
|
||||
});
|
||||
description = "A mapping of ordering to workspace names, for fixed workspaces";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs.my-niri.workspaces = {
|
||||
# Default workspaces, always there
|
||||
"01" = { name = "🌏 web"; };
|
||||
"02" = { name = "💬 chat"; };
|
||||
"03" = { name = "⚙️ code"; };
|
||||
"04" = { name = "🎶 music"; };
|
||||
"05" = { name = "🔧 extra"; fixed = false; };
|
||||
"06" = { name = "🧰 6"; fixed = false; };
|
||||
"07" = { name = "🔩 7"; fixed = false; };
|
||||
"08" = { name = "🛠️ 8"; fixed = false; };
|
||||
"09" = { name = "🔨 9"; fixed = false; };
|
||||
"10" = { name = "🎲 misc"; fixed = false; };
|
||||
"99" = { name = "📧 Email"; fixed = false; };
|
||||
};
|
||||
programs.niri.settings = {
|
||||
environment = {
|
||||
QT_QPA_PLATFORM = "wayland";
|
||||
|
@ -123,7 +138,12 @@ in
|
|||
|
||||
prefer-no-csd = true;
|
||||
|
||||
inherit workspaces;
|
||||
workspaces =
|
||||
let
|
||||
fixedWorkspaces = lib.filterAttrs (_: w: w.fixed) cfg.workspaces;
|
||||
workspaceConfig = lib.mapAttrs (_: w: { inherit (w) name; }) fixedWorkspaces;
|
||||
in
|
||||
workspaceConfig;
|
||||
|
||||
window-rules = [
|
||||
# Rounded Corners
|
||||
|
@ -133,7 +153,7 @@ in
|
|||
}
|
||||
# Workspace assignments
|
||||
{
|
||||
open-on-workspace = workspaces."01".name;
|
||||
open-on-workspace = cfg.workspaces."01".name;
|
||||
open-maximized = true;
|
||||
matches = [
|
||||
{ at-startup = true; app-id = "^firefox$"; }
|
||||
|
@ -142,7 +162,7 @@ in
|
|||
];
|
||||
}
|
||||
{
|
||||
open-on-workspace = workspaces."02".name;
|
||||
open-on-workspace = cfg.workspaces."02".name;
|
||||
open-maximized = true;
|
||||
matches = [
|
||||
{ title = "^((d|D)iscord|((A|a)rm(c|C)ord))$"; }
|
||||
|
@ -155,7 +175,7 @@ in
|
|||
];
|
||||
}
|
||||
{
|
||||
open-on-workspace = workspaces."99".name;
|
||||
open-on-workspace = cfg.workspaces."99".name;
|
||||
open-maximized = true;
|
||||
matches = [
|
||||
{ app-id = "thunderbird"; }
|
||||
|
@ -271,29 +291,29 @@ in
|
|||
#
|
||||
# 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+1".action = focus-workspace (cfg.workspaces."01".name);
|
||||
"Mod+2".action = focus-workspace (cfg.workspaces."02".name);
|
||||
"Mod+3".action = focus-workspace (cfg.workspaces."03".name);
|
||||
"Mod+4".action = focus-workspace (cfg.workspaces."04".name);
|
||||
"Mod+5".action = focus-workspace (cfg.workspaces."05".name);
|
||||
"Mod+6".action = focus-workspace (cfg.workspaces."06".name);
|
||||
"Mod+7".action = focus-workspace (cfg.workspaces."07".name);
|
||||
"Mod+8".action = focus-workspace (cfg.workspaces."08".name);
|
||||
"Mod+9".action = focus-workspace (cfg.workspaces."09".name);
|
||||
"Mod+0".action = focus-workspace (cfg.workspaces."10".name);
|
||||
"Mod+Shift+1".action = move-column-to-workspace (cfg.workspaces."01".name);
|
||||
"Mod+Shift+2".action = move-column-to-workspace (cfg.workspaces."02".name);
|
||||
"Mod+Shift+3".action = move-column-to-workspace (cfg.workspaces."03".name);
|
||||
"Mod+Shift+4".action = move-column-to-workspace (cfg.workspaces."04".name);
|
||||
"Mod+Shift+5".action = move-column-to-workspace (cfg.workspaces."05".name);
|
||||
"Mod+Shift+6".action = move-column-to-workspace (cfg.workspaces."06".name);
|
||||
"Mod+Shift+7".action = move-column-to-workspace (cfg.workspaces."07".name);
|
||||
"Mod+Shift+8".action = move-column-to-workspace (cfg.workspaces."08".name);
|
||||
"Mod+Shift+9".action = move-column-to-workspace (cfg.workspaces."09".name);
|
||||
"Mod+Shift+0".action = move-column-to-workspace (cfg.workspaces."10".name);
|
||||
|
||||
"Mod+asciicircum".action = focus-workspace (workspaces."99".name);
|
||||
"Mod+Shift+asciicircum".action = move-column-to-workspace (workspaces."99".name);
|
||||
"Mod+asciicircum".action = focus-workspace (cfg.workspaces."99".name);
|
||||
"Mod+Shift+asciicircum".action = move-column-to-workspace (cfg.workspaces."99".name);
|
||||
|
||||
"Mod+Tab".action = focus-workspace-previous;
|
||||
|
||||
|
|
|
@ -1,5 +1,20 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
|
||||
let
|
||||
iio-sway = pkgs.stdenv.mkDerivation {
|
||||
name = "iio-sway";
|
||||
version = "0.0.1";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "okeri";
|
||||
repo = "iio-sway";
|
||||
rev = "e07477d1b2478fede1446e97424a94c80767819d";
|
||||
hash = "sha256-JGacKajslCOvd/BFfFSf7s1/hgF6rJqJ6H6xNnsuMb4=";
|
||||
};
|
||||
buildInputs = with pkgs; [ dbus ];
|
||||
nativeBuildInputs = with pkgs; [ meson ninja pkg-config ];
|
||||
meta.mainProgram = "iio-sway";
|
||||
};
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
# Common configuration
|
||||
|
@ -49,25 +64,23 @@
|
|||
|
||||
startup = [
|
||||
# rotation
|
||||
(
|
||||
let
|
||||
iio-sway = pkgs.stdenv.mkDerivation {
|
||||
name = "iio-sway";
|
||||
version = "0.0.1";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "okeri";
|
||||
repo = "iio-sway";
|
||||
rev = "e07477d1b2478fede1446e97424a94c80767819d";
|
||||
hash = "sha256-JGacKajslCOvd/BFfFSf7s1/hgF6rJqJ6H6xNnsuMb4=";
|
||||
};
|
||||
buildInputs = with pkgs; [ dbus ];
|
||||
nativeBuildInputs = with pkgs; [ meson ninja pkg-config ];
|
||||
};
|
||||
in
|
||||
{ command = "${iio-sway}/bin/iio-sway"; }
|
||||
)
|
||||
{ command = "${lib.getExe iio-sway}"; }
|
||||
];
|
||||
};
|
||||
programs.my-niri.enable = true;
|
||||
programs.niri.settings = {
|
||||
# input.keyboard.xkb.options = "ctrl:swapcaps";
|
||||
input.mouse = lib.mkForce {
|
||||
# Make M575 fast for now
|
||||
accel-profile = "adaptive";
|
||||
accel-speed = 0.4;
|
||||
};
|
||||
input.touch.map-to-output = "eDP-1";
|
||||
switch-events = with config.lib.niri.actions; {
|
||||
tablet-mode-on.action = spawn "systemctl" "--user" "kill" "--signal" "SIGUSR2" "wvkbd";
|
||||
tablet-mode-off.action = spawn "systemctl" "--user" "kill" "--signal" "SIGUSR1" "wvkbd";
|
||||
};
|
||||
};
|
||||
## Virtual keyboard
|
||||
systemd.user.services.wvkbd = {
|
||||
Unit = {
|
||||
|
@ -99,7 +112,7 @@
|
|||
settings = [
|
||||
{
|
||||
profile.name = "undocked";
|
||||
profile.outputs = [{ criteria = "LVDS-1"; }];
|
||||
profile.outputs = [{ criteria = "eDP-1"; }];
|
||||
}
|
||||
{
|
||||
profile.name = "work-both";
|
||||
|
|
Loading…
Reference in a new issue