hyprland config

This commit is contained in:
reonokiy 2024-09-23 05:55:28 +08:00
parent f1e8289fb3
commit 71aaa6c056
Signed by: reonokiy
SSH key fingerprint: SHA256:2VjKpUxMIe0QYY3OVnOMuPiB0X5pvrIpJ+UiyFhxtq0
6 changed files with 281 additions and 0 deletions

86
dot_config/hypr/bind.conf Normal file
View file

@ -0,0 +1,86 @@
# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
# bind = $mod, Q, exec, $terminal
bind = $mod, T, exec, $terminal
bind = $mod, C, killactive,
bind = $mod, M, exit,
bind = $mod, E, exec, $files
bind = $mod, V, togglefloating,
bind = $mod, R, exec, $menu
bind = $mod, P, pseudo, # dwindle
bind = $mod, J, togglesplit, # dwindle
# Move focus with mod + arrow keys
bind = $mod, left, movefocus, l
bind = $mod, right, movefocus, r
bind = $mod, up, movefocus, u
bind = $mod, down, movefocus, d
# Switch workspaces with mod + [0-9]
bind = $mod, 1, workspace, 1
bind = $mod, 2, workspace, 2
bind = $mod, 3, workspace, 3
bind = $mod, 4, workspace, 4
bind = $mod, 5, workspace, 5
bind = $mod, 6, workspace, 6
bind = $mod, 7, workspace, 7
bind = $mod, 8, workspace, 8
bind = $mod, 9, workspace, 9
bind = $mod, 0, workspace, 10
# Move active window to a workspace with mod + SHIFT + [0-9]
bind = $mod SHIFT, 1, movetoworkspace, 1
bind = $mod SHIFT, 2, movetoworkspace, 2
bind = $mod SHIFT, 3, movetoworkspace, 3
bind = $mod SHIFT, 4, movetoworkspace, 4
bind = $mod SHIFT, 5, movetoworkspace, 5
bind = $mod SHIFT, 6, movetoworkspace, 6
bind = $mod SHIFT, 7, movetoworkspace, 7
bind = $mod SHIFT, 8, movetoworkspace, 8
bind = $mod SHIFT, 9, movetoworkspace, 9
bind = $mod SHIFT, 0, movetoworkspace, 10
# Move between left and right workspace with mod + left and right arrow keys
bind = $mod, LEFT, workspace, -1
bind = $mod, RIGHT, workspace, +1
bind = $mod SHIFT, LEFT, movetoworkspace, -1
bind = $mod SHIFT, RIGHT, movetoworkspace, +1
# Move between last and first workspace with mod + up and down arrow keys
bind = $mod, UP, workspace, previous
bind = $mod, DOWN, workspace, empty
bind = $mod SHIFT, UP, movetoworkspace, previous
bind = $mod SHIFT, DOWN, movetoworkspace, empty
# Example special workspace (scratchpad)
bind = $mod, S, togglespecialworkspace, magic
bind = $mod SHIFT, S, movetoworkspace, special:magic
# Scroll through existing workspaces with mod + scroll
bind = $mod, mouse_down, workspace, e-1
bind = $mod, mouse_up, workspace, e+1
# Move/resize windows with mod + LMB/RMB and dragging
bindm = $mod, mouse:272, movewindow
bindm = $mod, mouse:273, resizewindow
# ALT + SPACE to toggle menu
bind = ALT, SPACE, exec, $menu
bind = $mod, SPACE, exec, $menu
# Applications
bind = $mod, O, exec, $colorpicker
# Fn and Fn + F1-F12 keys
# See https://wiki.hyprland.org/Configuring/Binds/#uncommon-syms--binding-with-a-keycode
# and https://wiki.archlinux.org/title/Lenovo_XiaoXin_15are_2020
bindl = , XF86AudioMute, exec, $toggleVolumeMute
bindel = , XF86AudioLowerVolume, exec, $volumeDown
bindel = , XF86AudioRaiseVolume, exec, $volumeUp
bindel = , XF86AudioMicMute, exec, $toggleMicMute
# bind = , XKB_KEY_XF86Refresh, exec, $refreshPage ; Fn + F5
# bind = , XKB_KEY_XF86TouchpadToggle, exec, $toggleTouchpad ; Fn + F6
bindel = , XF86MonBrightnessDown, exec, $brightnessDown
bindel = , XF86MonBrightnessUp, exec, $brightnessUp
# other keys
bind = , code:107, exec, $screenShot

View file

@ -0,0 +1,17 @@
# See https://wiki.hyprland.org/Configuring/Monitors/
monitor=DP-1,highres,auto,2
# unscale XWayland
xwayland {
force_zero_scaling = true
}
# toolkit-specific scale
env = GDK_SCALE,2
env = XCURSOR_SIZE,32
# config force to use wayland backend
env = GDK_BACKEND=wayland,x11
env = QT_QPA_PLATFORM="wayland;xcb"
env = SDL_VIDEODRIVER=wayland
env = CLUTTER_BACKEND=wayland

21
dot_config/hypr/env.conf Normal file
View file

@ -0,0 +1,21 @@
env = XCURSOR_SIZE,24
# set locale to Chinese
env = LANG,en_US.UTF-8
env = LANGUAGE,en_US
# env = LANGUAGE,en_US:zh_CN
# set default input method
# see https://wiki.archlinux.org/title/Fcitx5 for more information
# env = GTK_IM_MODULE,fcitx
env = QT_IM_MODULE,fcitx
env = XMODIFIERS,@im=fcitx
# enable support of some games that use a specific version of the SDL2 library.
env = SDL_IM_MODULE,fcitx
# enable support in kitty. The value of this environment variable can only be ibus
env = GLFW_IM_MODULE,ibus
# for netease-cloud-music
env = QT_AUTO_SCREEN_SCALE_FACTOR,1

20
dot_config/hypr/exec.conf Normal file
View file

@ -0,0 +1,20 @@
# wallpapers
exec = hyprpaper
# fcitx5
exec-once = fcitx5 --replace -d
# custom cursor
exec-once = hyprctl setcursor Bibata-Modern-Classic 20
# startup applications
# exec-once = firefox
exec-once = 1password --silent
# clipboard manager
exec-once = wl-paste --type text --watch cliphist store #Stores only text data
exec-once = wl-paste --type image --watch cliphist store #Stores only image data
# eww widgets
exec-once = eww open status-bar
exec-once = eww open desktop-bg

View file

@ -0,0 +1,115 @@
# Environment Variables
source=~/.config/hypr/env.conf
# Display Settings
source=~/.config/hypr/display.conf
# Variables
source=~/.config/hypr/var.conf
# Keybinds
source=~/.config/hypr/bind.conf
# Startup Applications and Scripts
source=~/.config/hypr/exec.conf
# Window Rules
# For all categories, see https://wiki.hyprland.org/Configuring/Variables/
input {
kb_layout = us
kb_variant =
kb_model =
kb_options =
kb_rules =
follow_mouse = 1
touchpad {
natural_scroll = yes
}
sensitivity = 0 # -1.0 - 1.0, 0 means no modification.
}
general {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
gaps_in = 4
gaps_out = 8
border_size = 1
col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg
col.inactive_border = rgba(595959aa)
layout = dwindle
# Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on
allow_tearing = false
}
decoration {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
rounding = 20
blur {
enabled = true
size = 3
passes = 1
}
drop_shadow = yes
shadow_range = 4
shadow_render_power = 3
col.shadow = rgba(1a1a1aee)
}
animations {
enabled = yes
# Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more
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
}
dwindle {
# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
pseudotile = yes # master switch for pseudotiling. Enabling is bound to mod + P in the keybinds section below
preserve_split = yes # you probably want this
}
master {
# See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
new_is_master = true
}
gestures {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
workspace_swipe = off
}
misc {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
force_default_wallpaper = 0
disable_hyprland_logo = true
}
# Example per-device config
# See https://wiki.hyprland.org/Configuring/Keywords/#executing for more
device:epic-mouse-v1 {
sensitivity = -0.5
}
# Example windowrule v1
# windowrule = float, ^(kitty)$
# Example windowrule v2
# windowrulev2 = float,class:^(kitty)$,title:^(kitty)$
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
windowrulev2 = nomaximizerequest, class:.* # You'll probably like this.

22
dot_config/hypr/var.conf Normal file
View file

@ -0,0 +1,22 @@
# Apps
$terminal = kitty
$browser = firefox
$editor = code
$files = dolphin
# $menu = eww close launcher || eww open launcher
$menu = pkill wofi || wofi --show drun
$colorpicker = pkill hyprpicker || hyprpicker -a
# Keys
$mod = SUPER
# commands
$screenShot = hyprshot -m output -f screenshots
$toggleVolumeMute = wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
$volumeUp = wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+
$volumeDown = wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%-
$toggleMicMute = wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle
# $toggleTouchpad = xinput --list-props 12 | grep "Device Enabled" | grep -o "[01]$" | xargs -I{} xinput --set-prop 12 "Device Enabled" {}
$brightnessDown = brightnessctl set 5%-
$brightnessUp = brightnessctl set +5%
$testNotification = notify-send test