From fcb73d8ca77e79fe0cac3c132fe900c98aced8a8 Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Thu, 20 Feb 2025 12:40:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=80=E4=BA=9B=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.conf | 141 ++++++++++++++++++++++++++----------------------- parse_config.h | 34 +++++++++++- 2 files changed, 109 insertions(+), 66 deletions(-) diff --git a/config.conf b/config.conf index 969e4076..61d4efd2 100644 --- a/config.conf +++ b/config.conf @@ -19,6 +19,7 @@ scroller_proportion_preset=0.5,0.8,1.0 new_is_master=1 default_mfact=0.55 default_nmaster=1 +smartgaps=0 # Overview Setting hotarea_size=10 @@ -30,13 +31,25 @@ overviewgappo=30 # Misc axis_bind_apply_timeout=100 focus_on_activate=1 -numlockon=1 bypass_surface_visibility=0 sloppyfocus=1 warpcursor=1 +# keyboard +repeat_rate=25 +repeat_delay=600 +numlockon=1 + +# Trackpad +tap_to_click=1 +tap_and_drag=1 +drag_lock=1 +natural_scrolling=0 +disable_while_typing=1 +left_handed=0 +middle_button_emulation=0 + # Appearance -smartgaps=0 gappih=5 gappiv=5 gappoh=10 @@ -50,50 +63,51 @@ urgentcolor=0xad401fff scratchpadcolor=0x516c93ff globalcolor=0xb153a7ff +# tags rule +# layout support: tile,scroller,grid,monocle,spiral,dwindle +tags=id:1,layout_name:tile +tags=id:2,layout_name:tile +tags=id:3,layout_name:tile +tags=id:4,layout_name:tile +tags=id:5,layout_name:tile +tags=id:6,layout_name:tile +tags=id:7,layout_name:tile +tags=id:8,layout_name:tile +tags=id:9,layout_name:tile + # Window Rules -windowrule=isfloating:1,title:迅雷 -windowrule=width:800,title:迅雷 -windowrule=height:900,title:迅雷 - -windowrule=isfloating:1,appid:yesplaymusic -windowrule=width:1500,appid:yesplaymusic -windowrule=height:900,appid:yesplaymusic - -windowrule=isfloating:1,appid:clash-verge -windowrule=width:1500,appid:clash-verge -windowrule=height:900,appid:clash-verge - -windowrule=isfloating:1,appid:blueman-manager -windowrule=width:1500,appid:blueman-manager -windowrule=height:900,appid:blueman-manager - - -windowrule=isfloating:1,title:图片查看器 -windowrule=isfloating:1,title:图片查看 -windowrule=isfloating:1,title:选择文件 -windowrule=isfloating:1,title:打开文件 -windowrule=isfloating:1,title:qxdrag -windowrule=isfloating:1,title:rofi - Networks - -windowrule=isfloating:1,appid:Rofi -windowrule=isfloating:1,appid:qxdrag.py -windowrule=isfloating:1,appid:polkit-gnome-authentication-agent-1 - +# appid: type-string if match it or title, the rule match +# title: type-string if match it or appid, the rule match +# tags: type-num(1-9) +# isfloating: type-num(0 or 1) +# isfullscreen: type-num(0 or 1) +# scroller_proportion: type-float(0.1-1.0) +# animation_type : type-string(zoom,slide) +# isnoborder : type-num(0 or 1) +# monitor : type-int(0-99999) +# width : type-num(0-9999) +# height : type-num(0-9999) +# example +# windowrule=isfloating:1,appid:yesplaymusic +# windowrule=width:1500,appid:yesplaymusic +# windowrule=height:900,appid:yesplaymusic +# windowrule=isfloating:1,title:qxdrag +# windowrule=isfloating:1,appid:Rofi +# windowrule=isfloating:1,appid:wofi +# windowrule=isnoborder:1,appid:wofi # windowrule=animation_type:zoom,appid:wofi -windowrule=isfloating:1,appid:wofi -windowrule=isnoborder:1,appid:wofi -windowrule=animation_type:zoom,appid:wofi -windowrule=tags:4,appid:Google-chrome -windowrule=tags:3,appid:QQ -windowrule=tags:5,appid:yesplaymusic -windowrule=tags:2,appid:mpv -windowrule=tags:6,appid:obs +# open in specific tag +# windowrule=tags:4,appid:Google-chrome +# windowrule=tags:3,appid:QQ +# windowrule=tags:5,appid:yesplaymusic +# windowrule=tags:2,appid:mpv +# windowrule=tags:6,appid:obs # Monitor Rules -monitorrule=eDP-1,0.55,1,tile,0,1,0,0 -monitorrule=HDMI-A-1,0.55,1,tile,0,1,1920,0 +# monitorrule=eDP-1,0.55,1,tile,0,1,0,0 +# monitorrule=HDMI-A-1,0.55,1,tile,0,1,1920,0 # Key Bindings # The mod key is not case sensitive, @@ -106,8 +120,8 @@ bind=SUPER,r,reload_config # menu and terminal -bind=Alt,space,spawn,wofi --normal-window -c ~/.config/maomao/wofi/config -s ~/.config/maomao/wofi/style.css -bind=Alt,Return,spawn,st +bind=Alt,space,spawn,rofi -show drun +bind=Alt,Return,spawn,foot # exit bind=SUPER,m,quit @@ -163,6 +177,8 @@ bind=CTRL,Right,viewtoright_have_client, bind=CTRL+SUPER,Left,tagtoleft, bind=CTRL+SUPER,Right,tagtoright, +# normal num key is (1-9) +# right-side keyboard num keys is (KP_1-KP_9) bind=Ctrl,KP_1,view,1 bind=Ctrl,KP_2,view,2 bind=Ctrl,KP_3,view,3 @@ -195,34 +211,29 @@ bind=ALT+SHIFT,X,incgaps,1 bind=ALT+SHIFT,Z,incgaps,-1 bind=ALT+SHIFT,R,togglegaps -#custom app bind -bind=SUPER,Return,spawn,google-chrome -bind=SUPER,space,spawn,microsoft-edge -bind=CTRL,Return,spawn,bash ~/tool/clash.sh -bind=CTRL+SUPER,Return,spawn,st -e yazi -bind=CTRL+SHIFT,Return,spawn,st -e aerc -bind=CTRL+ALT,a,spawn,grim -g "$(slurp)" - | swappy -f - -bind=SUPER,h,spawn,bash ~/tool/hide_waybar_dwl.sh -bind=SUPER,l,spawn,swaylock -f -c 000000 -bind=CTRL+ALT,Return,spawn,st -e ~/tool/ter-multiplexer.sh -bind=SUPER+ALT,Return,spawn,mpv --player-operation-mode=pseudo-gui -bind=CTRL,space,spawn,rofi -normal-window -theme ~/.config/rofi/themes/fancy2.rasi -modi blocks -show blocks -blocks-wrap ~/.config/rofi/search.py -bind=SUPER,space,spawn,rofi -normal-window -theme ~/.config/rofi/themes/fancy2.rasi -modi blocks -show blocks -blocks-wrap ~/.config/rofi/history.py -bind=CTRL,comma,spawn,~/.config/hypr/scripts/brightness.sh down -bind=CTRL,period,spawn,~/.config/hypr/scripts/brightness.sh up -bind=ALT,comma,spawn,~/.config/hypr/scripts/volume.sh down -bind=ALT,period,spawn,~/.config/hypr/scripts/volume.sh up -bind=CTRL+ALT,backslash,spawn,swaync-client -t -bind=CTRL+ALT,BackSpace,spawn,swaync-client -C -bind=SUPER+SHIFT,P,spawn,wlr-randr --output eDP-1 --on -bind=SUPER,p,spawn,bash ~/.config/maomao/scripts/monitor.sh -bind=SUPER,k,spawn,bash ~/tool/wshowkey.sh +# switch tty +bind=Ctrl+Alt,F1,chvt,1 +bind=Ctrl+Alt,F2,chvt,2 +bind=Ctrl+Alt,F3,chvt,3 +bind=Ctrl+Alt,f4,chvt,4 +bind=Ctrl+Alt,F5,chvt,5 +bind=Ctrl+Alt,F6,chvt,6 +bind=Ctrl+Alt,F7,chvt,7 +bind=Ctrl+Alt,F8,chvt,8 +bind=Ctrl+Alt,F9,chvt,9 +bind=Ctrl+Alt,F10,chvt,10 +bind=Ctrl+Alt,F11,chvt,11 +bind=Ctrl+Alt,F12,chvt,12 + +#custom app bind example +# bind=SUPER,Return,spawn,google-chrome +# bind=CTRL+ALT,Return,spawn,st -e ~/tool/ter-multiplexer.sh # Mouse Button Bindings +# NONE mode key only work in ov mode mousebind=SUPER,btn_left,moveresize,curmove mousebind=NONE,btn_middle,togglemaxmizescreen,0 mousebind=SUPER,btn_right,moveresize,curresize -mousebind=SUPER+CTRL,btn_left,spawn,bash ~/tool/shotTranslate.sh shot mousebind=NONE,btn_left,toggleoverview,-1 mousebind=NONE,btn_right,killclient,0 diff --git a/parse_config.h b/parse_config.h index fe487d53..0ba151f3 100644 --- a/parse_config.h +++ b/parse_config.h @@ -76,11 +76,25 @@ typedef struct { unsigned int axis_bind_apply_timeout; unsigned int focus_on_activate; - unsigned int numlockon; int bypass_surface_visibility; int sloppyfocus; int warpcursor; + /* keyboard */ + int repeat_rate; + int repeat_delay; + unsigned int numlockon; + + /* Trackpad */ + int tap_to_click; + int tap_and_drag; + int drag_lock; + int natural_scrolling; + int disable_while_typing; + int left_handed; + int middle_button_emulation; + + int smartgaps; unsigned int gappih; unsigned int gappiv; @@ -460,6 +474,24 @@ void parse_config_line(Config *config, const char *line) { config->warpcursor = atoi(value); } else if (strcmp(key, "smartgaps") == 0) { config->smartgaps = atoi(value); + } else if (strcmp(key, "repeat_rate") == 0) { + config->repeat_rate = atoi(value); + } else if (strcmp(key, "repeat_delay") == 0) { + config->repeat_delay = atoi(value); + } else if (strcmp(key, "tap_to_click") == 0) { + config->tap_to_click = atoi(value); + } else if (strcmp(key, "tap_and_drag") == 0) { + config->tap_and_drag = atoi(value); + } else if (strcmp(key, "drag_lock") == 0) { + config->drag_lock = atoi(value); + } else if (strcmp(key, "natural_scrolling") == 0) { + config->natural_scrolling = atoi(value); + } else if (strcmp(key, "disable_while_typing") == 0) { + config->disable_while_typing = atoi(value); + } else if (strcmp(key, "left_handed") == 0) { + config->left_handed = atoi(value); + } else if (strcmp(key, "middle_button_emulation") == 0) { + config->middle_button_emulation = atoi(value); } else if (strcmp(key, "gappih") == 0) { config->gappih = atoi(value); } else if (strcmp(key, "gappiv") == 0) {