Skip to content

Instantly share code, notes, and snippets.

View levihuayuzhang's full-sized avatar

Levi Schwarzman levihuayuzhang

View GitHub Profile
@levihuayuzhang
levihuayuzhang / gnome_set_fractional_scaling.md
Last active May 19, 2025 14:55
gnome set fractional scaling
  1. echo $XDG_SESSION_TYPE
sudo cp ~/.config/monitors.xml ~gdm/.config/monitors.xml
sudo chown gdm:gdm ~gdm/.config/monitors.xml
  1. for GDM:
sudo machinectl shell gdm@ /bin/bash
@levihuayuzhang
levihuayuzhang / remove-window-button-.md
Last active May 19, 2025 06:46
Remove window button in Linux.
  1. move to right: gsettings set org.gnome.desktop.wm.preferences button-layout ':close,minimize,maximize'
  2. move to left: gsettings set org.gnome.desktop.wm.preferences button-layout 'close,minimize,maximize:'
  3. remove: gsettings set org.gnome.desktop.wm.preferences button-layout :
  4. get current: gsettings get org.gnome.desktop.wm.preferences button-layout
  5. reset all settings dconf reset -f /
@levihuayuzhang
levihuayuzhang / auto-close-screen-tty.md
Last active April 22, 2025 08:17
Auto close screen without DE (in TTY)
  1. set in grub config (blank in 60 seconds)
GRUB_CMDLINE_LINUX_DEFAULT="consoleblank=60"
  1. setterm -blank X (X in minutes) in shell init file (.bashrc) or /etc/rc.local.

Then, prevent sleep when lid close: sudoedit /etc/systemd/logind.conf:

HandleLidSwitch=ignore
"$schema" = 'https://starship.rs/config-schema.json'
# Inserts a blank line between shell prompts
add_newline = false
format = """
[](surface0)\
$os\
$username\
[](bg:peach fg:surface0)\
@levihuayuzhang
levihuayuzhang / config
Created March 24, 2025 07:56
Config for Ghostty on Mac.
# $HOME/Library/Application\ Support/com.mitchellh.ghostty/config
theme = dark:Adwaita Dark,light:Adwaita
# theme = Adwaita Dark
font-family = "CaskaydiaCove Nerd Font Mono"
window-theme = auto
window-height = 33
window-width = 110
window-colorspace = display-p3
@levihuayuzhang
levihuayuzhang / .wslconfig
Last active March 20, 2025 10:05 — forked from libChan/wsl_clash_proxy.sh
WSL2使用代理
[wsl2]
dnsTunneling=false
networkingMode=NAT # mirrored
dnsProxy=true
autoProxy=true
firewall=false
@levihuayuzhang
levihuayuzhang / input.conf
Last active March 1, 2025 04:02
MPV settings on MacOS.
# ~/.config/mpv/input.conf
r cycle_values video-rotate 90 180 270 0
@levihuayuzhang
levihuayuzhang / ubuntu-zh-cn-input.md
Last active March 22, 2024 07:26
Ubuntu安裝中文輸入法
sudo apt install ibus ibus-rime ibus-gtk ibus-gtk4 ibus-gtk3
sudo apt install ibus-pinyin ibus-sunpinyin

重新login後,在keyboard選擇: ibus-rime 默認爲繁體,ibus-pinyinibus-sunpinyin爲簡體。

sudo vim /etc/environment

@levihuayuzhang
levihuayuzhang / mac-service-root.md
Last active February 3, 2024 09:17
MacOS create service with launchctl and .plist file with root
@levihuayuzhang
levihuayuzhang / default.custom.yaml
Last active May 2, 2025 13:08
Rime輸入法配置
patch:
"menu/page_size": 8
"translator/enable_user_dict": true
"translator/enable_encoder": true #是否开启自动造词〔仅table_translator有效〕
"translator/encode_commit_history": true #是否对已上屛词自动成词〔仅table_translator效〕
"translator/enable_sentence": true #是否开启自动造句
"translator/enable_completion": true #编码逐渐提示开关;编码提示
"translator/enable_charset_filter": true #字符集过滤,低重形码用不着