feat: firefox -> zen, avizo -> swayosd

This commit is contained in:
Kat Inskip 2025-07-21 14:27:58 -07:00
parent 4e2f3ecae5
commit c8368a050e
Signed by: kat
GPG key ID: 465E64DECEA8CF0F
16 changed files with 214 additions and 46 deletions

32
flake.lock generated
View file

@ -466,6 +466,27 @@
"type": "github" "type": "github"
} }
}, },
"home-manager_2": {
"inputs": {
"nixpkgs": [
"zen-browser",
"nixpkgs"
]
},
"locked": {
"lastModified": 1753056897,
"narHash": "sha256-AVVMBFcuOXqIgmShvRv9TED3fkiZhQ0ZvlhsPoFfkNE=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "13a83d1b6545b7f0e8f7689bad62e7a3b1d63771",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"infrastructure": { "infrastructure": {
"inputs": { "inputs": {
"arcexprs": [ "arcexprs": [
@ -1601,20 +1622,21 @@
}, },
"zen-browser": { "zen-browser": {
"inputs": { "inputs": {
"home-manager": "home-manager_2",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
] ]
}, },
"locked": { "locked": {
"lastModified": 1727721329, "lastModified": 1753069499,
"narHash": "sha256-QYlWZwUSwrM7BuO+dXclZIwoPvBIuJr6GpFKv9XKFPI=", "narHash": "sha256-YtgY0ueqKNrBma4Euu8WH23BhUkBujirJDMDE1KujnU=",
"owner": "MarceColl", "owner": "0xc000022070",
"repo": "zen-browser-flake", "repo": "zen-browser-flake",
"rev": "e6ab73f405e9a2896cce5956c549a9cc359e5fcc", "rev": "c64b94235ae24e3b9e01a08f0331d8bb0e5b037a",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "MarceColl", "owner": "0xc000022070",
"repo": "zen-browser-flake", "repo": "zen-browser-flake",
"type": "github" "type": "github"
} }

View file

@ -80,7 +80,7 @@
}; };
}; };
zen-browser = { zen-browser = {
url = "github:MarceColl/zen-browser-flake"; url = "github:0xc000022070/zen-browser-flake";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
nixpkgs-xr = { nixpkgs-xr = {

View file

@ -1,6 +1,6 @@
{config, ...}: { {config, ...}: {
services.avizo = { services.avizo = {
enable = true; enable = false;
settings = { settings = {
default = { default = {
block-count = 100; block-count = 100;

View file

@ -1,12 +1,14 @@
{ {
config, config,
parent,
pkgs, pkgs,
lib, lib,
std, std,
... ...
}: let }: let
inherit (std) list; inherit (std) list;
inherit (lib.modules) mkMerge; inherit (lib.meta) getExe getExe';
inherit (lib.modules) mkMerge mkIf;
in { in {
programs.niri.settings.binds = let programs.niri.settings.binds = let
bindWorkspace = key: workspace: { bindWorkspace = key: workspace: {
@ -20,12 +22,32 @@ in {
bindWorkspace "0" 10 bindWorkspace "0" 10
) )
]; ];
in # See tip near https://github.com/sodiboo/niri-flake/blob/main/docs.md#user-content-programsnirisettingsbindsnameaction
mkMerge (workspaceBindings sh = config.lib.niri.actions.spawn "sh" "-c";
++ [ # ▀▀█
{ # ▄▄▄▄ ▄▄▄ ▄ ▄▄ ▄▄▄ ▄▄▄ ▄ ▄▄ ▄▄▄ █
# Transcribed: https://github.com/sodiboo/niri-flake/issues/483 # █▀ ▀█ █▀ █ █▀ ▀ █ ▀ █▀ ▀█ █▀ █ ▀ █ █
# thank you Pacman99 you chad :3 # █ █ █▀▀▀▀ █ ▀▀▀▄ █ █ █ █ ▄▀▀▀█ █
# ██▄█▀ ▀█▄▄▀ █ ▀▄▄▄▀ ▀█▄█▀ █ █ ▀▄▄▀█ ▀▄▄
# █
# ▀
#
personalBindings = {
"Mod+Return".action = sh ''${getExe config.programs.wezterm.package}'';
"Mod+T".action.toggle-window-floating = {};
"Mod+D".action = sh ''${getExe config.programs.fuzzel.package} -T "${getExe config.programs.wezterm.package} start"'';
"Mod+Escape".action = sh ''${getExe config.programs.wlogout.package} -p layer-shell'';
"Mod+Shift+Escape".action = sh ''${getExe config.programs.swaylock.package} -f'';
};
# ▄ █
# ▄▄▄ ▄▄█▄▄ ▄▄▄ ▄▄▄ █ ▄
# █ ▀ █ █▀ ▀█ █▀ ▀ █ ▄▀
# ▀▀▀▄ █ █ █ █ █▀█
# ▀▄▄▄▀ ▀▄▄ ▀█▄█▀ ▀█▄▄▀ █ ▀▄
#
stockBindings = {
# Taken from https://github.com/sodiboo/niri-flake/issues/483
"Mod+Q".action.close-window = {}; "Mod+Q".action.close-window = {};
"Mod+O".action.toggle-overview = {}; "Mod+O".action.toggle-overview = {};
@ -136,28 +158,69 @@ in {
# Powers off the monitors. To turn them back on, do any input like # Powers off the monitors. To turn them back on, do any input like
# moving the mouse or pressing any other key. # moving the mouse or pressing any other key.
"Mod+Shift+P".action.power-off-monitors = {}; "Mod+Shift+P".action.power-off-monitors = {};
};
# Kat # █ ▀
"XF86MonBrightnessUp".action.spawn = ["${config.services.avizo.package}/bin/lightctl" "up"]; # ▄▄▄▄▄ ▄▄▄ ▄▄▄█ ▄▄▄ ▄▄▄
"XF86MonBrightnessDown".action.spawn = ["${config.services.avizo.package}/bin/lightctl" "down"]; # █ █ █ █▀ █ █▀ ▀█ █ ▀ █
"XF86AudioRaiseVolume".action.spawn = ["${config.services.avizo.package}/bin/volumectl" "-u" "up"]; # █ █ █ █▀▀▀▀ █ █ █ ▄▀▀▀█
"XF86AudioLowerVolume".action.spawn = ["${config.services.avizo.package}/bin/volumectl" "-u" "down"]; # █ █ █ ▀█▄▄▀ ▀█▄██ ▄▄█▄▄ ▀▄▄▀█
"XF86AudioMute".action.spawn = ["${config.services.avizo.package}/bin/volumectl" "toggle-mute"]; #
#"XF86MonBrightnessUp".action.spawn = ["${pkgs.brightnessctl}/bin/brightnessctl" "-c" "backlight" "set" "5%+"]; mediaBindingsCommon = {
#"XF86MonBrightnessDown".action.spawn = ["${pkgs.brightnessctl}/bin/brightnessctl" "-c" "backlight" "set" "5%-"]; "XF86AudioPlay".action = sh ''${getExe pkgs.playerctl} play-pause'';
#"XF86AudioRaiseVolume".action.spawn = ["wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1+"]; "XF86AudioNext".action = sh ''${getExe pkgs.playerctl} next'';
#"XF86AudioLowerVolume".action.spawn = ["wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1-"]; "XF86AudioPrev".action = sh ''${getExe pkgs.playerctl} prev'';
#"XF86AudioMute".action.spawn = ["wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"]; };
"XF86AudioPlay".action.spawn = ["${pkgs.playerctl}/bin/playerctl" "play-pause"]; mediaBindingsAvizo = let
"XF86AudioNext".action.spawn = ["${pkgs.playerctl}/bin/playerctl" "next"]; lightctl = getExe' config.services.avizo.package "lightctl";
"XF86AudioPrev".action.spawn = ["${pkgs.playerctl}/bin/playerctl" "prev"]; volumectl = getExe' config.services.avizo.package "volumectl";
"Mod+Return".action.spawn = ["${config.programs.wezterm.package}/bin/wezterm"]; in mkIf config.services.avizo.enable {
"Mod+T".action.toggle-window-floating = {}; "XF86MonBrightnessUp".action = sh ''${lightctl} up'';
"Mod+D".action.spawn = ["${config.programs.wofi.package}/bin/wofi" "-t" "wezterm" "-IS" "drun"]; "XF86MonBrightnessDown".action = sh ''${volumectl} down'';
"Mod+Shift+D".action.spawn = ["${config.programs.wofi.package}/bin/wofi" "-t" "wezterm" "-IS" "run"]; "XF86AudioRaiseVolume" = {
"Mod+Escape".action.spawn = ["${config.programs.wlogout.package}/bin/wlogout" "-p" "layer-shell"]; allow-when-locked = true;
"Mod+Shift+Escape".action.spawn = ["${config.programs.swaylock.package}/bin/swaylock" "-f"]; action = sh ''${volumectl} -u up'';
#"Print".action.spawn = ["${pkgs.grimblast}/bin/grimblast" "copy" "area"]; };
} "XF86AudioLowerVolume" = {
]); allow-when-locked = true;
action = sh ''${volumectl} -u down'';
};
"XF86AudioMute" = {
allow-when-locked = true;
action = sh ''${volumectl} toggle-mute'';
};
};
mediaBindingsSwayOSD = let
swayosd-client = getExe' config.services.swayosd.package "swayosd-client";
in mkIf config.services.swayosd.enable {
"XF86MonBrightnessUp".action = sh ''${swayosd-client} --brightness raise'';
"XF86MonBrightnessDown".action = sh ''${swayosd-client} --brightness lower'';
"XF86AudioRaiseVolume" = {
allow-when-locked = true;
action = sh ''${swayosd-client} --output-volume 2'';
};
"XF86AudioLowerVolume" = {
allow-when-locked = true;
action = sh ''${swayosd-client} --output-volume -2'';
};
"XF86AudioMute" = {
allow-when-locked = true;
action = sh ''${swayosd-client} --output-volume mute-toggle'';
};
};
mediaBindingsAvizoless = mkIf (!(config.services.avizo.enable || config.services.swayosd.enable)) {
"XF86MonBrightnessUp".action = sh ''${getExe pkgs.brightnessctl} -c backlight set 5%+'';
"XF86MonBrightnessDown".action = sh ''${getExe pkgs.brightnessctl} -c backlight set 5%-'';
"XF86AudioRaiseVolume".action = sh ''${parent.services.wireplumber.package}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1+'';
"XF86AudioLowerVolume".action = sh ''${parent.services.wireplumber.package}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1-'';
"XF86AudioMute".action = sh ''${parent.services.wireplumber.package}/bin/wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle'';
};
in
mkMerge (workspaceBindings ++ [
stockBindings
personalBindings
mediaBindingsCommon
mediaBindingsAvizo
mediaBindingsSwayOSD
mediaBindingsAvizoless
]);
} }

View file

@ -0,0 +1,6 @@
_: {
catppuccin.fuzzel.enable = true;
programs.fuzzel = {
enable = true;
};
}

View file

@ -0,0 +1,60 @@
{
lib,
config,
pkgs,
...
}:
let
theme = pkgs.writeTextFile {
name = "swayosd-css";
text = ''
window#osd {
padding: 12px 20px;
border-radius: 999px;
border: solid 2px ${config.palette.${config.catppuccin.accent}.hex};
background: alpha(${config.palette.base.hex}, 0.99);
}
#container {
margin: 16px;
}
image,
label {
color: ${config.palette.text.hex};
}
progressbar:disabled,
image:disabled {
opacity: 0.5;
}
progressbar {
min-height: 6px;
border-radius: 999px;
background: transparent;
border: none;
}
trough {
min-height: inherit;
border-radius: inherit;
border: none;
background: alpha(${config.palette.${config.catppuccin.accent}.hex},0.3);
}
progress {
min-height: inherit;
border-radius: inherit;
border: none;
background: ${config.palette.${config.catppuccin.accent}.hex};
}
'';
};
in
{
services.swayosd = {
enable = true;
stylePath = theme;
};
}

View file

@ -178,7 +178,9 @@ _: {
tooltip-format-enumerate-connected = "{device_alias}\t{device_address}"; tooltip-format-enumerate-connected = "{device_alias}\t{device_address}";
tooltip-format-enumerate-connected-battery = "{device_alias}\t{device_address}\t{device_battery_percentage}%"; tooltip-format-enumerate-connected-battery = "{device_alias}\t{device_address}\t{device_battery_percentage}%";
}; };
mpris = {
ignored-players = ["firefox"];
};
wireplumber = { wireplumber = {
format = "vol {volume}%"; format = "vol {volume}%";
max-volume = 150; max-volume = 150;

View file

@ -1,5 +1,8 @@
_: { _: {
programs.firefox.profiles.main.settings = { programs.zen-browser.profiles.main.settings = {
"zen.welcome-screen.seen" = true;
"zen.watermark.enabled" = false;
# Derived from https://github.com/arcnmx/home/blob/9eb1cd4dd43883e1a0c6a2a55c00d7c3bede1776/cfg/firefox/default.nix#L7 # Derived from https://github.com/arcnmx/home/blob/9eb1cd4dd43883e1a0c6a2a55c00d7c3bede1776/cfg/firefox/default.nix#L7
# and https://git.ztn.sh/zotan/snowleopard/src/branch/dev/assets/prefs.js # and https://git.ztn.sh/zotan/snowleopard/src/branch/dev/assets/prefs.js
"services.sync.engine.prefs" = false; "services.sync.engine.prefs" = false;

View file

@ -1,5 +1,5 @@
_: { _: {
programs.firefox.profiles.main = { programs.zen-browser.profiles.main = {
containersForce = true; containersForce = true;
containers = { containers = {
main = { main = {

View file

@ -6,11 +6,11 @@
defaultFont = "Monaspace Krypton"; defaultFont = "Monaspace Krypton";
in { in {
home.sessionVariables = { home.sessionVariables = {
BROWSER = "firefox"; BROWSER = "zen";
}; };
home.packages = [pkgs.ff2mpv-rust]; home.packages = [pkgs.ff2mpv-rust];
programs.firefox = { programs.zen-browser = {
nativeMessagingHosts = [ nativeMessagingHosts = [
pkgs.ff2mpv-rust pkgs.ff2mpv-rust
]; ];
@ -22,6 +22,7 @@ in {
containersForce = true; containersForce = true;
extensions = { extensions = {
packages = with nur.repos.rycee.firefox-addons; [ packages = with nur.repos.rycee.firefox-addons; [
display-_anchors
pronoundb pronoundb
sponsorblock sponsorblock
link-cleaner link-cleaner

View file

@ -1,5 +1,5 @@
{nur, ...}: { {nur, ...}: {
programs.firefox.profiles.main.extensions = { programs.zen-browser.profiles.main.extensions = {
packages = with nur.repos.rycee.firefox-addons; [ packages = with nur.repos.rycee.firefox-addons; [
mtab mtab
]; ];

View file

@ -1,5 +1,5 @@
{nur, ...}: { {nur, ...}: {
programs.firefox.profiles.main = { programs.zen-browser.profiles.main = {
extensions = { extensions = {
packages = with nur.repos.rycee.firefox-addons; [ packages = with nur.repos.rycee.firefox-addons; [
tree-style-tab tree-style-tab

View file

@ -1,5 +1,5 @@
{nur, ...}: { {nur, ...}: {
programs.firefox.profiles.main.extensions = { programs.zen-browser.profiles.main.extensions = {
packages = with nur.repos.rycee.firefox-addons; [ packages = with nur.repos.rycee.firefox-addons; [
ublock-origin ublock-origin
]; ];

View file

@ -0,0 +1,5 @@
_: {
programs.obsidian = {
enable = true;
};
}

View file

@ -0,0 +1,5 @@
_: {
programs.zen-browser = {
enable = true;
};
}

View file

@ -117,6 +117,7 @@
spicetify-nix.homeManagerModules.spicetify spicetify-nix.homeManagerModules.spicetify
inputs.moonlight.homeModules.default inputs.moonlight.homeModules.default
inputs.nix-flatpak.homeManagerModules.nix-flatpak inputs.nix-flatpak.homeManagerModules.nix-flatpak
inputs.zen-browser.homeModules.default
] ]
++ (with (import (inputs.arcexprs + "/modules")).home-manager; [ ++ (with (import (inputs.arcexprs + "/modules")).home-manager; [
i3gopher i3gopher