From d928f410807fa23002597b5cd63e0e2c2ea0263f Mon Sep 17 00:00:00 2001 From: Rong Date: Sat, 19 Apr 2025 16:25:33 +0800 Subject: [PATCH] fix: improve structure and fix some bugs in config file --- sway.config => sway/config | 90 ++++++++++++++++++++++---------------- 1 file changed, 53 insertions(+), 37 deletions(-) rename sway.config => sway/config (70%) diff --git a/sway.config b/sway/config similarity index 70% rename from sway.config rename to sway/config index a722176..dc1c7be 100644 --- a/sway.config +++ b/sway/config @@ -9,23 +9,32 @@ set $right l # Terminal emulator set $term foot # Application launcher -set $menu wmenu-run -f "SourceCodePro Medium 13" -i -N 191919 -S 6f3f89 -s ffffff -M 6f3f89 -m ffffff | xargs swaymsg exec -- +set $menu rofi -show drun # run fcitx5 exec_always fcitx5 -d +# send signal to i3-blocks so the volume will update soon +exec pkill -SIGRTMIN+1 i3blocks ### Input configuration input "type:keyboard" { - repeat_delay 240 + repeat_delay 250 repeat_rate 30 xkb_file "~/.config/sway/layout.xkb" } ### Output configuration # -# Wallpaper -output * bg /home/Rong/Pictures/114514.jpg fill +# Default wallpaper (more resolutions are available in /usr/share/backgrounds/sway/) +output * bg /home/Rong/Pictures/Linux-GNU-Unix-unixporn-material-minimal-material-style-2088201-wallhere.com.jpg fill # +# Example configuration: +# +# output HDMI-A-1 resolution 1920x1080 position 1920,0 +# +# You can get the names of your outputs by running: swaymsg -t get_outputs ### Idle configuration +# +# Example configuration: # exec swayidle -w \ timeout 300 'swaylock -f -c 000000' \ @@ -40,29 +49,27 @@ output * bg /home/Rong/Pictures/114514.jpg fill # Start a terminal bindsym $mod+Return exec $term - # Start Ranger - bindsym $mod+m exec $term ranger + # Start yazi + bindsym $mod+m exec $term yazi # Kill focused window bindsym $mod+i kill # Start your launcher bindsym $mod+o exec $menu - #Start minecraft launcher (it's useless now) - bindsym $mod+x exec ~/Documents/xmcl-0.48.4-x64/xmcl - # Drag floating windows by holding down $mod and left mouse button. - # Resize them with right mouse button + $mod. - # Despite the name, also works for non-floating windows. - # Change normal to inverse to use left mouse button for resizing and right - # mouse button for dragging. + floating_modifier $mod normal # Reload the configuration file bindsym $mod+Shift+c reload - bindsym $mod+q exec "swaylock -f -c 000000" + # Quiet! + bindsym $mod+q exec "swaylock -f -c 000000"; \ + exec swayidle -w \ + timeout 150 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \ + before-sleep 'swaylock -f -c 000000' # Exit sway (logs you out of your Wayland session) - bindsym $mod+Shift+e exec 'swaymsg exit' -# -# Moving around: -# + bindsym $mod++e exec 'swaymsg exit' + # Shutdown now! + bindsym $mod+Shift+e exec shutdown now + # Move your focus around bindsym $mod+$left focus left bindsym $mod+$down focus down @@ -108,7 +115,7 @@ output * bg /home/Rong/Pictures/114514.jpg fill bindsym $mod+Shift+8 move container to workspace number 8 bindsym $mod+Shift+9 move container to workspace number 9 bindsym $mod+Shift+0 move container to workspace number 10 - # workspace control by Rong + # workspace control bindsym $mod+tab workspace back_and_forth bindsym $mod+comma workspace prev_on_output bindsym $mod+period workspace next_on_output @@ -124,7 +131,6 @@ output * bg /home/Rong/Pictures/114514.jpg fill # Switch the current container between different layout styles bindsym $mod+s layout stacking bindsym $mod+w layout tabbed - bindsym $mod+e layout toggle split # Make the current focus fullscreen bindsym $mod+f fullscreen @@ -134,8 +140,7 @@ output * bg /home/Rong/Pictures/114514.jpg fill # Swap focus between the tiling area and the floating area bindsym $mod+space focus mode_toggle - - # Move focus to the parent container +# Move focus to the parent container bindsym $mod+a focus parent # # Scratchpad: @@ -174,35 +179,47 @@ bindsym $mod+r mode "resize" # control your volume bindsym $mod+minus exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 2%- && wpctl get-volume @DEFAULT_AUDIO_SINK@ | sed 's/[^0-9]//g; s/^0//' > $wobfifo;exec pkill -SIGRTMIN+1 i3blocks bindsym $mod+equal exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 2%+ && wpctl get-volume @DEFAULT_AUDIO_SINK@ | sed 's/[^0-9]//g; s/^0//' > $wobfifo;exec pkill -SIGRTMIN+1 i3blocks - # Start color picker + # Start color picker bindsym $mod+Shift+p exec ~/.local/bin/wpicker + # Start wf-recorder with slurp to select a specific part of the screen + bindsym Ctrl+Print exec wf-recorder -g "$$(/usr/bin/slurp)" -f ~/Videos/records/recording_$(date +"%Y-%m-%d_%H:%M:%S.mp4");exec notify-send "Start recording..." + bindsym Ctrl+Shift+Print exec killall -s SIGINT wf-recorder;exec notify-send "Stop recording!" + # Make sure that some apps are always floating + for_window [app_id="simulator"] floating enable + for_window [app_id="simulator"] swaymsg move position center + for_window [app_id="simulator"] swaymsg resize set 70ppt 70ppt # # Status Bar: # # Read `man 5 sway-bar` for more information about this section. bar { - status_command i3blocks -c /home/Rong/.config/i3blocks/config + status_command i3blocks -c ~/.config/i3blocks/config position top - height 24 - font pango:Source Code Pro Bold + height 20 + font pango:NotoSansM Nerd Font Probe tray_output none tray_padding 0 colors { - statusline #AAAAAA - background #00000033 - focused_workspace #00000033 #00000033 #FFFFFF - active_workspace #00000033 #00000033 #AAAAAA - inactive_workspace #00000033 #00000033 #999999 - urgent_workspace #00000033 #00000033 #FF0000 + background #212121 + statusline #dddddd + separator #666666 + # class border backgr. text + focused_workspace #2b83a6 #2b83a6 #ffffff + active_workspace #212121 #212121 #ffffff + inactive_workspace #212121 #212121 #86888c + urgent_workspace #d64e4e #d64e4e #ffffff + binding_mode #229c56 #229c56 #ffffff } } # colors -client.focused #54FF9F #54FF9F #54FF9F #54FF9F -client.focused_inactive #B0C4DE #B0C4DE #B0C4DE #B0C4DE -client.unfocused #B0C4DE #B0C4DE #B0C4DE #B0C4DE +client.focused #00BFFF #00BFFF #00BFFF #00BFFF +client.focused_inactive #B0C4DE #B0C4DE #B0C4DE #B0C4DE +client.unfocused #B0C4DE #B0C4DE #B0C4DE #B0C4DE client.urgent #e6da00 #e6da00 #f1f1f1 #9962b7 -client.background #191919 +client.background #191919 +# Send signal to i3-blocks so that the vol will update once sway started +exec pkill -SIGRTMIN+1 i3blocks # autotiling exec_always autotiling -w 1 3 5 7 9 # remove titlebar @@ -212,4 +229,3 @@ default_floating_border normal # start dunst exec_always "dunst" include /etc/sway/config.d/* -# TODO:maybe there is sth to do...but i don't remember them...