Skip to content

Instantly share code, notes, and snippets.

View levihuayuzhang's full-sized avatar

Levi Schwarzman levihuayuzhang

View GitHub Profile
@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 / 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 / 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 / .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 / 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
"$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 / 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
@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 / 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 / download.sh
Created July 9, 2025 16:49 — forked from Aries0d0f/download.sh
Download all macOS Sonoma Aerial wallpaper
#!/bin/zsh
# This script helps those who want to
# get all Aerial wallpapers on macOS Sonoma
# all at once instead of clicking on settings one by one.
# Dependencies: jq, parallel
# Install all dependencies via `brew install jq parallel`
# After `parallel` installed run `sudo parallel --citation` first to read citation notice (IMPORTANT)