1
1
Fork 0

Compare commits

..

7 commits

Author SHA1 Message Date
d20ba24b96
waybar: trim niri workspace icons
Signed-off-by: Myned <dev@bjork.tech>
2024-12-23 22:56:45 -05:00
a3fe5057d3
chore: add todo
Signed-off-by: Myned <dev@bjork.tech>
2024-12-23 22:56:25 -05:00
5b9c31a907
niri: add window rules
Signed-off-by: Myned <dev@bjork.tech>
2024-12-23 22:56:07 -05:00
21c0dafd2c
niri: modify binds
Signed-off-by: Myned <dev@bjork.tech>
2024-12-23 22:55:53 -05:00
aa6fac79c6
niri: add sway-audio-idle-inhibit
Signed-off-by: Myned <dev@bjork.tech>
2024-12-23 22:54:53 -05:00
531a09176f
hyprland: fix steam bind
Signed-off-by: Myned <dev@bjork.tech>
2024-12-23 22:54:27 -05:00
026a76aeec
desktops: disable hyprland
Signed-off-by: Myned <dev@bjork.tech>
2024-12-23 22:54:09 -05:00
7 changed files with 236 additions and 48 deletions

View file

@ -6,7 +6,7 @@
with lib; {
config.custom.desktops = mkIf config.custom.full {
#// gnome.enable = true;
hyprland.enable = true;
#// hyprland.enable = true;
#// kde.enable = true;
niri.enable = true;
#// sway.enable = true;

View file

@ -247,7 +247,7 @@ in {
(key "S" "Ctrl+Alt" "exec" "${pkill} steam")
(key "S" "Super" "togglespecialworkspace" "steam")
(key "S" "Super+Shift" "movetoworkspacesilent" "special:steam")
(key "S" "Super+Shift" "exec" steam)
(key "S" "Super+Ctrl" "exec" steam)
(key "T" "Ctrl+Alt" "exec" "${pkill} kitty")
(key "T" "Super" "togglespecialworkspace" "terminal")
(key "T" "Super+Ctrl" "exec" kitty)

View file

@ -6,45 +6,32 @@
}:
with lib; let
audio = "~/.local/bin/audio";
bash = "${pkgs.bash}/bin/bash";
cat = "${pkgs.coreutils}/bin/cat";
clipse = "${pkgs.clipse}/bin/clipse";
codium = "${config.home-manager.users.${config.custom.username}.programs.vscode.package}/bin/codium";
gnome-text-editor = "${pkgs.gnome-text-editor}/bin/gnome-text-editor";
hyprlock = "${config.home-manager.users.${config.custom.username}.programs.hyprlock.package}/bin/hyprlock";
hyprpicker = "${pkgs.hyprpicker}/bin/hyprpicker";
inhibit = config.home-manager.users.${config.custom.username}.home.file.".local/bin/inhibit".source;
jq = "${pkgs.jq}/bin/jq";
kill = "${pkgs.procps}/bin/kill";
kitty = "${config.home-manager.users.${config.custom.username}.programs.kitty.package}/bin/kitty";
left = config.home-manager.users.${config.custom.username}.home.file.".local/bin/left".source;
libreoffice = "${config.custom.programs.libreoffice.package}/bin/libreoffice";
loginctl = "${pkgs.systemd}/bin/loginctl";
menu = config.home-manager.users.${config.custom.username}.home.file.".local/bin/menu".source;
loupe = "${pkgs.loupe}/bin/loupe";
nautilus = "${pkgs.nautilus}/bin/nautilus";
networkmanager_dmenu = "${pkgs.networkmanager_dmenu}/bin/networkmanager_dmenu";
notify-send = "${pkgs.libnotify}/bin/notify-send";
niri = "${config.programs.niri.package}/bin/niri";
obsidian = "${pkgs.obsidian}/bin/obsidian";
onlyoffice-desktopeditors = "${pkgs.onlyoffice-bin}/bin/onlyoffice-desktopeditors --system-title-bar --xdg-desktop-portal";
pkill = "${pkgs.procps}/bin/pkill";
playerctl = "${pkgs.playerctl}/bin/playerctl";
power = config.home-manager.users.${config.custom.username}.home.file.".local/bin/power".source;
remote = config.home-manager.users.${config.custom.username}.home.file.".local/bin/remote".source;
rofi-rbw = "${pkgs.rofi-rbw}/bin/rofi-rbw";
rm = "${pkgs.coreutils}/bin/rm";
sleep = "${pkgs.coreutils}/bin/sleep";
smile = "${pkgs.smile}/bin/smile";
steam = "${config.programs.steam.package}/bin/steam";
swayosd-client = "${pkgs.swayosd}/bin/swayosd-client";
systemctl = "${pkgs.systemd}/bin/systemctl";
toggle = "~/.local/bin/toggle";
virt-manager = "${config.programs.virt-manager.package}/bin/virt-manager";
vrr = config.home-manager.users.${config.custom.username}.home.file.".local/bin/vrr".source;
walker = "${config.home-manager.users.${config.custom.username}.programs.walker.package}/bin/walker";
waydroid = "${pkgs.waydroid}/bin/waydroid";
window = config.home-manager.users.${config.custom.username}.home.file.".local/bin/window".source;
workspace = config.home-manager.users.${config.custom.username}.home.file.".local/bin/workspace".source;
zoom = config.home-manager.users.${config.custom.username}.home.file.".local/bin/zoom".source;
_1password = "${config.programs._1password-gui.package}/bin/1password";
youtube-music = "${pkgs.youtube-music}/bin/youtube-music";
cfg = config.custom.desktops.niri.binds;
in {
@ -68,36 +55,99 @@ in {
}${key}";
value = {inherit action;};
};
# Launch VM
vm = ''${remote} --vm --client xfreerdp --username Myned --password "$(${cat} ${config.age.secrets."desktop/vm/myndows.pass".path})" ${
if config.custom.hidpi
then "--scale 140"
else ""
} myndows'';
in
listToAttrs (with config.home-manager.users.${config.custom.username}.lib.niri.actions; [
(key "0" "Mod" (spawn [swayosd-client "--output-volume" "mute-toggle"]))
(key "1" "Ctrl+Alt" (spawn ["lifx" "state" "--brightness" "0.01"]))
(key "1" "Mod" (focus-workspace "1"))
(key "1" "Mod+Alt" (spawn ["lifx" "state" "--kelvin" "1500"]))
(key "1" "Mod+Shift" (move-column-to-workspace "1"))
(key "2" "Ctrl+Alt" (spawn ["lifx" "state" "--brightness" "0.25"]))
(key "2" "Mod" (focus-workspace "2"))
(key "2" "Mod+Alt" (spawn ["lifx" "state" "--kelvin" "2500"]))
(key "2" "Mod+Shift" (move-column-to-workspace "2"))
(key "3" "Ctrl+Alt" (spawn ["lifx" "state" "--brightness" "0.50"]))
(key "3" "Mod" (focus-workspace "3"))
(key "3" "Mod+Alt" (spawn ["lifx" "state" "--kelvin" "3000"]))
(key "3" "Mod+Shift" (move-column-to-workspace "3"))
(key "4" "Ctrl+Alt" (spawn ["lifx" "state" "--brightness" "0.75"]))
(key "4" "Mod" (focus-workspace "4"))
(key "4" "Mod+Alt" (spawn ["lifx" "state" "--kelvin" "4000"]))
(key "4" "Mod+Shift" (move-column-to-workspace "4"))
(key "5" "Ctrl+Alt" (spawn ["lifx" "state" "--brightness" "1.00"]))
(key "5" "Mod" (focus-workspace "5"))
(key "5" "Mod+Alt" (spawn ["lifx" "state" "--kelvin" "5000"]))
(key "5" "Mod+Shift" (move-column-to-workspace "5"))
(key "6" "Mod" (focus-workspace "6"))
(key "6" "Mod+Shift" (move-column-to-workspace "6"))
(key "7" "Mod" (focus-workspace "7"))
(key "7" "Mod+Shift" (move-column-to-workspace "7"))
(key "8" "Mod" (focus-workspace "8"))
(key "8" "Mod+Shift" (move-column-to-workspace "8"))
(key "9" "Mod" (spawn audio))
(key "A" "Ctrl+Alt" (spawn [waydroid "session" "stop"]))
(key "A" "Mod" focus-column-or-monitor-left)
(key "A" "Mod+Ctrl" consume-or-expel-window-left)
(key "A" "Mod+Shift" move-column-left-or-to-monitor-left)
(key "Apostrophe" "Mod" screenshot)
(key "Apostrophe" "Mod+Ctrl+Shift" screenshot-screen)
(key "Apostrophe" "Mod+Shift" screenshot-window)
(key "B" "Ctrl+Alt" (spawn [pkill config.custom.browser.command]))
(key "B" "Mod" (spawn config.custom.browser.command))
(key "Backslash" "Mod" (spawn inhibit))
(key "Backslash" "Mod+Shift" (spawn power))
(key "Bracketleft" "Mod" (switch-layout "prev"))
(key "Bracketright" "Mod" (switch-layout "next"))
(key "Delete" "Ctrl+Alt" quit)
(key "C" "Mod" (spawn [walker "--modules" "clipboard"]))
(key "C" "Mod+Ctrl" (spawn [bash "-c" "${rm} ~/.cache/walker/clipboard.gob && ${notify-send} menu 'Clipboard cleared' --urgency low"]))
(key "Delete" "Ctrl+Alt" (spawn [loginctl "terminate-user" config.custom.username]))
(key "Delete" "Mod" (spawn [playerctl] "play-pause"))
(key "Down" "Mod" (spawn [swayosd-client "--brightness" "lower"]))
(key "E" "Ctrl+Alt" (spawn [pkill "codium"]))
(key "E" "Mod" (spawn codium))
(key "Equal" "Mod" (spawn [swayosd-client "--output-volume" "raise"]))
(key "Escape" "Mod+Alt" (spawn ["lifx" "state" "--color" "red"]))
(key "F" "Mod" (spawn [nautilus "--new-window"]))
(key "G" "Ctrl+Alt" (spawn [pkill "steam"]))
(key "G" "Mod" (spawn steam))
(key "K" "Ctrl+Alt" (spawn [pkill "obsidian"]))
(key "K" "Mod" (spawn obsidian))
(key "L" "Mod" (spawn [bash "-c" "${hyprlock} --immediate & ${niri} msg action power-off-monitors"]))
(key "L" "Mod+Shift" suspend)
(key "L" "Mod" (spawn [hyprlock "--immediate" "&" niri "msg" "power-off-monitors"]))
(key "Left" "Mod" (spawn [playerctl "previous"]))
(key "M" "Ctrl+Alt" (spawn [pkill "youtube-music"]))
(key "M" "Mod" (spawn youtube-music))
(key "Minus" "Mod" (spawn [swayosd-client "--output-volume" "lower"]))
(key "O" "Mod" (spawn [loupe "/tmp/wallpaper.png"]))
(key "P" "Ctrl+Alt" (spawn [pkill "1password"]))
(key "P" "Mod" (spawn _1password))
(key "Q" "Mod" close-window)
(key "R" "Mod" focus-window-or-workspace-down)
(key "R" "Mod+Shift" move-window-down-or-to-workspace-down)
(key "Return" "Mod" maximize-column)
(key "Return" "Mod+Ctrl" center-column)
(key "Return" "Mod+Shift" fullscreen-window)
(key "Right" "Mod" (spawn [playerctl "next"]))
(key "S" "Mod" focus-column-or-monitor-right)
(key "S" "Mod+Ctrl" consume-or-expel-window-right)
(key "S" "Mod+Shift" move-column-right-or-to-monitor-right)
(key "Semicolon" "Mod" (spawn [hyprpicker "--autocopy"]))
(key "Semicolon" "Mod+Shift" (spawn [hyprpicker "--autocopy --format rgb"]))
(key "Slash" "Mod+Shift" show-hotkey-overlay)
(key "Space" "Ctrl+Alt" (spawn ["lifx" "toggle"]))
(key "Space" "Ctrl+Alt" (spawn ["lifx" "toggle"]))
(key "T" "Ctrl+Alt" (spawn [pkill "kitty"]))
(key "T" "Mod" (spawn kitty))
(key "Up" "Mod" (spawn [swayosd-client "--brightness" "raise"]))
(key "V" "Mod" (spawn virt-manager))
(key "V" "Mod+Ctrl" (spawn vm))
(key "W" "Mod" focus-window-or-workspace-up)
(key "W" "Mod+Shift" move-window-up-or-to-workspace-up)
(key "X" "Mod" switch-preset-column-width)
@ -105,8 +155,12 @@ in {
# BUG: Release binds execute with all binds involving that modifier
# https://github.com/YaLTeR/niri/issues/605
#// (key "Super_L" "Mod" spawn menu)
(key "Space" "Mod" (spawn menu))
# TODO: Uncomment when fixed
#// (key "Shift_L" "Mod" focus-workspace-previous)
# TODO: Use "Super_L" when fixed
(key "Space" "Mod" (spawn walker))
(key "Space" "Mod+Ctrl+Shift" (spawn networkmanager_dmenu))
(key "Space" "Mod+Shift" (spawn [walker "--modules" "search"]))
# Media keys
# https://github.com/xkbcommon/libxkbcommon/blob/master/include/xkbcommon/xkbcommon-keysyms.h

View file

@ -1,10 +1,12 @@
{
config,
lib,
pkgs,
...
}:
with lib; let
niri = "${config.programs.niri.package}/bin/niri";
sway-audio-idle-inhibit = "${pkgs.sway-audio-idle-inhibit}/bin/sway-audio-idle-inhibit";
cfg = config.custom.desktops.niri.misc;
in {
@ -17,6 +19,10 @@ in {
programs.niri.settings = {
# https://github.com/YaLTeR/niri/wiki/Configuration:-Miscellaneous
spawn-at-startup = [
{command = [sway-audio-idle-inhibit];} # Inhibit while audio is playing
];
# HACK: Inherit home-manager environment variables in lieu of upstream fix
# https://github.com/nix-community/home-manager/issues/2659
# https://github.com/YaLTeR/niri/wiki/Configuration:-Miscellaneous#environment

View file

@ -13,20 +13,158 @@ in {
config = mkIf cfg.enable {
home-manager.users.${config.custom.username} = {
# https://github.com/YaLTeR/niri/wiki/Configuration:-Window-Rules
programs.niri.settings.window-rules = [
{
geometry-corner-radius = let
radius = config.custom.rounding + 0.0; # Convert to float
in {
top-left = radius;
top-right = radius;
bottom-right = radius;
bottom-left = radius;
};
programs.niri.settings = {
# HACK: Name workspaces after index to use open-on-workspace rule
workspaces = {
"1" = {};
"2" = {};
"3" = {};
};
clip-to-geometry = true;
}
];
window-rules = [
### Defaults
{
# Global
geometry-corner-radius = let
radius = config.custom.rounding + 0.0; # Convert to float
in {
top-left = radius;
top-right = radius;
bottom-right = radius;
bottom-left = radius;
};
clip-to-geometry = true;
}
{
# Startup
#?? <= 60 secs after niri launches
matches = [{at-startup = true;}];
}
{
# Android
matches = [{app-id = "^[Ww]aydroid.*$";}];
}
{
# Browsers
matches = [
{app-id = "^brave-browser$";}
{app-id = "^chromium-browser$";}
{app-id = "^firefox.*$";}
{app-id = "^google-chrome$";}
{app-id = "^vivaldi.*$";}
];
open-on-workspace = "2";
}
{
# Chats
matches = [
{app-id = "^cinny$";}
{app-id = "^discord$";}
{app-id = "^Element$";}
{app-id = "^org\.telegram\.desktop$";}
];
}
{
# Dropdown terminal
matches = [{app-id = "^dropdown$";}];
}
{
# Editors
matches = [
{app-id = "^codium$";}
{app-id = "^obsidian$";}
];
open-on-workspace = "2";
}
{
# Files
matches = [{app-id = "^org\.gnome\.Nautilus$";}];
}
{
# Games
matches = [
{app-id = "^.*\.(exe|x86_64)$";}
{app-id = "^moe\.launcher\..+$";}
{app-id = "^net\.retrodeck\.retrodeck$";}
{app-id = "^steam_app_.+$";}
];
open-on-workspace = "1";
variable-refresh-rate = true;
}
{
# Media
matches = [
{app-id = "^org\.gnome\.Loupe$";}
{app-id = "^Spotify$";}
{app-id = "^totem$";}
{app-id = "^YouTube Music$";}
];
open-on-workspace = "3";
}
{
# Office
matches = [
{app-id = "^draw\.io$";}
{app-id = "^libreoffice$";}
{app-id = "^ONLYOFFICE Desktop Editors$";}
];
open-on-workspace = "2";
}
{
# PiP
matches = [{title = "^Picture.in.[Pp]icture$";}];
}
{
# Terminals
matches = [
{app-id = "^foot$";}
{app-id = "^kitty$";}
{app-id = "^org\.wezfurlong\.wezterm$";}
];
}
{
# Vaults
matches = [
{app-id = "^1Password$";}
{app-id = "^Bitwarden$";}
];
}
{
# Virtual machines
matches = [
{app-id = "^(sdl-|wl|x)freerdp$";}
{app-id = "^looking-glass-client$";}
{app-id = "^org\.remmina\.Remmina$";}
{app-id = "^virt-manager$";}
];
open-on-workspace = "1";
}
### Overrides
];
};
};
};
}

View file

@ -221,20 +221,9 @@ in {
# https://www.nerdfonts.com/cheat-sheet
"niri/workspaces" = {
format = "{icon}";
format-icons = {
android = "";
dropdown = "󰞷";
game = "󰊴";
hidden = "";
music = "󰝚";
office = "󰈙";
password = "󰌾";
pip = "󰹙";
scratchpad = "";
steam = "󰓓";
terminal = "";
vm = "󰢹";
wallpaper = "󰏩";
};
};

View file

@ -193,6 +193,7 @@ in {
adw-gtk3
### Python packages
# TODO: Separate into standalone package for absolute path reference
# https://wiki.nixos.org/wiki/Python#Package_unavailable_in_Nixpkgs
# https://wiki.nixos.org/wiki/Packaging/Python
(python311.withPackages (