diff --git a/home/dot_config/hypr/hyprland.conf b/home/dot_config/hypr/hyprland.conf index b7f2b11..4f596a5 100644 --- a/home/dot_config/hypr/hyprland.conf +++ b/home/dot_config/hypr/hyprland.conf @@ -15,7 +15,7 @@ # ####################################################################################### $mainMod = SUPER # Sets "Windows" key as main modifier -$terminal = kitty +$terminal = ghostty $fileManager = dolphin $menu = rofi $iconTheme = Papirus @@ -85,8 +85,6 @@ exec-once = fcitx5 & # Clipboard history (called by wofi) exec-once = wl-paste --watch cliphist store # exec-once = QT_SCALE_FACTOR=1 albert & -# Bluetooth Manager -exec-once = blueman-applet & @@ -236,10 +234,10 @@ input { # gesture = 4, horizontal, workspace # https://wiki.hyprland.org/Configuring/Variables/#gestures -gestures { - workspace_swipe = true - workspace_swipe_fingers = 4 -} +# gestures { +# workspace_swipe = true +# workspace_swipe_fingers = 4 +# } # Example per-device config # See https://wiki.hyprland.org/Configuring/Keywords/#per-device-input-configs for more diff --git a/home/dot_config/hypr/hyprland/keymaps.conf b/home/dot_config/hypr/hyprland/keymaps.conf index 4caf009..8c7369b 100644 --- a/home/dot_config/hypr/hyprland/keymaps.conf +++ b/home/dot_config/hypr/hyprland/keymaps.conf @@ -1,5 +1,6 @@ ## Open Applications bind = $mainMod, R, exec, $terminal +bind = $mainMod, return, exec, $terminal bind = $mainMod, Q, killactive, # bind = $mainMod, M, exit bind = $mainMod SHIFT, F, exec, hyprctl --batch "dispatch togglefloating ; dispatch resizeactive exact 1440 810 ; dispatch centerwindow 1;" diff --git a/home/dot_config/waybar/config.jsonc b/home/dot_config/waybar/config.jsonc index 2c200ac..298113a 100644 --- a/home/dot_config/waybar/config.jsonc +++ b/home/dot_config/waybar/config.jsonc @@ -16,7 +16,7 @@ // "~/.config/waybar/modules/niri.jsonc" ], // Choose the order of the modules - "modules-left": ["custom/osicon", "sway/workspaces", "wlr/taskbar"], + "modules-left": ["custom/osicon", "sway/workspaces", "hyprland/workspaces", "wlr/taskbar"], // "modules-center": ["clock"], "modules-right": ["tray", "pulseaudio", "cpu", "memory", "network", "battery", "clock"], // "modules-right": ["cpu", "memory", "battery", "network", "tray"], diff --git a/home/dot_config/zsh/dot_zshrc b/home/dot_config/zsh/dot_zshrc index e4996b3..09f2b77 100644 --- a/home/dot_config/zsh/dot_zshrc +++ b/home/dot_config/zsh/dot_zshrc @@ -37,7 +37,7 @@ case "$(uname)" in # ;; esac -for file in $DOTFILES/tools/zsh/mod/*.zsh; do +for file in $DOTFILES/home/dot_config/zsh/mod/*.zsh; do source $file done diff --git a/home/dot_config/zsh/mod/completion.zsh b/home/dot_config/zsh/mod/completion.zsh new file mode 100644 index 0000000..90e53cc --- /dev/null +++ b/home/dot_config/zsh/mod/completion.zsh @@ -0,0 +1,20 @@ + +### completion +### ================= + +# use tab to select +zstyle ':completion:*' menu select + +# substring matching +zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' + +# use cache +zstyle ':completion:*' use-cache on +zstyle ':completion:*' cache-path "$XDG_CACHE_HOME/zsh/.zcompcache" + +# Colours in completion +zstyle ':completion:*' list-colors ''${(s.:.)LS_COLORS} + +# Complete . and .. special directories +zstyle ':completion:*' special-dirs true + diff --git a/home/dot_config/zsh/mod/config.zsh b/home/dot_config/zsh/mod/config.zsh index d89cfd0..019dd6a 100644 --- a/home/dot_config/zsh/mod/config.zsh +++ b/home/dot_config/zsh/mod/config.zsh @@ -9,8 +9,15 @@ HIST_STAMPS="yyyy-mm-dd" HISTSIZE=10000 SAVEHIST=10000 -export LANG=zh_CN.UTF-8 -export LC_ALL=zh_CN.UTF-8 +setopt INTERACTIVE_COMMENTS # Allow comments in interactive mode + +# Globbing +setopt EXTENDED_GLOB # Extended globbing +setopt GLOB_DOTS # Include dotfiles in globbing + +# Error correction +setopt CORRECT # Suggest corrections for commands +setopt CORRECT_ALL # Suggest corrections for arguments # Manually manage plugins 手动管理插件 # Load zsh-syntax-highlighting before zsh-history-substring-search diff --git a/home/dot_config/zsh/mod/keymap.zsh b/home/dot_config/zsh/mod/keymap.zsh index c9b683d..f0af1cb 100644 --- a/home/dot_config/zsh/mod/keymap.zsh +++ b/home/dot_config/zsh/mod/keymap.zsh @@ -3,49 +3,25 @@ # Author: js0ny # Sourced by user's zshrc 在用户的 zshrc 中被引用 -# read key: `fish_key_reader` +# read key: `read` # get current bindings: `bindkey` -bindkey -v # Vi Keybindings +# bindkey -v # Vi Keybindings -# Colemak hnei -# ^ -# n -# < h i > -# e -# v -# bindkey -M vicmd 'h' vi-backward-char # No change -# bindkey -M vicmd 'n' down-line-or-history -# bindkey -M vicmd 'e' up-line-or-history -# bindkey -M vicmd 'i' vi-forward-char -# -# # Similar position to [i] in QWERTY -# bindkey -M vicmd 'l' vi-insert -# bindkey -M vicmd 'L' vi-insert-bol -# # Ne{[k]s}t -# bindkey -M vicmd 'k' vi-repeat-search -# bindkey -M vicmd 'K' vi-rev-repeat-search -# # [J]ump -# bindkey -M vicmd 'j' vi-forward-word-end -# bindkey -M vicmd 'J' vi-forward-blank-word-end -# # Use N to Join -# bindkey -M vicmd 'N' vi-join +bindkey '^H' backward-kill-word # Ctrl-Backspace +bindkey '^[^?' backward-kill-line # Alt-Backspace -# Emacs Hybrid -bindkey '^A' beginning-of-line -bindkey '^E' end-of-line -bindkey '^F' forward-char -bindkey '^B' backward-char -bindkey '^P' up-line-or-history -bindkey '^N' down-line-or-history -bindkey '^R' history-incremental-search-backward -bindkey '^K' kill-line -# Zsh will parse to C-h -bindkey '^H' backward-kill-word +bindkey '^[[1;5D' backward-word # Ctrl-Left +bindkey '^[[1;5C' forward-word # Ctrl-Right -bindkey -M viins '^?' backward-delete-char -# LEADER CONVENTION -# ^X defines as a prefix key in shell -# ^A defines as a prefix key in tmux -# ^B defines as a prefix key in Terminal Emulators -# SPC defines as a prefix key in nvim +bindkey '^[[1;3D' beginning-of-line # Alt-Left +bindkey '^[[1;3C' end-of-line # Alt-Right + + +bindkey '^[[H' beginning-of-line # Home +bindkey '^[[F' end-of-line # End + + +bindkey '^[[3~' delete-char # Delete +bindkey '^[[3;5~' kill-word # Ctrl-Delete +bindkey '^[[3;3~' kill-line # Alt-Delete diff --git a/nixcfgs/hosts/zephyrus/default.nix b/nixcfgs/hosts/zephyrus/default.nix index b1cb197..1f58038 100644 --- a/nixcfgs/hosts/zephyrus/default.nix +++ b/nixcfgs/hosts/zephyrus/default.nix @@ -22,7 +22,7 @@ # desktop environment and display manager ../../modules/nixos/desktop/dm/sddm.nix ../../modules/nixos/desktop/de/kde.nix - ../../modules/nixos/desktop/de/sway.nix + ../../modules/nixos/desktop/de/hyprland.nix # desktop programs ../../modules/nixos/programs/zsh.nix @@ -51,6 +51,13 @@ # Use unfree software nixpkgs.config.allowUnfree = true; + zramSwap = { + enable = true; + memoryPercent = 10; + algorithm = "lz4"; + priority = 100; + }; + # Disable modem networking.modemmanager.enable = false; services.flatpak.enable = true; diff --git a/nixcfgs/modules/home/options.nix b/nixcfgs/modules/home/options.nix index abc5260..1f02f92 100644 --- a/nixcfgs/modules/home/options.nix +++ b/nixcfgs/modules/home/options.nix @@ -22,6 +22,18 @@ description = "The default terminal emulator to run CLI softwares directly"; }; + defaultExplorer = lib.mkOption { + type = lib.types.str; + default = "thunar"; + description = "The default file explorer"; + }; + + defaultTerminalExplorer = lib.mkOption { + type = lib.types.str; + default = "yazi"; + description = "The default file explorer with TUI"; + }; + iconTheme = lib.mkOption { type = lib.types.str; default = "Breeze"; diff --git a/nixcfgs/modules/nixos/desktop/de/hyprland.nix b/nixcfgs/modules/nixos/desktop/de/hyprland.nix index 7202283..490b5cc 100644 --- a/nixcfgs/modules/nixos/desktop/de/hyprland.nix +++ b/nixcfgs/modules/nixos/desktop/de/hyprland.nix @@ -1,4 +1,7 @@ {pkgs, ...}: { + imports = [ + ./wayland-wm.nix + ]; programs.hyprland = { enable = true; withUWSM = false; @@ -6,13 +9,10 @@ }; environment.systemPackages = with pkgs; [ - caelestia-shell - mako - rofi - xdg-desktop-portal-wlr + # caelestia-shell xdg-desktop-portal-hyprland hyprpolkitagent - cliphist grimblast + xdg-desktop-portal-wlr ]; } diff --git a/nixcfgs/modules/nixos/desktop/de/sway.nix b/nixcfgs/modules/nixos/desktop/de/sway.nix index ea80704..9767b09 100644 --- a/nixcfgs/modules/nixos/desktop/de/sway.nix +++ b/nixcfgs/modules/nixos/desktop/de/sway.nix @@ -1,15 +1,13 @@ {pkgs, ...}: { + imports = [ + ./wayland-wm.nix + ]; programs.sway.enable = true; programs.sway.xwayland.enable = true; environment.systemPackages = with pkgs; [ swaybg - swayidle - dunst - rofi - rofimoji - rofi-power-menu - swaylock-effects sway-contrib.grimshot waybar + xdg-desktop-portal-wlr ]; } diff --git a/nixcfgs/users/js0ny/config.nix b/nixcfgs/users/js0ny/config.nix index d47ec71..d46b3cb 100644 --- a/nixcfgs/users/js0ny/config.nix +++ b/nixcfgs/users/js0ny/config.nix @@ -4,5 +4,7 @@ defaultTerminal = "ghostty"; defaultTerminalRunner = "alacritty"; iconTheme = "Papirus"; + defaultExplorer = "dolphin"; + defaultTerminalExplorer = "yazi"; }; } diff --git a/nixcfgs/users/js0ny/programs/desktop/wayland-wm/hyprland.nix b/nixcfgs/users/js0ny/programs/desktop/wayland-wm/hyprland.nix new file mode 100644 index 0000000..9fcd687 --- /dev/null +++ b/nixcfgs/users/js0ny/programs/desktop/wayland-wm/hyprland.nix @@ -0,0 +1,8 @@ +{pkgs, ...}: { + home.packages = with pkgs; [ + grimblast + ]; + imports = [ + ./packages.nix + ]; +} diff --git a/nixcfgs/users/js0ny/programs/desktop/niri.nix b/nixcfgs/users/js0ny/programs/desktop/wayland-wm/niri.nix similarity index 100% rename from nixcfgs/users/js0ny/programs/desktop/niri.nix rename to nixcfgs/users/js0ny/programs/desktop/wayland-wm/niri.nix diff --git a/nixcfgs/users/js0ny/programs/desktop/wayland-wm/packages.nix b/nixcfgs/users/js0ny/programs/desktop/wayland-wm/packages.nix new file mode 100644 index 0000000..90fbf18 --- /dev/null +++ b/nixcfgs/users/js0ny/programs/desktop/wayland-wm/packages.nix @@ -0,0 +1,14 @@ +{pkgs, ...}: { + imports = [ + ../../rofi.nix + ./waybar.nix + ]; + home.packages = with pkgs; [ + swayidle # Screensaver + dunst # Notification daemon + swaylock-effects # Screensaver + cliphist # Clipboard daemon + swww # Wallpaper daemon + pavucontrol + ]; +} diff --git a/nixcfgs/users/js0ny/programs/desktop/sway.nix b/nixcfgs/users/js0ny/programs/desktop/wayland-wm/sway.nix similarity index 96% rename from nixcfgs/users/js0ny/programs/desktop/sway.nix rename to nixcfgs/users/js0ny/programs/desktop/wayland-wm/sway.nix index a5f3bfc..21bbe2d 100644 --- a/nixcfgs/users/js0ny/programs/desktop/sway.nix +++ b/nixcfgs/users/js0ny/programs/desktop/wayland-wm/sway.nix @@ -36,8 +36,10 @@ in { home.packages = with pkgs; [ grim slurp - grim - dunst sway-contrib.grimshot ]; + + imports = [ + ./packages.nix + ]; } diff --git a/nixcfgs/users/js0ny/programs/desktop/wayland-wm/waybar.nix b/nixcfgs/users/js0ny/programs/desktop/wayland-wm/waybar.nix new file mode 100644 index 0000000..43ba885 --- /dev/null +++ b/nixcfgs/users/js0ny/programs/desktop/wayland-wm/waybar.nix @@ -0,0 +1,6 @@ +{pkgs, ...}: { + home.packages = with pkgs; [ + waybar + pavucontrol + ]; +} diff --git a/nixcfgs/users/js0ny/programs/rofi.nix b/nixcfgs/users/js0ny/programs/rofi.nix new file mode 100644 index 0000000..4e115d9 --- /dev/null +++ b/nixcfgs/users/js0ny/programs/rofi.nix @@ -0,0 +1,7 @@ +{pkgs, ...}: { + home.packages = with pkgs; [ + rofi + rofimoji + rofi-power-menu + ]; +} diff --git a/nixcfgs/users/js0ny/zephyrus.nix b/nixcfgs/users/js0ny/zephyrus.nix index 1e00dcc..209125f 100644 --- a/nixcfgs/users/js0ny/zephyrus.nix +++ b/nixcfgs/users/js0ny/zephyrus.nix @@ -40,7 +40,7 @@ # Desktop Linux ./programs/desktop/plasma.nix - ./programs/desktop/sway.nix + ./programs/desktop/wayland-wm/hyprland.nix # General Program config ../../modules/home/programs/eza.nix