quickshell: native launcher + power menu, drop anyrun
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
9671dfb793
commit
77fca92c5c
2 changed files with 240 additions and 105 deletions
|
|
@ -55,7 +55,6 @@ in
|
|||
networkmanagerapplet
|
||||
pavucontrol
|
||||
polkit_gnome
|
||||
anyrun
|
||||
zenity
|
||||
libcanberra-gtk3
|
||||
];
|
||||
|
|
@ -167,30 +166,6 @@ in
|
|||
|
||||
extraConfig =
|
||||
let
|
||||
powerMenu = pkgs.writeShellScript "power-menu" ''
|
||||
# Stop the daemon so standalone stdin mode can run cleanly.
|
||||
# systemd restarts it automatically afterwards (Restart=on-failure).
|
||||
systemctl --user stop anyrun.service 2>/dev/null || true
|
||||
choice=$(printf '%s\n' \
|
||||
$'\uf023 Lock' \
|
||||
$'\uf08b Logout' \
|
||||
$'\uf01e Reboot' \
|
||||
$'\uf011 Shutdown' \
|
||||
| ${pkgs.anyrun}/bin/anyrun \
|
||||
--plugins "${pkgs.anyrun}/lib/libstdin.so" \
|
||||
--show-results-immediately true \
|
||||
--hide-plugin-info true \
|
||||
--close-on-click true)
|
||||
# Restart the daemon service (reset-failed clears the start-rate limiter).
|
||||
systemctl --user reset-failed anyrun.service 2>/dev/null
|
||||
systemctl --user start anyrun.service 2>/dev/null
|
||||
case "$choice" in
|
||||
*Lock) ${pkgs.hyprlock}/bin/hyprlock ;;
|
||||
*Logout) hyprctl dispatch exit ;;
|
||||
*Reboot) systemctl reboot ;;
|
||||
*Shutdown) systemctl poweroff ;;
|
||||
esac
|
||||
'';
|
||||
kbdBrightUp = pkgs.writeShellScript "kbd-bright-up" ''
|
||||
${pkgs.brightnessctl}/bin/brightnessctl -d smc::kbd_backlight set +10%
|
||||
brightness=$(${pkgs.brightnessctl}/bin/brightnessctl -d smc::kbd_backlight get)
|
||||
|
|
@ -260,7 +235,7 @@ in
|
|||
-- Apps
|
||||
hl.bind(mod .. " + T", hl.dsp.exec_cmd("ghostty"))
|
||||
hl.bind(mod .. " + E", hl.dsp.exec_cmd("nemo"))
|
||||
hl.bind(mod .. " + R", hl.dsp.exec_cmd("hyprctl layers -j | grep -q anyrun && anyrun close || anyrun"))
|
||||
hl.bind(mod .. " + R", hl.dsp.exec_cmd("${pkgs.quickshell}/bin/qs ipc call launcher toggle"))
|
||||
hl.bind(mod .. " + Q", hl.dsp.window.close())
|
||||
hl.bind(mod .. " + SHIFT + E", hl.dsp.exit())
|
||||
|
||||
|
|
@ -279,8 +254,8 @@ in
|
|||
hl.bind(mod .. " + K", hl.dsp.focus({ direction = "up" }))
|
||||
hl.bind(mod .. " + J", hl.dsp.focus({ direction = "down" }))
|
||||
|
||||
-- Power menu — dismiss launcher if open, then show menu
|
||||
hl.bind(mod .. " + L", hl.dsp.exec_cmd("anyrun close 2>/dev/null; ${powerMenu}"))
|
||||
-- Power menu (quickshell launcher in power mode)
|
||||
hl.bind(mod .. " + L", hl.dsp.exec_cmd("${pkgs.quickshell}/bin/qs ipc call launcher powermenu"))
|
||||
|
||||
-- Move windows
|
||||
hl.bind(mod .. " + SHIFT + left", hl.dsp.window.move({ direction = "left" }))
|
||||
|
|
@ -407,83 +382,6 @@ in
|
|||
# Hyprland session so they don't crash-loop in a GNOME session.
|
||||
wayland.systemd.target = "hyprland-session.target";
|
||||
|
||||
systemd.user.services.anyrun = {
|
||||
Unit = {
|
||||
Description = "Anyrun launcher daemon";
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
After = [ "graphical-session.target" ];
|
||||
};
|
||||
Service = {
|
||||
ExecStart = "${pkgs.anyrun}/bin/anyrun daemon";
|
||||
Restart = "on-failure";
|
||||
RestartSec = 2;
|
||||
};
|
||||
Install.WantedBy = [ "hyprland-session.target" ];
|
||||
};
|
||||
|
||||
xdg.configFile = {
|
||||
# anyrun config — written manually since HM 26.05 has no anyrun module.
|
||||
"anyrun/config.ron".text = ''
|
||||
Config(
|
||||
x: Fraction(0.5),
|
||||
y: Fraction(0.25),
|
||||
width: Absolute(350),
|
||||
height: Absolute(0),
|
||||
hide_icons: false,
|
||||
ignore_exclusive_zones: false,
|
||||
layer: Overlay,
|
||||
hide_plugin_info: true,
|
||||
close_on_click: true,
|
||||
max_entries: Some(8),
|
||||
plugins: [
|
||||
"${pkgs.anyrun}/lib/libapplications.so",
|
||||
],
|
||||
)
|
||||
'';
|
||||
"anyrun/style.css".text = ''
|
||||
* { all: unset; font-family: "FiraMono Nerd Font", monospace; font-size: 13px; }
|
||||
window { background: transparent; }
|
||||
box.main {
|
||||
background: #${c.base00};
|
||||
border: 1px solid #${c.base03};
|
||||
border-radius: 10px;
|
||||
padding: 8px;
|
||||
margin: 16px;
|
||||
}
|
||||
text {
|
||||
background: #${c.base01};
|
||||
color: #${c.base05};
|
||||
caret-color: #${c.base0D};
|
||||
padding: 8px 16px;
|
||||
border-radius: 6px;
|
||||
min-height: 0;
|
||||
}
|
||||
list.plugin { background: transparent; }
|
||||
.matches { background: transparent; }
|
||||
.match {
|
||||
padding: 4px 16px;
|
||||
border-radius: 6px;
|
||||
color: #${c.base05};
|
||||
background: transparent;
|
||||
}
|
||||
.match:selected {
|
||||
background: #${c.base02};
|
||||
border: none;
|
||||
}
|
||||
label.match.description { color: #${c.base04}; font-size: 11px; }
|
||||
'';
|
||||
"anyrun/applications.ron".text = ''
|
||||
(
|
||||
desktop_actions: false,
|
||||
max_entries: 8,
|
||||
terminal: Some((
|
||||
command: "ghostty",
|
||||
args: "-e {}",
|
||||
)),
|
||||
)
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue