dotfiles/scripts/keybind.sh
2024-10-06 19:37:15 +03:00

16 lines
546 B
Bash
Executable file

#!/bin/bash
GTK_THEME_NAME="Nightfox-Dark"
# Path to your Hyprland config file
config_file=~/.config/hypr/hyprland.conf
# Fetch keybinds from the config file
keybinds=$(grep -oP '(?<=bind=).*' $config_file)
# Clean up the keybinds (adjusting commas and removing unwanted text)
keybinds=$(echo "$keybinds" | sed 's/,\([^,]*\)$/ = \1/' | sed 's/, exec//g' | sed 's/^,//g')
# Pipe the keybinds into wofi for selection
echo "$keybinds" | GTK_THEME="${GTK_THEME_NAME}" wofi --dmenu --prompt "Keybinds" --lines 10 --width 500 --location "center"