mirror of
https://github.com/basecamp/omarchy.git
synced 2025-07-27 12:19:24 +00:00
Merge branch 'dev' into toggle-wofi
This commit is contained in:
51
bin/omarchy-show-keybindings
Executable file
51
bin/omarchy-show-keybindings
Executable file
@ -0,0 +1,51 @@
|
||||
#!/bin/bash
|
||||
|
||||
# A script to display Hyprland keybindings defined in your configuration
|
||||
# using wofi for an interactive search menu.
|
||||
|
||||
USER_HYPRLAND_CONF="$HOME/.config/hypr/hyprland.conf"
|
||||
OMARCHY_BINDINGS_CONF="$HOME/.local/share/omarchy/default/hypr/bindings.conf"
|
||||
|
||||
# Process the configuration file to extract and format keybindings
|
||||
# 1. `grep` finds all lines starting with 'bind' (allowing for leading spaces).
|
||||
# 2. The first `sed` removes comments (anything after a '#').
|
||||
# 3. `awk` does the heavy lifting of formatting the output.
|
||||
# - It sets the field separator to a comma ','.
|
||||
# - It removes the 'bind... =' part from the beginning of the line.
|
||||
# - It joins the key combination (e.g., "SUPER + Q").
|
||||
# - It joins the command that the key executes.
|
||||
# - It prints everything in a nicely aligned format.
|
||||
# 4. The final `sed` cleans up any leftover commas from the end of lines.
|
||||
grep -h '^[[:space:]]*bind' "$HYPRLAND_CONF" "$OMARCHY_BINDINGS_CONF" |
|
||||
awk -F, '
|
||||
{
|
||||
# Strip trailing comments
|
||||
sub(/#.*/, "");
|
||||
|
||||
# Remove the "bind... =" part and surrounding whitespace
|
||||
sub(/^[[:space:]]*bind[^=]*=(\+[[:space:]])?(exec, )?[[:space:]]*/, "", $1);
|
||||
|
||||
# Combine the modifier and key (first two fields)
|
||||
key_combo = $1 " + " $2;
|
||||
|
||||
# Clean up: strip leading "+" if present, trim spaces
|
||||
gsub(/^[ \t]*\+?[ \t]*/, "", key_combo);
|
||||
gsub(/[ \t]+$/, "", key_combo);
|
||||
|
||||
# Reconstruct the command from the remaining fields
|
||||
action = "";
|
||||
for (i = 3; i <= NF; i++) {
|
||||
action = action $i (i < NF ? "," : "");
|
||||
}
|
||||
|
||||
# Clean up trailing commas, remove leading "exec, ", and trim
|
||||
sub(/,$/, "", action);
|
||||
gsub(/(^|,)[[:space:]]*exec[[:space:]]*,?/, "", action);
|
||||
gsub(/^[ \t]+|[ \t]+$/, "", action);
|
||||
gsub(/[ \t]+/, " ", key_combo); # Collapse multiple spaces to one
|
||||
|
||||
if (action != "") {
|
||||
printf "%-35s → %s\n", key_combo, action;
|
||||
}
|
||||
}' |
|
||||
flock --nonblock /tmp/.wofi.lock -c "wofi -dmenu -i --width 60% --height 70% -p 'Hyprland Keybindings' -O alphabetical"
|
@ -35,6 +35,7 @@ bind = SUPER, C, exec, $webapp="https://app.hey.com/calendar/weeks/"
|
||||
bind = SUPER, E, exec, $webapp="https://app.hey.com"
|
||||
bind = SUPER, Y, exec, $webapp="https://youtube.com/"
|
||||
bind = SUPER SHIFT, G, exec, $webapp="https://web.whatsapp.com/"
|
||||
bind = SUPER ALT, G, exec, $webapp="https://messages.google.com/web/conversations"
|
||||
bind = SUPER, X, exec, $webapp="https://x.com/"
|
||||
bind = SUPER SHIFT, X, exec, $webapp="https://x.com/compose/post"
|
||||
|
||||
|
@ -10,12 +10,11 @@ bind = SUPER, G, exec, $messenger
|
||||
bind = SUPER, O, exec, obsidian -disable-gpu
|
||||
bind = SUPER, slash, exec, $passwordManager
|
||||
|
||||
# Toggle wofi
|
||||
bind = SUPER, space, exec, pkill wofi || wofi --show drun --sort-order=alphabetical
|
||||
|
||||
bind = SUPER SHIFT, SPACE, exec, pkill -SIGUSR1 waybar
|
||||
bind = SUPER CTRL, SPACE, exec, ~/.local/share/omarchy/bin/swaybg-next
|
||||
bind = SUPER SHIFT CTRL, SPACE, exec, ~/.local/share/omarchy/bin/omarchy-theme-next
|
||||
bind = SUPER, K, exec, ~/.local/share/omarchy/bin/omarchy-show-keybindings
|
||||
|
||||
bind = SUPER, W, killactive,
|
||||
|
||||
|
@ -15,7 +15,7 @@ windowrule = fullscreen, class:^(com.libretro.RetroArch)$
|
||||
windowrule = opacity 0.97 0.9, class:.*
|
||||
windowrule = opacity 1 0.97, class:^(Chromium|chromium|google-chrome|google-chrome-unstable)$
|
||||
windowrule = opacity 1 1, initialTitle:^(youtube.com_/)$ # Youtube
|
||||
windowrule = opacity 1 1, class:^(zoom|vlc|org.kde.kdenlive|com.obsproject.Studio|com.github.PintaProject.Pinta)$
|
||||
windowrule = opacity 1 1, class:^(zoom|vlc|org.kde.kdenlive|com.obsproject.Studio|com.github.PintaProject.Pinta|imv)$
|
||||
windowrule = opacity 1 1, class:^(com.libretro.RetroArch|steam)$
|
||||
|
||||
# Fix some dragging issues with XWayland
|
||||
|
@ -2,6 +2,7 @@ source ~/.local/share/omarchy/default/bash/functions
|
||||
web2app "WhatsApp" https://web.whatsapp.com/ https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/whatsapp.png
|
||||
web2app "Google Photos" https://photos.google.com/ https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/google-photos.png
|
||||
web2app "Google Contacts" https://contacts.google.com/ https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/google-contacts.png
|
||||
web2app "Google Messages" https://messages.google.com/web/conversations https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/google-messages.png
|
||||
web2app "ChatGPT" https://chatgpt.com/ https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/chatgpt.png
|
||||
web2app "YouTube" https://youtube.com/ https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/youtube.png
|
||||
web2app "GitHub" https://github.com/ https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/github-light.png
|
||||
|
Reference in New Issue
Block a user