Giter VIP home page Giter VIP logo

.dotfiles's People

Contributors

ysl2 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

.dotfiles's Issues

alacritty 版本限制和 sixel

0.12.1可用,高于此版本会提示需要toml配置文件
我的sixel fork版本是0.13.0-dev,不需要配置文件

需要rustup依赖,直接官网安装

Add new window manager or desktop environment

1. Don't bypass display manager

I have added desktop file into my fork dwm ysl2/dwm, so no need to manually add it. It will be auto added when compiling my dwm.

e.g, dwm

sudo vim /usr/share/xsessions/dwm.desktop

# Ref: https://github.com/elken/dwm/blob/master/dwm.desktop
[Desktop Entry]
Encoding=UTF-8
Name=DWM
Comment=Dynamic window manager
Exec=/home/elken/.dwm/bin/start.sh
Icon=dwm
Type=XSession

QQMusic cannot boot on linux

Append --no-sandbox %U into Exec, like this:

sudo vim /usr/share/applications/qqmusic.desktop

[Desktop Entry]
Name=qqmusic
Exec=/opt/qqmusic/qqmusic --no-sandbox %U
Terminal=false
Type=Application
Icon=qqmusic
StartupWMClass=qqmusic
Comment=Tencent QQMusic
Categories=AudioVideo;

Debian Installation

  • debian下载(本地包)
  • dd命令做安装盘
    • sudo dd if=/path/to/debian.iso of=/dev/sdX bs=4M status=progress oflag=sync
  • 安装。注意分区efi,512M,否则没法开机
  • 搭建clash,需要clash执行文件和country.mmdb
  • firefox设置代理,设置里面搜proxy
  • 上传github公钥
  • 当前用户添加到sudo
    • su -
    • usermod -aG sudo yusongli
  • 换清华源,testing,然后更新
  • 安装vim,git
  • 设置sudo免密
    • image
  • 配置github的ssh走443端口
  • 克隆dotlib,dotfiles,并放好
  • 运行触摸板按压脚本,在~/.scripts/window-manager/fix-touchpad.sh
  • 安装i3,i3blocks,st-flexipatch,dmenu-flexipatch(注意依赖),并且克隆自己的i3配置仓库,做xsession桌面启动文件,安装firacode,设置启动脚本(注意,安装pip和链接python3到python,依赖项和脚本权限777)
  • chrome, install from source
  • 中文输入
  • 微信
    • 星火应用商店,注意切换到debian桌面,然后再下载微信,最后把微信启动脚本链接到PATH里面。刚开始的时候会一直提示wine无响应,是因为正在加载,等加载完就好了
  • nvim
    • node和yarn
    • 克隆nvim仓库
    • sudo apt install -y xclip zathura texlive-full
  • 工作仓库
    • yunet.thesis (gitee),需要同时设置github地址
    • yunet.ppt (gitee)
    • drawio (gitee)
  • cargo install pfetch
  • 安装miniconda并设置MYCONDA变量和toconda
  • P ysl chafa
  • sudo apt install tmux
  • 通过星火应用商店安装wps
  • sudo apt install nvidia-driver

Debian install mariaDB

Install

Install via docker: https://mariadb.com/kb/en/installing-and-using-mariadb-via-docker/

or:

sudo apt install mariadb-server mycli -y
sudo mariadb-secure-installation

Create normal user with root permission

-- Ref: https://www.digitalocean.com/community/tutorials/how-to-create-a-new-user-and-grant-permissions-in-mysql
-- Note: `sammy` is your username, `password` is your strong password.
CREATE USER 'sammy'@'localhost' IDENTIFIED BY 'password';

Login

If you use docker, use:

mariadb -h 127.0.0.1 -P 3306 -u root -p

else, use:

mariadb -u root -p
mariadb -u sammy -p

terminfo

cat /etc/terminfo/README

This directory is for system-local terminfo descriptions. By default,
ncurses will search ${HOME}/.terminfo first, then /etc/terminfo (this
directory), then /lib/terminfo, and last not least /usr/share/terminfo.
# ~/.bashrc.localhost

export TERMINFO=/lib/terminfo

Mac installation

Window manager: refer to below options. Current is using Option 2.
Launcher: raycast
ScreenShoter: snipaste
ScreenRecorder: 1001 Record
Terminal: kitty (all localhost settings will take effect after re-login macOS)
Unzip: keka

  1. Raycast set default input method to ABC.
  2. System settings:
    • Reduce motion -> open it (for flameshot).
    • keyboard -> repeat rate and delay.

Option 1: yabai & skhd (has bug for WeCom)

  1. Check all yabai installation requirements listed here.
  2. System settings:
    • Create 9 desktops (for yabai).
    • keyboard -> keyboard Shortcuts -> mission control -> enable ^N (for yabai).

Option 2: rectangle & alttab (works well but lack of multi-desktop capability)

TrustedInstaller problem on windows

Ref: https://answers.microsoft.com/en-us/windows/forum/all/trouble-with-you-require-permission-from/f35e07eb-0663-4dec-b3f7-3ee515b1cdfc

  1. Right click on the file or directory.
  2. Click on “Properties” on the right click menu.
  3. Click on “Security” tab.
  4. Click on “Advanced” button at the bottom.
  5. In Advanced Security Dialog window, click on "Change permissions"(might be there or not) then "Add" button to add a new rule for yourself, give yourself full control

image

Windows install telescope-fzf-native.nvim

choco install make

Try this:

:! make -C $LUNARVIM_RUNTIME_DIR/site/pack/packer/start/telescope-fzf-native.nvim

or do make clean just to be sure:

:! cd $LUNARVIM_RUNTIME_DIR/site/pack/packer/start/telescope-fzf-native.nvim && make clean && make

CLI/TUI/GUI tools (Which I might easily forget)

https://github.com/johnalanwoods/maintained-modern-unix

Basic Tool Name Type (CLI/TUI/GUI) Note Installation
nmtui TUI Network
brightnessctl CLI Brightness
redshift CLI Brightness
bluetuith TUI Bluetooth
xrandr CLI Monitor control
arandr GUI Monitor control
termscp TUI SFTP in terminal
nvtop TUI Check GPU status in terminal
ncdu TUI Check disk usage
htop TUI Check system status
feh TUI For desktop wallpaper
picom TUI Window transparent
flameshot GUI Image capture
dunst CLI Show notification
udiskie GUI USB mount
tlp CLI Power saver
lxappearance GUI GTK theme changer
Other Tool Name Type (CLI/TUI/GUI) Note Installation
bluetoothctl CLI Bluetooth
img2pdf CLI Image to PDF, for Latex
pdf2svg CLI PDF to SVG, for Typst
qrcp CLI File transfer
carbonyl TUI Browser in terminal By npm
surf GUI Lightweight browser
trans CLI Language translate
shell_gpt CLI GPT in shell
frp CLI Proxy forward
bottom TUI Check system status
crlf2lf CLI Change file ending
zathura GUI PDF Viewer
chafa CLI Terminal image renderer
gh2md CLI Export github issues
tldraw GUI Whiteboard
wechat GUI Official WeChat (but with unofficial flatpak)
qq GUI Official QQ
gh CLI Official Github CLI By brew
color-picker GUI Color picker By apt

Gnome autostart

~/.config/autostart/Autostart.desktop

[Desktop Entry]
Type=Application
Name=Autostart
Exec=/home/yusongli/.autostart.sh > /dev/null 2>&1
Comment=Autostart script
X-GNOME-Autostart-enabled=true

~/.autostart.sh (Make sure this script is chmod 777)

#!/bin/bash

fcitx5 > /dev/null 2>&1 &
bash ~/.scripts/wm/autostart/keyboard.sh > /dev/null 2>&1 &

(flatpak 添加源、修改国内镜像) flatpak report: error: The application com.tencent.WeChat/x86_64/master requires the runtime org.freedesktop.Platform/x86_64/23.08 which was not found

Ref: https://mirror.sjtu.edu.cn/docs/flathub

官方添加源的方式:

flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

如果之前没有添加过官方的源,就直接添加国内镜像:


sudo flatpak remote-add flathub https://mirror.sjtu.edu.cn/flathub/flathub.flatpakrepo

否则,如果之前添加过官方的源,就将其修改为国内镜像:

sudo flatpak remote-modify flathub --url=https://mirror.sjtu.edu.cn/flathub

# 如果上述出现错误,可尝试:
wget https://mirror.sjtu.edu.cn/flathub/flathub.gpg
sudo flatpak remote-modify --gpg-import=flathub.gpg flathub

如果某次安装被中断,则需要修复:

flatpak repair

zathura相关的设置

Set it to fullscreen

# /usr/share/applications/org.pwmt.zathura.desktop

Exec=zathura %U --mode fullscreen

Disable laptop's touchpad and keyboard by xinput

Ref: https://bbs.archlinuxcn.org/viewtopic.php?id=10561

  1. First, we need to find the touchpad and keyboard's id.
❯ xinput list
⎡ Virtual core pointer                    	id=2	[master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer              	id=4	[slave  pointer  (2)]
⎜   ↳ OBINS OBINS
AnnePro2 Mouse              	id=13	[slave  pointer  (2)]
⎜   ↳ YICHIP Wireless Device Mouse            	id=14	[slave  pointer  (2)]
⎜   ↳ YICHIP Wireless Device Consumer Control 	id=16	[slave  pointer  (2)]
⎜   ↳ SYNA3073:00 06CB:8265 Mouse             	id=17	[slave  pointer  (2)]
⎜   ↳ SYNA3073:00 06CB:8265 Touchpad          	id=18	[slave  pointer  (2)]
⎜   ↳ SynPS/2 Synaptics TouchPad              	id=20	[slave  pointer  (2)]
⎣ Virtual core keyboard                   	id=3	[master keyboard (2)]
    ↳ Virtual core XTEST keyboard             	id=5	[slave  keyboard (3)]
    ↳ Power Button                            	id=6	[slave  keyboard (3)]
    ↳ Video Bus                               	id=7	[slave  keyboard (3)]
    ↳ Video Bus                               	id=8	[slave  keyboard (3)]
    ↳ Sleep Button                            	id=9	[slave  keyboard (3)]
    ↳ OBINS OBINS
AnnePro2                    	id=10	[slave  keyboard (3)]
    ↳ OBINS OBINS
AnnePro2 Consumer Control   	id=11	[slave  keyboard (3)]
    ↳ OBINS OBINS
AnnePro2 Keyboard           	id=12	[slave  keyboard (3)]
    ↳ YICHIP Wireless Device System Control   	id=15	[slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard            	id=19	[slave  keyboard (3)]
    ↳ HP WMI hotkeys                          	id=21	[slave  keyboard (3)]
    ↳ YICHIP Wireless Device Consumer Control 	id=22	[slave  keyboard (3)]

In the command output above, the SYNA3073:00 06CB:8265 Touchpad id=18 is the touchpad, and the AT Translated Set 2 keyboard id=19 is the keyboard.

  1. Then, we use the command below to disable:
# Disable the touchpad
xinput disable 18
# Disable the keyboard
xinput disable 19
  1. If we want to re-enable, just use xinput enable {id}.

deepin switch Capslock and ESC and restore

Ref: https://wiki.deepin.org/zh/%E5%BE%85%E5%88%86%E7%B1%BB/02_deepin%E6%B7%B1%E5%85%A5/%E4%BF%AE%E6%94%B9%E9%94%AE%E7%9B%98%E6%98%A0%E5%B0%84

# Switch
gsettings set com.deepin.dde.keybinding.mediakey capslock '[]'
gsettings set com.deepin.dde.keyboard layout-options '["caps:swapescape"]'

# Restore only capslock
gsettings reset com.deepin.dde.keybinding.mediakey capslock
gsettings reset com.deepin.dde.keyboard layout-options

# Restore all keys
gsettings reset-recursively com.deepin.dde.keybinding.mediakey
gsettings reset-recursively com.deepin.dde.keyboard

windows installation

Installation on Windows

dotfiles

# NOTE: 
# 1. You should open the `Developer Mode` item in Windows `Settings -> Update & Security -> Developer 
# 2. Don't use administrator terminal, instead, use your normal terminal.
git clone git@github.com:ysl2/.dotfiles.git
git clone -c core.symlinks=true git@github.com:ysl2/.dotlinks.git -b windows

Special packages

# Don't use this to install texlive, instead, install it manually by local install.
choco install texlive --params="'/scheme:full'"
choco install ntop.portable

# Update: don't use conda, instead, use original python
# That's beacuse you might encounter the SSL problem, annoying :-<
choco install miniconda3
# Add to PATH:
# C:\tools\miniconda3
# C:\tools\miniconda3\Scripts

# Cmake
# Add to PATH: C:\Program Files\CMake\bin

Other packages

Chocolatey v2.2.2
chocolatey 2.2.2
chocolatey-compatibility.extension 1.0.0
chocolatey-core.extension 1.4.0
chocolatey-font-helpers.extension 0.0.4
chocolatey-windowsupdate.extension 1.0.5
clash-for-windows 0.20.2
git 2.43.0
git.install 2.43.0
KB2919355 1.0.20160915
KB2919442 1.0.20160915
KB2999226 1.0.20181019
KB3033929 1.0.5
KB3035131 1.0.3
KB3118401 1.0.5
lazygit 0.40.2
lf 0.26.0
microsoft-windows-terminal 1.19.3172-beta
neovim 0.9.5
nerd-fonts-FiraCode 3.1.1
nodejs 21.4.0
nodejs.install 21.4.0
powershell-core 7.4.0
pwsh 7.4.0
redshift 1.12.0
sharpkeys 3.5.0.20180307
starship 1.17.1
starship.install 1.17.1
sumatrapdf 3.5.2
sumatrapdf.install 3.5.2
vcredist140 14.38.33130
vcredist2015 14.0.24215.20170201
vim 9.0.2146
winrar 6.24.0
34 packages installed.
  1. Lf

    You need to set system variable EDITOR to vim (or any other editor), and link neovide to notepad.exe to replace default notepad (optional). Use vim to edit single file by pressing e key, and use neovim to edit project by pressing l key (I tried to inverse those two behavior but failed, so must be this at least now).

latex环境

sudo apt install texlive-full

其他就不需要了。打开vscode就能好使。

Debian安装QEMU (通过virt-manager启动)

Ref: https://christitus.com/vm-setup-in-linux/

  1. 检查虚拟化:

    egrep -c '(vmx|svm)' /proc/cpuinfo
    

    If the output is zero then go to bios settings and enable VT-x (Virtualization Technology Extension) for Intel processor and AMD-V for AMD processor.

  2. 安装

sudo apt install qemu-kvm qemu-system qemu-utils python3 python3-pip libvirt-clients libvirt-daemon-system bridge-utils virtinst libvirt-daemon virt-manager -y
  1. 检查服务是否开启
sudo systemctl status libvirtd.service
  1. 设置网络
sudo virsh net-start default
sudo virsh net-autostart default
sudo virsh net-list --all
  1. 添加到用户组
sudo usermod -aG libvirt $USER
sudo usermod -aG libvirt-qemu $USER
sudo usermod -aG kvm $USER
sudo usermod -aG input $USER
sudo usermod -aG disk $USER

Android emulator on linux

Download genymotion from official website.

Install it, but without sudo (install under /home as normal user)

Create a new virtual android phone, but it's android version should below 9.0

Download https://github.com/m9rco/Genymotion_ARM_Translation zip file that fit for the virtual machine's android version, then drag drop into virtual machine

Reboot

Install apps by drag drop, finish.

add ssh host alias, and ssh-copy-id on windows

# $HOME\.pwshrc.localhost.ps1

# NOTE: The function name must starts with a letter.
function s53 {
    ssh username@localhost -p 22
}

# You can use it in powershell by `s53`
# NOTE: The double quotes.
ssh-copy-id "username@localhost -p 22"

[Mac] Known issues & New features

Docker installation

  1. Install

    sudo apt install -y docker.io
    
  2. Set mirror

    阿里云加速器(点击管理控制台 -> 登录账号(淘宝账号) -> 左侧镜像工具 -> 镜像加速器 -> 复制加速器地址)

    sudo mkdir -p /etc/docker
    sudo tee /etc/docker/daemon.json <<-'EOF'
    {
      "registry-mirrors": ["自己的阿里云镜像链接"]
    }
    EOF
    sudo systemctl daemon-reload
    sudo systemctl restart docker
    
  3. Without sudo

    # Create a Docker group if it doesn't already exist:
    sudo groupadd docker
    # Add your user to the Docker group:
    sudo usermod -aG docker $USER
    

安装PyQt5 designer

通过pip可以安装

# Install
pip install pyqt5-tools

# Use
# Method 1: directly
designer
# Method 2: command
pyqt5-tools designer

下面的方法是系统级别,不需要这么麻烦。

sudo apt-get install qttools5-dev-tools qttools5-dev

git sdk 64

Add git sdk 64 into right cleck menu

code
Windows Registry Editor Version 5.00
; Open files
; Default Git-Bash Location C:\Program Files\Git\git-bash.exe

[HKEY_CLASSES_ROOT\*\shell\Open Git Bash]
@="Open Git Bash"
"Icon"="C:\\git-sdk-64\\git-bash.exe"

[HKEY_CLASSES_ROOT\*\shell\Open Git Bash\command]
@="\"C:\\git-sdk-64\\git-bash.exe\" \"--cd=%1\""

; This will make it appear when you right click ON a folder
; The "Icon" line can be removed if you don't want the icon to appear

[HKEY_CLASSES_ROOT\Directory\shell\bash]
@="Open Git Bash"
"Icon"="C:\\git-sdk-64\\git-bash.exe"


[HKEY_CLASSES_ROOT\Directory\shell\bash\command]
@="\"C:\\git-sdk-64\\git-bash.exe\" \"--cd=%1\""

; This will make it appear when you right click INSIDE a folder
; The "Icon" line can be removed if you don't want the icon to appear

[HKEY_CLASSES_ROOT\Directory\Background\shell\bash]
@="Open Git Bash"
"Icon"="C:\\git-sdk-64\\git-bash.exe"

[HKEY_CLASSES_ROOT\Directory\Background\shell\bash\command]
@="\"C:\\git-sdk-64\\git-bash.exe\" \"--cd=%v.\""

Disable Git SDK welcome

/etc/profile.d/git-sdk.sh, line 481, sdk welcome

redshift install and usage

Install:

sudo apt install redshift

Usage:

# Set to default night mode colur
redshift -P -O 4500K
# Reset
redshift -x

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.