From 3daa3b59bfd5b0533cd2d97f0fa28af9574b9de9 Mon Sep 17 00:00:00 2001 From: "SilverAg.L" Date: Fri, 10 Oct 2025 14:55:43 +0800 Subject: [PATCH] initial commit with most component ready. --- .config/environment.d/01-proxy.conf | 4 + .config/environment.d/im.conf | 6 + .config/fastfetch/config.jsonc | 99 ++++ .config/foot/foot.ini | 183 +++++++ .config/fuzzel/fuzzel.ini | 27 + .config/gtklock/config.ini | 5 + .config/gtklock/style.css | 15 + .config/mako/config | 28 + .config/niri/config.kdl | 515 +++++++++++++++++++ .config/waybar/config.jsonc | 92 ++++ .config/waybar/style.css | 74 +++ .config/xdg-desktop-portal/niri-portals.conf | 6 + .config/yazi/yazi.toml | 4 + .zprofile | 11 + .zshrc | 143 +++++ bin/chbg | 11 + readme.md | 39 ++ 17 files changed, 1262 insertions(+) create mode 100644 .config/environment.d/01-proxy.conf create mode 100644 .config/environment.d/im.conf create mode 100644 .config/fastfetch/config.jsonc create mode 100644 .config/foot/foot.ini create mode 100644 .config/fuzzel/fuzzel.ini create mode 100644 .config/gtklock/config.ini create mode 100644 .config/gtklock/style.css create mode 100644 .config/mako/config create mode 100644 .config/niri/config.kdl create mode 100644 .config/waybar/config.jsonc create mode 100644 .config/waybar/style.css create mode 100644 .config/xdg-desktop-portal/niri-portals.conf create mode 100644 .config/yazi/yazi.toml create mode 100644 .zprofile create mode 100644 .zshrc create mode 100755 bin/chbg create mode 100644 readme.md diff --git a/.config/environment.d/01-proxy.conf b/.config/environment.d/01-proxy.conf new file mode 100644 index 0000000..a7cb8e2 --- /dev/null +++ b/.config/environment.d/01-proxy.conf @@ -0,0 +1,4 @@ +# Proxy, set in environment.d? +http_proxy="http://192.168.1.128:26100/" +https_proxy="http://192.168.1.128:26100/" + diff --git a/.config/environment.d/im.conf b/.config/environment.d/im.conf new file mode 100644 index 0000000..5db289d --- /dev/null +++ b/.config/environment.d/im.conf @@ -0,0 +1,6 @@ +#GTK_IM_MODULE=fcitx +#QT_IM_MODULE=fcitx +XMODIFIRERS=@im=fcitx +#SDL_IM_MODULE=fcitx +#GLFW_IM_MODULE=fcitx + diff --git a/.config/fastfetch/config.jsonc b/.config/fastfetch/config.jsonc new file mode 100644 index 0000000..90948ec --- /dev/null +++ b/.config/fastfetch/config.jsonc @@ -0,0 +1,99 @@ +{ + "$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json", + "_comment": "credit: https://github.com/xerolinux/xero-layan-git", + "modules": [ + "break", + { + "type": "host", + "key": " ", + "keyColor": "green" + }, + { + "type": "cpu", + "key": " ", + "showPeCoreCount": true, + "keyColor": "green" + }, + { + "type": "gpu", + "key": "󰾲 ", + "keyColor": "green" + }, + { + "type": "memory", + "key": " ", + "keyColor": "green" + }, + { + "type": "swap", + "key": "󰾴 ", + "keyColor": "green" + }, + { + "type": "disk", + "key": " ", + "keyColor": "green" + }, + "break", + { + "type": "os", + "key": " ", + "keyColor": "yellow" + }, + { + "type": "kernel", + "key": " ", + "keyColor": "yellow" + }, + { + "type": "packages", + "key": "󰏖 ", + "keyColor": "yellow" + }, + { + "type": "shell", + "key": " ", + "keyColor": "yellow" + }, + "break", + { + "type": "de", + "key": " ", + "keyColor": "blue" + }, + { + "type": "lm", + "key": "󰍂 ", + "keyColor": "blue" + }, + { + "type": "wm", + "key": " ", + "keyColor": "blue" + }, + { + "type": "wmtheme", + "key": "󰉼 ", + "keyColor": "blue" + }, + { + "type": "gpu", + "key": "󰾲 ", + "format": "{3}", + "keyColor": "blue" + }, + "break", + { + "type": "command", + "key": " ", + "keyColor": "magenta", + "text": "birth_install=$(stat -c %W /); current=$(date +%s); time_progression=$((current - birth_install)); days_difference=$((time_progression / 86400)); echo $days_difference days" + }, + { + "type": "uptime", + "key": " ", + "keyColor": "magenta" + }, + "break", + ] +} diff --git a/.config/foot/foot.ini b/.config/foot/foot.ini new file mode 100644 index 0000000..12e09fc --- /dev/null +++ b/.config/foot/foot.ini @@ -0,0 +1,183 @@ +# -*- conf -*- + +# shell=$SHELL (if set, otherwise user's default shell from /etc/passwd) +# term=foot (or xterm-256color if built with -Dterminfo=disabled) +#term=xterm-256color +# login-shell=no + +# app-id=foot +# title=foot +# locked-title=no + +font=Monaco Nerd Font Mono:size=11 +# font-bold= +# font-italic= +# font-bold-italic= +# line-height= +# letter-spacing=0 +# horizontal-letter-offset=0 +# vertical-letter-offset=0 +# underline-offset= +# box-drawings-uses-font-glyphs=no +dpi-aware=no + +# initial-window-size-pixels=700x500 # Or, +# initial-window-size-chars= +# initial-window-mode=windowed +pad=4x4 # optionally append 'center' +# resize-delay-ms=100 + +# notify=notify-send -a ${app-id} -i ${app-id} ${title} ${body} + +bold-text-in-bright=palette-based +# word-delimiters=,│`|:"'()[]{}<> +# selection-target=primary +# workers= + +[bell] +# urgent=no +# notify=no +# command= +# command-focused=no + +[scrollback] +# lines=1000 +# multiplier=3.0 +# indicator-position=relative +# indicator-format= + +[url] +# launch=xdg-open ${url} +# label-letters=sadfjklewcmpgh +osc8-underline=always +# protocols=http, https, ftp, ftps, file, gemini, gopher +# uri-characters=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.,~:;/?#@!$&%*+="' + +[cursor] +# style=block +# color=111111 dcdccc +# blink=no +# beam-thickness=1.5 +# underline-thickness= + +[mouse] +# hide-when-typing=no +# alternate-scroll-mode=yes + +[colors] +alpha=0.9 +# foreground=dcdccc +# background=000000 + +## Normal/regular colors (color palette 0-7) +regular0=000000 # black +regular1=aa0000 # red +regular2=00aa00 # green +regular3=aa5500 # yellow +regular4=3333aa # blue +regular5=aa00aa # magenta +regular6=00aaaa # cyan +regular7=aaaaaa # white + +## Bright colors (color palette 8-15) +bright0=555555 # bright black +bright1=ff5555 # bright red +bright2=55ff55 # bright green +bright3=ffff55 # bright yellow +bright4=5555ff # bright blue +bright5=ff55ff # bright magenta +bright6=55ffff # bright cyan +# bright7=ffffff # bright white + +## dimmed colors (see foot.ini(5) man page) +# dim0= +# ... +# dim7= + +## The remaining 256-color palette +# 16 = <256-color palette #16> +# ... +# 255 = <256-color palette #255> + +## Misc colors +# selection-foreground= +# selection-background= +# jump-labels= +# urls= +# scrollback-indicator= + +[csd] +# preferred=server +# size=26 +# font= +# color= +# border-width=0 +# border-color= +# button-width=26 +# button-color= +# button-minimize-color= +# button-maximize-color= +# button-close-color= + +[key-bindings] +# scrollback-up-page=Shift+Page_Up +# scrollback-up-half-page=none +# scrollback-up-line=none +# scrollback-down-page=Shift+Page_Down +# scrollback-down-half-page=none +# scrollback-down-line=none +# clipboard-copy=Control+Shift+c XF86Copy +# clipboard-paste=Control+Shift+v XF86Paste +# primary-paste=Shift+Insert +# search-start=Control+Shift+r +# font-increase=Control+plus Control+equal Control+KP_Add +# font-decrease=Control+minus Control+KP_Subtract +# font-reset=Control+0 Control+KP_0 +# spawn-terminal=Control+Shift+n +# minimize=none +# maximize=none +# fullscreen=none +# pipe-visible=[sh -c "xurls | fuzzel | xargs -r firefox"] none +# pipe-scrollback=[sh -c "xurls | fuzzel | xargs -r firefox"] none +# pipe-selected=[xargs -r firefox] none +# show-urls-launch=Control+Shift+u +# show-urls-copy=none +# noop=none + +[search-bindings] +# cancel=Control+g Control+c Escape +# commit=Return +find-prev=Control+p +find-next=Control+n +# cursor-left=Left Control+b +# cursor-left-word=Control+Left Mod1+b +# cursor-right=Right Control+f +# cursor-right-word=Control+Right Mod1+f +# cursor-home=Home Control+a +# cursor-end=End Control+e +# delete-prev=BackSpace +# delete-prev-word=Mod1+BackSpace Control+BackSpace +# delete-next=Delete +# delete-next-word=Mod1+d Control+Delete +# extend-to-word-boundary=Control+w +# extend-to-next-whitespace=Control+Shift+w +# clipboard-paste=Control+v Control+y +# primary-paste=Shift+Insert + +[url-bindings] +# cancel=Control+g Control+c Control+d Escape +# toggle-url-visible=t + +[mouse-bindings] +# selection-override-modifiers=Shift +# primary-paste=BTN_MIDDLE +# select-begin=BTN_LEFT +# select-begin-block=Control+BTN_LEFT +# select-extend=BTN_RIGHT +# select-extend-character-wise=Control+BTN_RIGHT +# select-word=BTN_LEFT-2 +# select-word-whitespace=Control+BTN_LEFT-2 +# select-row=BTN_LEFT-3 + +[main] +include=/usr/share/foot/themes/rose-pine diff --git a/.config/fuzzel/fuzzel.ini b/.config/fuzzel/fuzzel.ini new file mode 100644 index 0000000..2a09e1f --- /dev/null +++ b/.config/fuzzel/fuzzel.ini @@ -0,0 +1,27 @@ +[main] +anchor = top +font = MonacoNerdFontMono:size=13 +;dpi-aware = no +terminal = foot +y-margin = 16 +width = 60 +inner-pad = 16 +horizontal-pad = 32 +vertical-pad = 24 +line-height = 32 +lines = 10 +icon-theme = Papirus + +[border] +width = 1 +radius = 24 + +[colors] +background = 191724f3 +text = e0def4ff +border = 403d52ff +selection = 21202eff +selection-text = e0def4ff +selection-match = ebbcbaff +prompt = 908caaff +input = 9ccfd8ff diff --git a/.config/gtklock/config.ini b/.config/gtklock/config.ini new file mode 100644 index 0000000..17ed824 --- /dev/null +++ b/.config/gtklock/config.ini @@ -0,0 +1,5 @@ +[main] +style=/home/agxcoy/.config/gtklock/style.css +time-format=%H:%M:%S +date-format=%Y-%m-%d, %A +modules=/usr/lib/gtklock/userinfo-module.so diff --git a/.config/gtklock/style.css b/.config/gtklock/style.css new file mode 100644 index 0000000..ce5b080 --- /dev/null +++ b/.config/gtklock/style.css @@ -0,0 +1,15 @@ +*{ + transition: 1000ms ease ; +} +window { + background-image: url("/home/agxcoy/.local/share/.wallpaper_blur"); + background-size: cover; + background-repeat: no-repeat; + background-position: center; + background-color: rgba(0,0,0,0.3); + font-family: 'Monaco Nerd Font Mono'; + text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7) +} +#input-field { + background-color: rgba(3, 3, 3, 0.15) +} diff --git a/.config/mako/config b/.config/mako/config new file mode 100644 index 0000000..dd4301a --- /dev/null +++ b/.config/mako/config @@ -0,0 +1,28 @@ +sort=-time +layer=overlay +background-color=#1e1e2e +width=360 +height=560 +border-size=1 +border-color=#45475a +border-radius=12 +icons=1 +max-icon-size=32 +default-timeout=5000 +ignore-timeout=1 +font=MonacoNerdFontMono 11 +padding=8 + +[urgency=low] +border-color=#45475a + +[urgency=normal] +border-color=#45475a + +[urgency=high] +border-color=#f38ba8 +default-timeout=0 + +[category=mpd] +default-timeout=2000 +group-by=category diff --git a/.config/niri/config.kdl b/.config/niri/config.kdl new file mode 100644 index 0000000..e7c64bb --- /dev/null +++ b/.config/niri/config.kdl @@ -0,0 +1,515 @@ +// edited. thx to fizzyizzy05. +input { + keyboard { + xkb { + layout "us" + } + numlock + } + + touchpad { + // off + tap + // dwt + // dwtp + // drag false + // drag-lock + natural-scroll + // accel-speed 0.2 + // accel-profile "flat" + // scroll-method "two-finger" + // disabled-on-external-mouse + click-method "clickfinger" + } + + mouse { + // off + // natural-scroll + accel-speed -0.2 + accel-profile "flat" + // scroll-method "no-scroll" + } + + trackpoint { + // off + // natural-scroll + // accel-speed 0.2 + // accel-profile "flat" + // scroll-method "on-button-down" + // scroll-button 273 + // middle-emulation + } + + warp-mouse-to-focus + + focus-follows-mouse max-scroll-amount="0%" +} + +output "eDP-1" { + scale 1.25 +} + +output "HDMI-A-1" { + mode "1920x1080@180.000" + //position x=1920 y=0 + focus-at-startup +} + +layout { + gaps 6 + + center-focused-column "never" + + preset-column-widths { + proportion 0.33333 + proportion 0.5 + proportion 0.66667 + + // Fixed sets the width in logical pixels exactly. + // fixed 1920 + } + + // preset-window-heights { } + + default-column-width { proportion 0.5; } + // default-column-width {} + + focus-ring { + off + } + + border { + width 1 + active-color "#56949fff" + inactive-color "#403d52ff" + + urgent-color "#eb6f92ff" + + // active-gradient from="#ffbb66" to="#ffc880" angle=45 relative-to="workspace-view" + // inactive-gradient from="#505050" to="#808080" angle=45 relative-to="workspace-view" + } + + shadow { + on + + // draw-behind-window true + + // Softness controls the shadow blur radius. + softness 15 + + // Spread expands the shadow. + spread 2 + + // Offset moves the shadow relative to the window. + offset x=0 y=0 + + // You can also change the shadow color and opacity. + color "#000b" + } + + struts { + //left 0 + //right 6 + //top 3 + //bottom 3 + } + + insert-hint { + // off + color "#31748f4c" + } +} + +spawn-at-startup "waybar" +spawn-at-startup "swww-daemon" +spawn-at-startup "swww-daemon" "--namespace" "blur" +spawn-at-startup "xwayland-satellite" + +environment { + DISPLAY ":0" + //QT_QPA_PLATFORMTHEME "qt6ct" + ELECTRON_OZONE_PLATFORM_HINT "auto" +} + +prefer-no-csd + +screenshot-path "~/.tmp/Screenshots/%Y-%m-%d %H-%M-%S.png" +// screenshot-path null + +animations { + // off + + // Slow down all animations by this factor. Values below 1 speed them up instead. + // slowdown 3.0 + + window-open { + spring damping-ratio=0.80 stiffness=400 epsilon=0.0001 + } + + window-close { + duration-ms 350 + curve "ease-out-expo" + } + + window-resize { + spring damping-ratio=1.0 stiffness=300 epsilon=0.0001 + } + + window-movement { + spring damping-ratio=1.0 stiffness=300 epsilon=0.0001 + } + + overview-open-close { + duration-ms 300 + curve "ease-out-quad" + } + + horizontal-view-movement { + duration-ms 500 + curve "ease-out-expo" + } + + workspace-switch { + duration-ms 500 + curve "ease-out-expo" + } + + screenshot-ui-open { + duration-ms 400 + curve "ease-out-cubic" + } +} + +// from common to specific. +window-rule { + geometry-corner-radius 6 + clip-to-geometry true +} + +window-rule { + match app-id="QQ" + default-column-width { proportion 0.6; } + open-on-output "eDP-1" + block-out-from "screencast" +} + +window-rule { + match title="^(图片查看器|.*记录)$" app-id="QQ" + //match title="图片查看器" app-id="QQ" + //match app-id="^(lxqt-.*|pavu.*|.*portal-lxqt|.*gwenview|mpv)$" + open-floating true +} + +window-rule { + match title=r#"Code - OSS$"# + match title=r#"Visual Studio Code$"# + match app-id=r#"^code"# + open-maximized true +} + +window-rule { + match app-id=r#"firefox$"# title="^Picture-in-Picture$" + open-floating true + default-floating-position x=8 y=8 relative-to="bottom-right" + open-focused false + open-on-output "HDMI-A-1" +} + +window-rule { + match app-id=r#"^org\.keepassxc\.KeePassXC$"# + match app-id=r#"^org\.gnome\.World\.Secrets$"# + + open-floating true +} + +binds { + Mod+F1 { show-hotkey-overlay; } + + // Launch pwvucontrol + //Mod+Ctrl+V hotkey-overlay-title="Open pwvucontrol" { spawn "flatpak" "run" "com.saivert.pwvucontrol"; } + + Mod+Return hotkey-overlay-title="Terminal (foot)" { spawn "foot"; } + Mod+F9 hotkey-overlay-title="Browser (firefox)" { spawn "firefox"; } + Mod+F11 hotkey-overlay-title="Explorer (yazi)" { spawn "foot" "yazi"; } + //Shift+Mod+Return hotkey-overlay-title="Steam" { spawn "steam"; } + + // TODO: fuzzel organize my projects + Mod+Space hotkey-overlay-title="Open Projects ... (VSCode)" { spawn "fuzzel"; } + // TODO: implement wmenu-run + //Mod+Alt+R hotkey-overlay-title="Run a command" { spawn "rofi" "-show" "run"; } + // TODO: try gtklock + //Super+Escape hotkey-overlay-title="Lock the Screen: swaylock" { spawn "swaylock"; } + + XF86AudioRaiseVolume hotkey-overlay-title=null allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.01+"; } + XF86AudioLowerVolume hotkey-overlay-title=null allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.01-"; } + XF86AudioMute hotkey-overlay-title=null allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"; } + XF86AudioMicMute hotkey-overlay-title=null allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"; } + + // TODO: ---------------- + //Mod+Shift+M allow-when-locked=true { spawn "swayosd-client" "--input-volume" "mute-toggle"; } + + XF86AudioPlay allow-when-locked=true { spawn "playerctl" "play-pause"; } + XF86AudioPause allow-when-locked=true { spawn "playerctl" "play-pause"; } + XF86AudioNext allow-when-locked=true { spawn "playerctl" "next"; } + XF86AudioPrev allow-when-locked=true { spawn "playerctl" "previous"; } + XF86AudioStop allow-when-locked=true { spawn "playerctl" "stop"; } + + XF86MonBrightnessUp allow-when-locked=true { spawn "swayosd-client" "--brightness" "+5"; } + XF86MonBrightnessDown allow-when-locked=true { spawn "swayosd-client" "--brightness" "-5"; } + + Alt+Tab repeat=false { toggle-overview; } + Alt+F4 { close-window; } + + // TODO: merge yukitoha's + Mod+Left { focus-column-left; } + Mod+Down { focus-window-down; } + Mod+Up { focus-window-up; } + Mod+Right { focus-column-right; } + Mod+H { focus-column-left; } + Mod+J { focus-window-down; } + Mod+K { focus-window-up; } + Mod+L { focus-column-right; } + + Mod+Shift+Left { move-column-left; } + Mod+Shift+Down { move-window-down; } + Mod+Shift+Up { move-window-up; } + Mod+Shift+Right { move-column-right; } + Mod+Shift+H { move-column-left; } + Mod+Shift+J { move-window-down; } + Mod+Shift+K { move-window-up; } + Mod+Shift+L { move-column-right; } + + // Alternative commands that move across workspaces when reaching + // the first or last window in a column. + // Mod+J { focus-window-or-workspace-down; } + // Mod+K { focus-window-or-workspace-up; } + // Mod+Ctrl+J { move-window-down-or-to-workspace-down; } + // Mod+Ctrl+K { move-window-up-or-to-workspace-up; } + + Mod+Home { focus-column-first; } + Mod+End { focus-column-last; } + Mod+Ctrl+Home { move-column-to-first; } + Mod+Ctrl+End { move-column-to-last; } + + Mod+Ctrl+Left { focus-monitor-left; } + Mod+Ctrl+Down { focus-monitor-down; } + Mod+Ctrl+Up { focus-monitor-up; } + Mod+Ctrl+Right { focus-monitor-right; } + Mod+Ctrl+H { focus-monitor-left; } + Mod+Ctrl+J { focus-monitor-down; } + Mod+Ctrl+K { focus-monitor-up; } + Mod+Ctrl+L { focus-monitor-right; } + + Mod+Shift+Ctrl+Left { move-column-to-monitor-left; } + Mod+Shift+Ctrl+Down { move-column-to-monitor-down; } + Mod+Shift+Ctrl+Up { move-column-to-monitor-up; } + Mod+Shift+Ctrl+Right { move-column-to-monitor-right; } + Mod+Shift+Ctrl+H { move-column-to-monitor-left; } + Mod+Shift+Ctrl+J { move-column-to-monitor-down; } + Mod+Shift+Ctrl+K { move-column-to-monitor-up; } + Mod+Shift+Ctrl+L { move-column-to-monitor-right; } + + // Alternatively, there are commands to move just a single window: + // Mod+Shift+Ctrl+Left { move-window-to-monitor-left; } + // ... + + Mod+Page_Down { focus-workspace-down; } + Mod+Page_Up { focus-workspace-up; } + Mod+U { focus-workspace-down; } + Mod+I { focus-workspace-up; } + Mod+Shift+Page_Down { move-column-to-workspace-down; } + Mod+Shift+Page_Up { move-column-to-workspace-up; } + Mod+Shift+U { move-column-to-workspace-down; } + Mod+Shift+I { move-column-to-workspace-up; } + + // Alternatively, there are commands to move just a single window: + // Mod+Ctrl+Page_Down { move-window-to-workspace-down; } + // ... + + Mod+Shift+Alt+Page_Down hotkey-overlay-title="Move the current workspace down" { move-workspace-down; } + Mod+Shift+Alt+Page_Up hotkey-overlay-title="Move the current workspace up" { move-workspace-up; } + Mod+Shift+Alt+U hotkey-overlay-title="Move the current workspace down" { move-workspace-down; } + Mod+Shift+Alt+I hotkey-overlay-title="Move the current workspace up" { move-workspace-up; } + + // You can bind mouse wheel scroll ticks using the following syntax. + // These binds will change direction based on the natural-scroll setting. + // + // To avoid scrolling through workspaces really fast, you can use + // the cooldown-ms property. The bind will be rate-limited to this value. + // You can set a cooldown on any bind, but it's most useful for the wheel. + // Mod+WheelScrollDown cooldown-ms=150 { focus-workspace-down; } + // Mod+WheelScrollUp cooldown-ms=150 { focus-workspace-up; } + // Mod+Ctrl+WheelScrollDown cooldown-ms=150 { move-column-to-workspace-down; } + // Mod+Ctrl+WheelScrollUp cooldown-ms=150 { move-column-to-workspace-up; } + + // Mod+WheelScrollRight { focus-column-right; } + // Mod+WheelScrollLeft { focus-column-left; } + // Mod+Ctrl+WheelScrollRight { move-column-right; } + // Mod+Ctrl+WheelScrollLeft { move-column-left; } + // Usually scrolling up and down with Shift in applications results in + // horizontal scrolling; these binds replicate that. + // Mod+Shift+WheelScrollDown { focus-column-right; } + // Mod+Shift+WheelScrollUp { focus-column-left; } + // Mod+Ctrl+Shift+WheelScrollDown { move-column-right; } + // Mod+Ctrl+Shift+WheelScrollUp { move-column-left; } + + // Scroll between the workspace with Super+Scroll + Mod+WheelScrollDown cooldown-ms=75 { focus-column-right; } + Mod+WheelScrollUp cooldown-ms=75 { focus-column-left; } + + // Use the mouse buttons to switch between workspaces + Mod+MouseBack cooldown-ms=150 { focus-workspace-down; } + Mod+MouseForward cooldown-ms=150 { focus-workspace-up; } + + // Use the mouse buttons to move windows between workspaces + Mod+Shift+MouseBack cooldown-ms=150 { move-column-to-workspace-down; } + Mod+Shift+MouseForward cooldown-ms=150 { move-column-to-workspace-up; } + + // Use the mouse buttons to switch between monitors + Mod+Ctrl+MouseBack cooldown-ms=150 { focus-monitor-left; } + Mod+Ctrl+MouseForward cooldown-ms=150 { focus-monitor-right; } + + // Press mod+middle click to open the overview + Mod+MouseMiddle repeat=false { toggle-overview; } + + // Similarly, you can bind touchpad scroll "ticks". + // Touchpad scrolling is continuous, so for these binds it is split into + // discrete intervals. + // These binds are also affected by touchpad's natural-scroll, so these + // example binds are "inverted", since we have natural-scroll enabled for + // touchpads by default. + // Mod+TouchpadScrollDown { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02+"; } + // Mod+TouchpadScrollUp { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02-"; } + + // You can refer to workspaces by index. However, keep in mind that + // niri is a dynamic workspace system, so these commands are kind of + // "best effort". Trying to refer to a workspace index bigger than + // the current workspace count will instead refer to the bottommost + // (empty) workspace. + // + // For example, with 2 workspaces + 1 empty, indices 3, 4, 5 and so on + // will all refer to the 3rd workspace. + Mod+1 { focus-workspace 1; } + Mod+2 { focus-workspace 2; } + Mod+3 { focus-workspace 3; } + Mod+4 { focus-workspace 4; } + Mod+5 { focus-workspace 5; } + Mod+6 { focus-workspace 6; } + Mod+7 { focus-workspace 7; } + Mod+8 { focus-workspace 8; } + Mod+9 { focus-workspace 9; } + Mod+Ctrl+1 { move-column-to-workspace 1; } + Mod+Ctrl+2 { move-column-to-workspace 2; } + Mod+Ctrl+3 { move-column-to-workspace 3; } + Mod+Ctrl+4 { move-column-to-workspace 4; } + Mod+Ctrl+5 { move-column-to-workspace 5; } + Mod+Ctrl+6 { move-column-to-workspace 6; } + Mod+Ctrl+7 { move-column-to-workspace 7; } + Mod+Ctrl+8 { move-column-to-workspace 8; } + Mod+Ctrl+9 { move-column-to-workspace 9; } + + // Alternatively, there are commands to move just a single window: + // Mod+Ctrl+1 { move-window-to-workspace 1; } + + // Switches focus between the current and the previous workspace. + // Mod+Tab { focus-workspace-previous; } + + // The following binds move the focused window in and out of a column. + // If the window is alone, they will consume it into the nearby column to the side. + // If the window is already in a column, they will expel it out. + Mod+BracketLeft { consume-or-expel-window-left; } + Mod+BracketRight { consume-or-expel-window-right; } + + // Consume one window from the right to the bottom of the focused column. + Mod+Comma { consume-window-into-column; } + // Expel the bottom window from the focused column to the right. + Mod+Period { expel-window-from-column; } + + Mod+R { switch-preset-column-width; } + Mod+Shift+R { switch-preset-window-height; } + Mod+Ctrl+R { reset-window-height; } + Mod+F { maximize-column; } + Mod+Shift+F { fullscreen-window; } + + // Expand the focused column to space not taken up by other fully visible columns. + // Makes the column "fill the rest of the space". + Mod+Ctrl+F { expand-column-to-available-width; } + + Mod+C { center-column; } + + // Center all fully visible columns on screen. + Mod+Ctrl+C { center-visible-columns; } + + // Finer width adjustments. + // This command can also: + // * set width in pixels: "1000" + // * adjust width in pixels: "-5" or "+5" + // * set width as a percentage of screen width: "25%" + // * adjust width as a percentage of screen width: "-10%" or "+10%" + // Pixel sizes use logical, or scaled, pixels. I.e. on an output with scale 2.0, + // set-column-width "100" will make the column occupy 200 physical screen pixels. + Mod+Minus { set-column-width "-10%"; } + Mod+Equal { set-column-width "+10%"; } + + // Finer height adjustments when in column with other windows. + Mod+Shift+Minus { set-window-height "-10%"; } + Mod+Shift+Equal { set-window-height "+10%"; } + + // Move the focused window between the floating and the tiling layout. + Mod+V { toggle-window-floating; } + Mod+Shift+V { switch-focus-between-floating-and-tiling; } + + // Toggle tabbed column display mode. + // Windows in this column will appear as vertical tabs, + // rather than stacked on top of each other. + Mod+W { toggle-column-tabbed-display; } + + // Actions to switch layouts. + // Note: if you uncomment these, make sure you do NOT have + // a matching layout switch hotkey configured in xkb options above. + // Having both at once on the same hotkey will break the switching, + // since it will switch twice upon pressing the hotkey (once by xkb, once by niri). + // Mod+Space { switch-layout "next"; } + // Mod+Shift+Space { switch-layout "prev"; } + + // Take a screenshot + Print { screenshot; } + Ctrl+Print { screenshot-screen; } + Alt+Print { screenshot-window; } + + // Applications such as remote-desktop clients and software KVM switches may + // request that niri stops processing the keyboard shortcuts defined here + // so they may, for example, forward the key presses as-is to a remote machine. + // It's a good idea to bind an escape hatch to toggle the inhibitor, + // so a buggy application can't hold your session hostage. + // + // The allow-inhibiting=false property can be applied to other binds as well, + // which ensures niri always processes them, even when an inhibitor is active. + Mod+Escape allow-inhibiting=false { toggle-keyboard-shortcuts-inhibit; } + + // The quit action will show a confirmation dialog to avoid accidental exits. + Mod+Shift+E hotkey-overlay-title="Exit niri" { quit; } + Ctrl+Alt+Delete { quit; } + + // Powers off the monitors. To turn them back on, do any input like + // moving the mouse or pressing any other key. + //Mod+Shift+P { power-off-monitors; } +} + +hotkey-overlay { + skip-at-startup +} + +layer-rule { + match namespace="^swww-daemonblur$" + place-within-backdrop true +} + +overview { + backdrop-color "#26233a" + zoom 0.5 +} + +switch-events { + lid-close { spawn "bash" "-c" "swaylock" "&&" "systemctl" "suspend"; } +} diff --git a/.config/waybar/config.jsonc b/.config/waybar/config.jsonc new file mode 100644 index 0000000..9a5694b --- /dev/null +++ b/.config/waybar/config.jsonc @@ -0,0 +1,92 @@ +{ + "layer": "top", + "modules-left": ["sway/workspaces", "niri/workspaces", "niri/window", "sway/mode"], + "modules-center": ["clock"], + "modules-right": ["gamemode", "tray", "sway/scratchpad", "battery", "cpu", "memory", "pulseaudio"], + "sway/scratchpad": { + "format": "󱂬 {count}" + }, + "pulseaudio": { + "format": " {volume}%", + "on-click": "swayosd-client --output-volume mute-toggle", + "on-click-right": "flatpak run com.saivert.pwvucontrol" + }, + "sway/workspaces": { + "format": "{name}{windows}", + "format-window-separator": "|", + "window-rewrite-default": " {class} ", + "window-format": "{name}", + "window-rewrite": { + "class": " 󰈹 ", + "class": " 󰓇 ", + "class": "  ", + "class": "  ", + "class title": "  ", + "class title": "  ", + "class title": " 󰈔 ", + "class title": " 󰝪 ", + "class title": "  ", + "class": "  ", + "class<.*.bottles>": " 󰡔 ", + "class": " 󱢾 ", + "class": " 󰪚 ", + "class": "  ", + "class": "  ", + "class": "  ", + "class": " 󰋩 ", + "class": " 󰕾 ", + "class": "  ", + "class": "  ", + "class": "  ", + "class": "  ", + "class": "  ", + "class": "  ", + "class": "  ", + "class": "  ", + "class": "  ", + "class": "  ", + "class": "  ", + "class": " 󰕼 " + } + }, + "niri/workspaces": { + "format": "{index}" + }, + "mpris": { + "format": "{status_icon} {artist} - {title}", + "format-stopped": "", + "status-icons": { + "paused": "⏸", + "playing": "󰐊" + }, + "interval": "0.1" + }, + "clock": { + "format": "{:%d %b %H:%M}", + "interval": 1, + "tooltip-format": "{:%A %d %B %Y}" + }, + "tray": { + "spacing": 12 + }, + "gamemode": { + "glyph": "  ", + "format": "{glyph}", + "use-icon": false, + "icon-spacing": 16 + }, + "memory": { + "format": " {percentage}%", + "interval": 1 + }, + "cpu": { + "format": " {usage}%", + "interval": 1 + }, + "battery": { + "format": "{icon} {capacity}%", + "format-charging": "{icon} {capacity}% ", + "format-icons": ["󰁺", "󰁻", "󰁼", "󰁽", "󰁾", "󰁿", "󰂀", "󰂁", "󰂂", "󰁹"], + "interval": 1 + } +} diff --git a/.config/waybar/style.css b/.config/waybar/style.css new file mode 100644 index 0000000..a6f9bdd --- /dev/null +++ b/.config/waybar/style.css @@ -0,0 +1,74 @@ +window#waybar { + background-color: rgba(25, 23, 36, 0.75); + color: #cdd6f4; + transition-property: background-color; + transition-duration: .5s; + border-bottom: 1px solid rgba(144, 140, 170, 0.35); +} + +* { + font-family: "MonaspiceNe Nerd Font"; + font-size: 10pt; +} + +#workspaces button { + padding-top: 4px; + padding-bottom: 4px; + padding-left: 8px; + padding-right: 8px; + background-color: transparent; + border-radius: 100%; + border: 6px #f5c2e7; + font-weight: 800; + color: #a6adc8; +} + +#workspaces button.urgent { + color: #fab387; +} + +#workspaces button:hover { + background: rgba(69, 71, 90, 0.65); + color: #cdd6f4; + border: 12px #f5c2e7; + transition: none; +} + +#workspaces button.focused { + color: #f5c2e7; + border: 12px #f5c2e7; +} + +label.module { + padding: 0 10px 0 10px; +} + +box.module button:hover { + box-shadow: none; + outline: none; + font-style: normal; + text-shadow: none; +} + +#tray { + padding: 0 8 0 8; +} + +menu { + background-color: #181825; + color: #cdd6f4; + border: 1px solid #494d64; + padding: 6px; + border-radius: 12px; +} + +#tray menu menuitem:hover { + background-color: #1e1e2e; + color: #f5c2e7; + border-radius: 5px; +} + +#window { + font-weight: 800; + padding: 0px 8px 0px 8px; +} diff --git a/.config/xdg-desktop-portal/niri-portals.conf b/.config/xdg-desktop-portal/niri-portals.conf new file mode 100644 index 0000000..5f1851f --- /dev/null +++ b/.config/xdg-desktop-portal/niri-portals.conf @@ -0,0 +1,6 @@ +[preferred] +default=gnome;gtk; +org.freedesktop.impl.portal.Access=gtk +org.freedesktop.impl.portal.Notification=gtk +org.freedesktop.impl.portal.Secret=kwallet +org.freedesktop.impl.portal.FileChooser=gtk diff --git a/.config/yazi/yazi.toml b/.config/yazi/yazi.toml new file mode 100644 index 0000000..f140cf5 --- /dev/null +++ b/.config/yazi/yazi.toml @@ -0,0 +1,4 @@ +[mgr] +show_hidden = true +show_symlink = true +mouse_events = ["click"] diff --git a/.zprofile b/.zprofile new file mode 100644 index 0000000..79e97cc --- /dev/null +++ b/.zprofile @@ -0,0 +1,11 @@ +# init at each startup +mkdir -p /tmp/$USER +#ln -sf /tmp/$UID $HOME/.tmp +[[ ! -L $HOME/.tmp ]] && rm -f $HOME/.tmp && ln -s /tmp/$USER $HOME/.tmp + +# avoid dumplicate env appending. +[[ -f /run/user/$UID/.zshlogon ]] && return +touch /run/user/$UID/.zshlogon + +export PATH="$HOME/.local/bin:$PATH" +export EDITOR=nano diff --git a/.zshrc b/.zshrc new file mode 100644 index 0000000..b2d3d3f --- /dev/null +++ b/.zshrc @@ -0,0 +1,143 @@ +# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. +# Initialization code that may require console input (password prompts, [y/n] +# confirmations, etc.) must go above this block; everything else may go below. +if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then + source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" +fi + + +# Start configuration added by Zim install {{{ +# +# User configuration sourced by interactive shells +# + +# ----------------- +# Zsh configuration +# ----------------- + +# +# History +# + +# Remove older command from the history if a duplicate is to be added. +setopt HIST_IGNORE_ALL_DUPS + +# +# Input/output +# + +# Set editor default keymap to emacs (`-e`) or vi (`-v`) +bindkey -e + +# Prompt for spelling correction of commands. +#setopt CORRECT + +# Customize spelling correction prompt. +#SPROMPT='zsh: correct %F{red}%R%f to %F{green}%r%f [nyae]? ' + +# Remove path separator from WORDCHARS. +WORDCHARS=${WORDCHARS//[\/]} + +# ----------------- +# Zim configuration +# ----------------- + +# Use degit instead of git as the default tool to install and update modules. +#zstyle ':zim:zmodule' use 'degit' + +# -------------------- +# Module configuration +# -------------------- + +# +# git +# + +# Set a custom prefix for the generated aliases. The default prefix is 'G'. +#zstyle ':zim:git' aliases-prefix 'g' + +# +# input +# + +# Append `../` to your input for each `.` you type after an initial `..` +#zstyle ':zim:input' double-dot-expand yes + +# +# termtitle +# + +# Set a custom terminal title format using prompt expansion escape sequences. +# See http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html#Simple-Prompt-Escapes +# If none is provided, the default '%n@%m: %~' is used. +#zstyle ':zim:termtitle' format '%1~' + +# +# zsh-autosuggestions +# + +# Disable automatic widget re-binding on each precmd. This can be set when +# zsh-users/zsh-autosuggestions is the last module in your ~/.zimrc. +ZSH_AUTOSUGGEST_MANUAL_REBIND=1 + +# Customize the style that the suggestions are shown with. +# See https://github.com/zsh-users/zsh-autosuggestions/blob/master/README.md#suggestion-highlight-style +#ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=242' + +# +# zsh-syntax-highlighting +# + +# Set what highlighters will be used. +# See https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/docs/highlighters.md +ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets) + +# Customize the main highlighter styles. +# See https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/docs/highlighters/main.md#how-to-tweak-it +#typeset -A ZSH_HIGHLIGHT_STYLES +#ZSH_HIGHLIGHT_STYLES[comment]='fg=242' + +# ------------------ +# Initialize modules +# ------------------ + +ZIM_HOME=${ZDOTDIR:-${HOME}}/.zim +# Download zimfw plugin manager if missing. +if [[ ! -e ${ZIM_HOME}/zimfw.zsh ]]; then + if (( ${+commands[curl]} )); then + curl -fsSL --create-dirs -o ${ZIM_HOME}/zimfw.zsh \ + https://github.com/zimfw/zimfw/releases/latest/download/zimfw.zsh + else + mkdir -p ${ZIM_HOME} && wget -nv -O ${ZIM_HOME}/zimfw.zsh \ + https://github.com/zimfw/zimfw/releases/latest/download/zimfw.zsh + fi +fi +# Install missing modules, and update ${ZIM_HOME}/init.zsh if missing or outdated. +if [[ ! ${ZIM_HOME}/init.zsh -nt ${ZIM_CONFIG_FILE:-${ZDOTDIR:-${HOME}}/.zimrc} ]]; then + source ${ZIM_HOME}/zimfw.zsh init +fi +# Initialize modules. +source ${ZIM_HOME}/init.zsh + +# ------------------------------ +# Post-init module configuration +# ------------------------------ + +# +# zsh-history-substring-search +# + +zmodload -F zsh/terminfo +p:terminfo +# Bind ^[[A/^[[B manually so up/down works both before and after zle-line-init +for key ('^[[A' '^P' ${terminfo[kcuu1]}) bindkey ${key} history-substring-search-up +for key ('^[[B' '^N' ${terminfo[kcud1]}) bindkey ${key} history-substring-search-down +for key ('k') bindkey -M vicmd ${key} history-substring-search-up +for key ('j') bindkey -M vicmd ${key} history-substring-search-down +unset key +# }}} End configuration added by Zim install + +# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. +[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh + +# USER MANUAL CONFIGS +export GPG_TTY=$TTY diff --git a/bin/chbg b/bin/chbg new file mode 100755 index 0000000..99a4d40 --- /dev/null +++ b/bin/chbg @@ -0,0 +1,11 @@ +# to change wallpapers both niri workspace and niri tab view +WP_DIR="$HOME/.local/share" + +echo -n "making blurred version... " +mkdir -p $WP_DIR +cp $1 $WP_DIR/.wallpaper +magick $WP_DIR/.wallpaper -filter Gaussian -blur 0x30 $WP_DIR/.wallpaper_blur +echo "Done." + +swww img $WP_DIR/.wallpaper +swww img $WP_DIR/.wallpaper_blur --namespace blur diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..833b33e --- /dev/null +++ b/readme.md @@ -0,0 +1,39 @@ +# dotfiles (for niri) + +> it's all Yukitoha's fault! (x) + +by the time I make this repo, I even haven't configure fcitx5. +so English README only. + +> [!note] +> You may wanna try `stow`, which is not considered by me. +> in my case, just symlink them one by one, or at least, shell script. +> of course pull requests to directory structure are welcomed. + +## special thanks +- Vescrity (Yukitoha) +- fizzyizzy05 (Isabelle Jackson, xyn) + +## basic +- `niri`, and its optional deps (`yay -Si`). +- `swww` from fizzy dotfiles +- ZshIM from miku installation guide, basically to refer `powerlevel10k` zmodule. + - no `oh-my-zsh`. + - no other plugins from pacman, like `zsh-syntax-highlighting`. they are included in zim by default. + +## my later replacements +``` +alacritty -> foot +nautilus (gnome files) -> yazi (console) +swaylock -> gtklock +gnome-keyring -> kwallet (kd6) +... +``` + +## resources references +[Monaco Nerd Font Mono (MelodyEcho ver.)](https://glowmem.com/upload/articles/archlinux-note/Monaco_Nerd_Font_Mono-Regular.ttf) + +or just `ttf-monaco-nerd-font` from AUR, which may not suitable for VSCode though. + +> [!note] +> no wallpaper given. just run `.local/bin/chbg` to manually generate.