From c2299c21d146a89cc18849c44066116fdf7c5ef9 Mon Sep 17 00:00:00 2001 From: bh Date: Sat, 7 Mar 2026 20:25:03 +0800 Subject: Added hypr and quickshell --- hypr/.config/hypr/.hyprland.conf.bak | 223 +++++++++++++++++++++++++++ hypr/.config/hypr/hyprland.conf | 282 +++++++++++++++++++++++++++++++++++ hypr/.config/hypr/hyprpaper.conf | 14 ++ hypr/.config/hypr/scripts/mute | 14 ++ hypr/.config/hypr/scripts/screenshot | 15 ++ 5 files changed, 548 insertions(+) create mode 100644 hypr/.config/hypr/.hyprland.conf.bak create mode 100644 hypr/.config/hypr/hyprland.conf create mode 100644 hypr/.config/hypr/hyprpaper.conf create mode 100755 hypr/.config/hypr/scripts/mute create mode 100755 hypr/.config/hypr/scripts/screenshot (limited to 'hypr') diff --git a/hypr/.config/hypr/.hyprland.conf.bak b/hypr/.config/hypr/.hyprland.conf.bak new file mode 100644 index 0000000..4fcf08a --- /dev/null +++ b/hypr/.config/hypr/.hyprland.conf.bak @@ -0,0 +1,223 @@ +############################################ +# Keybindings +############################################ + +input { + kb_layout = us + kb_variant = dvps + kb_options = caps:backspace +} + + +############################################ +# Colours +############################################ + +$darkcyan = rgb(007575) +$lightcyan = rgb(1ebaba) +$lightercyan = rgb(19e0e0) +$red = rgb(e55235) + + +############################################ +# Workspaces (Hyprland calls them "desktops") +############################################ + +# Names: 一 二 三 四 五 六 七 八 九 十 󱉼 +# You don’t assign them globally; you move to them or bind to them. + +# Example binds (uncomment if you want): +# bind = SUPER, 1, workspace, name:一 +# bind = SUPER, 2, workspace, name:二 +# … +# bind = SUPER, 0, workspace, name:󱉼 + + +############################################ +# Window Appearance +############################################ + +general { + border_size = 1 + gaps_in = 6 + gaps_out = 6 +} + +decoration { + rounding = 0 + + active_border_color = $lightercyan + inactive_border_color = $darkcyan + urgent_border_color = $red + + # No split ratio or monocle mode — Hyprland tiling is automatic. +} + + +############################################ +# Startup Applications +############################################ + +exec-once = kitty +exec-once = kitty + +exec-once = polybar + +exec-once = feh --bg-fill /home/bh/Pictures/Wallpapers/TealNebula.jpg + +exec-once = dunst + + + +############################################ +# Floating Rules +############################################ + +windowrulev2 = float, class:^(floating)$ + + +############################################ +# MOVE FOCUS (bspc node -f X) +############################################ + +bind = SUPER, h, movefocus, l +bind = SUPER, j, movefocus, d +bind = SUPER, k, movefocus, u +bind = SUPER, l, movefocus, r + + +############################################ +# MOVE WINDOW (bspc node -s X) +############################################ + +bind = SUPER SHIFT, h, movewindow, l +bind = SUPER SHIFT, j, movewindow, d +bind = SUPER SHIFT, k, movewindow, u +bind = SUPER SHIFT, l, movewindow, r + + +############################################ +# PRESEL (Hyprland does not have preselection) +# → closest equivalent is splitratio and togglesplit +############################################ + +# directional preselect +bind = SUPER CTRL, h, splitratio, -0.1 +bind = SUPER CTRL, j, splitratio, +0.1 +bind = SUPER CTRL, k, splitratio, -0.1 +bind = SUPER CTRL, l, splitratio, +0.1 + +# ratio presets +bind = SUPER CTRL, n, splitratio, 0.75 +bind = SUPER CTRL, t, splitratio, 0.25 + + +############################################ +# SWITCH WORKSPACES +############################################ + +bind = SUPER, ampersand, workspace, name:一 +bind = SUPER, bracketleft, workspace, name:二 +bind = SUPER, braceleft, workspace, name:三 +bind = SUPER, braceright, workspace, name:四 +bind = SUPER, parenleft, workspace, name:五 +bind = SUPER, equal, workspace, name:六 +bind = SUPER, asterisk, workspace, name:七 +bind = SUPER, parenright, workspace, name:八 +bind = SUPER, plus, workspace, name:九 +bind = SUPER, bracketright, workspace, name:十 +bind = SUPER, exclam, workspace, name:󱉼 + + +############################################ +# MOVE WINDOW TO WORKSPACE +############################################ + +bind = SUPER SHIFT, ampersand, movetoworkspace, name:一 +bind = SUPER SHIFT, bracketleft, movetoworkspace, name:二 +bind = SUPER SHIFT, braceleft, movetoworkspace, name:三 +bind = SUPER SHIFT, braceright, movetoworkspace, name:四 +bind = SUPER SHIFT, parenleft, movetoworkspace, name:五 +bind = SUPER SHIFT, equal, movetoworkspace, name:六 +bind = SUPER SHIFT, asterisk, movetoworkspace, name:七 +bind = SUPER SHIFT, parenright, movetoworkspace, name:八 +bind = SUPER SHIFT, plus, movetoworkspace, name:九 +bind = SUPER SHIFT, bracketright, movetoworkspace, name:十 +bind = SUPER SHIFT, exclam, movetoworkspace, name:󱉼 + + +############################################ +# BSPWM FUNCTIONS → HYPRLAND EQUIVALENTS +############################################ + +# Toggle Monocle +bind = SUPER, m, togglefloating + +# Fullscreen (your custom script) +bind = SUPER, f, exec, ~/Scripts/fullscreen + +# Close window +bind = SUPER, c, killactive + +# Restart WM (Hyprland version) +bind = SUPER SHIFT, c, exec, hyprctl reload + +# Swap with last window +bind = SUPER CTRL, m, movetolast + + +############################################ +# OTHER FUNCTIONS +############################################ + +# Screen locker +bind = SUPER, slash, exec, ~/Scripts/blur-lock + + +############################################ +# APPLICATIONS +############################################ + +bind = SUPER, Return, exec, kitty +bind = SUPER ALT, Return, exec, kitty --class floating + +bind = SUPER, w, exec, zen-browser +bind = SUPER, d, exec, rofi -modi drun -show drun -config ~/.config/rofi/rofidmenu.rasi +bind = SUPER, v, exec, bash ~/Scripts/clipboard +bind = SUPER, e, exec, emacs +bind = SUPER, s, exec, ~/Scripts/screenshot +bind = SUPER SHIFT, s, exec, ~/Scripts/snip + + +############################################ +# AUDIO KEYS +############################################ + +# Volume up +bind = , XF86AudioRaiseVolume, exec, \ + pactl set-sink-volume @DEFAULT_SINK@ +5% && VOLUME=$(pactl get-sink-volume @DEFAULT_SINK@ | grep -Po '\\d+%' | head -1) && dunstify " Volume: $VOLUME" -h int:value:"${VOLUME%\%}" -r 2593 -t 1000 + +# Volume down +bind = , XF86AudioLowerVolume, exec, \ + pactl set-sink-volume @DEFAULT_SINK@ -5% && VOLUME=$(pactl get-sink-volume @DEFAULT_SINK@ | grep -Po '\\d+%' | head -1) && dunstify " Volume: $VOLUME" -h int:value:"${VOLUME%\%}" -r 2593 -t 1000 + +# Mute +bind = , XF86AudioMute, exec, ~/Scripts/mute + +############################################ +# Application Rules +############################################ + +# Window rules equivalent of bspc rule + +# kitty → workspace 一 +windowrulev2 = workspace name:一, class:^(kitty)$ + +# firefox → workspace 二 +windowrulev2 = workspace name:二, class:^(firefox)$ + +# zen → workspace 二 +windowrulev2 = workspace name:二, class:^(zen|zen-browser)$ + +# Emacs → workspace 三 +windowrulev2 = workspace name:三, class:^(Emacs)$ diff --git a/hypr/.config/hypr/hyprland.conf b/hypr/.config/hypr/hyprland.conf new file mode 100644 index 0000000..c03748b --- /dev/null +++ b/hypr/.config/hypr/hyprland.conf @@ -0,0 +1,282 @@ +# ██╗░░██╗██╗░░░██╗██████╗░██████╗░██╗░░░░░░█████╗░███╗░░██╗██████╗░ +# ██║░░██║╚██╗░██╔╝██╔══██╗██╔══██╗██║░░░░░██╔══██╗████╗░██║██╔══██╗ +# ███████║░╚████╔╝░██████╔╝██████╔╝██║░░░░░███████║██╔██╗██║██║░░██║ +# ██╔══██║░░╚██╔╝░░██╔═══╝░██╔══██╗██║░░░░░██╔══██║██║╚████║██║░░██║ +# ██║░░██║░░░██║░░░██║░░░░░██║░░██║███████╗██║░░██║██║░╚███║██████╔╝ +# ╚═╝░░╚═╝░░░╚═╝░░░╚═╝░░░░░╚═╝░░╚═╝╚══════╝╚═╝░░╚═╝╚═╝░░╚══╝╚═════╝░ +# +# █▄▄ █░█ ▀ █▀ █▀▀ █▀█ █▄░█ █▀▀ █ █▀▀ █▀▀ █▀█ █▀█ █░█ █▄█ █▀█ █▀█ █░░ ▄▀█ █▄░█ █▀▄ +# █▄█ █▀█ ░ ▄█ █▄▄ █▄█ █░▀█ █▀░ █ █▄█ █▀░ █▄█ █▀▄ █▀█ ░█░ █▀▀ █▀▄ █▄▄ █▀█ █░▀█ █▄▀ +# +# Translated from bspwm + sxhkd configuration + + +################# +### MONITORS ### +################# + +monitor=,preferred,auto,auto + + +################### +### MY PROGRAMS ### +################### + +$terminal = kitty +$fileManager = dolphin +$menu = rofi -modi drun -show drun -config ~/.config/rofi/rofidmenu.rasi +$browser = firefox + + +################# +### AUTOSTART ### +################# + +exec-once = kitty +exec-once = kitty +# exec-once = waybar +exec-once = hyprpaper +exec-once = dunst +exec-once = wl-paste --watch cliphist store + + +############################# +### ENVIRONMENT VARIABLES ### +############################# + +env = XCURSOR_SIZE,24 +env = HYPRCURSOR_SIZE,24 + + +##################### +### LOOK AND FEEL ### +##################### + +# Colors (from bspwm config) +$darkcyan = rgb(007575) +$lightcyan = rgb(1ebaba) +$lightercyan = rgb(19e0e0) +$red = rgb(e55235) + +general { + gaps_in = 3 + gaps_out = 3 + + border_size = 1 + + col.active_border = $lightercyan + col.inactive_border = $darkcyan + + resize_on_border = false + allow_tearing = false + layout = dwindle +} + +dwindle { + preserve_split = true + force_split = 2 + pseudotile = true + preserve_split = true +} + +decoration { + rounding = 0 + + active_opacity = 1.0 + inactive_opacity = 1.0 + + shadow { + enabled = true + range = 4 + render_power = 3 + color = rgba(1a1a1aee) + } + + blur { + enabled = true + size = 0 + passes = 5 + + ignore_opacity = false + new_optimizations = true + xray = false + vibrancy = 0.1696 + } +} + +animations { + enabled = true + + bezier = myBezier, 0.05, 0.9, 0.1, 1.05 + + animation = windows, 1, 7, myBezier + animation = windowsOut, 1, 7, default, popin 80% + animation = border, 1, 10, default + animation = borderangle, 1, 8, default + animation = fade, 1, 7, default + animation = workspaces, 1, 6, default +} + +master { + new_status = master +} + +misc { + force_default_wallpaper = 0 + disable_hyprland_logo = true +} + + +############# +### INPUT ### +############# + +input { + # kb_layout = us,us,cn,jp,ru + # kb_variant = dvorak,,wubi,,, + # kb_model = + # kb_options = grp:ctrl_shift_toggle + # kb_rules = + kb_layout = us + kb_variant = dvps + kb_options = caps:backspace + + follow_mouse = 0 + + sensitivity = 0 + + touchpad { + natural_scroll = false + } +} + +gestures { + # workspace_swipe option does not exist in current Hyprland +} + +device { + name = epic-mouse-v1 + sensitivity = -0.5 +} + + +#################### +### KEYBINDINGSS ### +#################### + +$mainMod = SUPER + +# Applications +bind = $mainMod, Return, exec, $terminal +bind = $mainMod ALT, Return, exec, kitty --class floating +bind = $mainMod, W, exec, $browser +bind = $mainMod, D, exec, $menu +bind = $mainMod, E, exec, emacs + +# Scripts +bind = $mainMod, V, exec, ~/.config/rofi/scripts/clipboard-wayland.sh +bind = $mainMod, S, exec, ~/.config/hypr/scripts/screenshot +bind = $mainMod SHIFT, S, exec, ~/.config/hypr/screenshot snip +bind = $mainMod, slash, exec, ~/Scripts/blur-lock + +# Window Management +bind = $mainMod SHIFT, C, killactive, +bind = $mainMod SHIFT, R, exec, hyprctl reload +bind = $mainMod, F, fullscreen, 0 +bind = $mainMod, M, fullscreen, 1 + +# Move Focus (Vim-style) +bind = $mainMod, H, movefocus, l +bind = $mainMod, L, movefocus, r +bind = $mainMod, K, movefocus, u +bind = $mainMod, J, movefocus, d + +# Move Window (Vim-style) +bind = $mainMod SHIFT, H, movewindow, l +bind = $mainMod SHIFT, L, movewindow, r +bind = $mainMod SHIFT, K, movewindow, u +bind = $mainMod SHIFT, J, movewindow, d + +# Preselection / Split Direction (Ctrl+Super+hjkl) +bind = $mainMod CTRL, H, layoutmsg, preselect l +bind = $mainMod CTRL, L, layoutmsg, preselect r +bind = $mainMod CTRL, K, layoutmsg, preselect u +bind = $mainMod CTRL, J, layoutmsg, preselect d + +# Swap with last window +bind = $mainMod CTRL, M, swapnext, prev + +# Switch Workspaces (Dvorak layout keys) +# Note: These keybinds match Dvorak layout from sxhkd config +bind = $mainMod, ampersand, workspace, 1 # 一 +bind = $mainMod, bracketleft, workspace, 2 # 二 +bind = $mainMod, braceleft, workspace, 3 # 三 +bind = $mainMod, braceright, workspace, 4 # 四 +bind = $mainMod, parenleft, workspace, 5 # 五 +bind = $mainMod, equal, workspace, 6 # 六 +bind = $mainMod, asterisk, workspace, 7 # 七 +bind = $mainMod, parenright, workspace, 8 # 八 +bind = $mainMod, plus, workspace, 9 # 九 +bind = $mainMod, bracketright, workspace, 10 # 十 +bind = $mainMod, exclam, workspace, 11 # 󱉼 + +# Move to Different Workspaces (Dvorak layout keys) +bind = $mainMod SHIFT, ampersand, movetoworkspace, 1 +bind = $mainMod SHIFT, bracketleft, movetoworkspace, 2 +bind = $mainMod SHIFT, braceleft, movetoworkspace, 3 +bind = $mainMod SHIFT, braceright, movetoworkspace, 4 +bind = $mainMod SHIFT, parenleft, movetoworkspace, 5 +bind = $mainMod SHIFT, equal, movetoworkspace, 6 +bind = $mainMod SHIFT, asterisk, movetoworkspace, 7 +bind = $mainMod SHIFT, parenright, movetoworkspace, 8 +bind = $mainMod SHIFT, plus, movetoworkspace, 9 +bind = $mainMod SHIFT, bracketright, movetoworkspace, 10 +bind = $mainMod SHIFT, exclam, movetoworkspace, 11 + +# Scroll through existing workspaces with mainMod + scroll +bind = $mainMod, mouse_down, workspace, e+1 +bind = $mainMod, mouse_up, workspace, e-1 + +# Move/resize windows with mainMod + LMB/RMB and dragging +bindm = $mainMod, mouse:272, movewindow +bindm = $mainMod, mouse:273, resizewindow + +# Media Keys +bindel = , XF86AudioRaiseVolume, exec, pactl set-sink-volume @DEFAULT_SINK@ +5% && VOLUME=$(pactl get-sink-volume @DEFAULT_SINK@ | grep -Po '\d+%' | head -1) && dunstify " Volume: $VOLUME" -h int:value:"${VOLUME%\%}" -r 2593 -t 1000 +bindel = , XF86AudioLowerVolume, exec, pactl set-sink-volume @DEFAULT_SINK@ -5% && VOLUME=$(pactl get-sink-volume @DEFAULT_SINK@ | grep -Po '\d+%' | head -1) && dunstify " Volume: $VOLUME" -h int:value:"${VOLUME%\%}" -r 2593 -t 1000 +bindl = , XF86AudioMute, exec, ~/.config/hypr/scripts/mute + + +################## +### LAYER RULES ### +################## + +layerrule = blur on, match:namespace rofi +layerrule = ignore_alpha 0.5, match:namespace rofi + + +############################## +### WINDOWS AND WORKSPACES ### +############################## + +# Send Firefox to workspace 2 +windowrule = match:class ^(firefox)$, workspace 2 + +# Send Emacs to workspace 3 +windowrule = match:class ^(Emacs)$, workspace 3 + +# Float windows with class "floating" +windowrule = match:class ^(floating)$, float on + +# Workspace Names (Chinese characters from bspwm) +exec-once = hyprctl dispatch renameworkspace "1 一" +exec-once = hyprctl dispatch renameworkspace "2 二" +exec-once = hyprctl dispatch renameworkspace "3 三" +exec-once = hyprctl dispatch renameworkspace "4 四" +exec-once = hyprctl dispatch renameworkspace "5 五" +exec-once = hyprctl dispatch renameworkspace "6 六" +exec-once = hyprctl dispatch renameworkspace "7 七" +exec-once = hyprctl dispatch renameworkspace "8 八" +exec-once = hyprctl dispatch renameworkspace "9 九" +exec-once = hyprctl dispatch renameworkspace "10 十" +exec-once = hyprctl dispatch renameworkspace "11 󱉼" diff --git a/hypr/.config/hypr/hyprpaper.conf b/hypr/.config/hypr/hyprpaper.conf new file mode 100644 index 0000000..f4bff53 --- /dev/null +++ b/hypr/.config/hypr/hyprpaper.conf @@ -0,0 +1,14 @@ +wallpaper { + monitor = eDP-1 + path = /home/bh/Pictures/Wallpapers/TealNebula.jpg + fit_mode = cover +} + +# optional fallback for any monitor without a specific target +wallpaper { + monitor = + path = /home/bh/Pictures/Wallpapers/TealNebula.jpg + fit_mode = cover +} + +splash = false diff --git a/hypr/.config/hypr/scripts/mute b/hypr/.config/hypr/scripts/mute new file mode 100755 index 0000000..7d17b92 --- /dev/null +++ b/hypr/.config/hypr/scripts/mute @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +# Toggle mute +pactl set-sink-mute @DEFAULT_SINK@ toggle + +# Get mute status +MUTE=$(pactl get-sink-mute @DEFAULT_SINK@ | awk '{print $2}') + +if [ "$MUTE" = "yes" ]; then + dunstify " Volume: Muted" -r 2593 -t 1000 +else + VOLUME=$(pactl get-sink-volume @DEFAULT_SINK@ | grep -Po "\d+%" | head -1) + dunstify " Volume: $VOLUME" -h int:value:${VOLUME%\%} -r 2593 -t 1000 +fi diff --git a/hypr/.config/hypr/scripts/screenshot b/hypr/.config/hypr/scripts/screenshot new file mode 100755 index 0000000..5ed5b7d --- /dev/null +++ b/hypr/.config/hypr/scripts/screenshot @@ -0,0 +1,15 @@ +#!/bin/bash + +mkdir -p ~/Pictures/Screenshots + +FILE=~/Pictures/Screenshots/$(date '+%Y-%m-%d_%H-%M-%S').png + +if [[ "$1" == "snip" ]]; then + grim -g "$(slurp)" "$FILE" || exit 1 +else + grim "$FILE" || exit 1 +fi + +wl-copy --type image/png < "$FILE" + +notify-send "Screenshot Taken" "Saved to $FILE" -i "$FILE" -- cgit v1.2.3