From b2b943f666a2fd740b97f71b58eeb6f5ec394c6d Mon Sep 17 00:00:00 2001 From: nnduc Date: Fri, 25 Sep 2026 14:35:35 +0700 Subject: [PATCH] up --- .zshrc | 2 +- README.md | 49 +++++++++++++++++++++++++++++++++++++++---- i3/config | 3 +++ nvim/init.lua | 15 ++++++++++++- nvim/lazy-lock.json | 24 ++++++++++----------- pipewire/minimal.conf | 2 +- sway/config | 9 ++++++-- zathura/zathurarc | 3 ++- 8 files changed, 85 insertions(+), 22 deletions(-) diff --git a/.zshrc b/.zshrc index 727bb9e..8492894 100755 --- a/.zshrc +++ b/.zshrc @@ -34,4 +34,4 @@ export PATH="$HOME/.local/bin:$PATH" alias ls='ls --color=auto' alias doc='docker-compose' - +alias cla='cd /home/nnduc/.cache/ && claude' diff --git a/README.md b/README.md index fefaae8..92b519c 100755 --- a/README.md +++ b/README.md @@ -34,6 +34,47 @@ Section "Device" Option "TearFree" "true" EndSection ``` + - amd: xf86-video-amdgpu (`VariableRefresh` = FreeSync, fullscreen apps only under Xorg) + - sudo -e /etc/X11/xorg.conf.d/20-amdgpu.conf +``` +Section "Device" + Identifier "AMD" + Driver "amdgpu" + Option "VariableRefresh" "true" + Option "TearFree" "true" +EndSection +``` +## High refresh rate flicker (AMD): +- At high refresh rates (240Hz+) the vblank can be too short for the GPU to + switch VRAM clock unnoticed, so the desktop flickers under changing load. + Windows avoids it by keeping VRAM clock high; amdgpu on Linux may not. +- Check: if the `*` jumps between levels while idle, this is likely the cause. +```bash +watch -n0.2 cat /sys/class/drm/card*/device/pp_dpm_mclk +``` +- Fix 1: run the desktop at a lower rate (`i3/config` uses 120Hz). Find the + output name with `xrandr` (e.g. `DisplayPort-0`) and adjust it there: +```bash +xrandr --output DisplayPort-0 --mode 1920x1080 --rate 120 +``` +- sway: same idea in `sway/config` (`swaymsg -t get_outputs` for the name). + Keep `adaptive_sync off` there — sway applies it to the whole desktop, which + can stutter/flicker: +``` +output DP-1 mode 1920x1080@120Hz adaptive_sync off +``` +- Fix 2: keep the high rate and pin VRAM clock to its top level (more idle + power, resets on reboot; top level is the last line of `pp_dpm_mclk`): +```bash +echo manual | sudo tee /sys/class/drm/card*/device/power_dpm_force_performance_level +echo 3 | sudo tee /sys/class/drm/card*/device/pp_dpm_mclk +``` +- Gaming: 120Hz + FreeSync is plenty for ~60fps games (VRR covers the dips). + Cap fps a few below max refresh so VRR stays active, e.g. Dota 2 console + `fps_max 117`. Under Xorg, VRR applies to fullscreen games only; under sway + with `adaptive_sync off` games run without it. +- To turn off FreeSync for a single game (Xorg): `adaptive_sync=false %command%` + (Steam launch options). ![stones](./screenshots/Screenshot_20240503_095414.png) ## Installing dependencies @@ -49,8 +90,8 @@ or manual/cargo install. ```bash sudo pacman -S i3-wm i3status i3blocks sway swaybg swaylock swayidle \ waybar polybar rofi alacritty dex snixembed \ - xss-lock xorg-xset xclip scrot imagemagick i3lock \ - network-manager-applet blueman gnome-keyring \ + xss-lock xorg-xset xorg-xrandr xclip scrot imagemagick i3lock \ + network-manager-applet blueman gnome-keyring polkit-gnome \ pipewire wireplumber pipewire-pulse pipewire-alsa pipewire-jack \ pasystray playerctl brightnessctl \ fcitx5 fcitx5-im fcitx5-configtool @@ -63,10 +104,10 @@ sudo emerge --ask \ gui-wm/sway gui-apps/swaybg gui-apps/swaylock gui-apps/swayidle \ gui-apps/waybar x11-misc/polybar x11-misc/rofi x11-terms/alacritty \ x11-misc/dex x11-misc/snixembed \ - x11-misc/xss-lock x11-apps/xset x11-misc/xclip media-gfx/scrot \ + x11-misc/xss-lock x11-apps/xset x11-apps/xrandr x11-misc/xclip media-gfx/scrot \ media-gfx/imagemagick x11-misc/i3lock \ net-misc/networkmanager net-misc/network-manager-applet net-wireless/blueman \ - app-crypt/gnome-keyring \ + app-crypt/gnome-keyring gnome-extra/polkit-gnome \ media-video/pipewire media-video/wireplumber media-sound/playerctl \ app-i18n/fcitx app-i18n/fcitx-qt app-i18n/fcitx-gtk ``` diff --git a/i3/config b/i3/config index 41af263..b84ed2c 100755 --- a/i3/config +++ b/i3/config @@ -95,6 +95,9 @@ floating_modifier $mod # or left-clicking anywhere into the window while holding the floating modifier. #tiling_drag modifier titlebar #xrandr --output HDMI-2 --auto --right-of eDP1 +# High refresh rates can flicker on AMD (VRAM clock switching), so run the +# desktop at 120Hz. See README "High refresh rate flicker". +exec --no-startup-id xrandr --output DisplayPort-0 --mode 1920x1080 --rate 120 # start a terminal #bindsym $mod+Return exec i3-sensible-terminal diff --git a/nvim/init.lua b/nvim/init.lua index 3501ac3..41ec5ff 100755 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -52,7 +52,7 @@ vim.keymap.set("n", "P", '"+P') -- Background toogling vim.keymap.set("n", "bg", function() - vim.o.background = vim.o.background == "dark" and "light" or "dark" + vim.o.background = vim.o.background == "dark" and "light" or "dark" end, { desc = "Toggle light/dark background" }) -- Join paragraph @@ -224,4 +224,17 @@ require("lazy").setup({ -- Julia { "JuliaEditorSupport/julia-vim" }, + { + dir = "/home/nnduc/git/vim-uk", + event = "VeryLazy", + build = "cmake -S . -B build -DCMAKE_BUILD_TYPE=Release && cmake --build build -j", + opts = { + input_method = "vni", + toggle_key = "v", + }, + config = function(_, opts) + require("uknvim").setup(opts) + end, + }, + }) diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index 81c89a4..c583990 100755 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -1,20 +1,20 @@ { "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, - "coq.artifacts": { "branch": "artifacts", "commit": "ef5f21d638ccc456cfa5b8d0ab37093cefe48c8b" }, - "coq.thirdparty": { "branch": "3p", "commit": "2bd969a2bcd2624f9c260b1000957c7e665e308e" }, - "coq_nvim": { "branch": "coq", "commit": "d939a34ceb2b57d2937890337a4aa75eb55e18a8" }, - "fzf-lua": { "branch": "main", "commit": "d9508cc1d05ffcdc91a32dfd38fc1013a56b20da" }, - "gruvbox.nvim": { "branch": "main", "commit": "334d5fd49fc8033f26408425366c66c6390c57bb" }, + "coq.artifacts": { "branch": "artifacts", "commit": "d545035d06408f2d68cd03bc401425e42c298fc4" }, + "coq.thirdparty": { "branch": "3p", "commit": "a021e24f1ff538d339aece0de80d621b68862701" }, + "coq_nvim": { "branch": "coq", "commit": "df4eb27b425568cea17f01a25a07cf447066ce81" }, + "fzf-lua": { "branch": "main", "commit": "05e44d38de0a79c11fba5f7bf8138791b1dbdd1e" }, + "gruvbox.nvim": { "branch": "main", "commit": "154eb5ff5b96d0641307113fa385eaf0d36d9796" }, "julia-vim": { "branch": "master", "commit": "52b30547346b21bc93acda28d626795667f9e087" }, "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, - "lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" }, - "nvim-autopairs": { "branch": "master", "commit": "59bce2eef357189c3305e25bc6dd2d138c1683f5" }, - "nvim-bqf": { "branch": "main", "commit": "f65fba733268ffcf9c5b8ac381287eca7c223422" }, - "nvim-lspconfig": { "branch": "master", "commit": "0203a9608d63eda57679b01e69f33a7b4c34b0d1" }, - "nvim-tree.lua": { "branch": "master", "commit": "4b30847c91d498446cb8440c03031359b045e050" }, - "nvim-web-devicons": { "branch": "master", "commit": "d7462543c9e366c0d196c7f67a945eaaf5d99414" }, + "lualine.nvim": { "branch": "master", "commit": "221ce6b2d999187044529f49da6554a92f740a96" }, + "nvim-autopairs": { "branch": "master", "commit": "430522f95fe4fb7c511ec64f8c1a90cc6a66c05c" }, + "nvim-bqf": { "branch": "main", "commit": "c282a62bec6c0621a1ef5132aa3f4c9fc4dcc2c7" }, + "nvim-lspconfig": { "branch": "master", "commit": "16286347bdba1333c7d124d9de9fe6630731b2b2" }, + "nvim-tree.lua": { "branch": "master", "commit": "b2aadda94b107480c48e548d6db51c6840b7b33c" }, + "nvim-web-devicons": { "branch": "master", "commit": "5f032a85be210cd1c6ac98861eb3b187ff3bd5eb" }, "vim-fugitive": { "branch": "master", "commit": "3b753cf8c6a4dcde6edee8827d464ba9b8c4a6f0" }, "vim-ime": { "branch": "master", "commit": "79e3b02eb50a57305113550be7ca163b267b5e30" }, "viml-surround": { "branch": "master", "commit": "98358bad347aa2b8a180c2edde84c3bd8a51fdd1" }, - "vimtex": { "branch": "master", "commit": "82d2305ff71dfb3bd91602534cc9bb9a195bcb38" } + "vimtex": { "branch": "master", "commit": "cb81778aee678b513af3de7f1ca5943e7ee31b2f" } } diff --git a/pipewire/minimal.conf b/pipewire/minimal.conf index 537d950..482bcce 100755 --- a/pipewire/minimal.conf +++ b/pipewire/minimal.conf @@ -26,7 +26,7 @@ context.properties = { core.name = pipewire-0 # core name and socket name ## Properties for the DSP configuration. - #default.clock.rate = 48000 + default.clock.rate = 48000 #default.clock.allowed-rates = [ 48000 ] #default.clock.quantum = 1024 #default.clock.min-quantum = 32 diff --git a/sway/config b/sway/config index ba8608f..a6a84da 100755 --- a/sway/config +++ b/sway/config @@ -22,8 +22,8 @@ set $term alacritty set $menu rofi -show drun # Font for window titles. -font pango:NotoSans 12 +font pango:DejaVu Sans Mono 8 ### Output configuration # set $wallpaper_dir /media/sync/images/wallpapers @@ -36,7 +36,9 @@ exec --no-startup-id ~/.config/sway/scripts/wallpaper-rotate $wallpaper_dir #output HDMI-A-1 resolution 1920x1080@120hz position 1920,0 # # You can get the names of your outputs by running: swaymsg -t get_outputs -output DP-2 adaptive_sync on +# adaptive_sync on the desktop makes sway stutter/flicker; 120Hz avoids AMD +# VRAM clock flicker at high refresh (see README). +output DP-1 mode 1920x1080@120Hz adaptive_sync off allow_tearing yes ### Idle configuration # @@ -80,6 +82,9 @@ exec swayidle -w \ input "2:7:SynPS/2_Synaptics_TouchPad" { events disabled_on_external_mouse } +input "type:pointer" { + accel_profile "flat" # no mouse acceleration for all pointers +} input "5426:156:Razer_Razer_DeathAdder_V2_X_HyperSpeed_Mouse" { accel_profile "flat" # disable mouse acceleration (enabled by default; to set it manually, use "adaptive" instead of "flat") pointer_accel 0.5 # set mouse sensitivity (between -1 and 1) diff --git a/zathura/zathurarc b/zathura/zathurarc index 253954a..1c84b54 100755 --- a/zathura/zathurarc +++ b/zathura/zathurarc @@ -1 +1,2 @@ -set selection-clipboard clipboard \ No newline at end of file +set selection-clipboard clipboard +set guioptions "sh"