Skip to content

Instantly share code, notes, and snippets.

View levihuayuzhang's full-sized avatar

Levi Schwarzman levihuayuzhang

View GitHub Profile
@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 January 28, 2024 07:39
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 #字符集过滤,低重形码用不着
@levihuayuzhang
levihuayuzhang / .zshrc
Created January 15, 2024 07:49
add env var for nvidia HPC SDK
source /etc/profile.d/modules.sh # install `environment-modules` (https://askubuntu.com/questions/343692/module-load-command-does-not-work)
# https://docs.nvidia.com/hpc-sdk//hpc-sdk-install-guide/index.html#install-linux-end-usr-env-settings
NVARCH=`uname -s`_`uname -m`; export NVARCH
NVCOMPILERS=/opt/nvidia/hpc_sdk; export NVCOMPILERS
export MODULEPATH=$NVCOMPILERS/modulefiles:$MODULEPATH
module load nvhpc
@levihuayuzhang
levihuayuzhang / environment
Created January 15, 2024 06:29
use adwaita dark in gnome for qt applications
# /etc/environment
QT_QPA_PLATFORMTHEME=gnome
QT_STYLE_OVERRIDE=adwaita-dark