From 0ef575b082b834215d6f21a6fda351d67d96a980 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Sun, 27 Apr 2025 18:32:40 +0200 Subject: [PATCH] use dbus keybind for releasing super for overview AAAAAAAAAAAAAAAA LETS FUCKING GO FINALLY A GOOD LOOKING LAUNCHER THAT POPS UP INSTANTLY --- .config/hypr/hyprland.conf | 3 ++ .config/hypr/hyprland/execs.conf | 2 +- .config/hypr/hyprland/keybinds.conf | 35 +++++++++++-------- .../quickshell/modules/overview/Overview.qml | 24 ++++++++++++- 4 files changed, 47 insertions(+), 17 deletions(-) diff --git a/.config/hypr/hyprland.conf b/.config/hypr/hyprland.conf index aa7c076c..1255db74 100644 --- a/.config/hypr/hyprland.conf +++ b/.config/hypr/hyprland.conf @@ -1,6 +1,9 @@ # This file sources other files in `hyprland` and `custom` folders # You wanna add your stuff in file in `custom` +exec = hyprctl dispatch submap global # DO NOT REMOVE THIS OR YOU WON'T BE ABLE TO USE ANY KEYBIND +submap = global # This is required for catchall to work + # Defaults source=~/.config/hypr/hyprland/env.conf source=~/.config/hypr/hyprland/execs.conf diff --git a/.config/hypr/hyprland/execs.conf b/.config/hypr/hyprland/execs.conf index 232f7e1d..a9f867d1 100644 --- a/.config/hypr/hyprland/execs.conf +++ b/.config/hypr/hyprland/execs.conf @@ -1,7 +1,7 @@ # Bar, wallpaper exec-once = swww-daemon --format xrgb exec-once = /usr/lib/geoclue-2.0/demos/agent & gammastep -exec-once = agsv1 & +exec-once = qs & # Input method exec-once = fcitx5 diff --git a/.config/hypr/hyprland/keybinds.conf b/.config/hypr/hyprland/keybinds.conf index 2dc2df7c..c86220d1 100644 --- a/.config/hypr/hyprland/keybinds.conf +++ b/.config/hypr/hyprland/keybinds.conf @@ -1,3 +1,23 @@ +# These absolutely need to be the first, or they won't work consistently +bindid = Super, Super_L, Toggle overview, global, quickshell:overviewToggleRelease +binditn = Super, catchall, global, quickshell:overviewToggleReleaseInterrupt +bind = Super, mouse:272, global, quickshell:overviewToggleReleaseInterrupt +bind = Super, mouse:273, global, quickshell:overviewToggleReleaseInterrupt +bind = Super, mouse:274, global, quickshell:overviewToggleReleaseInterrupt +bind = Super, mouse:275, global, quickshell:overviewToggleReleaseInterrupt +bind = Super, mouse:276, global, quickshell:overviewToggleReleaseInterrupt +bind = Super, mouse:277, global, quickshell:overviewToggleReleaseInterrupt +bind = Super, mouse_up, global, quickshell:overviewToggleReleaseInterrupt +bind = Super, mouse_down,global, quickshell:overviewToggleReleaseInterrupt + +bindit = ,Super_L, global, quickshell:workspaceNumber +bind = Super, Tab, global, quickshell:overviewToggle +bind = Super, B, global, quickshell:sidebarLeftToggle +bind = Super, A, global, quickshell:sidebarLeftToggle +bind = Super, O, global, quickshell:sidebarLeftToggle +bind = Super, N, global, quickshell:sidebarRightToggle +bind = Ctrl+Alt, Delete, global, quickshell:sessionToggle + # Lines ending with `# [hidden]` won't be shown on cheatsheet # Lines starting with #! are section headings @@ -160,13 +180,7 @@ bind = Alt, Tab, bringactivetotop, # [hidden] bring it to the top bindr = Ctrl+Super, R, exec, killall ags agsv1 gjs ydotool; agsv1 & # Restart widgets bindr = Ctrl+Super+Alt, R, exec, hyprctl reload; killall agsv1 ydotool; agsv1 & # [hidden] bind = Ctrl+Alt, Slash, exec, agsv1 run-js 'cycleMode();' # Cycle bar mode (normal, focus) -bindr = Super, Super_L, exec, qs ipc call overview toggle || agsv1 -t 'overview' # Toggle overview/launcher -# bind = Super, Tab, exec, qs ipc call overview toggle || agsv1 -t 'overview' # [hidden] bind = Super, Slash, exec, for ((i=0; i<$(hyprctl monitors -j | jq length); i++)); do agsv1 -t "cheatsheet""$i"; done # Show cheatsheet -bind = Super, B, exec, qs ipc call sidebarLeft toggle || agsv1 -t 'sideleft' # Toggle left sidebar -bind = Super, A, exec, qs ipc call sidebarLeft toggle || agsv1 -t 'sideleft' # [hidden] -bind = Super, O, exec, qs ipc call sidebarLeft toggle || agsv1 -t 'sideleft' # [hidden] -# bind = Super, N, exec, qs ipc call sidebarRight toggle || agsv1 -t 'sideright' # Toggle right sidebar bind = Super, M, exec, agsv1 run-js 'openMusicControls.value = (!mpris.getPlayer() ? false : !openMusicControls.value);' # Toggle music controls bind = Super, Comma, exec, agsv1 run-js 'openColorScheme.value = true; Utils.timeout(2000, () => openColorScheme.value = false);' # View color scheme and options bind = Super, K, exec, for ((i=0; i<$(hyprctl monitors -j | jq length); i++)); do agsv1 -t "osk""$i"; done # Toggle on-screen keyboard @@ -175,11 +189,6 @@ bind = Ctrl+Super, G, exec, for ((i=0; i<$(hyprctl monitors -j | jq length); i++ bindle=, XF86MonBrightnessUp, exec, qs ipc call brightness increment || agsv1 run-js 'brightness.screen_value += 0.05; indicator.popup(1);' # [hidden] bindle=, XF86MonBrightnessDown, exec, qs ipc call brightness decrement || agsv1 run-js 'brightness.screen_value -= 0.05; indicator.popup(1);' # [hidden] -# bind = Super, Super_L, global, quickshell:overviewToggleRelease -bindit = ,Super_L, global, quickshell:workspaceNumber -bind = Super, Tab, global, quickshell:overviewToggle -bind = Super, N, global, quickshell:sidebarRightToggle -bind = Ctrl+Alt, Delete, global, quickshell:sessionToggle # Testing bind = Super+Alt, f11, exec, bash -c 'RANDOM_IMAGE=$(find ~/Pictures -type f | grep -v -i "nipple" | grep -v -i "pussy" | shuf -n 1); ACTION=$(notify-send "Test notification with body image" "This notification should contain your user account image and Discord icon. Oh and here is a random image in your Pictures folder: \"Testing" -p -h "string:image-path:/var/lib/AccountsService/icons/$USER" -t 6000 -i "discord" -A "openImage=Open profile image" -A "action2=Open the random image" -A "action3=Useless button"); [[ $ACTION == *openImage ]] && xdg-open "/var/lib/AccountsService/icons/$USER"; [[ $ACTION == *action2 ]] && xdg-open \"$RANDOM_IMAGE\"' # [hidden] @@ -218,7 +227,3 @@ bind = Super+Alt, Slash, exec, pkill fuzzel || fuzzel # Toggle fallback launcher # Cursed stuff ## Make window not amogus large bind = Ctrl+Super, Backslash, resizeactive, exact 640 480 # [hidden] - - - - diff --git a/.config/quickshell/modules/overview/Overview.qml b/.config/quickshell/modules/overview/Overview.qml index c12143f5..aed8c0ab 100644 --- a/.config/quickshell/modules/overview/Overview.qml +++ b/.config/quickshell/modules/overview/Overview.qml @@ -10,7 +10,8 @@ import Quickshell.Wayland import Quickshell.Hyprland Scope { - id: overview + id: root + property bool overviewReleaseMightTrigger: true Variants { model: Quickshell.screens @@ -111,6 +112,9 @@ Scope { function open() { GlobalStates.overviewOpen = true } + function toggleReleaseInterrupt() { + root.overviewReleaseMightTrigger = false + } } GlobalShortcut { @@ -125,9 +129,27 @@ Scope { name: "overviewToggleRelease" description: "Toggles overview on release" + onPressed: { + root.overviewReleaseMightTrigger = true + } + onReleased: { + if (!root.overviewReleaseMightTrigger) { + root.overviewReleaseMightTrigger = true + return + } GlobalStates.overviewOpen = !GlobalStates.overviewOpen } } + GlobalShortcut { + name: "overviewToggleReleaseInterrupt" + description: "Interrupts possibility of overview being toggled on release" + + "This is necessary because onReleased triggers whether or not you press something else while holding the key." + + "To make sure this works consistently, use binditn = MODKEYS, catchall in an automatically triggered submap that includes everything." + + onPressed: { + root.overviewReleaseMightTrigger = false + } + } }