Files
nixos-blueprint/modules/home/desktop/hyprland/default.nix
unexplrd 4204c45f31 repeat
2025-02-15 00:06:10 +02:00

1911 lines
56 KiB
Nix

{
osConfig,
config,
pkgs,
lib,
...
}: let
cfg = config.desktop.hyprland;
hostname = osConfig.networking.hostName;
keyboard =
if hostname == "eldrid"
then "chromeos"
else "platform";
xdgPictures =
config.xdg.userDirs.pictures;
in {
options = {
desktop.hyprland.enable =
lib.mkEnableOption "enable hyprland desktop";
};
config = lib.mkIf cfg.enable {
wayland.windowManager.hyprland = {
enable = true;
systemd = {
enable = true;
variables = [
"--all"
];
};
package = pkgs.hyprland;
plugins = with pkgs.hyprlandPlugins; [
# hyprexpo
hyprspace
hy3
# hyprsplit
];
settings = {
input = {
kb_layout = "us,ua";
resolve_binds_by_sym = 1;
repeat_rate = 50;
repeat_delay = 300;
# mouse
accel_profile = "flat";
sensitivity = 0;
};
device = [
{
name = "ite-tech.-inc.-ite-device(8910)-keyboard";
kb_variant = "colemak_dh,";
}
{
name = "at-translated-set-2-keyboard";
kb_variant = "colemak_dh,";
}
{
name = "keyd-virtual-keyboard";
kb_variant = "colemak_dh,";
}
];
xwayland.force_zero_scaling = true;
monitor = [
", preferred, auto, 1"
"desc:AOC 27V2G5 0x0000026C, addreserved, 0, 300, 0, 0"
"desc:Samsung Electric Company S24R65x H4TMA03291, preferred, 0x0, 1, bitdepth, 10, vrr, 1"
"desc:Philips Consumer Electronics Company 27M2N5500 UK02418033254, 2560x1440@180.00Hz, 0x0, 1.3333333, bitdepth, 10, vrr, 1"
"desc:BOE 0x08E8, preferred, 1920x0, 1.2, bitdepth, 10"
"desc:LG Display 0x068B, preferred, 1920x0, 1.2, bitdepth, 10"
"desc:Chimei Innolux Corporation 0x1406, preferred, 1920x0, 1.2"
];
env = [
# "EDITOR,hx"
"ELECTRON_OZONE_PLATFORM_HINT,auto"
"QT_QPA_PLATFORM,wayland"
# "QT_QPA_PLATFORMTHEME,gtk3"
"XCURSOR_SIZE,32"
#"GTK_THEME,adw-gtk3"
"GSK_RENDERER,ngl"
# "DISPLAY,:123"
];
decoration = {
shadow.enabled = false;
# drop_shadow = false;
blur = {
size = 8;
passes = 3;
};
# shadow_offset = "0 5";
# "col.shadow" = "rgba(00000099)";
rounding = 12;
};
misc = {
disable_splash_rendering = true;
disable_hyprland_logo = true;
# vfr = true;
};
bezier = [
"easeOutQuad, 0.25, 0.46, 0.45, 0.94"
"easeOutExpo, 0.19, 1, 0.22, 1"
];
animation = [
"workspaces, 1, 3, easeOutExpo, slidefade 20%"
"windows, 1, 3, easeOutExpo, popin 80%"
"layers, 1, 2, easeOutExpo, fade"
];
#group = {
# };
plugin = [
{
hyprexpo = {
columns = 3;
gap_size = 8;
#bg_col = "rgb(111111)";
workspace_method = "first 1"; # [center/first] [workspace] e.g. first 1 or center m+1
enable_gesture = true; # laptop touchpad
gesture_fingers = 3; # 3 or 4
gesture_distance = 400; # how far is the "max"
gesture_positive = false; # positive = swipe down. Negative = swipe up.;
};
}
{
hy3 = {
autotile = true;
tab_first_window = false;
tabs = {
render_text = true;
height = 24;
padding = 8;
rounding = 8;
text_height = 14;
text_center = true;
text_font = "${config.stylix.fonts.sansSerif.name}";
"col.active" = "0xff${config.lib.stylix.colors.base00}";
"col.inactive" = "0xff${config.lib.stylix.colors.base00}";
"col.urgent" = "0xff${config.lib.stylix.colors.base00}";
"col.active.text" = "0xff${config.lib.stylix.colors.base0D}";
"col.inactive.text" = "0xff${config.lib.stylix.colors.base05}";
"col.urgent.text" = "0xff${config.lib.stylix.colors.base09}";
"col.active.border" = "0xff${config.lib.stylix.colors.base0D}";
"col.inactive.border" = "0xff${config.lib.stylix.colors.base05}";
"col.urgent.border" = "0xff${config.lib.stylix.colors.base09}";
};
};
}
];
dwindle = {
force_split = 2;
default_split_ratio = 1.4;
};
master = {
mfact = 0.6;
};
"$mod" = "SUPER";
"$modShift" = "$mod SHIFT";
"$modCtrl" = "$mod CTRL";
"$modShiftCtrl" = "$mod SHIFT CTRL";
"$left" = "N";
"$down" = "E";
"$up" = "I";
"$right" = "O";
"$terminal" = "ghostty";
"$launcher" = "walker";
"$screenLocker" = "hyprlock";
"$webBrowser" = "io.github.zen_browser.zen";
"$clipboardManager" = "copyq menu";
general = {
gaps_in = 4;
gaps_out = 8;
border_size = 3;
allow_tearing = true;
layout = "hy3";
};
# group = {
# groupbar = lib.mkDefault {
# height = 24;
# font_size = 14;
# font_family = "${config.stylix.fonts.sansSerif.name}";
# "col.active" = "0xff${config.lib.stylix.colors.base00}";
# "col.inactive" = "0xff${config.lib.stylix.colors.base00}";
# # "col.urgent" = "0xff${config.lib.stylix.colors.base00}";
# "col.text.active" = "0xff${config.lib.stylix.colors.base0D}";
# "col.text.inactive" = "0xff${config.lib.stylix.colors.base05}";
# # "col.text.urgent" = "0xff${config.lib.stylix.colors.base09}";
# };
# };
bindn = [", mouse:272, hy3:focustab, mouse"];
bind = [
"$mod, Return, exec, $terminal"
"$mod, Space, exec, $launcher"
"$mod, Escape, exec, hyprctl switchxkblayout all next"
"$modCtrl, Q, killactive"
"$modCtrl, M, fullscreen"
"$modCtrl, G, togglefloating"
# "$mod,T, togglegroup"
# "$mod, period, changegroupactive, f"
# "$mod, comma, changegroupactive, b"
# "$mod, S, hy3:changegroup, opposite"
"$mod, T, hy3:changegroup, toggletab"
"$mod, S, hy3:changegroup, opposite"
"$mod, period, hy3:focustab, r, wrap"
"$mod, comma, hy3:focustab, l, wrap"
"$modCtrl, period, hy3:changefocus, raise"
"$modCtrl, comma, hy3:changefocus, lower"
"$mod, Tab, overview:toggle"
# "$mod, Tab, hyprexpo:expo, toggle"
"$modCtrl, L, exec, $screenLocker"
"$modCtrl, B, exec, $webBrowser"
"$modCtrl, V, exec, $clipboardManager"
# ", Print, exec, flameshot gui" #${xdg.userDirs.pictures}/screenshots/"
", Print, exec, ${pkgs.grim}/bin/grim -g \"$(${pkgs.slurp}/bin/slurp -o -r -c '\#\#00000000')\" -t ppm - | ${pkgs.satty}/bin/satty --filename - --fullscreen --output-filename ${xdgPictures}/screenshots/satty-$(date '+%Y%m%d-%H:%M:%S').png"
# ", Print, exec, grimblast --freeze copy area" #${xdg.userDirs.pictures}/screenshots/"
# "CTRL, Print, exec, grimblast --freeze copy active" #${xdg.userDirs.pictures}/screenshots/"
# "SHIFT, Print, exec, grimblast --freeze copy output" #${xdg.userDirs.pictures}/screenshots/"
# navigation
#"$modCtrl, N,"
"$mod, $left, hy3:movefocus, l"
"$mod, $down, hy3:movefocus, d"
"$mod, $up, hy3:movefocus, u"
"$mod, $right, hy3:movefocus, r"
"$modShift, $left, workspace, e-1"
"$modShift, $right, workspace, e+1"
# "$modShift, $down, focusmonitor, HDMI-A-1"
# "$modShift, $up, focusmonitor, eDP-1"
"$mod, left, hy3:movefocus, l"
"$mod, up, hy3:movefocus, u"
"$mod, down, hy3:movefocus, d"
"$mod, right, hy3:movefocus, r"
"$modShift, left, workspace, e-1"
"$modShift, right, workspace, e+1"
"$modShift, down, focusmonitor, e+1"
"$modShift, up, focusmonitor, e-1"
"$modCtrl, $left, hy3:movewindow, l"
"$modCtrl, $down, hy3:movewindow, d"
"$modCtrl, $up, hy3:movewindow, u"
"$modCtrl, $right, hy3:movewindow, r"
"$modCtrl, left, hy3:movewindow, l"
"$modCtrl, up, hy3:movewindow, u"
"$modCtrl, down, hy3:movewindow, d"
"$modCtrl, right, hy3:movewindow, r"
# workspaces
"$mod, 1, workspace, 1"
"$mod, 2, workspace, 2"
"$mod, 3, workspace, 3"
"$mod, 4, workspace, 4"
"$mod, 5, workspace, 5"
"$mod, 6, workspace, 6"
"$mod, 7, workspace, 7"
"$mod, 8, workspace, 8"
"$mod, 9, workspace, 9"
"$mod, 0, workspace, 10"
"$modShiftCtrl, 1, movetoworkspace, 1"
"$modShiftCtrl, 2, movetoworkspace, 2"
"$modShiftCtrl, 3, movetoworkspace, 3"
"$modShiftCtrl, 4, movetoworkspace, 4"
"$modShiftCtrl, 5, movetoworkspace, 5"
"$modShiftCtrl, 6, movetoworkspace, 6"
"$modShiftCtrl, 7, movetoworkspace, 7"
"$modShiftCtrl, 8, movetoworkspace, 8"
"$modShiftCtrl, 9, movetoworkspace, 9"
"$modShiftCtrl, 0, movetoworkspace, 10"
"$mod, Q, workspace, 1"
"$mod, W, workspace, 2"
"$mod, F, workspace, 3"
"$mod, P, workspace, 4"
"$mod, B, workspace, 5"
"$mod, J, workspace, 6"
"$mod, L, workspace, 7"
"$mod, U, workspace, 8"
"$mod, Y, workspace, 9"
"$mod, ', workspace, 10"
"$modShiftCtrl, Q, movetoworkspace, 1"
"$modShiftCtrl, W, movetoworkspace, 2"
"$modShiftCtrl, F, movetoworkspace, 3"
"$modShiftCtrl, P, movetoworkspace, 4"
"$modShiftCtrl, B, movetoworkspace, 5"
"$modShiftCtrl, J, movetoworkspace, 6"
"$modShiftCtrl, L, movetoworkspace, 7"
"$modShiftCtrl, U, movetoworkspace, 8"
"$modShiftCtrl, Y, movetoworkspace, 9"
"$modShiftCtrl, ', movetoworkspace, 10"
"$modShiftCtrl, $left, movetoworkspace, e-1"
"$modShiftCtrl, $right, movetoworkspace, e+1"
"$modShiftCtrl, left, movetoworkspace, e-1"
"$modShiftCtrl, right, movetoworkspace, e+1"
];
# binde = [
# "$mod, comma, resizeactive, -10 0"
# "$mod, period, resizeactive, 10 0"
# "$modShift, comma, resizeactive, 0 -10"
# "$modShift, period, resizeactive, 0 10"
# ];
bindl = [
", switch:on:Lid Switch, exec, hyprctl keyword monitor 'eDP-1, disable'"
", switch:off:Lid Switch, exec, hyprctl keyword monitor 'eDP-1, preferred, 1920x0, 1.2'"
", XF86MonBrightnessUp, exec, brightnessctl s 5%+"
", XF86MonBrightnessDown, exec, brightnessctl s 5%-"
"ALT, XF86MonBrightnessUp, exec, brightnessctl s 5%+ -d ${keyboard}::kbd_backlight"
"ALT, XF86MonBrightnessDown, exec, brightnessctl s 5%- -d ${keyboard}::kbd_backlight"
", XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"
", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
", XF86AudioPlay, exec, playerctl play-pause"
", XF86AudioPrev, exec, playerctl previous"
", XF86AudioNext, exec, playerctl next"
"$modCtrl, Escape, exit"
];
binde = [
", XF86MonBrightnessUp, exec, brightnessctl s 5%+"
", XF86MonBrightnessDown, exec, brightnessctl s 5%-"
"ALT, XF86MonBrightnessUp, exec, brightnessctl s 5%+ -d ${keyboard}::kbd_backlight"
"ALT, XF86MonBrightnessDown, exec, brightnessctl s 5%- -d ${keyboard}::kbd_backlight"
", XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"
", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
];
bindm = [
# mouse movements
"$mod, mouse:272, movewindow"
"$mod, mouse:273, resizewindow"
"$mod ALT, mouse:272, resizewindow"
];
gestures = {
workspace_swipe = true;
workspace_swipe_fingers = 3;
workspace_swipe_distance = 300;
};
workspace = [
"1, defaultName:general"
"2, defaultName:browse"
"3, defaultName:chat"
"4, defaultName:code"
"5, defaultName:uni"
"6, defaultName:games"
"7, defaultName:sysadmin"
"8, defaultName:media"
"9, defaultName:bg"
# "10, defaultName:"
];
windowrulev2 = [
# tray/misc utilities
"float, initialTitle:MainPicker" # why is it not floating by default
"float, class:(com.saivert.pwvucontrol)"
"float, class:(re.sonny.Junction)"
"float, class:(com.github.hluk.copyq)"
"float, class:(nm-connection-editor)"
"float, class:(.blueman-manager-wrapped)"
# screenshot editor
"noanim, class:com.gabm.satty"
"float, class:com.gabm.satty"
"rounding 0, class:com.gabm.satty"
"size 100% 100%, class:com.gabm.satty"
"move 0 0, class:com.gabm.satty"
"pin, class:com.gabm.satty"
## games
"float, class:(com.mojang.minecraft.java-edition)"
"immediate, class:(com.mojang.minecraft.java-edition)"
# apex legends
# "immediate, class:(steam_app_1172470)"
# cs2
"immediate, class:(cs2)"
# deadlock
# "float, class:(steam_app_1422450)"
"fullscreen, class:(steam_app_1422450)"
"immediate, class:(steam_app_1422450)"
"immediate, initialTitle:(Ghostrunner)"
# dead by daylight
"immediate, class:deadbydaylight-egs-shipping.exe"
## workspace assignments
"workspace name:chat, class:org.telegram.desktop"
"workspace name:chat, class:org.signal.Signal"
"workspace name:chat, class:im.riot.Riot"
"workspace name:chat, class:WebCord"
"workspace name:games, class:com.heroicgameslauncher.hgl"
"workspace name:games, class:net.lutris.Lutris"
"workspace name:games, class:steam"
# "workspace name:game, class:"
];
};
extraConfig = ''
bind = $modShift, R, submap, resize
submap = resize
binde = , right, resizeactive, 10 0
binde = , left, resizeactive, -10 0
binde = , up, resizeactive, 0 -10
binde = , down, resizeactive, 0 10
binde = , $right, resizeactive, 10 0
binde = , $left, resizeactive, -10 0
binde = , $up, resizeactive, 0 -10
binde = , $down, resizeactive, 0 10
bind = , escape, submap, reset
submap = reset
'';
};
services.hyprpaper = {
enable = true;
};
services.hypridle = {
enable = true;
settings = {
general = {
before_sleep_cmd = "loginctl lock-session";
after_sleep_cmd = "hyprctl dispatch dpms on";
lock_cmd = "pidof hyprlock || hyprlock";
# unlock_cmd = "loginctl unlock-session";
};
listener = [
{
timeout = 600;
on-timeout = "pidof hyprlock || hyprlock";
}
{
timeout = 601;
on-timeout = "hyprctl dispatch dpms off";
on-resume = "hyprctl dispatch dpms on";
}
];
};
};
services.gnome-keyring = {
enable = true;
components = ["secrets" "ssh"];
};
services = {
network-manager-applet.enable = true;
blueman-applet.enable = true;
playerctld.enable = true;
copyq.enable = true;
};
gtk = {
enable = true;
iconTheme = {
name = "Papirus";
package = pkgs.papirus-icon-theme;
};
};
qt = {
enable = true;
# platformTheme.name = "gtk3";
#style.name = "gtk2";
};
dconf.settings = {
"org/gnome/desktop/interface" = {
icon-theme = "${config.gtk.iconTheme.name}";
};
};
stylix.targets.waybar.enable = false;
programs.waybar = {
enable = true;
#package = pkgs.waybar-0.11.0";
systemd = {
enable = true;
target = "graphical-session.target";
};
settings = {
bar-0 = {
layer = "top";
position = "bottom";
height = 40;
spacing = 6;
margin-left = 6;
margin-right = 6;
margin-bottom = 6;
reload_style_on_change = true;
modules-left = [
#"custom/notification"
"clock"
"wlr/taskbar"
];
modules-center = ["group/hypr" "custom/notification"];
modules-right = [
"privacy"
"tray"
"wireplumber"
(lib.mkIf (hostname != "dunamis")
"group/laptop")
"idle_inhibitor"
];
"hyprland/workspaces" = {
format = "{icon}";
format-icons = {
"1" = "I";
"2" = "II";
"3" = "III";
"4" = "IV";
"5" = "V";
"6" = "VI";
"7" = "VII";
"8" = "IIX";
"9" = "IX";
"10" = "X";
general = "󰾞";
browse = "󰜏";
chat = "󰭹";
code = "󰅩";
uni = "󰁰";
games = "󰺵";
sysadmin = "󰒓";
media = "󱖑";
bg = "󰣆";
#focused = "󰗝";
#active = "󰻃";
#default = "󰄰";
};
};
"hyprland/language" = {
format = "{}";
format-en = "🇺🇸";
format-uk = "🇺🇦";
};
"custom/separator" = {
format = "|";
interval = "once";
tooltip = false;
};
"custom/text" = {
format = "here will be workspaces";
interval = "once";
tooltip = false;
};
"group/hypr" = {
orientation = "inherit";
modules = [
"hyprland/language"
"hyprland/workspaces"
];
};
"group/laptop" = {
orientation = "inherit";
drawer = {
transition-duration = 500;
children-class = "laptop";
transition-left-to-right = false;
};
modules = [
"battery"
"power-profiles-daemon"
"custom/separator"
"custom/kbd-backlight"
"custom/separator"
"backlight"
"custom/separator"
];
};
"backlight" = {
# device = "intel_backlight";
format = "{percent}% {icon}";
format-icons = ["" ""];
};
"idle_inhibitor" = {
format = "{icon}";
format-icons = {
activated = "󰈈";
deactivated = "󰈉";
};
};
"tray" = {
icon-size = 24;
spacing = 3;
};
"clock" = {
interval = 1;
format = "{:%H:%M:%S}";
tooltip-format = "{:%d.%m.%Y}";
};
"custom/backlight" = {
format = "{}% {icon}";
interval = 1;
format-icons = ["󰃠"];
exec = "sudo -u user -- ~/.local/bin/brightness.nu get-percentage";
on-scroll-up = "sudo -u user -- ~/.local/bin/brightness.nu increase 2";
on-scroll-down = "sudo -u user ~/.local/bin/brightness.nu decrease 2";
};
"custom/kbd-backlight" = {
exec = "~/.local/bin/keyboard-brightness.nu get-percentage";
interval = 1;
format = "{}% {icon}";
format-icons = ["󰌌"];
on-scroll-up = "~/.local/bin/keyboard-brightness.nu increase";
on-scroll-down = "~/.local/bin/keyboard-brightness.nu decrease";
};
battery = {
states = {
good = 95;
warning = 30;
critical = 15;
};
format = "{capacity}% {icon}";
format-full = "{capacity}% 󱟢";
format-charging = "{capacity}% 󰂄";
format-plugged = "{capacity}% 󰚥";
format-alt = "{icon} {time}";
format-icons = ["󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹"];
};
"upower" = {
icon-size = 16;
format = "{percentage}";
hide-if-empty = true;
tooltip = true;
tooltip-spacing = 20;
};
"power-profiles-daemon" = {
format = "{icon}";
tooltip-format = "Power profile: {profile}\nDriver: {driver}";
tooltip = true;
format-icons = {
default = "󱡮";
performance = "󱡮";
balanced = "";
power-saver = "";
};
};
"wireplumber" = {
scroll-step = 3;
format = "{volume}% {icon}";
format-muted = "󰖁";
format-icons = ["󰕿" "󰖀" "󰕾"];
on-click = "${pkgs.pwvucontrol}/bin/pwvucontrol";
on-click-right = "wpctl set-mute @DEFAULT_SINK@ toggle";
};
"custom/notification" = {
tooltip = false;
format = "{icon}";
format-icons = {
notification = "";
none = "";
dnd-notification = "";
dnd-none = "";
};
return-type = "json";
exec-if = "which swaync-client";
exec = "swaync-client -swb";
on-click = "swaync-client -t -sw";
on-click-right = "swaync-client -d -sw";
escape = true;
};
"privacy" = {
# icon-spacing = 4;
icon-size = 16;
transition-duration = 250;
screenshare = {
type = "screenshare";
tooltip = true;
tooltip-icon-size = 24;
};
audio-in = {
type = "audio-in";
tooltip = true;
tooltip-icon-size = 24;
};
};
"wlr/taskbar" = {
format = "{icon}";
icon-size = 24;
icon-theme = "${config.dconf.settings."org/gnome/desktop/interface".icon-theme}";
tooltip-format = "{title}";
on-click = "activate";
};
};
};
style = ''
@define-color base00 #${config.lib.stylix.colors.base00};
@define-color base01 #${config.lib.stylix.colors.base01};
@define-color base02 #${config.lib.stylix.colors.base02};
@define-color base03 #${config.lib.stylix.colors.base03};
@define-color base04 #${config.lib.stylix.colors.base04};
@define-color base05 #${config.lib.stylix.colors.base05};
@define-color base06 #${config.lib.stylix.colors.base06};
@define-color base07 #${config.lib.stylix.colors.base07};
@define-color base08 #${config.lib.stylix.colors.base08};
@define-color base09 #${config.lib.stylix.colors.base09};
@define-color base0A #${config.lib.stylix.colors.base0A};
@define-color base0B #${config.lib.stylix.colors.base0B};
@define-color base0C #${config.lib.stylix.colors.base0C};
@define-color base0D #${config.lib.stylix.colors.base0D};
@define-color base0E #${config.lib.stylix.colors.base0E};
@define-color base0F #${config.lib.stylix.colors.base0F};
* {
font-family: ${config.stylix.fonts.sansSerif.name}, FontAwesome;
font-weight: 500;
font-size: 100%;
/* margin: 0px 2px 2px 2px; */
}
window#waybar {
background-color: transparent;
/* border-top: 3px solid @overlay0; */
color: @base05;
/* padding: 0px 2px 0px 0px; */
transition-property: background-color;
transition-duration: 0.5s;
}
.modules-left {
border-radius: 16px;
}
.modules-center {
border-radius: 16px;
}
.modules-right {
border-radius: 16px;
}
tooltip {
background: @base01;
border: 1px solid @base0E;
}
tooltip label {
color: @base05;
}
/* .modules-center {
margin: 4px;
margin-top: 6px;
}*/
button {
box-shadow: inset 0 -3px transparent;
border-radius: 16px;
}
/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */
button:hover {
background: inherit;
box-shadow: inset 0 -3px transparent;
}
#mode {
background-color: rgba(0, 0, 0, 0.2);
box-shadow: inset 0 -3px @base05;
}
#clock,
#battery,
#cpu,
#memory,
#disk,
#temperature,
#backlight,
#custom-backlight,
#custom-kbd-backlight,
#workspaces,
#network,
#pulseaudio,
#wireplumber,
#custom-media,
#laptop,
#tray,
#mode,
#privacy
#privacy-item,
#idle_inhibitor,
#backlight-slider,
#custom-notification,
#scratchpad,
#power-profiles-daemon,
#taskbar,
#language,
#upower,
#mpris,
#mpd {
padding: 0 0.8em;
border-radius: 16px;
color: @base05;
background-color: @base00;
}
/* #upower, */
#battery,
#backlight,
#custom-kbd-backlight,
#backlight-slider,
#cpu,
#memory,
#disk,
#network,
#wireplumber,
#power-profiles-daemon {
padding-right: 0.8em;
}
#language {
padding-right: 0;
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
#workspaces {
font-weight: bold;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
#taskbar,
#idle_inhibitor,
#workspaces {
padding: 0 0.5em;
}
#taskbar button,
#workspaces button {
padding: 0 0.2em;
}
#workspaces button.active {
color: @base0D;
}
#taskbar button:hover {
box-shadow: transparent;
}
#taskbar.empty,
window#empty {
background-color: transparent;
}
#battery.critical:not(.charging) {
background-color: @base09;
color: @base00;
animation-name: blink;
animation-duration: 0.5s;
animation-timing-function: steps(12);
animation-iteration-count: infinite;
animation-direction: alternate;
}
#power-profiles-daemon.performance {
background-color: @base00;
color: @base0D;
}
#power-profiles-daemon.balanced {
background-color: @base00;
color: @base0B;
}
#power-profiles-daemon.power-saver {
background-color: @base00;
color: @base0A;
}
label:focus {
background-color: #000000;
}
#tray > .passive {
-gtk-icon-effect: dim;
}
#tray > .needs-attention {
-gtk-icon-effect: highlight;
background-color: @base08;
}
#idle_inhibitor {
padding: 0 0.9em;
}
#idle_inhibitor:hover {
box-shadow: inset 0 -3px @base05;
}
#idle_inhibitor.activated {
background-color: @base05;
color: @base00;
}
#idle_inhibitor.activated:hover {
box-shadow: inset 0 -3px @base00;
}
#laptop,
#privacy {
padding: 0em;
}
#privacy-item.screenshare {
background-color: @base00;
color: @base0C;
}
#privacy-item.audio-in {
background-color: @base00;
color: @base0E;
}
#privacy-item.audio-out {
background-color: @base;
}
'';
};
# stylix.targets.wofi.enable = false;
programs.rofi = {
enable = false;
theme = {
window = {
height = 360;
border = 3;
};
inputbar = {
children = ["prompt" "entry"];
border-radius = 5;
padding = 2;
};
prompt = {
padding = 6;
border-radius = 3;
margin = "20px 0px 0px 20px";
};
textbox-prompt-colon = {
expand = false;
str = "~>";
};
entry = {
padding = 6;
margin = "20px 0px 0px 10px";
};
listview = {
border = "0px 0px 0px";
padding = "6px 0px 0px";
margin = "10px 0px 0px 20px";
columns = 2;
lines = 5;
};
element = {
padding = 5;
};
element-icon = {
size = 25;
};
mode-switcher = {
spacing = 0;
};
button = {
padding = 10;
vertical-align = "0.5";
horizontal-align = "0.5";
};
message = {
margin = 2;
padding = 2;
border-radius = 5;
};
textbox = {
padding = 6;
margin = "20 0 0 20";
};
};
extraConfig = {
show-icons = true;
modi = "run,drun,window";
kb-primary-paste = "Control+V,Shift+Insert";
kb-secondary-paste = "Control+v,Insert";
};
};
programs.wofi = {
enable = false;
settings = {
show = "drun";
width = "450";
height = "350";
always_parse_args = true;
show_all = true;
term = "wezterm";
hide_scroll = true;
print_command = true;
insensitive = true;
prompt = "~>";
columns = 2;
halign = "fill";
#valign = "fill";
line_wrap = "char";
dynamic_lines = false;
};
style = lib.mkDefault ''
@define-color base00 #${config.lib.stylix.colors.base00};
@define-color base01 #${config.lib.stylix.colors.base01};
@define-color base02 #${config.lib.stylix.colors.base02};
@define-color base03 #${config.lib.stylix.colors.base03};
@define-color base04 #${config.lib.stylix.colors.base04};
@define-color base05 #${config.lib.stylix.colors.base05};
@define-color base06 #${config.lib.stylix.colors.base06};
@define-color base07 #${config.lib.stylix.colors.base07};
@define-color base08 #${config.lib.stylix.colors.base08};
@define-color base09 #${config.lib.stylix.colors.base09};
@define-color base0A #${config.lib.stylix.colors.base0A};
@define-color base0B #${config.lib.stylix.colors.base0B};
@define-color base0C #${config.lib.stylix.colors.base0C};
@define-color base0D #${config.lib.stylix.colors.base0D};
@define-color base0E #${config.lib.stylix.colors.base0E};
@define-color base0F #${config.lib.stylix.colors.base0F};
* {
/* font-family: ${config.stylix.fonts.serif.name}, monospace; */
font-size: 16px;
}
/* Window */
window {
margin: 0px;
padding: 8px;
border: 4px solid @base0D;
border-radius: 16px;
background-color: @base00;
}
/* Inner Box */
#inner-box {
margin: 5px;
padding: 10px;
border: none;
background-color: @base00;
}
/* Outer Box */
#outer-box {
margin: 5px;
padding: 10px;
border: none;
background-color: @base00;
}
/* Scroll */
#scroll {
margin: 0px;
padding: 10px;
border: none;
background-color: @base00;
}
/* Input */
#input {
margin: 5px 20px;
padding: 10px;
border: none;
border-radius: 7px;
color: @base05;
background-color: @base00;
}
#input image {
border: none;
color: @base08;
}
#input * {
outline: 4px solid @base0C!important;
}
/* Text */
#text {
margin: 5px;
border: none;
color: @base05;
}
#entry {
background-color: @base00;
}
#entry arrow {
border: none;
color: @base0E;
}
/* Selected Entry */
#entry:selected {
border: 0.11em solid @base0D;
}
#entry:selected #text {
color: @base0C;
}
#entry:drop(active) {
background-color: @base0A!important;
}
'';
};
programs.walker = {
enable = true;
package = pkgs.walker;
runAsService = true;
config = {
activation_mode.labels = "neiotsra";
# theme = "stylix";
as_window = false;
builtins = {
applications = {
actions = {enabled = true;};
context_aware = true;
name = "applications";
placeholder = "Applications";
prioritize_new = true;
refresh = true;
show_generic = false;
show_icon_when_single = true;
show_sub_when_single = true;
weight = 5;
};
calc = {
icon = "accessories-calculator";
min_chars = 4;
name = "calc";
placeholder = "Calculator";
weight = 5;
};
clipboard = {
image_height = 300;
max_entries = 10;
name = "clipboard";
placeholder = "Clipboard";
switcher_only = true;
weight = 5;
};
commands = {
icon = "utilities-terminal";
name = "commands";
placeholder = "Commands";
switcher_only = true;
weight = 5;
};
custom_commands = {
icon = "utilities-terminal";
name = "custom_commands";
placeholder = "Custom Commands";
weight = 5;
};
dmenu = {
name = "dmenu";
placeholder = "Dmenu";
switcher_only = true;
weight = 5;
};
emojis = {
history = true;
name = "emojis";
placeholder = "Emojis";
switcher_only = true;
typeahead = true;
weight = 5;
};
finder = {
concurrency = 8;
icon = "folder";
ignore_gitignore = true;
name = "finder";
placeholder = "Finder";
refresh = true;
switcher_only = true;
weight = 5;
};
runner = {
generic_entry = false;
history = true;
icon = "utilities-terminal";
name = "runner";
placeholder = "Runner";
refresh = true;
typeahead = true;
weight = 5;
};
ssh = {
history = true;
icon = "preferences-system-network";
name = "ssh";
placeholder = "SSH";
refresh = true;
switcher_only = true;
weight = 5;
};
switcher = {
name = "switcher";
placeholder = "Switcher";
prefix = "/";
weight = 5;
};
# websearch = {
# engines = ["google"];
# icon = "applications-internet";
# name = "websearch";
# placeholder = "Websearch";
# weight = 5;
# };
windows = {
icon = "view-restore";
name = "windows";
placeholder = "Windows";
weight = 5;
};
};
disable_click_to_close = false;
force_keyboard_focus = true;
list = {
max_entries = 50;
show_initial_entries = true;
single_click = true;
};
search = {
delay = 0;
force_keyboard_focus = true;
history = true;
placeholder = "Search...";
};
};
theme = {
layout = {
ui = {
anchors = {
bottom = false;
left = false;
right = false;
top = false;
};
window = {
h_align = "center";
v_align = "center";
box = {
width = 500;
height = 300;
h_align = "center";
v_align = "center";
spacing = 12;
orientation = "vertical";
# margins = {
# bottom = 200;
# top = 200;
# start = 200;
# };
search = {
margins = {
bottom = 0;
top = 0;
start = 8;
end = 8;
};
spacing = 12;
# v_align = "baseline";
h_align = "top";
h_expand = true;
v_expand = true;
};
scroll = {
h_align = "fill";
v_align = "fill";
h_expand = false;
overlay_scrolling = true;
list = {
# max_height = 300;
margins = {
bottom = 8;
top = 0;
start = 8;
end = 8;
};
always_show = true;
v_align = "fill";
h_align = "bottom";
h_expand = true;
v_expand = true;
item = {
icon.theme = "${config.gtk.iconTheme.name}";
spacing = 4;
activation_label = {
h_align = "end";
# v_align = "bottom";
h_expand = false;
justify = "right";
spacing = 4;
margins.end = 12;
# x_align = 1;
};
text = {
h_align = "start";
h_expand = true;
revert = true;
wrap = true;
};
};
};
};
};
};
};
};
style = ''
@define-color base00 #${config.lib.stylix.colors.base00};
@define-color base01 #${config.lib.stylix.colors.base01};
@define-color base02 #${config.lib.stylix.colors.base02};
@define-color base03 #${config.lib.stylix.colors.base03};
@define-color base04 #${config.lib.stylix.colors.base04};
@define-color base05 #${config.lib.stylix.colors.base05};
@define-color base06 #${config.lib.stylix.colors.base06};
@define-color base07 #${config.lib.stylix.colors.base07};
@define-color base08 #${config.lib.stylix.colors.base08};
@define-color base09 #${config.lib.stylix.colors.base09};
@define-color base0A #${config.lib.stylix.colors.base0A};
@define-color base0B #${config.lib.stylix.colors.base0B};
@define-color base0C #${config.lib.stylix.colors.base0C};
@define-color base0D #${config.lib.stylix.colors.base0D};
@define-color base0E #${config.lib.stylix.colors.base0E};
@define-color base0F #${config.lib.stylix.colors.base0F};
#window,
#box,
#search,
#password,
#input,
#typeahead,
#spinner,
#list,
child,
scrollbar,
slider,
#item,
#text,
#label,
#sub,
#activationlabel {
all: unset;
}
#window {
background: none;
color: @base05;
}
#box {
border-radius: 20px;
border-width: 4px;
border-color: @base0D;
background: @base00;
}
#search {
background: @base01;
border-radius: 12px;
padding: 8px;
}
#password,
#input,
#typeahead {
background: none;
box-shadow: none;
border-radius: 12px;
}
#input > *:first-child,
#typeahead > *:first-child {
margin-right: 12px;
border-radius: 12px;
}
/* #spinner {
} */
#typeahead {
color: @base05;
}
#input placeholder {
opacity: 0.5;
}
#list {
padding: 8px;
border-radius: 12px;
background: @base01;
}
child {
box-shadow: none;
}
child:selected,
child:hover {
box-shadow: none;
border-radius: 8px;
background: @base02;
}
#item {
padding: 4px;
}
/* #icon {
}
#text {
}
#label {
} */
#sub {
font-size: smaller;
opacity: 0.5;
}
#activationlabel {
opacity: 0.5;
}
.activation #activationlabel {
opacity: 1;
color: @base05;
}
.activation #text,
.activation #icon,
.activation #search {
opacity: 0.5;
}
'';
};
};
services.swaync = {
enable = true;
settings = {
cssPriority = "user";
image-visibility = "when-available";
keyboard-shortcut = true;
relative-timestamps = true;
timeout = 5;
timeout-low = 5;
timeout-critical = 0;
script-fail-notify = true;
transition-time = 200;
# Layer settings
layer-shell = true;
layer = "overlay";
control-center-layer = "overlay";
# Notification settings
positionX = "right";
positionY = "top";
notification-2fa-action = true;
notification-inline-replies = false;
notification-icon-size = 32;
notification-body-image-height = 100;
notification-body-image-width = 200;
notification-window-width = 300;
# Control center settings
control-center-positionX = "right";
control-center-positionY = "top";
control-center-width = 500;
control-center-exclusive-zone = true;
fit-to-screen = true;
hide-on-action = true;
hide-on-clear = false;
# Widget settings
widgets = [
"title"
"dnd"
"notifications"
"mpris"
];
widget-config = {
title = {
text = "Notifications";
clear-all-button = true;
button-text = "Clear All";
};
dnd = {
text = "Do Not Disturb";
};
mpris = {
image-size = 96;
image-radius = 12;
blur = true;
};
};
};
style = ''
/*** Global ***/
progress,
progressbar,
trough {
border-radius: 16px;
}
.app-icon,
.image {
-gtk-icon-effect: none;
}
.notification-action {
border-radius: 12px;
margin: 0.5rem;
}
.close-button {
margin: 24px;
padding: 0.2rem;
border-radius: 16px;
}
/*** Notifications ***/
.notification-group.collapsed
.notification-row:not(:last-child)
.notification-action,
.notification-group.collapsed
.notification-row:not(:last-child)
.notification-default-action {
opacity: 0;
}
.trough {
margin: 4px;
border-radius: 7px;
}
.notification,
.notification.low,
.notification.normal,
.notification.critical,
.control-center {
margin: 16px;
border-radius: 7px;
}
.floating-notifications,
.notification-content {
border-radius: 7px;
}
.control-center-list {
background: transparent;
}
/*** Widgets ***/
/* Title widget */
.widget-title {
margin: 0.5rem;
}
.widget-title > label {
font-weight: bold;
}
.widget-title > button {
border-radius: 16px;
padding: 0.5rem;
}
/* DND Widget */
.widget-dnd {
margin: 0.5rem;
}
.widget-dnd > label {
font-weight: bold;
}
.widget-dnd > switch {
border-radius: 16px;
}
.widget-dnd > switch slider {
border-radius: 16px;
padding: 0.25rem;
}
/* Mpris widget */
.widget-mpris .widget-mpris-player {
border-radius: 16px;
margin: 0.5rem;
padding: 0.5rem;
}
.widget-mpris .widget-mpris-player .widget-mpris-album-art {
border-radius: 16px;
}
.widget-mpris .widget-mpris-player .widget-mpris-title {
font-weight: bold;
}
.widget-mpris .widget-mpris-player .widget-mpris-subtitle {
font-weight: normal;
}
.widget-mpris .widget-mpris-player > box > button {
border: 1px solid transparent;
border-radius: 16px;
padding: 0.25rem;
}
'';
};
services.dunst = {
enable = false;
settings = {
global = {
width = 300;
height = 300;
icon_theme = "${config.dconf.settings."org/gnome/desktop/interface".icon-theme}";
corner_radius = lib.mkDefault 9;
#corners = "top-right,bottom-left";
offset = "16x16";
origin = "bottom-right";
timeout = 15;
frame_width = 3;
notification_limit = 5;
};
rule-telegram = {
"desktop_entry" = "org.telegram.desktop";
"urgency" = "normal";
};
};
};
stylix.targets.hyprlock.enable = false;
programs.hyprlock = {
enable = true;
settings = {
general = {
disable_loading_bar = true;
#grace = 300;
hide_cursor = true;
no_fade_in = false;
};
background = [
{
path = "screenshot";
blur_passes = 4;
blur_size = 8;
}
];
input-field = [
{
size = "274, 50";
rounding = 12;
outline_thickness = 3;
position = "0, 0";
monitor = "";
dots_center = true;
fade_on_empty = false;
font_family = "${config.stylix.fonts.serif.name}";
font_color = "rgb(${config.lib.stylix.colors.base05})";
inner_color = "rgb(${config.lib.stylix.colors.base00})";
outer_color = "rgb(${config.lib.stylix.colors.base0D})";
check_color = "rgb(${config.lib.stylix.colors.base0A})";
fail_color = "rgb(${config.lib.stylix.colors.base08})";
placeholder_text = "locked...";
fail_text = "wrong";
#placeholder_text = '\'<span foreground="##cad3f5">Password...</span>'\';
shadow_passes = 0;
}
];
shape = [
{
rounding = 12;
#border_size = 3;
size = "274, 50";
color = "rgb(${config.lib.stylix.colors.base00})";
border_color = "rgb(${config.lib.stylix.colors.base0D})";
position = "0, 60";
halign = "center";
valign = "center";
}
{
rounding = 12;
#border_size = 3;
size = "274, 50";
color = "rgb(${config.lib.stylix.colors.base00})";
border_color = "rgb(${config.lib.stylix.colors.base0D})";
position = "0, -60";
halign = "center";
valign = "center";
}
];
label = [
{
monitor = "";
text = "$LAYOUT"; #"cmd[update:1000] ${pkgs.uutils-coreutils-noprefix}/bin/echo $(${pkgs.uutils-coreutils-noprefix}/bin/date +%H:%M:%S)";
#text = "$TIME
text_align = "center";
font_size = 16;
font_family = "${config.stylix.fonts.serif.name}";
outer_color = "rgb(${config.lib.stylix.colors.base00})";
color = "rgb(${config.lib.stylix.colors.base05})";
position = "0, 60";
halign = "center";
valign = "center";
}
{
monitor = "";
text = "cmd[update:1000] ${pkgs.uutils-coreutils-noprefix}/bin/echo $(${pkgs.uutils-coreutils-noprefix}/bin/date +'%m/%d %a %T')";
#text = "$TIME
text_align = "center";
font_size = 16;
font_family = "${config.stylix.fonts.serif.name}";
outer_color = "rgb(${config.lib.stylix.colors.base00})";
color = "rgb(${config.lib.stylix.colors.base05})";
position = "0, -60";
halign = "center";
valign = "center";
}
];
};
};
services.wlsunset = {
enable = true;
latitude = "49.6";
longitude = "36.1";
temperature = {
day = 6500;
night = 3000;
};
systemdTarget = "graphical-session.target";
};
services.udiskie = {
enable = true;
automount = false;
notify = true;
tray = "auto";
};
services.flameshot = {
enable = false;
settings = {
General = {
buttons = "@Variant(000x7f000vQList<int>0000x130000000x1000x2000x3000x4000x5000x6000x12000xf000x13000b000 000x10000000v000x17000xe000f000x11)";
filenamePattern = "screenshot-%F_%H-%M-%S";
saveAsFileExtension = "png";
savePath = "/home/user/pics/screenshots";
uiColor = "#${config.lib.stylix.colors.base0D}";
showStartupLaunchMessage = false;
showDesktopNotification = false;
showHelp = false;
};
};
};
home.packages = with pkgs; [
brightnessctl
nautilus
helvum
loupe
evince
junction
celluloid
mission-center
dconf
glib
grimblast
grim
slurp
libnotify
playerctl
wdisplays
pwvucontrol
wl-clipboard-rs
libqalculate
#papirus-icon-theme
];
xdg.mime.enable = true;
xdg.mimeApps = {
enable = true;
defaultApplications = let
file_manager = ["org.gnome.Nautilus.desktop"];
web_browser = ["re.sonny.Junction.desktop"];
image_viewer = ["org.gnome.Loupe.desktop"];
video_player = ["io.github.celluloid_player.Celluloid.desktop"];
pdf_reader = ["org.gnome.Evince.desktop"];
in {
"inode/directory" = file_manager;
"video/x-matroska" = video_player;
"video/mp4" = video_player;
"video/mpeg" = video_player;
"video/x-mpeg" = video_player;
"image/png" = image_viewer;
"image/jpeg" = image_viewer;
"application/pdf" = pdf_reader;
"text/html" = web_browser;
"x-scheme-handler/http" = web_browser;
"x-scheme-handler/https" = web_browser;
"x-scheme-handler/about" = web_browser;
"x-scheme-handler/unknown" = web_browser;
};
};
systemd.user.settings.Manager.DefaultEnvironment = {
# QT_QPA_PLATFORMTHEME = "gtk3";
QT_QPA_PLATFORM = "wayland";
};
systemd.user.targets.tray = {
# workaround for udiskie
Unit = {
Description = "Home Manager System Tray";
};
};
systemd.user = {
services = {
udiskie = {
Unit = {
PartOf = ["graphical-session.target"];
After = ["graphical-session.target"];
Requisite = ["graphical-session.target"];
};
Install = {
WantedBy = ["hyprland-session.target"];
};
};
waybar = {
Unit = {
PartOf = ["graphical-session.target"];
After = ["graphical-session.target"];
Requisite = ["graphical-session.target"];
};
Install = {
WantedBy = ["hyprland-session.target"];
};
};
copyq = {
Unit = {
PartOf = ["graphical-session.target"];
After = ["graphical-session.target"];
Requisite = ["graphical-session.target"];
};
Install = {
WantedBy = ["hyprland-session.target"];
};
Service = {
Environment = lib.mkForce "QT_QPA_PLATFORM=wayland";
Restart = "on-failure";
RestartSec = 1;
TimeoutStopSec = 10;
};
};
network-manager-applet = {
Unit = {
PartOf = ["graphical-session.target"];
After = ["graphical-session.target"];
Requisite = ["graphical-session.target"];
};
Install = {
WantedBy = ["hyprland-session.target"];
};
};
# gnome-polkit-agent = {
# Unit = {
# PartOf = ["graphical-session.target"];
# After = ["graphical-session.target"];
# Requisite = ["graphical-session.target"];
# };
# Install = {
# WantedBy = ["hyprland-session.target"];
# };
# Service = {
# Type = "simple";
# ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
# Restart = "on-failure";
# RestartSec = 1;
# TimeoutStopSec = 10;
# };
# };
hyprpolkitagent = {
Install.WantedBy = ["hyprland-session.target"];
Service = {
Type = "simple";
ExecStart = "${pkgs.hyprpolkitagent}/libexec/hyprpolkitagent";
Restart = "on-failure";
RestartSec = 1;
TimeoutStopSec = 10;
};
};
wlsunset = {
Unit = {
PartOf = ["graphical-session.target"];
After = ["graphical-session.target"];
Requisite = ["graphical-session.target"];
};
Install = {
WantedBy = ["hyprland-session.target"];
};
};
};
};
};
}