diff --git a/modules/home/hyprland/conf/hypr/keybindings.conf b/modules/home/hyprland/conf/hypr/keybindings.conf index faf66a0..68e2d2b 100644 --- a/modules/home/hyprland/conf/hypr/keybindings.conf +++ b/modules/home/hyprland/conf/hypr/keybindings.conf @@ -79,15 +79,23 @@ bind = $mod, J, movefocus, d # Resize windows binde = $mod CONTROL, right, resizeactive, 10 0 +binde = $mod CONTROL, H, resizeactive, 10 0 binde = $mod CONTROL, left, resizeactive, -10 0 +binde = $mod CONTROL, L, resizeactive, -10 0 binde = $mod CONTROL, up, resizeactive, 0 -10 +binde = $mod CONTROL, K, resizeactive, 0 -10 binde = $mod CONTROL, down, resizeactive, 0 10 +binde = $mod CONTROL, J, resizeactive, 0 10 # Move Window with mod + SHIFT + arrow keys bind = $mod SHIFT, left, movewindow, l +bind = $mod SHIFT, H, movewindow, l bind = $mod SHIFT, right, movewindow, r +bind = $mod SHIFT, L, movewindow, r bind = $mod SHIFT, up, movewindow, u +bind = $mod SHIFT, K, movewindow, u bind = $mod SHIFT, down, movewindow, d +bind = $mod SHIFT, J, movewindow, d # Move/resize windows with mod + LMB/RMB and dragging bindm = $mod, mouse:272, movewindow @@ -139,7 +147,7 @@ bind = $mod CONTROL, S, togglespecialworkspace, # Scroll through existing workspaces with mod + scroll bind = $mod CTRL, right, workspace, e+1 -bind = $mod, mouse_up, workspace, e+1 bind = $mod CTRL, left, workspace, e-1 -bind = $mod, mouse_down, workspace, e-1` \ No newline at end of file + +bind = $mod, TAB, exec, ~/.config/hypr/scripts/switch.sh diff --git a/modules/home/hyprland/conf/hypr/scripts/switch.sh b/modules/home/hyprland/conf/hypr/scripts/switch.sh new file mode 100755 index 0000000..0ed8c7f --- /dev/null +++ b/modules/home/hyprland/conf/hypr/scripts/switch.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash + +# 获取窗口列表,格式为 "ADDRESS [Workspace] Class: Title" +# 使用 jq 解析 hyprctl clients -j 的 JSON 输出 +# select(.workspace.id != -1) 过滤掉特殊工作区(如概览)的窗口 +WINDOWS_LIST=$(hyprctl clients -j | jq -r '.[] | select(.workspace.id != -1) | "\(.address)\t[\(.workspace.name)] \(.class): \(.title)"') + +# 如果没有窗口,显示提示并退出 +if [ -z "$WINDOWS_LIST" ]; then + rofi -e "No open windows found." + exit 1 +fi + +# 使用 Rofi 显示窗口列表,允许用户选择 +# -dmenu: dmenu 模式 +# -i: 不区分大小写搜索 +# -p: 提示符文本 +# -markup-rows: (可选) 如果你想在列表中使用 Pango 标记 +# -format 's': 输出选择的完整行 +CHOSEN_WINDOW_LINE=$(echo -e "$WINDOWS_LIST" | rofi -dmenu -i -p "󰖯 Switch Window" -format 's') +# 你可以使用其他图标,例如  或 Window: + +# 如果用户取消了选择 (Rofi 返回空),则退出 +if [ -z "$CHOSEN_WINDOW_LINE" ]; then + exit 0 +fi + +# 从选择的行中提取窗口地址 (它是第一个字段,以制表符分隔) +CHOSEN_ADDRESS=$(echo "$CHOSEN_WINDOW_LINE" | awk -F'\t' '{print $1}') + +# 使用 hyprctl 切换到选定的窗口 +hyprctl dispatch focuswindow address:"$CHOSEN_ADDRESS" + +exit 0 \ No newline at end of file diff --git a/modules/home/hyprland/conf/hypr/windowrules.conf b/modules/home/hyprland/conf/hypr/windowrules.conf index f31ceb0..95a636f 100644 --- a/modules/home/hyprland/conf/hypr/windowrules.conf +++ b/modules/home/hyprland/conf/hypr/windowrules.conf @@ -37,4 +37,3 @@ windowrulev2 = opacity 0.80 0.70,class:^(blueman-manager)$ windowrulev2 = opacity 1.00 1.00,class:^(code)$ windowrulev2 = opacity 0.80 0.80,class:^(code-url-handler)$ -windowrulev2 = opacity 0.50 0.50,class:^(kitty)$ diff --git a/modules/home/hyprland/conf/kitty/kitty.conf b/modules/home/hyprland/conf/kitty/kitty.conf index 77ae653..22cefca 100644 --- a/modules/home/hyprland/conf/kitty/kitty.conf +++ b/modules/home/hyprland/conf/kitty/kitty.conf @@ -1,11 +1,27 @@ -# vim:ft=kitty +# 背景透明度 +background_opacity 0.6 -## name: Catppuccin Latte 🐑 -## author: Pocco81 (https://github.com/Pocco81) -## license: MIT -## upstream: https://github.com/catppuccin/kitty/blob/main/latte.conf -## blurb: Soothing pastel theme for the high-spirited! +# 开启抗锯齿 +enable_ligatures yes +# 开启字体平滑 +font_antialias true +# 开启子像素渲染 +font_hinting full +# 终端兼容性设置 +term xterm-256color +shell_integration no-rc + +# 修复 SSH 退格键问题 +map ctrl+h send_text all \x08 +backspace_sends_backspace yes + +# 设置四周边距(单位:像素) +window_padding_width 8 + +map ctrl+shift+equal change_font_size all +1 +map ctrl+shift+minus change_font_size all -1 +map ctrl+shift+backspace change_font_size all 0 # The basic colors @@ -77,12 +93,4 @@ color14 #179299 # white color7 #ACB0BE -color15 #ACB0BE - -# 终端兼容性设置 -term xterm-256color -shell_integration no-rc - -# 修复 SSH 退格键问题 -map ctrl+h send_text all \x08 -backspace_sends_backspace yes +color15 #ACB0BE \ No newline at end of file diff --git a/modules/home/hyprland/conf/waybar/config.jsonc b/modules/home/hyprland/conf/waybar/config.jsonc index 90341c7..35da2aa 100644 --- a/modules/home/hyprland/conf/waybar/config.jsonc +++ b/modules/home/hyprland/conf/waybar/config.jsonc @@ -10,10 +10,10 @@ "modules-left": [ "custom/lr", "hyprland/workspaces", - "custom/rr", - "custom/lr", - "hyprland/window", "custom/rr" + // "custom/lr", + // "hyprland/window", + // "custom/rr" ], "modules-center": ["custom/lr", "clock", "custom/rr"], "modules-right": [ @@ -76,7 +76,7 @@ "title<.*youtube.*>": "", "rofi": "󱓞", "kitty": "", - "org.gnome.Nautilus": "󰪶", + "nemo": "󰪶", "wechat": "", "wps": "󰈬", "class": "󰈛", diff --git a/modules/home/hyprland/default.nix b/modules/home/hyprland/default.nix index eda44da..1df4c9f 100644 --- a/modules/home/hyprland/default.nix +++ b/modules/home/hyprland/default.nix @@ -35,15 +35,6 @@ in programs = { - bash = { - initExtra = '' - if [ -z $DISPLAY ] && [ "$(tty)" = "/dev/tty1" ]; - then - echo 'Welcome! ' - fi - ''; - }; - swaylock.enable = true; };