1
1
Fork 0

Compare commits

...

11 commits

Author SHA1 Message Date
cf486d7735
niri: potentially fix cursor theme in some applications
Signed-off-by: Myned <dev@bjork.tech>
2024-12-26 19:14:57 -05:00
7827d05eb7
starship: modify config
Signed-off-by: Myned <dev@bjork.tech>
2024-12-26 19:13:06 -05:00
c324b5a115
waybar: refactor config
Signed-off-by: Myned <dev@bjork.tech>
2024-12-26 19:13:06 -05:00
4c593ab11f
kitty: modify config
Signed-off-by: Myned <dev@bjork.tech>
2024-12-26 19:13:06 -05:00
0716de4245
niri: add startup commands
Signed-off-by: Myned <dev@bjork.tech>
2024-12-26 19:13:06 -05:00
1879223bfe
swaync: modify config
Signed-off-by: Myned <dev@bjork.tech>
2024-12-26 19:13:06 -05:00
8715c6d1e4
gnome: add fractional scaling experimental feature
Signed-off-by: Myned <dev@bjork.tech>
2024-12-26 19:13:06 -05:00
da3a049ea2
programs: disable unused modules
Signed-off-by: Myned <dev@bjork.tech>
2024-12-26 19:13:06 -05:00
baed356708
niri: modify input sensitivity
Signed-off-by: Myned <dev@bjork.tech>
2024-12-26 19:13:06 -05:00
654b594643
nix: use lib where possible
Signed-off-by: Myned <dev@bjork.tech>
2024-12-26 19:13:06 -05:00
48e84a857d
gnome: add minimal option with core-os-services
Signed-off-by: Myned <dev@bjork.tech>
2024-12-26 19:06:11 -05:00
21 changed files with 593 additions and 487 deletions

View file

@ -8,7 +8,13 @@ with lib; let
in { in {
options.custom.desktops = { options.custom.desktops = {
enable = mkOption {default = config.custom.minimal;}; enable = mkOption {default = config.custom.minimal;};
desktop = mkOption {default = "niri";};
desktop = mkOption {
default =
if config.custom.full
then "niri"
else "gnome";
};
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {

View file

@ -1,7 +1,6 @@
{ {
config, config,
lib, lib,
pkgs,
... ...
}: }:
with lib; let with lib; let
@ -10,22 +9,23 @@ in {
options.custom.desktops.gnome = { options.custom.desktops.gnome = {
enable = mkOption {default = false;}; enable = mkOption {default = false;};
gdm = mkOption {default = true;}; gdm = mkOption {default = true;};
minimal = mkOption {default = false;};
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
# https://wiki.nixos.org/wiki/GNOME
# FIXME: xdg-desktop-portal-[gnome|gtk] not working through steam # FIXME: xdg-desktop-portal-[gnome|gtk] not working through steam
services = { services = {
xserver = { xserver = mkIf (!cfg.minimal) {
enable = true; enable = true;
desktopManager.gnome.enable = true; desktopManager.gnome.enable = true;
displayManager.gdm.enable = cfg.gdm; displayManager.gdm.enable = cfg.gdm;
}; };
gnome.gnome-browser-connector.enable = true; # Install extensions from browser gnome = {
core-os-services.enable = mkIf cfg.minimal true;
gnome-browser-connector.enable = !cfg.minimal;
};
}; };
# Remove default packages
# https://wiki.nixos.org/wiki/GNOME#Excluding_GNOME_Applications
environment.gnome.excludePackages = [pkgs.gnome-shell-extensions];
}; };
} }

View file

@ -10,11 +10,18 @@ in {
options.custom.desktops.hyprland.enable = mkOption {default = false;}; options.custom.desktops.hyprland.enable = mkOption {default = false;};
config = mkIf cfg.enable { config = mkIf cfg.enable {
custom.desktops.hyprland = mkIf config.custom.full { custom.desktops = mkIf config.custom.full {
binds.enable = true; hyprland = {
plugins.enable = true; binds.enable = true;
rules.enable = true; plugins.enable = true;
settings.enable = true; rules.enable = true;
settings.enable = true;
};
gnome = {
enable = true;
minimal = true;
};
}; };
# https://github.com/hyprwm/Hyprland # https://github.com/hyprwm/Hyprland

View file

@ -158,7 +158,7 @@ in {
merge = field: expr: rules: merge = field: expr: rules:
map ( map (
rule: rule:
if builtins.isAttrs field if isAttrs field
then "${rule}, ${lib.concatStringsSep ", " (lib.mapAttrsToList (f: e: format f e) field)}" then "${rule}, ${lib.concatStringsSep ", " (lib.mapAttrsToList (f: e: format f e) field)}"
else "${rule}, ${format field expr}" else "${rule}, ${format field expr}"
) )

View file

@ -15,12 +15,19 @@ in {
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
custom.desktops.niri = mkIf config.custom.full { custom.desktops = mkIf config.custom.full {
binds.enable = true; niri = {
input.enable = true; binds.enable = true;
layout.enable = true; input.enable = true;
misc.enable = true; layout.enable = true;
rules.enable = true; misc.enable = true;
rules.enable = true;
};
gnome = {
enable = true;
minimal = true;
};
}; };
# https://github.com/YaLTeR/niri # https://github.com/YaLTeR/niri

View file

@ -25,7 +25,7 @@ in {
click-method = "clickfinger"; # Multi-finger click click-method = "clickfinger"; # Multi-finger click
dwt = true; # Disable while typing dwt = true; # Disable while typing
dwtp = true; # Disable while trackpointing dwtp = true; # Disable while trackpointing
scroll-factor = 0.5; scroll-factor = 0.4;
}; };
# BUG: Applies to trackball device, switch to "flat" when per-device configuration is supported # BUG: Applies to trackball device, switch to "flat" when per-device configuration is supported
@ -33,7 +33,7 @@ in {
mouse = { mouse = {
accel-profile = "adaptive"; accel-profile = "adaptive";
accel-speed = -0.1; accel-speed = -0.2;
}; };
trackball = { trackball = {

View file

@ -5,8 +5,12 @@
... ...
}: }:
with lib; let with lib; let
_1password = "${config.programs._1password-gui.package}/bin/1password";
audio = config.home-manager.users.${config.custom.username}.home.file.".local/bin/audio".source;
niri = "${config.programs.niri.package}/bin/niri"; niri = "${config.programs.niri.package}/bin/niri";
rm = "${pkgs.coreutils}/bin/rm";
sway-audio-idle-inhibit = "${pkgs.sway-audio-idle-inhibit}/bin/sway-audio-idle-inhibit"; sway-audio-idle-inhibit = "${pkgs.sway-audio-idle-inhibit}/bin/sway-audio-idle-inhibit";
wallpaper = "${config.home-manager.users.${config.custom.username}.home.file.".local/bin/wallpaper".source}";
cfg = config.custom.desktops.niri.misc; cfg = config.custom.desktops.niri.misc;
in { in {
@ -19,9 +23,20 @@ in {
programs.niri.settings = { programs.niri.settings = {
# https://github.com/YaLTeR/niri/wiki/Configuration:-Miscellaneous # https://github.com/YaLTeR/niri/wiki/Configuration:-Miscellaneous
spawn-at-startup = [ # https://github.com/YaLTeR/niri/wiki/Configuration:-Miscellaneous#spawn-at-startup
{command = [sway-audio-idle-inhibit];} # Inhibit while audio is playing # https://github.com/YaLTeR/niri/wiki/Configuration:-Key-Bindings#actions
]; spawn-at-startup = let
home = config.home-manager.users.${config.custom.username}.home.homeDirectory;
in
[
{command = [_1password "--silent"];} # Launch password manager in background
{command = [audio "--init"];} # Enforce audio profile state
{command = [rm "${home}/.cache/walker/clipboard.gob"];} # Clear clipboard history
{command = [sway-audio-idle-inhibit];} # Inhibit while audio is playing
]
++ optionals config.custom.wallpaper [
{command = [wallpaper];}
];
# HACK: Inherit home-manager environment variables in lieu of upstream fix # HACK: Inherit home-manager environment variables in lieu of upstream fix
# https://github.com/nix-community/home-manager/issues/2659 # https://github.com/nix-community/home-manager/issues/2659
@ -30,12 +45,18 @@ in {
mapAttrs (name: value: toString value) mapAttrs (name: value: toString value)
config.home-manager.users.${config.custom.username}.home.sessionVariables; config.home-manager.users.${config.custom.username}.home.sessionVariables;
cursor = { # https://github.com/YaLTeR/niri/wiki/Configuration:-Miscellaneous#cursor
cursor = with config.home-manager.users.${config.custom.username}.home.pointerCursor; {
inherit size;
hide-after-inactive-ms = 1000 * 15; # Milliseconds hide-after-inactive-ms = 1000 * 15; # Milliseconds
hide-when-typing = true; hide-when-typing = true;
theme = name;
}; };
# https://github.com/YaLTeR/niri/wiki/Configuration:-Miscellaneous#hotkey-overlay
hotkey-overlay.skip-at-startup = true; hotkey-overlay.skip-at-startup = true;
# https://github.com/YaLTeR/niri/wiki/Configuration:-Miscellaneous#prefer-no-csd
prefer-no-csd = true; prefer-no-csd = true;
# https://github.com/YaLTeR/niri/wiki/Configuration:-Switch-Events # https://github.com/YaLTeR/niri/wiki/Configuration:-Switch-Events

View file

@ -9,13 +9,20 @@ in {
options.custom.desktops.sway.enable = mkOption {default = false;}; options.custom.desktops.sway.enable = mkOption {default = false;};
config = mkIf cfg.enable { config = mkIf cfg.enable {
custom.desktops.sway = mkIf config.custom.full { custom.desktops = mkIf config.custom.full {
binds.enable = true; sway = {
input.enable = true; binds.enable = true;
output.enable = true; input.enable = true;
rules.enable = true; output.enable = true;
settings.enable = true; rules.enable = true;
swayfx.enable = true; settings.enable = true;
swayfx.enable = true;
};
gnome = {
enable = true;
minimal = true;
};
}; };
# https://wiki.nixos.org/wiki/Sway # https://wiki.nixos.org/wiki/Sway

View file

@ -43,10 +43,10 @@ with lib; {
(mkIf config.custom.full { (mkIf config.custom.full {
_1password.enable = true; _1password.enable = true;
adb.enable = true; adb.enable = true;
ags.enable = true; #// ags.enable = true;
#// anyrun.enable = true; #// anyrun.enable = true;
#// bitwarden-menu.enable = true; #// bitwarden-menu.enable = true;
clipse.enable = true; #// clipse.enable = true;
discord.enable = true; discord.enable = true;
element-desktop.enable = true; element-desktop.enable = true;
#// fuzzel.enable = true; #// fuzzel.enable = true;
@ -67,13 +67,13 @@ with lib; {
obs-studio.enable = true; obs-studio.enable = true;
onlyoffice.enable = true; onlyoffice.enable = true;
#// onedrive.enable = true; #// onedrive.enable = true;
path-of-building.enable = true; #// path-of-building.enable = true;
rbw.enable = true; #// rbw.enable = true;
remmina.enable = true; remmina.enable = true;
rofi-rbw.enable = true; #// rofi-rbw.enable = true;
rofi.enable = true; #// rofi.enable = true;
seahorse.enable = true; seahorse.enable = true;
slurp.enable = true; #// slurp.enable = true;
steam.enable = true; steam.enable = true;
#// swaylock.enable = true; #// swaylock.enable = true;
#// thunderbird.enable = true; #// thunderbird.enable = true;
@ -82,7 +82,7 @@ with lib; {
walker.enable = true; walker.enable = true;
waybar.enable = true; waybar.enable = true;
wireshark.enable = true; wireshark.enable = true;
wofi.enable = true; #// wofi.enable = true;
#// wpaperd.enable = true; #// wpaperd.enable = true;
}) })
]; ];

View file

@ -17,7 +17,7 @@ in {
font = { font = {
name = config.custom.font.monospace; name = config.custom.font.monospace;
size = 14; size = 13;
}; };
# https://sw.kovidgoyal.net/kitty/conf/ # https://sw.kovidgoyal.net/kitty/conf/
@ -33,7 +33,7 @@ in {
scrollback_lines = -1; scrollback_lines = -1;
strip_trailing_spaces = "smart"; strip_trailing_spaces = "smart";
tab_bar_style = "powerline"; tab_bar_style = "powerline";
touch_scroll_multiplier = 3; touch_scroll_multiplier = 5;
url_style = "straight"; url_style = "straight";
wayland_enable_ime = "no"; wayland_enable_ime = "no";
window_padding_width = "2.5 5"; # top/bottom left/right window_padding_width = "2.5 5"; # top/bottom left/right

View file

@ -41,7 +41,7 @@ in {
# https://starship.rs/config/#prompt # https://starship.rs/config/#prompt
add_newline = false; add_newline = false;
format = concatStringsSep "" [ format = concatStrings [
# Top left # Top left
"$shell" "$shell"
"$all" "$all"
@ -59,9 +59,19 @@ in {
"$character" "$character"
]; ];
# https://starship.rs/advanced-config/#enable-right-prompt
right_format = concatStrings [
# Bottom right
];
# https://starship.rs/config/#battery # https://starship.rs/config/#battery
battery = { battery = {
format = " [$symbol]($style)"; format = " [$symbol]($style)";
charging_symbol = "󰂄";
discharging_symbol = "󰂃";
empty_symbol = "󰂎";
full_symbol = "󰁹";
unknown_symbol = "󰂑";
display = [ display = [
{ {
@ -204,7 +214,7 @@ in {
style = "bold #657b83"; style = "bold #657b83";
# https://docs.rs/chrono/latest/chrono/format/strftime/index.html # https://docs.rs/chrono/latest/chrono/format/strftime/index.html
time_format = "%a %b %-d %I:%M%P"; time_format = "%a %b %-d %-I:%M%P";
}; };
# https://starship.rs/config/#username # https://starship.rs/config/#username

View file

@ -122,7 +122,7 @@ in {
src = "${pkgs.writeShellApplication { src = "${pkgs.writeShellApplication {
name = "search"; name = "search";
text = builtins.readFile ./search.sh; text = readFile ./search.sh;
runtimeInputs = with pkgs; [ runtimeInputs = with pkgs; [
coreutils coreutils
@ -145,7 +145,7 @@ in {
font: larger ${config.custom.font.monospace}; font: larger ${config.custom.font.monospace};
} }
${builtins.readFile ./style.css} ${readFile ./style.css}
''; '';
#!! Inherit from default layout #!! Inherit from default layout

View file

@ -7,39 +7,41 @@
}: }:
with lib; let with lib; let
audio = config.home-manager.users.${config.custom.username}.home.file.".local/bin/audio".source; audio = config.home-manager.users.${config.custom.username}.home.file.".local/bin/audio".source;
bash = "${pkgs.bash}/bin/bash";
blueberry = "${pkgs.blueberry}/bin/blueberry"; blueberry = "${pkgs.blueberry}/bin/blueberry";
bluetoothctl = "${pkgs.bluez}/bin/bluetoothctl"; bluetoothctl = "${pkgs.bluez}/bin/bluetoothctl";
cat = "${pkgs.coreutils}/bin/cat"; cat = "${pkgs.coreutils}/bin/cat";
date = "${pkgs.coreutils}/bin/date";
easyeffects = "${pkgs.easyeffects}/bin/easyeffects"; easyeffects = "${pkgs.easyeffects}/bin/easyeffects";
echo = "${pkgs.coreutils}/bin/echo"; echo = "${pkgs.coreutils}/bin/echo";
grep = "${pkgs.gnugrep}/bin/grep"; gnome-calendar = "${pkgs.gnome-calendar}/bin/gnome-calendar";
hyprctl = "${config.programs.hyprland.package}/bin/hyprctl"; gnome-clocks = "${pkgs.gnome-clocks}/bin/gnome-clocks";
gnome-weather = "${pkgs.gnome-weather}/bin/gnome-weather";
inhibit = config.home-manager.users.${config.custom.username}.home.file.".local/bin/inhibit".source; inhibit = config.home-manager.users.${config.custom.username}.home.file.".local/bin/inhibit".source;
jq = "${pkgs.jq}/bin/jq"; jq = "${pkgs.jq}/bin/jq";
loginctl = "${pkgs.systemd}/bin/loginctl"; loginctl = "${pkgs.systemd}/bin/loginctl";
network = config.home-manager.users.${config.custom.username}.home.file.".local/bin/network".source; network = config.home-manager.users.${config.custom.username}.home.file.".local/bin/network".source;
niri = "${config.programs.niri.package}/bin/niri";
nm-connection-editor = "${pkgs.networkmanagerapplet}/bin/nm-connection-editor"; nm-connection-editor = "${pkgs.networkmanagerapplet}/bin/nm-connection-editor";
pgrep = "${pkgs.procps}/bin/pgrep"; pgrep = "${pkgs.procps}/bin/pgrep";
ping = "${pkgs.iputils}/bin/ping"; pwvucontrol = "${pkgs.pwvucontrol}/bin/pwvucontrol";
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; remote = config.home-manager.users.${config.custom.username}.home.file.".local/bin/remote".source;
rfkill = "${pkgs.util-linux}/bin/rfkill"; rfkill = "${pkgs.util-linux}/bin/rfkill";
sleep = "${pkgs.coreutils}/bin/sleep";
swaync-client = "${config.home-manager.users.${config.custom.username}.services.swaync.package}/bin/swaync-client"; swaync-client = "${config.home-manager.users.${config.custom.username}.services.swaync.package}/bin/swaync-client";
swayosd-client = "${pkgs.swayosd}/bin/swayosd-client"; swayosd-client = "${pkgs.swayosd}/bin/swayosd-client";
systemctl = "${pkgs.systemd}/bin/systemctl"; systemctl = "${pkgs.systemd}/bin/systemctl";
systemd-inhibit = "${pkgs.systemd}/bin/systemd-inhibit";
tailscale = "${pkgs.tailscale}/bin/tailscale"; tailscale = "${pkgs.tailscale}/bin/tailscale";
tr = "${pkgs.coreutils}/bin/tr"; tr = "${pkgs.coreutils}/bin/tr";
virsh = "${pkgs.libvirt}/bin/virsh";
virt-manager = "${pkgs.virt-manager}/bin/virt-manager";
vpn = config.home-manager.users.${config.custom.username}.home.file.".local/bin/vpn".source; vpn = config.home-manager.users.${config.custom.username}.home.file.".local/bin/vpn".source;
wttrbar = "${pkgs.wttrbar}/bin/wttrbar"; wttrbar = "${pkgs.wttrbar}/bin/wttrbar";
cfg = config.custom.programs.waybar; cfg = config.custom.programs.waybar;
in { in {
options.custom.programs.waybar.enable = mkOption {default = false;}; options.custom.programs.waybar = {
enable = mkOption {default = false;};
desktop = mkOption {default = config.custom.desktops.desktop;};
};
config = mkIf cfg.enable { config = mkIf cfg.enable {
age.secrets = let age.secrets = let
@ -52,416 +54,437 @@ in {
"desktop/vm/myndows.pass" = secret "desktop/vm/myndows.pass"; "desktop/vm/myndows.pass" = secret "desktop/vm/myndows.pass";
}; };
home-manager.users.${config.custom.username} = { home-manager.sharedModules = [
# https://github.com/Alexays/Waybar {
# https://www.nerdfonts.com/cheat-sheet # https://github.com/Alexays/Waybar
programs.waybar = { #!! Some settings need a restart to take effect
enable = true; #?? systemctl --user restart waybar
systemd.enable = true; # Start on login
# ?? waybar --log-level debug
style = let
gap = toString config.custom.gap;
in ''
* {
border-radius: 50px;
color: #93a1a1;
font: 18px '${config.custom.font.monospace}';
margin: 0;
padding: 0;
}
.horizontal > box {
margin: 0 ${gap}px ${gap}px;
}
${readFile ./style.css}
'';
### SETTINGS ###
# https://github.com/Alexays/Waybar/wiki/Configuration
# https://docs.gtk.org/Pango/pango_markup.html#pango-markup
#?? pkill -SIGUSR2 -x waybar #?? pkill -SIGUSR2 -x waybar
settings = let programs.waybar = {
## INHERIT ## enable = true;
#!! Module defaults are not accurate to documentation systemd.enable = true;
# TODO: Submit pull request to fix in addition to inconsistent hyphen vs underscore
# https://github.com/Alexays/Waybar/wiki/Module:-Cava
cava-config = {
cava_config = null; # Default: null?
framerate = 30; # Default: 30?
autosens = 1; # Default: 1
# sensitivity = 0; # Default: 100?
bars = 16; # Default: 2
lower_cutoff_freq = 50; # Default: 50?
higher_cutoff_freq = 10000; # Default: 10000?
sleep_timer = 5; # Default: 0
hide_on_silence = true; # Default: false
method = "pipewire"; # Default: pulse
source = "auto"; # Default: auto?
sample_rate = 44100; # Default: 44100?
sample_bits = 16; # Default: 16?
stereo = false; # Default: true
reverse = false; # Default: false
bar_delimiter = 32; # ASCII code for space, default: 59 or ;
monstercat = true; # Default: false?
waves = true; # Default: false?
noise_reduction = 0.2; # Default: 0.77?
input_delay = 1; # Default: 4
format-icons = [
""
""
""
""
""
""
""
""
]; # !! Required
on-click = easyeffects;
on-scroll-up = "${swayosd-client} --output-volume raise";
on-scroll-down = "${swayosd-client} --output-volume lower";
rotate = 180;
};
in {
status = {
reload_style_on_change = true; # Reload CSS when modified
## GLOBAL ## # https://github.com/Alexays/Waybar/wiki/Styling
layer = "top"; #?? GTK_DEBUG=interactive waybar
position = "bottom"; style = let
border = toString config.custom.border;
font = config.custom.font.monospace;
gap = toString config.custom.gap;
in ''
* {
border-radius: 50px;
color: #93a1a1;
font: 18px '${font}';
margin: 0;
padding: 0;
}
## POSITION ## .horizontal > box {
modules-left = [ border: ${border} solid #073642;
"custom/power" margin: 0 ${gap}px ${gap}px;
"custom/inhibitor" }
"custom/vpn"
"custom/vm"
(mkIf config.custom.desktops.hyprland.enable "hyprland/workspaces")
(mkIf config.custom.desktops.niri.enable "niri/workspaces")
];
modules-center = [
"clock#date"
"clock#time"
"custom/weather"
];
modules-right = [
"mpris"
"tray"
"custom/equalizer"
"wireplumber"
"bluetooth"
"network"
"power-profiles-daemon"
"battery"
];
## MODULES ## ${readFile ./style.css}
# https://github.com/Alexays/Waybar/wiki/Module:-Custom '';
"custom/power" = {
format = ""; # https://github.com/Alexays/Waybar/wiki/Configuration
on-click = "${systemctl} poweroff"; # https://docs.gtk.org/Pango/pango_markup.html#pango-markup
on-click-right = "${systemctl} reboot"; # https://www.nerdfonts.com/cheat-sheet
on-click-middle = "${loginctl} terminate-session ''"; settings = let
# Common module settings
#!! Some settings are commonly available for use but not documented per module
common = {
# https://github.com/Alexays/Waybar/issues/1800
smooth-scrolling-threshold = 2;
on-scroll-down =
if cfg.desktop == "niri"
then "${niri} msg action focus-workspace-down"
else "";
on-scroll-up =
if cfg.desktop == "niri"
then "${niri} msg action focus-workspace-up"
else "";
}; };
"custom/inhibitor" = { #!! Module defaults are not accurate to documentation
interval = 5; cava =
exec = "~/.config/waybar/scripts/inhibitor.sh"; common
on-click = inhibit;
};
"custom/vm" = {
interval = 5;
exec = "~/.config/waybar/scripts/vm.sh";
on-click = ''${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'';
};
"custom/vpn" = {
interval = 5;
exec = "~/.config/waybar/scripts/vpn.sh";
on-click = "${vpn} mypi3";
};
# https://github.com/Alexays/Waybar/wiki/Module:-Idle-Inhibitor
# FIXME: Not currently usable
# https://github.com/Alexays/Waybar/issues/690
idle_inhibitor = {
format = "{icon}";
format-icons = {
activated = "󰅶";
deactivated = "󰾪";
};
};
# https://github.com/Alexays/Waybar/wiki/Module:-Hyprland
# https://www.nerdfonts.com/cheat-sheet
"hyprland/workspaces" = {
show-special = true;
format = "{icon}";
format-icons = {
android = "";
dropdown = "󰞷";
game = "󰊴";
hidden = "";
music = "󰝚";
office = "󰈙";
password = "󰌾";
pip = "󰹙";
scratchpad = "";
steam = "󰓓";
terminal = "";
vm = "󰢹";
wallpaper = "󰏩";
};
};
# https://github.com/Alexays/Waybar/wiki/Module:-Niri
# https://www.nerdfonts.com/cheat-sheet
"niri/workspaces" = {
format = "{icon}";
format-icons = {
scratchpad = "";
};
};
cava = cava-config;
# https://github.com/Alexays/Waybar/wiki/Module:-Clock
"clock#date" = {
format = "{:%a %b %d}";
tooltip-format = "{calendar}";
calendar.format = {
months = "<span color='#eee8d5'>{}</span>";
weeks = "<span color='#eee8d5'>{}</span>";
weekdays = "<span color='#93a1a1'>{}</span>";
days = "<span color='#586e75'>{}</span>";
today = "<span color='#eee8d5'>{}</span>";
};
};
"clock#time" = {
# https://fmt.dev/latest/syntax/#chrono-format-specifications
format = "<span text_transform='lowercase'>{:%I:%M%p}</span>";
on-click = "${swaync-client} --toggle-panel";
on-scroll-up = "${swayosd-client} --output-volume raise";
on-scroll-down = "${swayosd-client} --output-volume lower";
};
# https://github.com/bjesus/wttrbar
"custom/weather" = {
format = "{}°";
interval = 60 * 60;
return-type = "json";
exec = lib.strings.concatStringsSep " " [
"${wttrbar}"
"--ampm"
"--fahrenheit"
"--hide-conditions"
"--main-indicator temp_F"
];
};
"cava#reverse" =
cava-config
// { // {
reverse = true; autosens = 1; # Default: 1
bar_delimiter = 32; # ASCII code for space, default: 59 or ;
bars = 16; # Default: 2
cava_config = null; # Default: null?
format-icons = ["" "" "" "" "" "" "" ""]; #!! Required
framerate = 30; # Default 30?
hide_on_silence = true; # Default false
higher_cutoff_freq = 10000; # Default 10000?
input_delay = 1; # Default 4
lower_cutoff_freq = 50; # Default 50?
method = "pipewire"; # Default pulse
monstercat = true; # Default false?
noise_reduction = 0.2; # Default 0.77?
on-click = easyeffects;
on-scroll-down = "${swayosd-client} --output-volume lower";
on-scroll-up = "${swayosd-client} --output-volume raise";
reverse = false; # Default false
rotate = 180;
sample_bits = 16; # Default 16?
sample_rate = 44100; # Default 44100?
#// sensitivity = 0; # Default 100?
sleep_timer = 5; # Default 0
source = "auto"; # Default auto?
stereo = false; # Default true
waves = true; # Default false?
}; };
in {
default = {
layer = "top";
position = "bottom";
reload_style_on_change = true;
"custom/equalizer" = { modules-left = [
interval = 5; "custom/power"
on-click = audio; "custom/inhibitor"
exec = pkgs.writeShellScript "equalizer.sh" '' "custom/vpn"
${echo} 󰺢 "custom/vm"
${echo} "$(${cat} ~/.audio)" (mkIf config.custom.desktops.hyprland.enable "hyprland/workspaces")
${echo} "$(${cat} ~/.audio | ${tr} '[:upper:]' '[:lower:]')" (mkIf config.custom.desktops.niri.enable "niri/workspaces")
'';
};
# https://github.com/Alexays/Waybar/wiki/Module:-MPRIS
mpris = {
format = "{player_icon} {dynamic}";
format-paused = "{status_icon} {dynamic}";
dynamic-len = 25;
dynamic-order = [
"title"
"artist"
];
dynamic-separator = " 󰧟 ";
player-icons.default = "󰎈";
status-icons.paused = "";
on-click-middle = ""; # TODO: Close music player
on-scroll-up = "${swayosd-client} --output-volume raise";
on-scroll-down = "${swayosd-client} --output-volume lower";
};
# https://github.com/Alexays/Waybar/wiki/Module:-WirePlumber
wireplumber = {
format = "{icon} {volume}%";
format-muted = "󰸈";
format-icons = [
"󰕿"
"󰖀"
"󰕾"
];
on-click = easyeffects;
on-click-right = "${swayosd-client} --output-volume mute-toggle";
on-scroll-up = "${swayosd-client} --output-volume raise";
on-scroll-down = "${swayosd-client} --output-volume lower";
};
# https://github.com/Alexays/Waybar/wiki/Module:-Bluetooth
bluetooth = {
format-disabled = "󰂲";
format-off = "󰂲";
format-on = "󰂯";
format-connected = "󰂱";
on-click = blueberry;
on-click-right = "${bluetoothctl} disconnect";
on-click-middle = "${rfkill} toggle bluetooth"; # Toggle bluetooth on/off
};
# https://github.com/Alexays/Waybar/wiki/Module:-Network
network = {
format = "{icon}";
format-icons = {
disabled = "";
disconnected = "";
ethernet = "󰈀";
linked = "";
wifi = [
"󰤯"
"󰤟"
"󰤢"
"󰤥"
"󰤨"
];
};
on-click = nm-connection-editor;
on-click-right = network; # Toggle networking on/off
};
# https://github.com/Alexays/Waybar/wiki/Module:-PowerProfilesDaemon
power-profiles-daemon = {
format = "{icon}";
format-icons = {
default = "";
performance = "";
balanced = "";
power-saver = "";
};
tooltip = false;
};
# https://github.com/Alexays/Waybar/wiki/Module:-Battery
"battery" = {
format = "{icon} {power:.0f}W";
interval = 5;
format-icons = [
"󰂃"
"󰁺"
"󰁻"
"󰁼"
"󰁽"
"󰁾"
"󰁿"
"󰂀"
"󰂁"
"󰂂"
"󰁹"
]; ];
states = { modules-center = [
critical = 15; #// "cava#forward"
warning = 30; "clock#date"
};
on-click = power; # BUG: Padding modifiers not currently supported, so use custom module
# https://github.com/Alexays/Waybar/issues/1469 et al.
#// "clock#time"
"custom/time"
"custom/weather"
#// "cava#reverse"
];
modules-right = [
"mpris"
"tray"
"custom/equalizer"
"wireplumber"
"bluetooth"
"network"
"power-profiles-daemon"
"battery"
];
# https://github.com/Alexays/Waybar/wiki/Module:-Battery
battery =
common
// {
format = "{icon} {power:.0f}W";
format-icons = ["󰂃" "󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹"];
interval = 5; # Seconds
states = {
critical = 15; # Percent
warning = 30; # Percent
};
};
# https://github.com/Alexays/Waybar/wiki/Module:-Bluetooth
bluetooth =
common
// {
format-connected = "󰂱";
format-disabled = "󰂲";
format-off = "󰂲";
format-on = "󰂯";
on-click = "${rfkill} toggle bluetooth";
on-click-middle = "${bluetoothctl} disconnect";
on-click-right = blueberry;
};
# https://github.com/Alexays/Waybar/wiki/Module:-Cava
"cava#forward" = cava;
"cava#reverse" = cava // {reverse = true;};
# https://github.com/Alexays/Waybar/wiki/Module:-Clock
# https://fmt.dev/latest/syntax/#chrono-format-specifications
"clock#date" =
common
// {
format = "{:%a %b %d}";
tooltip-format = "{calendar}";
on-click-right = gnome-calendar;
calendar = {
format = {
months = "<span color='#eee8d5'>{}</span>";
weeks = "<span color='#eee8d5'>{}</span>";
weekdays = "<span color='#93a1a1'>{}</span>";
days = "<span color='#586e75'>{}</span>";
today = "<span color='#eee8d5'>{}</span>";
};
};
};
"clock#time" =
common
// {
format = "<span text_transform='lowercase'>{:%-I:%M%p}</span>";
on-click = "${swaync-client} --toggle-panel";
on-click-right = gnome-clocks;
};
# https://github.com/Alexays/Waybar/wiki/Module:-Hyprland
"hyprland/workspaces" =
common
// {
format = "{icon}";
format-icons = {
android = "";
dropdown = "󰞷";
game = "󰊴";
hidden = "";
music = "󰝚";
office = "󰈙";
password = "󰌾";
pip = "󰹙";
scratchpad = "";
steam = "󰓓";
terminal = "";
vm = "󰢹";
wallpaper = "󰏩";
};
show-special = true;
};
# https://github.com/Alexays/Waybar/wiki/Module:-Idle-Inhibitor
# BUG: Not currently compatible with other inhibit activations
# https://github.com/Alexays/Waybar/issues/690
idle_inhibitor =
common
// {
format = "{icon}";
format-icons = {
activated = "󰅶";
deactivated = "󰾪";
};
};
# https://github.com/Alexays/Waybar/wiki/Module:-Niri
"niri/workspaces" =
common
// {
format = "{icon}";
format-icons = {
scratchpad = "";
};
};
# https://github.com/Alexays/Waybar/wiki/Module:-MPRIS
mpris =
common
// {
format = "{player_icon} {dynamic}";
format-paused = "{status_icon} {dynamic}";
dynamic-len = 25; # Characters
dynamic-order = ["title" "artist"];
dynamic-separator = " 󰧟 ";
player-icons.default = "󰎈";
status-icons.paused = "";
# TODO: on-click focus currently playing window
#// on-click = "";
on-click-middle =
if cfg.desktop == "niri"
then ''${niri} msg action close-window --id "$(${niri} msg -j windows | ${jq} '.[] | select(.app_id == "YouTube Music").id')"''
else "";
on-scroll-down = "${swayosd-client} --output-volume lower";
on-scroll-up = "${swayosd-client} --output-volume raise";
};
# https://github.com/Alexays/Waybar/wiki/Module:-Network
network =
common
// {
format = "{icon}";
format-icons = {
disabled = "";
disconnected = "";
ethernet = "󰈀";
linked = "";
wifi = ["󰤯" "󰤟" "󰤢" "󰤥" "󰤨"];
};
on-click = network;
on-click-right = nm-connection-editor;
};
# https://github.com/Alexays/Waybar/wiki/Module:-PowerProfilesDaemon
power-profiles-daemon =
common
// {
format = "{icon}";
format-icons = {
default = "";
performance = "";
balanced = "";
power-saver = "";
};
tooltip = false;
};
# https://github.com/Alexays/Waybar/wiki/Module:-WirePlumber
wireplumber =
common
// {
format = "{icon} {volume}%";
format-icons = ["󰕿" "󰖀" "󰕾"];
format-muted = "󰸈";
on-click = "${swayosd-client} --output-volume mute-toggle";
on-click-right = pwvucontrol;
on-scroll-down = "${swayosd-client} --output-volume lower";
on-scroll-up = "${swayosd-client} --output-volume raise";
};
# https://github.com/Alexays/Waybar/wiki/Module:-Custom
"custom/equalizer" =
common
// {
exec = pkgs.writeShellScript "equalizer.sh" ''
${echo} 󰺢
${echo} "$(${cat} ~/.audio)"
${echo} "$(${cat} ~/.audio | ${tr} '[:upper:]' '[:lower:]')"
'';
interval = 5; # Seconds
on-click = audio;
on-click-right = easyeffects;
};
"custom/inhibitor" =
common
// {
exec = pkgs.writeShellScript "inhibitor.sh" ''
if ${pgrep} systemd-inhibit &> /dev/null; then
${echo} 󰅶
${echo} Enabled
${echo} enabled
else
${echo} 󰾪
${echo} Disabled
${echo} disabled
fi
'';
interval = 5; # Seconds
on-click = inhibit;
};
"custom/power" =
common
// {
format = "";
on-click = "${systemctl} poweroff";
on-click-middle = "${loginctl} terminate-session ${config.custom.username}";
on-click-right = "${systemctl} reboot";
};
"custom/time" =
common
// {
exec = "${date} '+%-I:%M%P'";
interval = 60; # Seconds
on-click = "${swaync-client} --toggle-panel";
on-click-right = gnome-clocks;
};
"custom/vm" =
common
// {
exec = pkgs.writeShellScript "vm.sh" ''
case "$(${virsh} domstate myndows)" in
'running')
${echo}
${echo} Online
${echo} online;;
'paused')
${echo}
${echo} Paused
${echo} paused;;
'shut off')
${echo}
${echo} Offline
${echo} offline;;
*)
${echo}
${echo} Unknown
${echo} unknown;;
esac
'';
interval = 5;
on-click = ''${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'';
on-click-middle = "${virsh} shutdown myndows";
on-click-right = virt-manager;
};
"custom/vpn" =
common
// {
exec = pkgs.writeShellScript "vpn.sh" ''
if [[ $(${tailscale} status --json | ${jq} .ExitNodeStatus.Online) == 'true' ]]; then
${echo} 󰖂
${echo} Connected
${echo} connected
else
${echo} 󰖂
${echo} Disconnected
${echo} disconnected
fi
'';
interval = 5; # Seconds
on-click = "${vpn} mypi3";
};
# https://github.com/bjesus/wttrbar
"custom/weather" =
common
// {
exec = lib.strings.concatStringsSep " " [
wttrbar
"--ampm"
"--fahrenheit"
"--hide-conditions"
"--main-indicator temp_F"
];
format = "{}°";
interval = 60 * 60; # Seconds
return-type = "json";
on-click-right = gnome-weather;
};
}; };
}; };
}; };
}; }
];
# TODO: Convert to writeShellApplication
### SCRIPTS ###
#?? text
#?? tooltip
#?? class
xdg.configFile = {
# Return inhibit idle status
"waybar/scripts/inhibitor.sh" = {
executable = true;
text = ''
#! /usr/bin/env ${bash}
if ${pgrep} systemd-inhibit &> /dev/null; then
${echo} 󰅶
${echo} Enabled
${echo} enabled
else
${echo} 󰾪
${echo} Disabled
${echo} disabled
fi
'';
};
# Return tailscale status
"waybar/scripts/vm.sh" = {
executable = true;
text = ''
#! /usr/bin/env ${bash}
case "$(virsh domstate myndows)" in
'running')
${echo}
${echo} Online
${echo} online;;
'paused')
${echo}
${echo} Paused
${echo} paused;;
'shut off')
${echo}
${echo} Offline
${echo} offline;;
*)
${echo}
${echo} Unknown
${echo} unknown;;
esac
'';
};
# Return tailscale status
"waybar/scripts/vpn.sh" = {
executable = true;
text = ''
#! /usr/bin/env ${bash}
if [[ $(${tailscale} status --json | ${jq} .ExitNodeStatus.Online) == 'true' ]]; then
${echo} 󰖂
${echo} Connected
${echo} connected
else
${echo} 󰖂
${echo} Disconnected
${echo} disconnected
fi
'';
};
};
};
}; };
} }

View file

@ -42,7 +42,6 @@ tooltip label {
.horizontal > box { .horizontal > box {
background: #002b36; background: #002b36;
/* border: 2px #586e75 solid; */
padding: 4px; padding: 4px;
} }

View file

@ -26,7 +26,7 @@ in {
-- # TODO: Remove when using Wayland -- # TODO: Remove when using Wayland
config.font_size = ${toString (14 * config.custom.scale)} config.font_size = ${toString (14 * config.custom.scale)}
${builtins.readFile ./config.lua} ${readFile ./config.lua}
return config return config
''; '';

View file

@ -25,7 +25,7 @@ in {
#// excludeShellChecks = ["SC2154"]; # argc evaluates variables at runtime #// excludeShellChecks = ["SC2154"]; # argc evaluates variables at runtime
runtimeInputs = dependencies; runtimeInputs = dependencies;
text = builtins.readFile ./${name}.sh; text = readFile ./${name}.sh;
} }
+ "/bin/${name}"; + "/bin/${name}";
}; };
@ -38,7 +38,7 @@ in {
pkgs.writers.writePython3Bin name {libraries = dependencies;} pkgs.writers.writePython3Bin name {libraries = dependencies;}
# Disable linting # Disable linting
# https://flake8.pycqa.org/en/3.1.1/user/ignoring-errors.html#ignoring-entire-files # https://flake8.pycqa.org/en/3.1.1/user/ignoring-errors.html#ignoring-entire-files
("# flake8: noqa\n" + builtins.readFile ./${name}.py) ("# flake8: noqa\n" + readFile ./${name}.py)
+ "/bin/${name}"; + "/bin/${name}";
}; };
in in

View file

@ -12,26 +12,51 @@ in {
# https://github.com/ErikReider/SwayNotificationCenter # https://github.com/ErikReider/SwayNotificationCenter
services.swaync = { services.swaync = {
enable = true; enable = true;
style = ./style.css;
# https://github.com/ErikReider/SwayNotificationCenter/blob/main/data/style/style.scss
style = let
border = toString config.custom.border;
gap = toString config.custom.gap;
in ''
.control-center {
border: ${border} solid #073642;
margin: ${gap}px;
}
.notification.low {
border: ${border} solid #6c71c4;
}
.notification.normal {
border: ${border} solid #d33682;
}
.notification.critical {
border: ${border} solid #dc322f;
}
${readFile ./style.css}
'';
# https://github.com/ErikReider/SwayNotificationCenter/blob/main/src/configSchema.json # https://github.com/ErikReider/SwayNotificationCenter/blob/main/src/configSchema.json
settings = { settings = {
control-center-width = 750 / config.custom.scale; control-center-height = builtins.floor (config.custom.height / 2);
control-center-height = config.custom.height / 2;
control-center-positionY = "bottom"; control-center-positionY = "bottom";
control-center-width = builtins.floor (1000 / config.custom.scale);
fit-to-screen = false; fit-to-screen = false;
hide-on-clear = true; hide-on-clear = true;
notification-2fa-action = false; notification-2fa-action = false;
notification-icon-size = 32;
#// notification-inline-replies = true; #// notification-inline-replies = true;
notification-window-width = builtins.floor (750 / config.custom.scale);
positionX = "center"; positionX = "center";
positionY = "top"; positionY = "top";
timeout-low = 5;
timeout = 5; # normal timeout = 5; # normal
timeout-critical = 0; timeout-critical = 0;
timeout-low = 5;
widgets = [ widgets = [
"notifications" "notifications"
"backlight"
"inhibitors" "inhibitors"
"dnd" "dnd"
"title" "title"

View file

@ -5,7 +5,6 @@ https://github.com/ErikReider/SwayNotificationCenter/blob/main/data/style/style.
***/ ***/
@define-color cc-bg #002b36; @define-color cc-bg #002b36;
@define-color noti-border-color #073642; @define-color noti-border-color #073642;
@define-color noti-bg #002b36; @define-color noti-bg #002b36;
@define-color noti-bg-opaque #002b36; @define-color noti-bg-opaque #002b36;
@ -13,24 +12,29 @@ https://github.com/ErikReider/SwayNotificationCenter/blob/main/data/style/style.
@define-color noti-bg-hover #073642; @define-color noti-bg-hover #073642;
@define-color noti-bg-hover-opaque #073642; @define-color noti-bg-hover-opaque #073642;
@define-color noti-bg-focus #002b36; @define-color noti-bg-focus #002b36;
@define-color text-color #93a1a1; @define-color text-color #93a1a1;
@define-color text-color-disabled #586e75; @define-color text-color-disabled #586e75;
.notification.low { .control-center {
border: 2px solid #6c71c4; padding: 16px;
} }
.notification.normal { .control-center .notification {
border: 2px solid #d33682; box-shadow: none;
}
.notification.critical {
border: 2px solid #dc322f;
} }
.notification-content { .notification-content {
padding: 16px; padding: 12px;
}
.notification-content .app-icon,
.notification-content .image {
margin: 0 8px 0 0;
}
.notification-group-buttons,
.notification-group-headers {
margin: 0;
} }
.text-box .summary, .text-box .summary,
@ -41,13 +45,3 @@ https://github.com/ErikReider/SwayNotificationCenter/blob/main/data/style/style.
.text-box .body { .text-box .body {
font-size: 16px; font-size: 16px;
} }
.control-center {
/* border: 2px solid #073642; */
margin: 10px; /* Gap size */
padding: 16px;
}
.control-center .notification {
box-shadow: none;
}

View file

@ -119,7 +119,10 @@ in {
workspaces-only-on-primary = mkBoolean true; workspaces-only-on-primary = mkBoolean true;
#?? [as] #?? [as]
experimental-features = mkArray type.string ["variable-refresh-rate"]; experimental-features = mkArray type.string [
"scale-monitor-framebuffer" # https://wiki.archlinux.org/title/HiDPI#Fractional_scaling
"variable-refresh-rate" # https://wiki.archlinux.org/title/Variable_refresh_rate#GNOME
];
}; };
"org/gnome/mutter/wayland/keybindings" = { "org/gnome/mutter/wayland/keybindings" = {

View file

@ -17,13 +17,15 @@ in {
package = pkgs.google-cursor; package = pkgs.google-cursor;
}; };
gtk = { gtk = let
css = readFile ./style.css;
in {
enable = true; enable = true;
gtk3.extraCss = builtins.readFile ./style.css; gtk3.extraCss = css;
gtk4 = { gtk4 = {
extraConfig.gtk-hint-font-metrics = 1; # Fix blurry fonts extraConfig.gtk-hint-font-metrics = 1; # Fix blurry fonts
extraCss = builtins.readFile ./style.css; extraCss = css;
}; };
font = { font = {

View file

@ -97,12 +97,14 @@ in {
gnome-calendar # Calendar gnome-calendar # Calendar
gnome-clocks # Clock gnome-clocks # Clock
gnome-connections # Remote desktop client gnome-connections # Remote desktop client
gnome-contacts # Contact editor
gnome-disk-utility # Disk formatter gnome-disk-utility # Disk formatter
gnome-firmware # Firmware updater gnome-firmware # Firmware updater
gnome-font-viewer # Font viewer gnome-font-viewer # Font viewer
gnome-graphs # Data plotter gnome-graphs # Data plotter
gnome-maps # OpenStreetMap client gnome-maps # OpenStreetMap client
gnome-obfuscate # Image redacter gnome-obfuscate # Image redacter
gnome-online-accounts-gtk # GNOME accounts
gnome-podcasts # Podcast feed gnome-podcasts # Podcast feed
gnome-resources # System monitor gnome-resources # System monitor
gnome-software # Flatpak manager gnome-software # Flatpak manager