diff --git a/.config/sway/config b/.config/sway/config index cefcd92..f7389b8 100644 --- a/.config/sway/config +++ b/.config/sway/config @@ -88,7 +88,7 @@ output * bg /usr/share/backgrounds/default.jxl fill bindsym --to-code $mod+Shift+c reload # Exit sway (logs you out of your Wayland session) - bindsym --to-code $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit' + bindsym --to-code $mod+Shift+e exec dms ipc call powermenu toggle # # Moving around: # diff --git a/.config/sway/config.d/60-autostart.conf b/.config/sway/config.d/60-autostart.conf new file mode 100644 index 0000000..8613d92 --- /dev/null +++ b/.config/sway/config.d/60-autostart.conf @@ -0,0 +1,4 @@ +# Autostart (xdg-autostart does not run under sway). Delayed so the DMS tray is ready; guarded against duplicates. +exec sh -c 'sleep 5; pgrep -f "[n]extcloud.*--background" >/dev/null || flatpak run com.nextcloud.desktopclient.nextcloud --background' +exec sh -c 'sleep 5; pgrep -f "[R]emmina.* -i" >/dev/null || flatpak run org.remmina.Remmina -i' +exec sh -c 'sleep 8; pgrep -x geary >/dev/null || geary --gapplication-service' diff --git a/README.md b/README.md index 23082e4..147068a 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,9 @@ | `.config/swaylock` | локскрин с обоями | | `.config/kitty/kitty.conf` | прозрачность терминала, чтобы был виден blur | | `.config/sway/config.d/50-dms.conf` | запуск DMS, blur для его слоёв, хоткей буфера обмена, медиаклавиши (громкость, яркость, плеер) | +| `home/.tmux.conf` | tmux: префикс `Ctrl+A`, сплиты `|` и `-`, нумерация с 1, тема Tokyo Night | +| `home/.oh-my-zsh/custom/sysadmin.zsh` | алиасы сисадмина (`ports`, `jce`, `dnfu`, `tm`) и автоподключение fzf / zoxide / eza, если установлены | +| `.config/sway/config.d/60-autostart.conf` | автозапуск Nextcloud, Remmina и Geary (xdg-autostart в sway не работает) | | `.config/dms/settings.json` | настройки DMS: виджеты бара (раскладка, VPN, температура, приватность), шрифты, панель управления | | `.config/sway/config.d/40-bar.conf.off` | старый запуск waybar (отключён; переименуйте в `.conf`, чтобы вернуть waybar вместо DMS) | | `.config/sway/config.d/05-outputs.conf` | расположение и масштаб мониторов (ноутбук слева, HDMI справа; подгоните под своё железо) | diff --git a/home/.oh-my-zsh/custom/sysadmin.zsh b/home/.oh-my-zsh/custom/sysadmin.zsh new file mode 100644 index 0000000..a0a8759 --- /dev/null +++ b/home/.oh-my-zsh/custom/sysadmin.zsh @@ -0,0 +1,36 @@ +# Sysadmin helpers. Tools that are not installed are skipped silently. + +# --- systemd / logs / network --- +alias sc='systemctl' +alias scu='systemctl --user' +alias jc='journalctl' +alias jcf='journalctl -f' +alias jce='journalctl -p err -b' # errors since boot +alias ports='ss -tulpn' # listening sockets +alias myip='curl -s ifconfig.me; echo' +alias df='df -hT -x tmpfs -x devtmpfs' +alias free='free -h' +alias dnfu='sudo dnf upgrade --refresh' + +# --- safer defaults --- +alias cp='cp -iv' +alias mv='mv -iv' +alias mkdir='mkdir -pv' + +# --- nicer replacements, enabled when installed --- +if command -v eza >/dev/null; then + alias ls='eza --icons --group-directories-first' + alias ll='eza -lah --icons --group-directories-first --git' + alias lt='eza --tree --level=2 --icons' +else + alias ll='ls -lah --color=auto' +fi +command -v bat >/dev/null && alias cat='bat --paging=never --style=plain' +command -v zoxide >/dev/null && eval "$(zoxide init zsh)" +if command -v fzf >/dev/null; then + for f in /usr/share/fzf/shell/key-bindings.zsh /usr/share/fzf/shell/completion.zsh; do [ -r "$f" ] && source "$f"; done + export FZF_DEFAULT_OPTS='--height=40% --layout=reverse --border --color=bg+:#3b4261,fg+:#c0caf5,hl:#bb9af7,hl+:#bb9af7,pointer:#ff9e64,prompt:#7dcfff' +fi + +# --- tmux: attach to "main" or create it --- +tm() { tmux new-session -A -s "${1:-main}"; } diff --git a/home/.tmux.conf b/home/.tmux.conf new file mode 100644 index 0000000..1dc1d7e --- /dev/null +++ b/home/.tmux.conf @@ -0,0 +1,53 @@ +# Меняем префикс на Ctrl+A +unbind C-b +set -g prefix C-a +bind C-a send-prefix + +# Включаем поддержку мыши (чтобы скроллить и кликать по панелям как в GUI!) +set -g mouse on + +# ---------- Usability ---------- +set -g base-index 1 # windows and panes start at 1 +setw -g pane-base-index 1 +set -g renumber-windows on +set -g escape-time 10 # no lag on Esc (vim) +set -g history-limit 50000 +set -g focus-events on +set -g set-clipboard on # copy from tmux into the system clipboard (OSC52, kitty) +set -g default-terminal "tmux-256color" +set -ag terminal-overrides ",xterm-kitty:RGB" +setw -g aggressive-resize on + +# Splits in the current directory, intuitive keys +bind | split-window -h -c "#{pane_current_path}" +bind - split-window -v -c "#{pane_current_path}" +bind c new-window -c "#{pane_current_path}" +unbind '"' +unbind % + +# Vim-style pane navigation / resize +bind h select-pane -L +bind j select-pane -D +bind k select-pane -U +bind l select-pane -R +bind -r H resize-pane -L 5 +bind -r J resize-pane -D 5 +bind -r K resize-pane -U 5 +bind -r L resize-pane -R 5 + +# Reload config +bind r source-file ~/.tmux.conf \; display-message "tmux.conf reloaded" + +# ---------- Look (Tokyo Night, matches kitty) ---------- +set -g status-position top +set -g status-interval 5 +set -g status-style "bg=#1f2335,fg=#a9b1d6" +set -g status-left-length 30 +set -g status-left "#[bg=#bb9af7,fg=#11111b,bold] #S #[bg=#1f2335,fg=#bb9af7] " +set -g status-right-length 60 +set -g status-right "#[fg=#7dcfff]#{?client_prefix,PREFIX ,}#[fg=#a9b1d6]#H #[fg=#565f89]| #[fg=#a9b1d6]%d.%m %H:%M " +setw -g window-status-format " #I:#W " +setw -g window-status-current-format "#[bg=#3b4261,fg=#c0caf5,bold] #I:#W " +set -g pane-border-style "fg=#3b4261" +set -g pane-active-border-style "fg=#bb9af7" +set -g message-style "bg=#bb9af7,fg=#11111b" diff --git a/install.sh b/install.sh index 8d5f8dd..12738a3 100755 --- a/install.sh +++ b/install.sh @@ -105,6 +105,15 @@ install_configs() { say "Copying configs to $CFG" mkdir -p "$CFG" cp -a "$REPO/.config/." "$CFG/" + if [ -d "$REPO/home" ]; then + say "Copying shell/tmux files into $HOME (existing ones are backed up)" + local f + while IFS= read -r f; do + [ -e "$HOME/$f" ] && { mkdir -p "$BACKUP/$(dirname "$f")"; cp -a "$HOME/$f" "$BACKUP/$f"; } + done < <(cd "$REPO/home" && find . -type f | sed 's|^\./||') + mkdir -p "$HOME/.oh-my-zsh/custom" + cp -a "$REPO/home/." "$HOME/" + fi # waybar is replaced by DMS; a stale 40-bar.conf from an older install would start a second bar rm -f "$CFG/sway/config.d/40-bar.conf" chmod +x "$CFG"/sway/*.sh "$CFG"/rofi/*.sh 2>/dev/null || true