bemoji, power menu

This commit is contained in:
Fern Garden 2025-08-05 13:45:14 +08:00
parent 3f6c52f187
commit 078a00771b

View file

@ -3,7 +3,26 @@
pkgs, pkgs,
... ...
}: }:
with lib; { with lib; let
power-menu = pkgs.writeScript "power-menu" ''
SELECTION="$(printf "󰌾 Lock\n󰶐 Power off monitors\n󰗽 Log out\n󰤄 Suspend\n Reboot\n󰐥 Shutdown" | fuzzel --dmenu -l 6 -p " ")"
case $SELECTION in
*"Lock")
loginctl lock-session;;
*"Power off monitors")
niri msg action power-off-monitors;;
*"Log out")
niri msg action exit;;
*"Suspend")
systemctl suspend;;
*"Reboot")
systemctl reboot;;
*"Shutdown")
systemctl poweroff;;
esac
'';
in {
imports = [../home.nix]; imports = [../home.nix];
# Consistent theming. # Consistent theming.
@ -36,7 +55,6 @@ with lib; {
# Wayland environment variables. # Wayland environment variables.
environment = { environment = {
CLUTTER_BACKEND = "wayland"; CLUTTER_BACKEND = "wayland";
DISPLAY = null;
GDK_BACKEND = "wayland,x11"; GDK_BACKEND = "wayland,x11";
MOZ_ENABLE_WAYLAND = "1"; MOZ_ENABLE_WAYLAND = "1";
NIXOS_OZONE_WL = "1"; NIXOS_OZONE_WL = "1";
@ -52,11 +70,6 @@ with lib; {
path = getExe pkgs.xwayland-satellite-unstable; path = getExe pkgs.xwayland-satellite-unstable;
}; };
# Autostart.
spawn-at-startup = [
{command = ["smile" "--start-hidden"];}
];
# Don't show client-side window decorations. # Don't show client-side window decorations.
prefer-no-csd = true; prefer-no-csd = true;
@ -76,7 +89,7 @@ with lib; {
# Spawn programs. # Spawn programs.
"Mod+Return".action.spawn = "ghostty"; "Mod+Return".action.spawn = "ghostty";
"Mod+Space".action.spawn = "fuzzel"; "Mod+Space".action.spawn = "fuzzel";
"Mod+E".action.spawn = "smile"; "Mod+E".action.spawn = "bemoji";
"Mod+Alt+L".action.spawn = "hyprlock"; "Mod+Alt+L".action.spawn = "hyprlock";
# Show overview # Show overview
@ -136,11 +149,8 @@ with lib; {
# Close windows. # Close windows.
"Mod+Q".action.close-window = {}; "Mod+Q".action.close-window = {};
# Quit Niri. # Power menu.
"Mod+Shift+E".action.quit = {}; "Mod+Shift+E".action.spawn = "${power-menu}";
# Turn off monitors.
"Mod+Shift+Escape".action.power-off-monitors = {};
# Take a screenshot. # Take a screenshot.
"Mod+P".action.screenshot = {}; "Mod+P".action.screenshot = {};
@ -232,15 +242,6 @@ with lib; {
proportion = 1.0 / 2.0; proportion = 1.0 / 2.0;
}; };
}; };
window-rules = [
{
matches = [
{app-id = "it.mijorus.smile";}
];
open-floating = true;
}
];
}; };
}; };
@ -270,93 +271,6 @@ with lib; {
stylix.targets.hyprlock.useWallpaper = false; stylix.targets.hyprlock.useWallpaper = false;
# Logout screen.
programs.wlogout = {
enable = true;
layout = [
{
label = "lock";
action = "loginctl lock-session";
text = "Lock";
keybind = "l";
}
{
label = "logout";
action = "niri msg action exit";
text = "Logout";
keybind = "e";
}
{
label = "suspend";
action = "systemctl suspend";
text = "Suspend";
keybind = "u";
}
{
label = "shutdown";
action = "systemctl poweroff";
text = "Shutdown";
keybind = "s";
}
{
label = "reboot";
action = "systemctl reboot";
text = "Reboot";
keybind = "r";
}
];
style = ''
* {
background-image: none;
box-shadow: none;
}
window {
background-color: rgba(12, 12, 12, 0.6);
}
button {
border-radius: 0;
border-color: #7fbbb3;
text-decoration-color: #d3c6aa;
color: #d3c6aa;
background-color: #272e33;
border-style: solid;
border-width: 1px;
background-repeat: no-repeat;
background-position: center;
background-size: 25%;
}
button:focus, button:active, button:hover {
outline-style: none;
background-color: #2e383c;
}
#lock {
background-image: image(url("${pkgs.wleave}/share/wleave/icons/lock.svg"));
}
#logout {
background-image: image(url("${pkgs.wleave}/share/wleave/icons/logout.svg"));
}
#suspend {
background-image: image(url("${pkgs.wleave}/share/wleave/icons/suspend.svg"));
}
#shutdown {
background-image: image(url("${pkgs.wleave}/share/wleave/icons/shutdown.svg"));
}
#reboot {
background-image: image(url("${pkgs.wleave}/share/wleave/icons/reboot.svg"));
}
'';
};
# Auto-lock. # Auto-lock.
services.hypridle = { services.hypridle = {
enable = true; enable = true;
@ -496,6 +410,7 @@ with lib; {
fonts.fontconfig.enable = true; # discover fonts installed by home.packages. fonts.fontconfig.enable = true; # discover fonts installed by home.packages.
home.packages = with pkgs; [ home.packages = with pkgs; [
bemoji
caligula caligula
celluloid celluloid
decibels decibels
@ -531,7 +446,6 @@ with lib; {
seahorse seahorse
signal-desktop signal-desktop
simple-scan simple-scan
smile
system-config-printer system-config-printer
via via
wdisplays wdisplays