diff --git a/.dotter/artix-laptop.toml b/.dotter/artix-laptop.toml index 94aaf974..55ba8728 100644 --- a/.dotter/artix-laptop.toml +++ b/.dotter/artix-laptop.toml @@ -2,6 +2,7 @@ packages = [ "wayland" ] [variables] dpi = "96" -font_size = "16" -terminal = "ghostty" +# font_size = "16" +font_size = "12" +terminal = "alacritty" browser = "floorp" diff --git a/.dotter/artix-machine.toml b/.dotter/artix-machine.toml index d4fbc3e3..d53ae2be 100644 --- a/.dotter/artix-machine.toml +++ b/.dotter/artix-machine.toml @@ -3,5 +3,5 @@ packages = [ "x11" ] [variables] dpi = "96" font_size = "10" -terminal = "ghostty" +terminal = "alacritty" browser = "floorp" diff --git a/.dotter/global.toml b/.dotter/global.toml index 49880136..a1a5b624 100644 --- a/.dotter/global.toml +++ b/.dotter/global.toml @@ -32,7 +32,7 @@ depends = [ "base", "awesome_laptop", "picom", "dunst", "rofi" ] "config/x11/xresources" = {target = "~/.config/x11/xresources", type = "template"} [wayland] -depends = [ "base", "hyprland", "dunst", "rofi" ] +depends = [ "base", "hyprland", "dunst", "rofi", "niri", "fuzzel" ] [wayland.files] "config/zsh/.zprofile-wayland" = "~/.config/zsh/.zprofile" @@ -45,7 +45,7 @@ depends = [ "base", "hyprland", "dunst", "rofi" ] depends = [ "shell" ] [zsh.files] -"config/shell/env" = "~/.zshenv" +"config/shell/env" = {target = "~/.zshenv", type = "template"} "config/zsh/" = "~/.config/zsh/" [fish] @@ -64,6 +64,9 @@ depends = [ "shell" ] "config/rofi/" = "~/.config/rofi/" "config/rofi/config.rasi" = {target = "~/.config/rofi/config.rasi", type = "template"} +[fuzzel.files] +"config/fuzzel/" = "~/.config/fuzzel/" + [misc] depends = [ "torrent", "zathura", "email" ] @@ -104,6 +107,12 @@ depends = [ "torrent", "zathura", "email" ] [dunst.files] "config/dunst/" = "~/.config/dunst/" +[niri] +depends = [ "misc", "local", "eww", "lock" ] + +[niri.files] +"config/niri/" = "~/.config/niri/" + [hyprland] depends = [ "misc", "local", "eww", "lock" ] diff --git a/config/eww.bak/eww.scss b/config/eww.bak/eww.scss deleted file mode 100644 index eea4cef3..00000000 --- a/config/eww.bak/eww.scss +++ /dev/null @@ -1,129 +0,0 @@ -$base: #191724; -$surface: #1f1d2e; -$overlay: #26233a; -$muted: #6e6a86; -$subtle: #908caa; -$text: #e0def4; -$love: #eb6f92; -$gold: #f6c177; -$rose: #ebbcba; -$pine: #31748f; -$foam: #9ccfd8; -$iris: #c4a7e7; -$highlight_low: #21202e; -$highlight_med: #403d52; -$highlight_high: #524f67; -$bg: rgba(25, 23, 37, 0.7); - -* { - all: unset; //Unsets everything so you can style everything from scratch - font-family: "JetBrainsMono NF"; -} - -//Global Styles -.bar, -.bar-1 { - background-color: $bg; - color: $text; - font-weight: bold; -} - -// Styles on classes (see eww.yuck for more information) - -.sidestuff slider { - all: unset; -} - -.metric scale trough highlight { - all: unset; - background-color: $love; - border-radius: 10px; -} - -.metric scale trough { - all: unset; - background-color: $highlight_med; - border-radius: 50px; - min-height: 3px; - min-width: 50px; - margin-left: 1px; - margin-right: 2px; -} - -.metric scale trough highlight { - all: unset; - // background-color: $subtle; - background-color: $foam; - color: $base; - border-radius: 10px; -} - -.metric scale trough { - all: unset; - background-color: $highlight_med; - border-radius: 50px; - min-height: 3px; - min-width: 50px; - margin-left: 1px; - margin-right: 2px; -} - -.label-ram { - font-size: large; -} - -.music { - &.playing { - color: $pine; - } - - &.paused { - color: $muted; - } -} - -.workspaces { - .current { - color: $pine; - } -} - -.icon-module { - & > &__icon { - margin-right: 5px; - } -} - -.cpu { - &.warning { - color: $gold; - } - - &.danger { - color: $love; - } -} - -.battery { - &.warning { - color: $gold; - } - - &.critical { - color: $love; - } - - &.Charging { - color: $pine; - } -} - -.network { - &.disconnected { - color: $love; - } -} - -.workspaces button:hover { - background: $highlight_med; -} diff --git a/config/eww.bak/eww.yuck b/config/eww.bak/eww.yuck deleted file mode 100644 index 8debe384..00000000 --- a/config/eww.bak/eww.yuck +++ /dev/null @@ -1,244 +0,0 @@ -;; Variables -(defpoll clock_time :interval "5m" "date +\%I") -(defpoll clock_minute :interval "5s" "date +\%M") -(defpoll clock_date :interval "10h" "date '+%d/%m'") -(defpoll volume_percent :interval "3s" "amixer -D pulse sget Master | grep 'Left:' | awk -F'[][]' '{ print $2 }' | tr -d '%'") -(defpoll mic_percent :interval "3s" "amixer -D pulse sget Capture | grep 'Left:' | awk -F'[][]' '{ print $2 }' | tr -d '%'") -(defpoll brightness_percent :interval "5s" "brightnessctl -m | awk -F, '{print substr($4, 0, length($4)-1)}' | tr -d '%'") -;; (defpoll battery :interval "15s" "./scripts/battery --bat") -;; (defpoll battery_status :interval "1m" "./scripts/battery --bat-st") -;; (defpoll memory :interval "15s" "scripts/memory") -;; (defpoll memory_used_mb :interval "2m" "scripts/mem-ad used") -;; (defpoll memory_total_mb :interval "2m" "scripts/mem-ad total") -;; (defpoll memory_free_mb :interval "2m" "scripts/mem-ad free") -(defvar vol_reveal false) -(defvar br_reveal false) -(defvar music_reveal false) -(defvar wifi_rev false) -(defvar time_rev false) -(deflisten workspace "scripts/workspace") - -(defvar eww "$HOME/.local/bin/eww/eww -c $HOME/.config/eww/bar") - -(defwidget bar [] -(centerbox :orientation "h" - (workspaces) - (window) - (sidestuff))) - -(defwidget sidestuff [] -(box - :class "sidestuff" - :orientation "h" - :space-evenly false - :halign "end" - :spacing 10 - (music) - (metric - :label "" - :value volume - :onchange "pulsemixer --set-volume {}" ) - ;; (metric_extended - ;; :label "" - ;; :value brightness - ;; :onchange "doas brightnessctl set {}" ) - (cpu) - (github) - ;; (network) - (battery) - (bright) - time - date - )) - - -(deflisten workspaces :initial "[]" "bash ~/.config/eww/scripts/get-workspaces") -(deflisten current_workspace :initial "1" "bash ~/.config/eww/scripts/get-active-workspace") - -(defwidget workspaces [] - (eventbox :onscroll "bash ~/.config/eww/scripts/change-active-workspace {} ${current_workspace}" :class "workspaces" - (box :space-evenly true - :halign "start" - :space-evenly true - :spacing 5 - (label :text "${workspaces}${current_workspace}" :visible false) - (for workspace in workspaces - (eventbox :onclick "hyprctl dispatch workspace ${workspace.id}" - (box :class "workspace-entry ${workspace.windows > 0 ? "occupied" : "empty"}" - (label :text "${workspace.id}" :class "workspace-entry ${workspace.id == current_workspace ? "current" : ""}" ) - ) - ) - ) - ) - ) - ) - - -(deflisten window :initial "..." "bash ~/.config/eww/scripts/get-window-title") -(defwidget window [] -(box :class "window" - (label :text "${window}"))) - -(defwidget music [] -(box :class "music ${music_status == "Playing" ? "playing" : "paused"}" - :orientation "h" - :space-evenly false - :halign "center" - (button :onclick "sp play" {music != "" ? "${music}" : ""}))) - -(defwidget icon-module [icon ?class ?visible] -(box :class "${class} icon-module" - :orientation "h" - :halign "end" - :space-evenly false - :visible {visible ?: true} ; because the argument is optional - (label :class "icon-module__icon" :text "${icon}") - (children))) - -(defwidget metric [label value onchange] -(box :orientation "h" - :class "metric" - :space-evenly false - (box :class "label" label) - (scale :min 0 - :max 101 - :active {onchange != ""} - :value value - :onchange onchange))) - -(defpoll music - :interval "1s" - "scripts/get-music") - -(defpoll music_status - :interval "1s" - "sp status") - -(defpoll volume - :interval "1s" - "scripts/getvol") - -(defwidget metric_extended [label value onchange] -(box - :orientation "h" - :class "metric" - :space-evenly false - (box - :class "label" label) - (scale - :min 0 - :max 256 - :active {onchange != ""} - :value value - :onchang - :onchange onchange))) - -(defpoll brightness - :interval "1s" - :class "brightness" - "brightnessctl get") - -;; "format-icons": ["", "", "", "", "", "", "", "", ""], - -(defwidget battery [] -(icon-module - :icon "${EWW_BATTERY.BAT0.status == "Charging" ? "" : - EWW_BATTERY.BAT0.capacity > 90 ? "" : - EWW_BATTERY.BAT0.capacity > 70 ? "" : - EWW_BATTERY.BAT0.capacity > 40 ? "" : - EWW_BATTERY.BAT0.capacity > 20 ? "" : - ""}" - :class "battery ${EWW_BATTERY.BAT0.capacity > 30 ? "good" : EWW_BATTERY.BAT0.capacity > 10 ? "warning" : "critical"} ${EWW_BATTERY.BAT0.status}" - (label - :text "${EWW_BATTERY.BAT0.capacity}%"))) - - -(defpoll time :interval "1s" - "date '+%H:%M:%S'") - -(defpoll date :interval "10s" - "date '+%d.%m.%Y'") - - -(defpoll github_poll - :initial "" - :interval "1m" "sh ~/.config/eww/scripts/github") -(defwidget github [] -(button - :onclick "xdg-open https://github.com/notifications" - (box - (icon-module - :class "github" - :icon "" - :visible {github_poll != ""}) - github_poll))) - - -(defwidget cpu [] -(icon-module - :icon "" - :class "cpu ${EWW_CPU.avg > 90 ? "danger" : EWW_CPU.avg > 60 ? "warning" : ""}" - (label - :text "${round(EWW_CPU.avg, 0)}%"))) - -;; (defpoll net_poll -;; :initial "..." -;; :interval "10s" "sh ~/.config/eww/scripts/get-network") -(defwidget network [] -(icon-module - :icon "" - :class "network ${EWW_NET.wlan0.NET_DOWN == 0 && EWW_NET.wlan0.NET_UP == 0 ? "disconnected" : ""}" - (label - :text "${EWW_NET.wlan0.NET_DOWN == 0 && EWW_NET.wlan0.NET_UP == 0 ? "Disconnected ⚠" : ""}"))) - - ;; "network": { - ;; "format-wifi": "{essid} ({signalStrength}%) ", - ;; "format-ethernet": "{ipaddr}/{cidr} ", - ;; "tooltip-format": "{ifname} via {gwaddr} ", - ;; "format-linked": "{ifname} (No IP) ", - ;; "format-disconnected": "", - ;; "format-alt": "{ifname}: {ipaddr}/{cidr}" - ;; }, - - -(defwindow bar - :monitor 0 - :exclusive true - :geometry (geometry - :x "0%" - :y "0%" - :width "100%" - :height "10px" - :anchor "top center") - :reserve (struts :side "top" :distance "4%") -(bar)) - - -(defwindow bar-1 - :monitor 1 - :exclusive true - :geometry (geometry - :x "0%" - :y "0%" - :width "100%" - :height "10px" - :anchor "top center") - :reserve (struts :side "top" :distance "4%") - (bar)) - -(defwidget bright [] - (eventbox :onhover "eww update br_reveal=true" :onhoverlost "eww update br_reveal=false" - (box :class "module-2" :space-evenly "false" :orientation "h" :spacing "3" - (label - :text "${brightness_percent < 30 ? "☼": "☀"}" - :class "bright_icon" :tooltip "brightness") - (revealer :transition "slideleft" - :reveal br_reveal - :duration "350ms" - (scale :class "brightbar" - :value brightness_percent - :orientation "h" - :tooltip "${brightness_percent}%" - :max 100 - :min 0 - :onchange "brightnessctl set {}%" ))))) diff --git a/config/eww/eww.scss b/config/eww/eww.scss index deecec4d..b4662f15 100644 --- a/config/eww/eww.scss +++ b/config/eww/eww.scss @@ -18,7 +18,7 @@ $bg: rgba(25, 23, 37, 0.7); * { all: unset; font-family: "JetBrainsMono Nerd Font"; - font-size: 20; + font-size: 14; } /** General **/ diff --git a/config/fuzzel/fuzzel.ini b/config/fuzzel/fuzzel.ini new file mode 100644 index 00000000..4b0546a9 --- /dev/null +++ b/config/fuzzel/fuzzel.ini @@ -0,0 +1,30 @@ +dpi-aware=no +icon-theme=Papirus-Dark +width=24 +font=JetBrainsMono NF:size=12 +line-height=24 +fields=name,generic,comment,categories,filename,keywords +prompt="❯ " +show-actions=yes +exit-on-keyboard-focus-loss=no +match-counter=true +hide-before-typing=true + +[colors] +background=191724e6 +text=908caaff +prompt=908caaff +placeholder=6e6a86ff +input=c4a7e7ff +match=ebbcbaff +selection=403d52ff +selection-text=e0def4ff +selection-match=eb6f92ff +counter=908caaff +border=ebbcbaff + +[border] +radius=20 + +[dmenu] +exit-immediately-if-empty=yes diff --git a/config/hypr/application-style.conf b/config/hypr/application-style.conf new file mode 100644 index 00000000..e69de29b diff --git a/config/hypr/hyprland.conf b/config/hypr/hyprland.conf index 30589e44..f530727e 100644 --- a/config/hypr/hyprland.conf +++ b/config/hypr/hyprland.conf @@ -32,7 +32,8 @@ monitor=eDP-1,prefered,0x0,1 $terminal = {{terminal}} $fileManager = $terminal -e yazi # $menu = wofi --show drun -ib -$menu = rofi -show combi -show-icons +# $menu = rofi -show combi -show-icons +$menu = fuzzel $browser = {{browser}} ################# @@ -44,10 +45,11 @@ $browser = {{browser}} exec-once=pipewire & pipewire-pulse & wireplumber & eww daemon & eww open bar exec-once=dbus-update-activation-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP DISPLAY XAUTHORITY -exec-once=nextcloud & /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 & xrdb "$XDG_CONFIG_HOME/x11/xresources" & transmission-daemon & dunst & hyprpaper +exec-once=nextcloud & /usr/lib/hyprpolkitagent & xrdb "$XDG_CONFIG_HOME/x11/xresources" & transmission-daemon & dunst & hyprpaper exec-once=[workspace 1 silent] $browser exec-once=[workspace 8 silent] kotatogram-desktop & flatpak run dev.vencord.Vesktop # exec-once=[workspace 9 silent] spotify-launcher +exec-once = hyprpm reload -n # Source a file (multi-file configs) source=~/.config/hypr/rose-pine.conf @@ -89,7 +91,7 @@ general { # Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on allow_tearing = false - layout = dwindle + layout = dwindle # dwindle,master,scrolling } # https://wiki.hyprland.org/Configuring/Variables/#decoration @@ -218,6 +220,29 @@ cursor { hide_on_key_press = true } +plugin { + hyprscrolling { + fullscreen_on_one_column=true + } + hyprexpo { + columns = 3 + gap_size = 4 + bg_col = rgb(191724) + workspace_method = center current # [center/first] [workspace] e.g. first 1 or center m+1 + + enable_gesture = true # laptop touchpad + gesture_fingers = 4 # 3 or 4 + gesture_distance = 300 # how far is the "max" + gesture_positive = false # positive = swipe down. Negative = swipe up. + } + split-monitor-workspaces { + count = 10 + keep_focused = 1 + enable_notifications = 0 + enable_persistent_workspaces = 1 + } +} + ################### ### KEYBINDINGS ### ################### @@ -261,49 +286,51 @@ bind = $mainMod SHIFT, L, movewindow, r bind = $mainMod SHIFT, H, movewindow, l # Switch workspaces with mainMod + [0-9] -bind = $mainMod, 1, workspace, 1 -bind = $mainMod, 2, workspace, 2 -bind = $mainMod, 3, workspace, 3 -bind = $mainMod, 4, workspace, 4 -bind = $mainMod, 5, workspace, 5 -bind = $mainMod, 6, workspace, 6 -bind = $mainMod, 7, workspace, 7 -bind = $mainMod, 8, workspace, 8 -bind = $mainMod, 9, workspace, 9 -bind = $mainMod, 0, workspace, 10 -# bind = $mainMod, 1, split-workspace, 1 -# bind = $mainMod, 2, split-workspace, 2 -# bind = $mainMod, 3, split-workspace, 3 -# bind = $mainMod, 4, split-workspace, 4 -# bind = $mainMod, 5, split-workspace, 5 -# bind = $mainMod, 6, split-workspace, 6 -# bind = $mainMod, 7, split-workspace, 7 -# bind = $mainMod, 8, split-workspace, 8 -# bind = $mainMod, 9, split-workspace, 9 -# bind = $mainMod, 0, split-workspace, 10 +# bind = $mainMod, 1, workspace, 1 +# bind = $mainMod, 2, workspace, 2 +# bind = $mainMod, 3, workspace, 3 +# bind = $mainMod, 4, workspace, 4 +# bind = $mainMod, 5, workspace, 5 +# bind = $mainMod, 6, workspace, 6 +# bind = $mainMod, 7, workspace, 7 +# bind = $mainMod, 8, workspace, 8 +# bind = $mainMod, 9, workspace, 9 +# bind = $mainMod, 0, workspace, 10 +bind = $mainMod, 1, split-workspace, 1 +bind = $mainMod, 2, split-workspace, 2 +bind = $mainMod, 3, split-workspace, 3 +bind = $mainMod, 4, split-workspace, 4 +bind = $mainMod, 5, split-workspace, 5 +bind = $mainMod, 6, split-workspace, 6 +bind = $mainMod, 7, split-workspace, 7 +bind = $mainMod, 8, split-workspace, 8 +bind = $mainMod, 9, split-workspace, 9 +bind = $mainMod, 0, split-workspace, 10 # Move active window to a workspace with mainMod + SHIFT + [0-9] -bind = $mainMod SHIFT, 1, movetoworkspace, 1 -bind = $mainMod SHIFT, 2, movetoworkspace, 2 -bind = $mainMod SHIFT, 3, movetoworkspace, 3 -bind = $mainMod SHIFT, 4, movetoworkspace, 4 -bind = $mainMod SHIFT, 5, movetoworkspace, 5 -bind = $mainMod SHIFT, 6, movetoworkspace, 6 -bind = $mainMod SHIFT, 7, movetoworkspace, 7 -bind = $mainMod SHIFT, 8, movetoworkspace, 8 -bind = $mainMod SHIFT, 9, movetoworkspace, 9 -bind = $mainMod SHIFT, 0, movetoworkspace, 10 -# bind = $mainMod SHIFT, 1, split-movetoworkspace, 1 -# bind = $mainMod SHIFT, 2, split-movetoworkspace, 2 -# bind = $mainMod SHIFT, 3, split-movetoworkspace, 3 -# bind = $mainMod SHIFT, 4, split-movetoworkspace, 4 -# bind = $mainMod SHIFT, 5, split-movetoworkspace, 5 -# bind = $mainMod SHIFT, 6, split-movetoworkspace, 6 -# bind = $mainMod SHIFT, 7, split-movetoworkspace, 7 -# bind = $mainMod SHIFT, 8, split-movetoworkspace, 8 -# bind = $mainMod SHIFT, 9, split-movetoworkspace, 9 -# bind = $mainMod SHIFT, 0, split-movetoworkspace, 10 +# bind = $mainMod SHIFT, 1, movetoworkspace, 1 +# bind = $mainMod SHIFT, 2, movetoworkspace, 2 +# bind = $mainMod SHIFT, 3, movetoworkspace, 3 +# bind = $mainMod SHIFT, 4, movetoworkspace, 4 +# bind = $mainMod SHIFT, 5, movetoworkspace, 5 +# bind = $mainMod SHIFT, 6, movetoworkspace, 6 +# bind = $mainMod SHIFT, 7, movetoworkspace, 7 +# bind = $mainMod SHIFT, 8, movetoworkspace, 8 +# bind = $mainMod SHIFT, 9, movetoworkspace, 9 +# bind = $mainMod SHIFT, 0, movetoworkspace, 10 +bind = $mainMod SHIFT, 1, split-movetoworkspace, 1 +bind = $mainMod SHIFT, 2, split-movetoworkspace, 2 +bind = $mainMod SHIFT, 3, split-movetoworkspace, 3 +bind = $mainMod SHIFT, 4, split-movetoworkspace, 4 +bind = $mainMod SHIFT, 5, split-movetoworkspace, 5 +bind = $mainMod SHIFT, 6, split-movetoworkspace, 6 +bind = $mainMod SHIFT, 7, split-movetoworkspace, 7 +bind = $mainMod SHIFT, 8, split-movetoworkspace, 8 +bind = $mainMod SHIFT, 9, split-movetoworkspace, 9 +bind = $mainMod SHIFT, 0, split-movetoworkspace, 10 + +bind = $mainMod, O, split-changemonitor, next # Example special workspace (scratchpad) # bind = $mainMod, S, togglespecialworkspace, magic # bind = $mainMod SHIFT, S, movetoworkspace, special:magic @@ -322,14 +349,15 @@ bind = $mainMod SHIFT, K, movewindow, u bind = $mainMod SHIFT, L, movewindow, r bind = $mainMod SHIFT, H, movewindow, l -# # Laptop multimedia keys for volume and LCD brightness -# bindel = ,XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ -bindel = , XF86AudioRaiseVolume, exec, pulsemixer --change-volume +2 # increase volume by 2 -# bindel = ,XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- -bindel = , XF86AudioLowerVolume, exec, pulsemixer --change-volume -2 # decrease volume by 2 -# bindel = ,XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle -bindel = , XF86AudioMute, exec, pulsemixer --toggle-mute # mute volume -# bindel = ,XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle +# Laptop multimedia keys for volume and LCD brightness +bindel = ,XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 2%+ +# bindel = , XF86AudioRaiseVolume, exec, pulsemixer --change-volume +2 # increase volume by 2 +bindel = ,XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 2%- +# bindel = , XF86AudioLowerVolume, exec, pulsemixer --change-volume -2 # decrease volume by 2 +bindel = , XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle +# bindel = , XF86AudioMute, exec, pulsemixer --toggle-mute # mute volume +bindel = , XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle + bindel = ,XF86MonBrightnessUp, exec, doas brightnessctl set +2% # increase brightness by 2% bindel = ,XF86MonBrightnessDown, exec, doas brightnessctl set 2%- # decrease brightness by 2% @@ -352,6 +380,7 @@ bind = , PRINT, exec, hyprshot -m output bind = SHIFT, PRINT, exec, hyprshot -m window bind = $mainMod ALT, P, exec, hyprpicker -a # colorpicker +bind = SUPER, grave, hyprexpo:expo, toggle # can be: toggle, select, off/disable or on/enable ############################## ### WINDOWS AND WORKSPACES ### @@ -411,3 +440,10 @@ windowrulev2 = opacity 0.9, class:kdeconnect windowrulev2 = move 100%-250 100%-250, class:galculator windowrulev2 = size 250 250, class:galculator windowrulev2 = float, class:galculator + +windowrule = opacity 0.0 override, class:^(xwaylandvideobridge)$ +windowrule = noanim, class:^(xwaylandvideobridge)$ +windowrule = noinitialfocus, class:^(xwaylandvideobridge)$ +windowrule = maxsize 1 1, class:^(xwaylandvideobridge)$ +windowrule = noblur, class:^(xwaylandvideobridge)$ +windowrule = nofocus, class:^(xwaylandvideobridge)$ diff --git a/config/niri/config.kdl b/config/niri/config.kdl new file mode 100644 index 00000000..bfa6ebde --- /dev/null +++ b/config/niri/config.kdl @@ -0,0 +1,638 @@ +// This config is in the KDL format: https://kdl.dev +// "/-" comments out the following node. +// Check the wiki for a full description of the configuration: +// https://github.com/YaLTeR/niri/wiki/Configuration:-Introduction + +workspace "browser" +workspace "chat" + +environment { + QT_QPA_PLATFORM "wayland" + XDG_SESSION_TYPE "wayland" + XDG_CURRENT_DESKTOP "niri" + XDG_SESSION_DESKTOP "niri" + WM "niri" + DISPLAY null + ELECTRON_OZONE_PLATFORM_HINT "auto" +} + +// Input device configuration. +// Find the full list of options on the wiki: +// https://github.com/YaLTeR/niri/wiki/Configuration:-Input +input { + keyboard { + xkb { + // You can set rules, model, layout, variant and options. + // For more information, see xkeyboard-config(7). + + // For example: + layout "lv" + // options "grp:win_space_toggle,compose:ralt,ctrl:nocaps" + } + + // Enable numlock on startup, omitting this setting disables it. + repeat-delay 300 + repeat-rate 50 + track-layout "global" + // numlock + } + + // Next sections include libinput settings. + // Omitting settings disables them, or leaves them at their default values. + 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 + } + + 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 + } + + // Uncomment this to make the mouse warp to the center of newly focused windows. + // warp-mouse-to-focus + + // Focus windows and outputs automatically when moving the mouse into them. + // Setting max-scroll-amount="0%" makes it work only on windows already fully on screen. + focus-follows-mouse max-scroll-amount="95%" +} + +cursor { + // xcursor-theme "breeze_cursors" + xcursor-size 24 + + hide-when-typing + hide-after-inactive-ms 1000 +} + +// You can configure outputs by their name, which you can find +// by running `niri msg outputs` while inside a niri instance. +// The built-in laptop monitor is usually called "eDP-1". +// Find more information on the wiki: +// https://github.com/YaLTeR/niri/wiki/Configuration:-Outputs +// Remember to uncomment the node by removing "/-"! +output "eDP-1" { + // Uncomment this line to disable this output. + // off + + // Resolution and, optionally, refresh rate of the output. + // The format is "x" or "x@". + // If the refresh rate is omitted, niri will pick the highest refresh rate + // for the resolution. + // If the mode is omitted altogether or is invalid, niri will pick one automatically. + // Run `niri msg outputs` while inside a niri instance to list all outputs and their modes. + mode "2880x1800@120.000" + + // You can use integer or fractional scale, for example use 1.5 for 150% scale. + scale 1.5 + + // Transform allows to rotate the output counter-clockwise, valid values are: + // normal, 90, 180, 270, flipped, flipped-90, flipped-180 and flipped-270. + transform "normal" + + // Position of the output in the global coordinate space. + // This affects directional monitor actions like "focus-monitor-left", and cursor movement. + // The cursor can only move between directly adjacent outputs. + // Output scale and rotation has to be taken into account for positioning: + // outputs are sized in logical, or scaled, pixels. + // For example, a 3840×2160 output with scale 2.0 will have a logical size of 1920×1080, + // so to put another output directly adjacent to it on the right, set its x to 1920. + // If the position is unset or results in an overlap, the output is instead placed + // automatically. + position x=1280 y=0 + + variable-refresh-rate on-demand=true + focus-at-startup + background-color "#000" + backdrop-color "#000" +} + +// Settings that influence how windows are positioned and sized. +// Find more information on the wiki: +// https://github.com/YaLTeR/niri/wiki/Configuration:-Layout +layout { + // Set gaps around windows in logical pixels. + gaps 4 + + // When to center a column when changing focus, options are: + // - "never", default behavior, focusing an off-screen column will keep at the left + // or right edge of the screen. + // - "always", the focused column will always be centered. + // - "on-overflow", focusing a column will center it if it doesn't fit + // together with the previously focused column. + center-focused-column "never" + + // You can customize the widths that "switch-preset-column-width" (Mod+R) toggles between. + preset-column-widths { + // Proportion sets the width as a fraction of the output width, taking gaps into account. + // For example, you can perfectly fit four windows sized "proportion 0.25" on an output. + // The default preset widths are 1/3, 1/2 and 2/3 of the output. + proportion 0.33333 + proportion 0.5 + proportion 0.66667 + + // Fixed sets the width in logical pixels exactly. + // fixed 1920 + } + + // You can also customize the heights that "switch-preset-window-height" (Mod+Shift+R) toggles between. + // preset-window-heights { } + + // You can change the default width of the new windows. + default-column-width { proportion 0.5; } + // If you leave the brackets empty, the windows themselves will decide their initial width. + // default-column-width {} + + // By default focus ring and border are rendered as a solid background rectangle + // behind windows. That is, they will show up through semitransparent windows. + // This is because windows using client-side decorations can have an arbitrary shape. + // + // If you don't like that, you should uncomment `prefer-no-csd` below. + // Niri will draw focus ring and border *around* windows that agree to omit their + // client-side decorations. + // + // Alternatively, you can override it with a window rule called + // `draw-border-with-background`. + + // You can change how the focus ring looks. + focus-ring { + // Uncomment this line to disable the focus ring. + off + + // How many logical pixels the ring extends out from the windows. + width 2 + + // Colors can be set in a variety of ways: + // - CSS named colors: "red" + // - RGB hex: "#rgb", "#rgba", "#rrggbb", "#rrggbbaa" + // - CSS-like notation: "rgb(255, 127, 0)", rgba(), hsl() and a few others. + + // Color of the ring on the active monitor. + active-color "#ebbcba" + + // Color of the ring on inactive monitors. + inactive-color "#6e6a86" + + // You can also use gradients. They take precedence over solid colors. + // Gradients are rendered the same as CSS linear-gradient(angle, from, to). + // The angle is the same as in linear-gradient, and is optional, + // defaulting to 180 (top-to-bottom gradient). + // You can use any CSS linear-gradient tool on the web to set these up. + // Changing the color space is also supported, check the wiki for more info. + // + // active-gradient from="#80c8ff" to="#bbddff" angle=45 + + // You can also color the gradient relative to the entire view + // of the workspace, rather than relative to just the window itself. + // To do that, set relative-to="workspace-view". + // + // inactive-gradient from="#505050" to="#808080" angle=45 relative-to="workspace-view" + } + + // You can also add a border. It's similar to the focus ring, but always visible. + border { + // The settings are the same as for the focus ring. + // If you enable the border, you probably want to disable the focus ring. + // off + + width 2 + active-color "#ebbcba" + inactive-color "#6e6a86" + + // Color of the border around windows that request your attention. + urgent-color "#eb6f92" + + // active-gradient from="#ffbb66" to="#ffc880" angle=45 relative-to="workspace-view" + // inactive-gradient from="#505050" to="#808080" angle=45 relative-to="workspace-view" + } + + // You can enable drop shadows for windows. + shadow { + // Uncomment the next line to enable shadows. + // on + + // By default, the shadow draws only around its window, and not behind it. + // Uncomment this setting to make the shadow draw behind its window. + // + // Note that niri has no way of knowing about the CSD window corner + // radius. It has to assume that windows have square corners, leading to + // shadow artifacts inside the CSD rounded corners. This setting fixes + // those artifacts. + // + // However, instead you may want to set prefer-no-csd and/or + // geometry-corner-radius. Then, niri will know the corner radius and + // draw the shadow correctly, without having to draw it behind the + // window. These will also remove client-side shadows if the window + // draws any. + // + // draw-behind-window true + + // You can change how shadows look. The values below are in logical + // pixels and match the CSS box-shadow properties. + + // Softness controls the shadow blur radius. + softness 30 + + // Spread expands the shadow. + spread 5 + + // Offset moves the shadow relative to the window. + offset x=0 y=5 + + // You can also change the shadow color and opacity. + color "#0007" + } + + // Struts shrink the area occupied by windows, similarly to layer-shell panels. + // You can think of them as a kind of outer gaps. They are set in logical pixels. + // Left and right struts will cause the next window to the side to always be visible. + // Top and bottom struts will simply add outer gaps in addition to the area occupied by + // layer-shell panels and regular gaps. + struts { + // left 64 + // right 64 + // top 64 + // bottom 64 + } +} + +// Add lines like this to spawn processes at startup. +// Note that running niri as a session supports xdg-desktop-autostart, +// which may be more convenient to use. +// See the binds section below for more spawn examples. + +// This line starts waybar, a commonly used bar for Wayland compositors. +spawn-at-startup "pipewire" +spawn-at-startup "pipewire-pulse" +spawn-at-startup "wireplumber" +spawn-at-startup "eww" "daemon" +spawn-at-startup "eww" "open bar" +spawn-at-startup "mako" +// spawn-at-startup "dbus-update-activation-environment" "WAYLAND_DISPLAY" "XDG_CURRENT_DESKTOP" "DISPLAY" "XAUTHORITY" +spawn-at-startup "nextcloud" +// spawn-at-startup "/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1" +spawn-at-startup "xrdb" "~/.config/x11/xresources" +spawn-at-startup "transmission-daemon" +spawn-at-startup "floorp" +spawn-at-startup "kotatogram-desktop" +spawn-at-startup "flatpak" "run" "dev.vencord.Vesktop" + +// Uncomment this line to ask the clients to omit their client-side decorations if possible. +// If the client will specifically ask for CSD, the request will be honored. +// Additionally, clients will be informed that they are tiled, removing some client-side rounded corners. +// This option will also fix border/focus ring drawing behind some semitransparent windows. +// After enabling or disabling this, you need to restart the apps for this to take effect. +prefer-no-csd + +// You can change the path where screenshots are saved. +// A ~ at the front will be expanded to the home directory. +// The path is formatted with strftime(3) to give you the screenshot date and time. +screenshot-path "~/Pictures/screenshots/%Y-%m-%d-%H%M%S_niri.png" + +// You can also set this to null to disable saving screenshots to disk. +// screenshot-path null + +// Animation settings. +// The wiki explains how to configure individual animations: +// https://github.com/YaLTeR/niri/wiki/Configuration:-Animations +animations { + // Uncomment to turn off all animations. + off + + // Slow down all animations by this factor. Values below 1 speed them up instead. + // slowdown 3.0 +} + +layer-rule { + match namespace="^notifications$" + block-out-from "screencast" +} + +// Window rules let you adjust behavior for individual windows. +// Find more information on the wiki: +// https://github.com/YaLTeR/niri/wiki/Configuration:-Window-Rules +// +// Work around WezTerm's initial configure bug +// by setting an empty default-column-width. +window-rule { + // This regular expression is intentionally made as specific as possible, + // since this is the default config, and we want no false positives. + // You can get away with just app-id="wezterm" if you want. + match app-id=r#"^org\.wezfurlong\.wezterm$"# + default-column-width {} +} + +// Open the Firefox picture-in-picture player as floating by default. +window-rule { + // This app-id regular expression will work for both: + // - host Firefox (app-id is "firefox") + // - Flatpak Firefox (app-id is "org.mozilla.firefox") + match app-id=r#"firefox$"# title="^Picture-in-Picture$" + match app-id=r#"floorp$"# title="^Picture-in-Picture$" + open-floating true +} + +window-rule { + match app-id="steam" title=r#"^notificationtoasts_\d+_desktop$"# + default-floating-position x=10 y=10 relative-to="bottom-right" +} + +// Example: block out two password managers from screen capture. +// (This example rule is commented out with a "/-" in front.) +window-rule { + match app-id=r#"^org\.keepassxc\.KeePassXC$"# + match app-id=r#"^org\.gnome\.World\.Secrets$"# + + block-out-from "screen-capture" + + // Use this instead if you want them visible on third-party screenshot tools. + // block-out-from "screencast" +} + +window-rule { + match at-startup=true app-id=r#"floorp$"# + open-maximized true + open-on-workspace "browser" +} + +window-rule { + match at-startup=true app-id=r#"^org\.telegram\.desktop$"# + exclude app-id=r#"^org\.telegram\.desktop$"# title="^Media viewer$" + open-on-workspace "chat" +} + + +// Example: enable rounded corners for all windows. +// (This example rule is commented out with a "/-" in front.) +/-window-rule { + geometry-corner-radius 12 + clip-to-geometry true +} + +binds { + // Keys consist of modifiers separated by + signs, followed by an XKB key name + // in the end. To find an XKB name for a particular key, you may use a program + // like wev. + // + // "Mod" is a special modifier equal to Super when running on a TTY, and to Alt + // when running as a winit window. + // + // Most actions that you can bind here can also be invoked programmatically with + // `niri msg action do-something`. + + // Mod-Shift-/, which is usually the same as Mod-?, + // shows a list of important hotkeys. + Mod+Shift+Slash { show-hotkey-overlay; } + + // Suggested binds for running programs: terminal, app launcher, screen locker. + Mod+Return hotkey-overlay-title="Open a Terminal: alacritty" { spawn "alacritty"; } + Mod+P hotkey-overlay-title="Run an Application: fuzzel" { spawn "fuzzel"; } + Super+Space hotkey-overlay-title="Lock the Screen: hyprlock" { spawn "hyprlock"; } + + // You can also use a shell. Do this if you need pipes, multiple commands, etc. + // Note: the entire command goes as a single argument in the end. + // Mod+T { spawn "bash" "-c" "notify-send hello && exec alacritty"; } + + // Example volume keys mappings for PipeWire & WirePlumber. + // The allow-when-locked=true property makes them work even when the session is locked. + XF86AudioRaiseVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1+"; } + XF86AudioLowerVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1-"; } + XF86AudioMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"; } + XF86AudioMicMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"; } + + // Open/close the Overview: a zoomed-out view of workspaces and windows. + // You can also move the mouse into the top-left hot corner, + // or do a four-finger swipe up on a touchpad. + Mod+O repeat=false { toggle-overview; } + + Mod+Shift+Q { close-window; } + + Mod+H { focus-column-left; } + Mod+J { focus-window-down; } + Mod+K { focus-window-up; } + Mod+L { focus-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+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+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; } + // ... + + // And you can also move a whole workspace to another monitor: + // Mod+Shift+Ctrl+Left { move-workspace-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+Ctrl+Page_Down { move-column-to-workspace-down; } + Mod+Ctrl+Page_Up { move-column-to-workspace-up; } + Mod+Ctrl+U { move-column-to-workspace-down; } + Mod+Ctrl+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+Page_Down { move-workspace-down; } + Mod+Shift+Page_Up { move-workspace-up; } + Mod+Shift+U { move-workspace-down; } + Mod+Shift+I { 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; } + + // 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+Shift+1 { move-column-to-workspace 1; } + Mod+Shift+2 { move-column-to-workspace 2; } + Mod+Shift+3 { move-column-to-workspace 3; } + Mod+Shift+4 { move-column-to-workspace 4; } + Mod+Shift+5 { move-column-to-workspace 5; } + Mod+Shift+6 { move-column-to-workspace 6; } + Mod+Shift+7 { move-column-to-workspace 7; } + Mod+Shift+8 { move-column-to-workspace 8; } + Mod+Shift+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+Comma { consume-or-expel-window-left; } + Mod+Period { 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+M { maximize-column; } + Mod+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+Ctrl+Space { 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"; } + + 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 { 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 +} diff --git a/config/shell/aliasrc b/config/shell/aliasrc index a44f9c17..a4e15f50 100644 --- a/config/shell/aliasrc +++ b/config/shell/aliasrc @@ -57,6 +57,7 @@ alias \ gds="git diff --staged" \ gl="git log --all --graph --pretty=format:'%C(magenta)%h %C(white) %an %ar%C(auto) %D%n%s%n'" \ gp="git pull" \ + gC="git clone" \ gs="git status --short" # doas not required for some system commands diff --git a/config/yazi/init.lua b/config/yazi/init.lua index e2158b87..40412706 100644 --- a/config/yazi/init.lua +++ b/config/yazi/init.lua @@ -20,52 +20,52 @@ require("augment-command"):setup({ wraparound_file_navigation = false, }) require("git"):setup() -require("yatline"):setup({ - show_background = false, - section_separator = { open = "", close = "" }, - part_separator = { open = "", close = "" }, - inverse_separator = { open = "", close = "" }, - - header_line = { - left = { - section_a = { - { type = "line", custom = false, name = "tabs", params = { "left" } }, - }, - section_b = {}, - section_c = {}, - }, - right = { - section_a = { - { type = "string", custom = false, name = "date", params = { "%A, %d %B %Y" } }, - }, - section_b = { - { type = "string", custom = false, name = "date", params = { "%X" } }, - }, - section_c = {}, - }, - }, - - status_line = { - left = { - section_a = {}, - section_b = {}, - section_c = { - { type = "string", custom = false, name = "hovered_path" }, - { type = "coloreds", custom = false, name = "task_states" }, - }, - }, - right = { - section_a = { - { type = "string", custom = false, name = "cursor_position" }, - { type = "string", custom = false, name = "cursor_percentage" }, - }, - section_b = { - { type = "string", custom = false, name = "hovered_file_extension", params = { true } }, - }, - section_c = { - { type = "coloreds", custom = false, name = "permissions" }, - { type = "coloreds", custom = false, name = "count", params = "true" }, - }, - }, - }, -}) +-- require("yatline"):setup({ +-- show_background = false, +-- section_separator = { open = "", close = "" }, +-- part_separator = { open = "", close = "" }, +-- inverse_separator = { open = "", close = "" }, +-- +-- header_line = { +-- left = { +-- section_a = { +-- { type = "line", custom = false, name = "tabs", params = { "left" } }, +-- }, +-- section_b = {}, +-- section_c = {}, +-- }, +-- right = { +-- section_a = { +-- { type = "string", custom = false, name = "date", params = { "%A, %d %B %Y" } }, +-- }, +-- section_b = { +-- { type = "string", custom = false, name = "date", params = { "%X" } }, +-- }, +-- section_c = {}, +-- }, +-- }, +-- +-- status_line = { +-- left = { +-- section_a = {}, +-- section_b = {}, +-- section_c = { +-- { type = "string", custom = false, name = "hovered_path" }, +-- { type = "coloreds", custom = false, name = "task_states" }, +-- }, +-- }, +-- right = { +-- section_a = { +-- { type = "string", custom = false, name = "cursor_position" }, +-- { type = "string", custom = false, name = "cursor_percentage" }, +-- }, +-- section_b = { +-- { type = "string", custom = false, name = "hovered_file_extension", params = { true } }, +-- }, +-- section_c = { +-- { type = "coloreds", custom = false, name = "permissions" }, +-- { type = "coloreds", custom = false, name = "count", params = "true" }, +-- }, +-- }, +-- }, +-- }) diff --git a/config/yazi/package.toml b/config/yazi/package.toml index 684a60a5..04cebbc3 100644 --- a/config/yazi/package.toml +++ b/config/yazi/package.toml @@ -5,13 +5,13 @@ hash = "50da29476e744dba37d77fb209328fd1" [[plugin.deps]] use = "dedukun/relative-motions" -rev = "ce2e890" -hash = "23915860e59348bf4166778bb0e606f7" +rev = "2e3b617" +hash = "b67ee12053113983273e9118a7d1272b" [[plugin.deps]] use = "hankertrix/augment-command" -rev = "ac4a651" -hash = "7b6b0b8c260c9c5e557287bf9b370f7c" +rev = "a03a237" +hash = "56dfc522998328d0c417226e88da862c" [[plugin.deps]] use = "kirasok/torrent-preview" @@ -20,8 +20,8 @@ hash = "6af40ce6b2cd849b5fa32de04a598b06" [[plugin.deps]] use = "ndtoan96/ouch" -rev = "2496cd9" -hash = "5b9dea47776a30946cfbf83232d18fb1" +rev = "1ee69a5" +hash = "63679f3daf8551ff8755be38b5ced0f" [[plugin.deps]] use = "pirafrank/what-size" @@ -30,48 +30,48 @@ hash = "fca231a128488a554823374f8f6d5241" [[plugin.deps]] use = "yazi-rs/plugins:git" -rev = "c0ad8a3" -hash = "bf6f074cd41ee33c3360341d168f9733" +rev = "86d28e4" +hash = "e01006bfb38951ea89031bd918b20dbb" [[plugin.deps]] use = "yazi-rs/plugins:chmod" -rev = "c0ad8a3" -hash = "d0ad0c1946b46a30c8489735fe8de41c" +rev = "86d28e4" +hash = "a030fe48d91b04341ad2fba9be957df" [[plugin.deps]] use = "yazi-rs/plugins:full-border" -rev = "c0ad8a3" +rev = "86d28e4" hash = "3996fc74044bc44144b323686f887e1" [[plugin.deps]] use = "yazi-rs/plugins:mount" -rev = "c0ad8a3" -hash = "c0b6cd7dc830b96e77e5c8a71eec7926" +rev = "86d28e4" +hash = "b3f1d6ec3721d4061aad5f69cddb0cf9" [[plugin.deps]] use = "yazi-rs/plugins:smart-filter" -rev = "c0ad8a3" -hash = "4d82cd9e7534d976f000edf9c0f68d8f" +rev = "86d28e4" +hash = "f660384d7ed12ecd456efed313453310" [[plugin.deps]] use = "yazi-rs/plugins:diff" -rev = "c0ad8a3" +rev = "86d28e4" hash = "47865a70cade14a0b9b6bc6a54f16bdb" [[plugin.deps]] use = "AnirudhG07/rich-preview" -rev = "de28f50" -hash = "b9cd4027db110b4228889be32462f363" +rev = "843c3fa" +hash = "b4040931f0d2f9670ddb4923e55cd881" [[plugin.deps]] use = "macydnah/office" -rev = "d1e3e51" -hash = "35241f7d85abc5a0d2441020bc597ceb" +rev = "4002d36" +hash = "9c68763dd4f2799f7cfee1e9c3e819a9" [[plugin.deps]] use = "boydaihungst/mediainfo" -rev = "c6d0de7" -hash = "7b024fc14b462235068400207cbe7bf0" +rev = "a7d1aa6" +hash = "844133c7247cda086819d63a9ca5e457" [[plugin.deps]] use = "iynaix/time-travel" @@ -80,8 +80,8 @@ hash = "69967963fba96295a07b68354fc91ea9" [[plugin.deps]] use = "imsi32/yatline" -rev = "2ecf715" -hash = "38e2ea4703ea606d4eef574e8e8b8fd7" +rev = "88bd1c5" +hash = "981acbe9b758b1af3a8154c932bb936d" [[plugin.deps]] use = "kristoferssolo/vidir" diff --git a/config/yazi/plugins/augment-command.yazi/README.md b/config/yazi/plugins/augment-command.yazi/README.md index 566b29cf..48fe5267 100644 --- a/config/yazi/plugins/augment-command.yazi/README.md +++ b/config/yazi/plugins/augment-command.yazi/README.md @@ -46,7 +46,7 @@ plugin. ## Requirements -- [Yazi][yazi-link] v25.5.28+ +- [Yazi][yazi-link] v25.5.31+ - [`7z` or `7zz` command][7z-link] - [`file` command][file-command-link] @@ -1206,7 +1206,7 @@ are also supported, for example: [[mgr.prepend_keymap]] on = "k" run = "plugin augment-command -- arrow -1" -desc = "Move cursor up" +desc = "Move the cursor up" [[mgr.prepend_keymap]] on = "r" @@ -1221,6 +1221,7 @@ desc = "Permanently delete the files" [[mgr.prepend_keymap]] on = ["g", "j"] run = "plugin augment-command -- parent_arrow 1" +desc = "Move the cursor down in the parent directory" ``` For the default descriptions of the commands, you can refer to diff --git a/config/yazi/plugins/augment-command.yazi/main.lua b/config/yazi/plugins/augment-command.yazi/main.lua index d1a257d6..cd162951 100644 --- a/config/yazi/plugins/augment-command.yazi/main.lua +++ b/config/yazi/plugins/augment-command.yazi/main.lua @@ -1,4 +1,4 @@ ---- @since 25.5.28 +--- @since 25.5.31 -- Plugin to make some Yazi commands smarter -- Written in Lua 5.4 @@ -938,7 +938,7 @@ local function show_overwrite_prompt(file_path_to_overwrite) -- Wrap the string in a line and align it to the center. first_line = ui.Line(overwrite_confirm_options.content) - :align(ui.Line.CENTER) + :align(ui.Align.CENTER) -- Otherwise, just set the first line to the content given else @@ -951,9 +951,9 @@ local function show_overwrite_prompt(file_path_to_overwrite) first_line, ui.Line(string.rep("─", overwrite_confirm_options.pos.w - 2)) :style(ui.Style(th.confirm.border)) - :align(ui.Line.LEFT), - ui.Line(tostring(file_path_to_overwrite)):align(ui.Line.LEFT), - }):wrap(ui.Text.WRAP_TRIM) + :align(ui.Align.LEFT), + ui.Line(tostring(file_path_to_overwrite)):align(ui.Align.LEFT), + }):wrap(ui.Wrap.TRIM) -- Get the user's confirmation for -- whether they want to overwrite the item @@ -3886,7 +3886,7 @@ local function handle_quit(args, config) content = ui.Text({ "There are multiple tabs open.", "Are you sure you want to quit?", - }):wrap(ui.Text.WRAP_TRIM), + }):wrap(ui.Wrap.TRIM), }, true, true) -- Get the type of the quit content @@ -3895,7 +3895,7 @@ local function handle_quit(args, config) -- If the type of the quit content is a string or a list of strings if quit_content_type == "string" or quit_content_type == "table" then quit_confirm_options.content = ui.Text(quit_confirm_options.content) - :wrap(ui.Text.WRAP_TRIM) + :wrap(ui.Wrap.TRIM) end -- Get the user's confirmation for quitting diff --git a/config/yazi/plugins/chmod.yazi/main.lua b/config/yazi/plugins/chmod.yazi/main.lua index 589ebd56..b05f05af 100644 --- a/config/yazi/plugins/chmod.yazi/main.lua +++ b/config/yazi/plugins/chmod.yazi/main.lua @@ -1,4 +1,4 @@ ---- @since 25.5.28 +--- @since 25.5.31 local selected_or_hovered = ya.sync(function() local tab, paths = cx.active, {} diff --git a/config/yazi/plugins/git.yazi/main.lua b/config/yazi/plugins/git.yazi/main.lua index fd8b8bf6..140ad5a7 100644 --- a/config/yazi/plugins/git.yazi/main.lua +++ b/config/yazi/plugins/git.yazi/main.lua @@ -1,4 +1,4 @@ ---- @since 25.5.28 +--- @since 25.5.31 local WINDOWS = ya.target_family() == "windows" diff --git a/config/yazi/plugins/mediainfo.yazi/README.md b/config/yazi/plugins/mediainfo.yazi/README.md index 9e6078ba..bab05a9c 100644 --- a/config/yazi/plugins/mediainfo.yazi/README.md +++ b/config/yazi/plugins/mediainfo.yazi/README.md @@ -10,7 +10,7 @@ This is a Yazi plugin for previewing media files. The preview shows thumbnail using `ffmpeg` if available and media metadata using `mediainfo`. > [!IMPORTANT] -> Minimum version: yazi v25.5.28. +> Minimum version: yazi v25.5.31. ## Preview diff --git a/config/yazi/plugins/mediainfo.yazi/main.lua b/config/yazi/plugins/mediainfo.yazi/main.lua index ced08601..2d759df3 100644 --- a/config/yazi/plugins/mediainfo.yazi/main.lua +++ b/config/yazi/plugins/mediainfo.yazi/main.lua @@ -1,4 +1,4 @@ ---- @since 25.5.28 +--- @since 25.5.31 local skip_labels = { ["Complete name"] = true, @@ -129,7 +129,7 @@ function M:peek(job) w = job.area.w, h = job.area.h - image_height, })) - :wrap(is_wrap and ui.Text.WRAP or ui.Text.WRAP_NO), + :wrap(is_wrap and ui.Wrap.YES or ui.Wrap.NO), }) end diff --git a/config/yazi/plugins/mount.yazi/main.lua b/config/yazi/plugins/mount.yazi/main.lua index 87c7313d..32dc15ea 100644 --- a/config/yazi/plugins/mount.yazi/main.lua +++ b/config/yazi/plugins/mount.yazi/main.lua @@ -1,4 +1,4 @@ ---- @since 25.5.28 +--- @since 25.5.31 local toggle_ui = ya.sync(function(self) if self.children then @@ -274,7 +274,7 @@ function M.operate(type) end end -function M.fail(s, ...) ya.notify { title = "Mount", content = string.format(s, ...), timeout = 10, level = "error" } end +function M.fail(...) ya.notify { title = "Mount", content = string.format(...), timeout = 10, level = "error" } end function M:click() end diff --git a/config/yazi/plugins/office.yazi/main.lua b/config/yazi/plugins/office.yazi/main.lua index 2fa02249..3ec73850 100644 --- a/config/yazi/plugins/office.yazi/main.lua +++ b/config/yazi/plugins/office.yazi/main.lua @@ -29,32 +29,39 @@ end function M:doc2pdf(job) local tmp = "/tmp/yazi-" .. ya.uid() .. "/" .. ya.hash("office.yazi") .. "/" ---[[ For Future Reference: Regarding `libreoffice` as preconverter + --[[ For Future Reference: Regarding `libreoffice` as preconverter 1. It prints errors to stdout (always, doesn't matter if it succeeded or it failed) 2. Always writes the converted files to the filesystem, so no "Mario|Bros|Piping|Magic" for the data stream (https://ask.libreoffice.org/t/using-convert-to-output-to-stdout/38753) 3. The `pdf:draw_pdf_Export` filter needs literal double quotes when defining its options (https://help.libreoffice.org/latest/en-US/text/shared/guide/pdf_params.html?&DbPAR=SHARED&System=UNIX#generaltext/shared/guide/pdf_params.xhp) 3.1 Regarding double quotes and Lua strings, see https://www.lua.org/manual/5.1/manual.html#2.1 --]] local libreoffice = Command("libreoffice") - :args({ + :arg({ "--headless", "--convert-to", - "pdf:draw_pdf_Export:{" .. - "\"PageRange\":{" .. - "\"type\":\"string\"," .. - "\"value\":" .. "\"" .. job.skip + 1 .. "\"" .. - "}" .. - "}", + "pdf:draw_pdf_Export:{" + .. '"PageRange":{' + .. '"type":"string",' + .. '"value":' + .. '"' + .. job.skip + 1 + .. '"' + .. "}" + .. "}", "--outdir", tmp, - tostring(job.file.url) + tostring(job.file.url), }) :stdin(Command.NULL) :stdout(Command.PIPED) :stderr(Command.NULL) :output() - + if not libreoffice.status.success then - ya.err(libreoffice.stdout:match("LibreOffice .+"):gsub("%\n.*", "") .. " " .. libreoffice.stdout:match("Error .+"):gsub("%\n.*", "")) + ya.err( + libreoffice.stdout:match("LibreOffice .+"):gsub("%\n.*", "") + .. " " + .. libreoffice.stdout:match("Error .+"):gsub("%\n.*", "") + ) return nil, Err("Failed to preconvert `%s` to a temporary PDF", job.file.name) end @@ -80,7 +87,7 @@ function M:preload(job) end local output, err = Command("pdftoppm") - :args({ + :arg({ "-singlefile", "-jpeg", "-jpegopt", diff --git a/config/yazi/plugins/ouch.yazi/README.md b/config/yazi/plugins/ouch.yazi/README.md index e09b3dfc..72ad1974 100644 --- a/config/yazi/plugins/ouch.yazi/README.md +++ b/config/yazi/plugins/ouch.yazi/README.md @@ -43,7 +43,7 @@ prepend_previewers = [ { mime = "application/x-bzip2", run = "ouch" }, { mime = "application/x-7z-compressed", run = "ouch" }, { mime = "application/x-rar", run = "ouch" }, - { mime = "application/x-xz", run = "ouch" }, + { mime = "application/x-xz", run = "ouch" }, { mime = "application/xz", run = "ouch" }, ] ``` @@ -56,7 +56,7 @@ If you want to change the icon or the style of text, you can modify the `peek` f For compession, add this to your `keymap.toml`: ```toml -[[manager.prepend_keymap]] +[[mgr.prepend_keymap]] on = ["C"] run = "plugin ouch" desc = "Compress with ouch" @@ -73,7 +73,7 @@ To decompress with `ouch`, configure the opener in `yazi.toml`. ```toml [opener] extract = [ - { run = 'ouch d -y "%*"', desc = "Extract here with ouch", for = "windows" }, + { run = 'ouch d -y %*', desc = "Extract here with ouch", for = "windows" }, { run = 'ouch d -y "$@"', desc = "Extract here with ouch", for = "unix" }, ] ``` diff --git a/config/yazi/plugins/ouch.yazi/main.lua b/config/yazi/plugins/ouch.yazi/main.lua index f642eb35..9491e170 100644 --- a/config/yazi/plugins/ouch.yazi/main.lua +++ b/config/yazi/plugins/ouch.yazi/main.lua @@ -2,13 +2,13 @@ local M = {} function M:peek(job) local child = Command("ouch") - :args({ "l", "-t", "-y", tostring(job.file.url) }) + :arg({ "l", "-t", "-y", tostring(job.file.url) }) :stdout(Command.PIPED) :stderr(Command.PIPED) :spawn() local limit = job.area.h local file_name = string.match(tostring(job.file.url), ".*[/\\](.*)") - local lines = string.format("📁 \x1b[2m%s\x1b[0m\n", file_name) + local lines = string.format("\u{1f4c1} %s\n", file_name) local num_lines = 1 local num_skip = 0 repeat @@ -31,12 +31,12 @@ function M:peek(job) child:start_kill() if job.skip > 0 and num_lines < limit then - ya.manager_emit( + ya.emit( "peek", { tostring(math.max(0, job.skip - (limit - num_lines))), only_if = tostring(job.file.url), upper_bound = "" } ) else - ya.preview_widgets(job, { ui.Text(lines):area(job.area) }) + ya.preview_widget(job, { ui.Text(lines):area(job.area) }) end end @@ -44,7 +44,7 @@ function M:seek(job) local h = cx.active.current.hovered if h and h.url == job.file.url then local step = math.floor(job.units * job.area.h / 10) - ya.manager_emit("peek", { + ya.emit("peek", { math.max(0, cx.active.preview.skip + step), only_if = tostring(job.file.url), }) @@ -81,15 +81,15 @@ local get_compression_target = ya.sync(function() table.insert(paths, tostring(url)) end -- The compression targets are aquired, now unselect them - ya.manager_emit("escape", {}) + ya.emit("escape", {}) end return paths, default_name end) local function invoke_compress_command(paths, name) local cmd_output, err_code = Command("ouch") - :args({ "c", "-y" }) - :args(paths) + :arg({ "c", "-y" }) + :arg(paths) :arg(name) :stderr(Command.PIPED) :output() @@ -116,7 +116,7 @@ function M:entry(job) default_fmt = "zip" end - ya.manager_emit("escape", { visual = true }) + ya.emit("escape", { visual = true }) -- Get the files that need to be compressed and infer a default archive name local paths, default_name = get_compression_target() diff --git a/config/yazi/plugins/relative-motions.yazi/README.md b/config/yazi/plugins/relative-motions.yazi/README.md index b950feaf..0779f1ac 100644 --- a/config/yazi/plugins/relative-motions.yazi/README.md +++ b/config/yazi/plugins/relative-motions.yazi/README.md @@ -6,7 +6,7 @@ https://github.com/dedukun/relative-motions.yazi/assets/25795432/04fb186a-5efe-4 ## Requirements -- [Yazi](https://github.com/sxyazi/yazi) v25.4.8+ +- [Yazi](https://github.com/sxyazi/yazi) v25.5.28+ ## Installation diff --git a/config/yazi/plugins/relative-motions.yazi/main.lua b/config/yazi/plugins/relative-motions.yazi/main.lua index 722325e7..87508cec 100644 --- a/config/yazi/plugins/relative-motions.yazi/main.lua +++ b/config/yazi/plugins/relative-motions.yazi/main.lua @@ -1,4 +1,4 @@ ---- @since 25.4.8 +--- @since 25.5.28 -- stylua: ignore local MOTIONS_AND_OP_KEYS = { { on = "0" }, { on = "1" }, { on = "2" }, { on = "3" }, { on = "4" }, @@ -141,7 +141,7 @@ local render_numbers = ya.sync(function(_, mode) return { ui.List(entities):area(self._area), - ui.Text(linemodes):area(self._area):align(ui.Text.RIGHT), + ui.Text(linemodes):area(self._area):align(ui.Align.RIGHT), } end end) diff --git a/config/yazi/plugins/rich-preview.yazi/main.lua b/config/yazi/plugins/rich-preview.yazi/main.lua index 7c621d08..72be898d 100644 --- a/config/yazi/plugins/rich-preview.yazi/main.lua +++ b/config/yazi/plugins/rich-preview.yazi/main.lua @@ -2,7 +2,7 @@ local M = {} function M:peek(job) local child = Command("rich") - :args({ + :arg({ "-j", "--left", "--line-numbers", diff --git a/config/yazi/plugins/smart-filter.yazi/main.lua b/config/yazi/plugins/smart-filter.yazi/main.lua index 4141f954..490a9dd8 100644 --- a/config/yazi/plugins/smart-filter.yazi/main.lua +++ b/config/yazi/plugins/smart-filter.yazi/main.lua @@ -1,4 +1,4 @@ ---- @since 25.5.28 +--- @since 25.5.31 local hovered = ya.sync(function() local h = cx.active.current.hovered diff --git a/config/yazi/plugins/yatline.yazi/main.lua b/config/yazi/plugins/yatline.yazi/main.lua index 48591c58..a4e5d1a3 100644 --- a/config/yazi/plugins/yatline.yazi/main.lua +++ b/config/yazi/plugins/yatline.yazi/main.lua @@ -1,3 +1,4 @@ +--- @since 25.5.31 --- @diagnostic disable: undefined-global, undefined-field --- @alias Mode Mode Comes from Yazi. --- @alias Rect Rect Comes from Yazi. @@ -424,12 +425,20 @@ function Yatline.string.get:hovered_mime() end --- Gets the hovered file's user and group ownership of the current active tab. +--- Unix-like systems only. --- @return string ownership Current active tab's hovered file's user and group ownership. function Yatline.string.get:hovered_ownership() local hovered = cx.active.current.hovered if hovered then - return ya.user_name(hovered.cha.uid) .. ":" .. ya.group_name(hovered.cha.gid) + if not hovered.cha.uid or not hovered.cha.gid then + return "" + end + + local username = ya.user_name(hovered.cha.uid) or tostring(hovered.cha.uid) + local groupname = ya.group_name(hovered.cha.gid) or tostring(hovered.cha.gid) + + return username .. ":" .. groupname else return "" end @@ -713,6 +722,7 @@ function Yatline.coloreds.create(coloreds, component_type) end --- Gets the hovered file's permissions of the current active tab. +--- Unix-like systems only. --- @return Coloreds coloreds Current active tab's hovered file's permissions function Yatline.coloreds.get:permissions() local hovered = cx.active.current.hovered @@ -990,8 +1000,10 @@ local function config_side(side) if component_group then if component.custom then - section_components[#section_components + 1] = - { component_group.create(component.name, in_section), component_group.has_separator } + if component.name ~= nil and component.name ~= "" and #component.name ~= 0 then + section_components[#section_components + 1] = + { component_group.create(component.name, in_section), component_group.has_separator } + end else local getter = component_group.get[component.name] @@ -1075,9 +1087,65 @@ local function config_paragraph(area, line) end return { - setup = function(_, config) + setup = function(_, config, pre_theme) config = config or {} + if config == 0 then + config = { + show_background = false, + + header_line = { + left = { + section_a = { + { type = "line", custom = false, name = "tabs", params = { "left" } }, + }, + section_b = {}, + section_c = {}, + }, + right = { + section_a = { + { type = "string", custom = false, name = "date", params = { "%A, %d %B %Y" } }, + }, + section_b = { + { type = "string", custom = false, name = "date", params = { "%X" } }, + }, + section_c = {}, + }, + }, + + status_line = { + left = { + section_a = { + { type = "string", custom = false, name = "tab_mode" }, + }, + section_b = { + { type = "string", custom = false, name = "hovered_size" }, + }, + section_c = { + { type = "string", custom = false, name = "hovered_path" }, + { type = "coloreds", custom = false, name = "count" }, + }, + }, + right = { + section_a = { + { type = "string", custom = false, name = "cursor_position" }, + }, + section_b = { + { type = "string", custom = false, name = "cursor_percentage" }, + }, + section_c = { + { type = "string", custom = false, name = "hovered_file_extension", params = { true } }, + { type = "coloreds", custom = false, name = "permissions" }, + }, + }, + }, + } + end + + if pre_theme then + config.theme = pre_theme + end + tab_width = config.tab_width or 20 local component_positions = config.component_positions or { "header", "tab", "status" } @@ -1249,7 +1317,7 @@ return { Progress.partial_render = function(self) local progress = cx.tasks.progress if progress.total == 0 then - return { config_paragraph(self._area) } + return config_paragraph(self._area) end local gauge = ui.Gauge():area(self._area) @@ -1265,11 +1333,9 @@ return { end local left = progress.total - progress.succ - return { - gauge - :percent(percent) - :label(ui.Span(string.format("%3d%%, %d left", percent, left)):style(th.status.progress_label)), - } + return gauge + :percent(percent) + :label(ui.Span(string.format("%3d%%, %d left", percent, left)):style(th.status.progress_label)) end if display_header_line then @@ -1280,7 +1346,7 @@ return { return { config_paragraph(self._area, left_line), - ui.Text(right_line):area(self._area):align(ui.Text.RIGHT), + right_line:area(self._area):align(ui.Align.RIGHT), } end @@ -1306,8 +1372,8 @@ return { return { config_paragraph(self._area, left_line), - ui.Text(right_line):area(self._area):align(ui.Text.RIGHT), - table.unpack(Progress:new(self._area, right_width):redraw()), + right_line:area(self._area):align(ui.Align.RIGHT), + table.unpack(ui.redraw(Progress:new(self._area, right_width))), } end @@ -1356,6 +1422,8 @@ return { end end + table.insert(childrens, Modal:new(self._area)) + self._children = childrens end end, diff --git a/config/yazi/yazi.toml b/config/yazi/yazi.toml index f011fc2c..56bdb834 100644 --- a/config/yazi/yazi.toml +++ b/config/yazi/yazi.toml @@ -88,16 +88,6 @@ preloaders = [ {mime = "video/*", run = "video"}, {mime = "application/pdf", run = "pdf"}, ] -prepend_preloaders = [ - # Office Documents - {mime = "application/openxmlformats-officedocument.*", run = "office"}, - {mime = "application/oasis.opendocument.*", run = "office"}, - {mime = "application/ms-*", run = "office"}, - {mime = "application/msword", run = "office"}, - {name = "*.docx", run = "office"}, - {mime = "{audio,video,image}/*", run = "mediainfo"}, - {mime = "application/subrip", run = "mediainfo"}, -] previewers = [ {name = "*/", run = "folder", sync = true}, {mime = "text/*", run = "code"}, diff --git a/config/zsh/.zprofile-wayland b/config/zsh/.zprofile-wayland index ddc3dd21..bde3260c 100644 --- a/config/zsh/.zprofile-wayland +++ b/config/zsh/.zprofile-wayland @@ -5,4 +5,5 @@ export XDG_CURRENT_DESKTOP=Hyprland export XDG_SESSION_TYPE=wayland export XDG_SESSION_DESKTOP=Hyprland -[ "$(tty)" = "/dev/tty1" ] && ! pidof -s Hyprland >/dev/null 2>&1 && Hyprland +[ "$(tty)" = "/dev/tty1" ] && ! pidof -s niri >/dev/null 2>&1 && niri --session +# [ "$(tty)" = "/dev/tty1" ] && ! pidof -s Hyprland >/dev/null 2>&1 && Hyprland