Update 2026-01-31

Update 2026-01-27
This commit is contained in:
2026-01-31 17:45:16 +02:00
parent 8c606045e1
commit 5324f54618
73 changed files with 6508 additions and 5373 deletions

View File

@@ -75,7 +75,8 @@ depends = [ "torrent", "zathura", "email" ]
"config/tmThemes/" = "~/.config/silicon/" "config/tmThemes/" = "~/.config/silicon/"
"config/btop/" = "~/.config/btop/" "config/btop/" = "~/.config/btop/"
"config/htoprc" = "~/.config/htop/htoprc" "config/htoprc" = "~/.config/htop/htoprc"
"config/fastfetch/" = "~/.config/fastfetch/" "config/fastfetch/examples/10.jsonc" = "~/.config/fastfetch/config.jsonc"
# "config/fastfetch/config.jsonc" = "~/.config/fastfetch/config.jsonc"
"config/flameshot.ini" = "~/.config/flameshot/flameshot.ini" "config/flameshot.ini" = "~/.config/flameshot/flameshot.ini"
"config/gitui/" = "~/.config/gitui/" "config/gitui/" = "~/.config/gitui/"
"config/lazygit/" = "~/.config/lazygit/" "config/lazygit/" = "~/.config/lazygit/"
@@ -113,7 +114,7 @@ depends = [ "torrent", "zathura", "email" ]
"config/mako/" = "~/.config/mako/" "config/mako/" = "~/.config/mako/"
[niri] [niri]
depends = [ "misc", "local", "waybar", "lock" ] depends = [ "misc", "local", "waybar", "ashell", "lock" ]
# [niri.files] # [niri.files]
# "config/niri/" = "~/.config/niri/" # "config/niri/" = "~/.config/niri/"
@@ -139,6 +140,9 @@ depends = [ "misc", "local", "eww", "lock" ]
"config/waybar/config.jsonc" = {target = "~/.config/waybar/config.jsonc", type = "template"} "config/waybar/config.jsonc" = {target = "~/.config/waybar/config.jsonc", type = "template"}
"config/waybar/style.css" = {target = "~/.config/waybar/style.css", type = "template"} "config/waybar/style.css" = {target = "~/.config/waybar/style.css", type = "template"}
[ashell.files]
"config/ashell/" = {target = "~/.config/ashell/", type = "template"}
[lock.files] [lock.files]
"config/gtklock/" = "~/.config/gtklock/" "config/gtklock/" = "~/.config/gtklock/"
"config/swaylock.conf" = "~/.config/swaylock/config" "config/swaylock.conf" = "~/.config/swaylock/config"

67
config/ashell/config.toml Normal file
View File

@@ -0,0 +1,67 @@
log_level = "warn"
outputs = "All"
position = "Top"
app_launcher_cmd = "fuzzel"
[modules]
left = [ [ "Workspaces" ] ]
center = [ "WindowTitle" ]
right = [ "SystemInfo", "Tray", [ "Clock", "Privacy", "Settings" ] ]
[updates]
check_cmd = "checkupdates; paru -Qua"
update_cmd = 'alacritty -e bash -c "paru; echo Done - Press enter to exit; read" &'
[workspaces]
visibility_mode = "All"
# enable_workspace_filling = true
# disable_special_workspaces = true
[clock]
format = "%a %d %b %Y %H:%M:%S"
[settings]
indicators = [ "IdleInhibitor", "PowerProfile", "Audio", "Bluetooth", "Network", "Vpn", "Battery" ]
lock_cmd = "playerctl --all-players pause; swaylock"
audio_sinks_more_cmd = "{{terminal}} -e pulsemixer"
audio_sources_more_cmd = "{{terminal}} -e pulsemixer"
wifi_more_cmd = "nm-connection-editor"
vpn_more_cmd = "mullvad-vpn"
bluetooth_more_cmd = "{{terminal}} -e bluetui"
suspend_cmd = "loginctl suspend"
hibernate_cmd = "loginctl hibernate"
reboot_cmd = "loginctl reboot"
logout_cmd = "logout"
remove_airplane_btn = true
remove_idle_btn = true
[system_info]
indicators = [ "Cpu", "Memory", "Temperature" ]
[system_info.temperature]
sensor = "k10temp Tctl"
warn_threshold = 70
alert_threshold = 85
[appearance]
style = "Solid"
opacity = 0.9
# Rose Pine (main)
primary_color = "#c4a7e7" # iris
success_color = "#31748f" # pine
text_color = "#e0def4" # text
workspace_colors = [ "#31748f" ]
special_workspace_colors = [ "#31748f" ]
[appearance.danger_color]
base = "#eb6f92" # love
weak = "#f6c177" # gold
[appearance.background_color]
base = "#191724" # base
weak = "#1f1d2e" # surface
strong = "#26233a" # overlay
[appearance.secondary_color]
base = "#26233a" # overlay

View File

@@ -4,7 +4,7 @@
# Specify desired highlighting theme (e.g. "TwoDark"). Run `bat --list-themes` # Specify desired highlighting theme (e.g. "TwoDark"). Run `bat --list-themes`
# for a list of all available themes # for a list of all available themes
--theme="base16" --theme="Rosé Pine"
# Enable this to use italic text on the terminal. This is not supported on all # Enable this to use italic text on the terminal. This is not supported on all
# terminal emulators (like tmux, by default): # terminal emulators (like tmux, by default):

View File

@@ -1,18 +1,18 @@
#? Config file for btop v. 1.4.5 #? Config file for btop v.1.4.6
#* Name of a btop++/bpytop/bashtop formatted ".theme" file, "Default" and "TTY" for builtin themes. #* Name of a btop++/bpytop/bashtop formatted ".theme" file, "Default" and "TTY" for builtin themes.
#* Themes should be placed in "../share/btop/themes" relative to binary or "$HOME/.config/btop/themes" #* Themes should be placed in "../share/btop/themes" relative to binary or "$HOME/.config/btop/themes"
color_theme = "/home/kristofers/.config/btop/themes/rose-pine.theme" color_theme = "/home/kristofers/.config/btop/themes/rose-pine.theme"
#* If the theme set background should be shown, set to False if you want terminal background transparency. #* If the theme set background should be shown, set to False if you want terminal background transparency.
theme_background = False theme_background = false
#* Sets if 24-bit truecolor should be used, will convert 24-bit colors to 256 color (6x6x6 color cube) if false. #* Sets if 24-bit truecolor should be used, will convert 24-bit colors to 256 color (6x6x6 color cube) if false.
truecolor = True truecolor = true
#* Set to true to force tty mode regardless if a real tty has been detected or not. #* Set to true to force tty mode regardless if a real tty has been detected or not.
#* Will force 16-color mode and TTY theme, set all graph symbols to "tty" and swap out other non tty friendly symbols. #* Will force 16-color mode and TTY theme, set all graph symbols to "tty" and swap out other non tty friendly symbols.
force_tty = False force_tty = false
#* Define presets for the layout of the boxes. Preset 0 is always all boxes shown with default settings. Max 9 presets. #* Define presets for the layout of the boxes. Preset 0 is always all boxes shown with default settings. Max 9 presets.
#* Format: "box_name:P:G,box_name:P:G" P=(0 or 1) for alternate positions, G=graph symbol to use for box. #* Format: "box_name:P:G,box_name:P:G" P=(0 or 1) for alternate positions, G=graph symbol to use for box.
@@ -22,10 +22,13 @@ presets = "cpu:1:default,proc:0:default cpu:0:default,mem:0:default,net:0:defaul
#* Set to True to enable "h,j,k,l,g,G" keys for directional control in lists. #* Set to True to enable "h,j,k,l,g,G" keys for directional control in lists.
#* Conflicting keys for h:"help" and k:"kill" is accessible while holding shift. #* Conflicting keys for h:"help" and k:"kill" is accessible while holding shift.
vim_keys = True vim_keys = true
#* Rounded corners on boxes, is ignored if TTY mode is ON. #* Rounded corners on boxes, is ignored if TTY mode is ON.
rounded_corners = True rounded_corners = true
#* Use terminal synchronized output sequences to reduce flickering on supported terminals.
terminal_sync = true
#* Default symbols to use for graph creation, "braille", "block" or "tty". #* Default symbols to use for graph creation, "braille", "block" or "tty".
#* "braille" offers the highest resolution but might not be included in all fonts. #* "braille" offers the highest resolution but might not be included in all fonts.
@@ -53,44 +56,47 @@ graph_symbol_proc = "default"
shown_boxes = "net proc cpu mem" shown_boxes = "net proc cpu mem"
#* Update time in milliseconds, recommended 2000 ms or above for better sample times for graphs. #* Update time in milliseconds, recommended 2000 ms or above for better sample times for graphs.
update_ms = 1000 update_ms = 500
#* Processes sorting, "pid" "program" "arguments" "threads" "user" "memory" "cpu lazy" "cpu direct", #* Processes sorting, "pid" "program" "arguments" "threads" "user" "memory" "cpu lazy" "cpu direct",
#* "cpu lazy" sorts top process over time (easier to follow), "cpu direct" updates top process directly. #* "cpu lazy" sorts top process over time (easier to follow), "cpu direct" updates top process directly.
proc_sorting = "cpu direct" proc_sorting = "cpu direct"
#* Reverse sorting order, True or False. #* Reverse sorting order, True or False.
proc_reversed = False proc_reversed = false
#* Show processes as a tree. #* Show processes as a tree.
proc_tree = False proc_tree = false
#* Use the cpu graph colors in the process list. #* Use the cpu graph colors in the process list.
proc_colors = True proc_colors = true
#* Use a darkening gradient in the process list. #* Use a darkening gradient in the process list.
proc_gradient = True proc_gradient = true
#* If process cpu usage should be of the core it's running on or usage of the total available cpu power. #* If process cpu usage should be of the core it's running on or usage of the total available cpu power.
proc_per_core = True proc_per_core = true
#* Show process memory as bytes instead of percent. #* Show process memory as bytes instead of percent.
proc_mem_bytes = True proc_mem_bytes = true
#* Show cpu graph for each process. #* Show cpu graph for each process.
proc_cpu_graphs = True proc_cpu_graphs = true
#* Use /proc/[pid]/smaps for memory information in the process info box (very slow but more accurate) #* Use /proc/[pid]/smaps for memory information in the process info box (very slow but more accurate)
proc_info_smaps = False proc_info_smaps = false
#* Show proc box on left side of screen instead of right. #* Show proc box on left side of screen instead of right.
proc_left = False proc_left = false
#* (Linux) Filter processes tied to the Linux kernel(similar behavior to htop). #* (Linux) Filter processes tied to the Linux kernel(similar behavior to htop).
proc_filter_kernel = False proc_filter_kernel = false
#* In tree-view, always accumulate child process resources in the parent process. #* In tree-view, always accumulate child process resources in the parent process.
proc_aggregate = False proc_aggregate = false
#* Should cpu and memory usage display be preserved for dead processes when paused.
keep_dead_proc_usage = false
#* Sets the CPU stat shown in upper half of the CPU graph, "total" is always available. #* Sets the CPU stat shown in upper half of the CPU graph, "total" is always available.
#* Select from a list of detected attributes from the options menu. #* Select from a list of detected attributes from the options menu.
@@ -104,28 +110,28 @@ cpu_graph_lower = "total"
show_gpu_info = "Auto" show_gpu_info = "Auto"
#* Toggles if the lower CPU graph should be inverted. #* Toggles if the lower CPU graph should be inverted.
cpu_invert_lower = True cpu_invert_lower = true
#* Set to True to completely disable the lower CPU graph. #* Set to True to completely disable the lower CPU graph.
cpu_single_graph = False cpu_single_graph = false
#* Show cpu box at bottom of screen instead of top. #* Show cpu box at bottom of screen instead of top.
cpu_bottom = False cpu_bottom = false
#* Shows the system uptime in the CPU box. #* Shows the system uptime in the CPU box.
show_uptime = True show_uptime = true
#* Shows the CPU package current power consumption in watts. Requires running `make setcap` or `make setuid` or running with sudo. #* Shows the CPU package current power consumption in watts. Requires running `make setcap` or `make setuid` or running with sudo.
show_cpu_watts = True show_cpu_watts = true
#* Show cpu temperature. #* Show cpu temperature.
check_temp = True check_temp = true
#* Which sensor to use for cpu temperature, use options menu to select from list of available sensors. #* Which sensor to use for cpu temperature, use options menu to select from list of available sensors.
cpu_sensor = "Auto" cpu_sensor = "Auto"
#* Show temperatures for cpu cores also if check_temp is True and sensors has been found. #* Show temperatures for cpu cores also if check_temp is True and sensors has been found.
show_coretemp = True show_coretemp = true
#* Set a custom mapping between core and coretemp, can be needed on certain cpus to get correct temperature for correct core. #* Set a custom mapping between core and coretemp, can be needed on certain cpus to get correct temperature for correct core.
#* Use lm-sensors or similar to see which cores are reporting temperatures on your machine. #* Use lm-sensors or similar to see which cores are reporting temperatures on your machine.
@@ -137,17 +143,20 @@ cpu_core_map = ""
temp_scale = "celsius" temp_scale = "celsius"
#* Use base 10 for bits/bytes sizes, KB = 1000 instead of KiB = 1024. #* Use base 10 for bits/bytes sizes, KB = 1000 instead of KiB = 1024.
base_10_sizes = False base_10_sizes = false
#* Show CPU frequency. #* Show CPU frequency.
show_cpu_freq = True show_cpu_freq = true
#* How to calculate CPU frequency, available values: "first", "range", "lowest", "highest" and "average".
freq_mode = "first"
#* Draw a clock at top of screen, formatting according to strftime, empty string to disable. #* Draw a clock at top of screen, formatting according to strftime, empty string to disable.
#* Special formatting: /host = hostname | /user = username | /uptime = system uptime #* Special formatting: /host = hostname | /user = username | /uptime = system uptime
clock_format = "%X" clock_format = "%X"
#* Update main ui in background when menus are showing, set this to false if the menus is flickering too much for comfort. #* Update main ui in background when menus are showing, set this to false if the menus is flickering too much for comfort.
background_update = True background_update = true
#* Custom cpu model name, empty string to disable. #* Custom cpu model name, empty string to disable.
custom_cpu_name = "" custom_cpu_name = ""
@@ -157,43 +166,43 @@ custom_cpu_name = ""
disks_filter = "exclude=/boot /var/cache/pacman/pkg /var/log" disks_filter = "exclude=/boot /var/cache/pacman/pkg /var/log"
#* Show graphs instead of meters for memory values. #* Show graphs instead of meters for memory values.
mem_graphs = True mem_graphs = true
#* Show mem box below net box instead of above. #* Show mem box below net box instead of above.
mem_below_net = False mem_below_net = false
#* Count ZFS ARC in cached and available memory. #* Count ZFS ARC in cached and available memory.
zfs_arc_cached = True zfs_arc_cached = true
#* If swap memory should be shown in memory box. #* If swap memory should be shown in memory box.
show_swap = True show_swap = true
#* Show swap as a disk, ignores show_swap value above, inserts itself after first disk. #* Show swap as a disk, ignores show_swap value above, inserts itself after first disk.
swap_disk = False swap_disk = false
#* If mem box should be split to also show disks info. #* If mem box should be split to also show disks info.
show_disks = True show_disks = false
#* Filter out non physical disks. Set this to False to include network disks, RAM disks and similar. #* Filter out non physical disks. Set this to False to include network disks, RAM disks and similar.
only_physical = True only_physical = true
#* Read disks list from /etc/fstab. This also disables only_physical. #* Read disks list from /etc/fstab. This also disables only_physical.
use_fstab = True use_fstab = true
#* Setting this to True will hide all datasets, and only show ZFS pools. (IO stats will be calculated per-pool) #* Setting this to True will hide all datasets, and only show ZFS pools. (IO stats will be calculated per-pool)
zfs_hide_datasets = False zfs_hide_datasets = false
#* Set to true to show available disk space for privileged users. #* Set to true to show available disk space for privileged users.
disk_free_priv = False disk_free_priv = false
#* Toggles if io activity % (disk busy time) should be shown in regular disk usage view. #* Toggles if io activity % (disk busy time) should be shown in regular disk usage view.
show_io_stat = True show_io_stat = true
#* Toggles io mode for disks, showing big graphs for disk read/write speeds. #* Toggles io mode for disks, showing big graphs for disk read/write speeds.
io_mode = False io_mode = false
#* Set to True to show combined read/write io graphs in io mode. #* Set to True to show combined read/write io graphs in io mode.
io_graph_combined = True io_graph_combined = true
#* Set the top speed for the io graphs in MiB/s (100 by default), use format "mountpoint:speed" separate disks with whitespace " ". #* Set the top speed for the io graphs in MiB/s (100 by default), use format "mountpoint:speed" separate disks with whitespace " ".
#* Example: "/mnt/media:100 /:20 /boot:1". #* Example: "/mnt/media:100 /:20 /boot:1".
@@ -205,10 +214,10 @@ net_download = 100
net_upload = 100 net_upload = 100
#* Use network graphs auto rescaling mode, ignores any values set above and rescales down to 10 Kibibytes at the lowest. #* Use network graphs auto rescaling mode, ignores any values set above and rescales down to 10 Kibibytes at the lowest.
net_auto = True net_auto = true
#* Sync the auto scaling for download and upload to whichever currently has the highest scale. #* Sync the auto scaling for download and upload to whichever currently has the highest scale.
net_sync = False net_sync = false
#* Starts with the Network Interface specified here. #* Starts with the Network Interface specified here.
net_iface = "" net_iface = ""
@@ -217,26 +226,32 @@ net_iface = ""
base_10_bitrate = "Auto" base_10_bitrate = "Auto"
#* Show battery stats in top right if battery is present. #* Show battery stats in top right if battery is present.
show_battery = True show_battery = true
#* Which battery to use if multiple are present. "Auto" for auto detection. #* Which battery to use if multiple are present. "Auto" for auto detection.
selected_battery = "Auto" selected_battery = "Auto"
#* Show power stats of battery next to charge indicator. #* Show power stats of battery next to charge indicator.
show_battery_watts = True show_battery_watts = true
#* Set loglevel for "~/.config/btop/btop.log" levels are: "ERROR" "WARNING" "INFO" "DEBUG". #* Set loglevel for "~/.local/state/btop.log" levels are: "ERROR" "WARNING" "INFO" "DEBUG".
#* The level set includes all lower levels, i.e. "DEBUG" will show all logging info. #* The level set includes all lower levels, i.e. "DEBUG" will show all logging info.
log_level = "WARNING" log_level = "WARNING"
#* Automatically save current settings to config file on exit.
save_config_on_exit = true
#* Measure PCIe throughput on NVIDIA cards, may impact performance on certain cards. #* Measure PCIe throughput on NVIDIA cards, may impact performance on certain cards.
nvml_measure_pcie_speeds = True nvml_measure_pcie_speeds = true
#* Measure PCIe throughput on AMD cards, may impact performance on certain cards. #* Measure PCIe throughput on AMD cards, may impact performance on certain cards.
rsmi_measure_pcie_speeds = True rsmi_measure_pcie_speeds = true
#* Horizontally mirror the GPU graph. #* Horizontally mirror the GPU graph.
gpu_mirror_graph = True gpu_mirror_graph = true
#* Set which GPU vendors to show. Available values are "nvidia amd intel"
shown_gpus = "nvidia amd intel"
#* Custom gpu0 model name, empty string to disable. #* Custom gpu0 model name, empty string to disable.
custom_gpu_name0 = "" custom_gpu_name0 = ""

View File

@@ -1,277 +0,0 @@
# Fastfetch configuration
# Write every argument in different lines.
# Direct arguments will overwrite the corresponding ones in this file.
# Argument keys are not case sensitive.
# Whitespaces are trimmed at the beginning and the end.
# Empty lines or lines starting with # are ignored.
# This file was shipped with 1.3.3.
# Use fastfetch --print-config > ~/.config/fastfetch/config.conf to overwrite this with the current defaults
# Below some often useful options are listed. Uncomment and modify them so they take affect.
# Note that there are a lot more options than the ones listed here, take a look at "fastfetch --help".
# Of course all of them can be made persistent here too.
# Config option:
# Load additional config files.
# Some are shipped with fastfetch, list them with "fastfetch --list-presets".
# Must be a path to a config file or the name of a shipped preset.
# The config file is completly loaded before continuing in the current file, so the placement of this option matters, as later options overwrite already set ones.
# Can be used multiple times to load multiple config files / presets.
#--load-config /path/to/config.txt
# Structure option:
# Sets the modules to use and their order.
# Must be a list of module names, separated by colons.
# List available modules with "fastfetch --list-modules".
# Get the default structure with "fastfetch --print-structure".
# --structure Title:Separator:OS:Host:Kernel:Uptime:Packages:Shell:Resolution:DE:WM:WMTheme:Theme:Icons:Font:Cursor:Terminal:TerminalFont:CPU:GPU:Memory:Disk:Battery:Locale:Break:Colors
--structure
Title
Separator
OS
Host
Kernel
Uptime
Break
Packages
Break
Memory
Disk
Battery
Break
DateTime
Break
Colors
# Multithreading option:
# Sets if fastfetch should use multiple threads to detect the values.
# Must be true or false.
# Default is true.
--multithreading true
# Slow operations option:
# Sets if fastfetch is allowed to use known slow operations to detect more / better values.
# Must be true or false.
# Default is false.
#--allow-slow-operations false
# Linewrap option:
# Sets if fastfetch should disable linewrap during the run.
# Must be true or false.
# Default is true.
#--disable-linewrap true
# Cursor option:
# Sets if fastfetch should hide the console cursor during the run.
# Must be true or false.
# Default is true.
--hide-cursor true
# Logo option:
# Sets the logo to use.
# List available logos with "fastfetch --list-logos".
# Print available logos with "fastfetch --print-logos".
# Must be the name of an available logo or a path to a text file containing a custom logo.
# Default is the current distribution.
#--logo arch
# Logo type option:
# Sets the logo type to use.
# Must be auto, builtin, file, raw, sixel or kitty.
# Default is auto.
--logo-type auto
# Logo width option:
# Sets the width of the logos (in characters) if the logo is an image.
# Must be a positive integer.
# Default is 65.
--logo-width 65
# Logo color options:
# Overwrite a color in the logo. Also works for user provided logos.
# In the user logo, they replace $[1-9]. Use $$ to print a single $ sign.
# Must be linux console color codes or the name of a color.
# Default is the one specified by the logo.
# Use "fastfetch --help color" to learn more and see examples.
# Valid index range is [1-9].
# --logo-color-1 red
# --logo-color-2 32
# [...]
# --logo-color-9 yellow
# Logo padding option:
# Adds a padding to the left and the right side of the logo.
# Must be a positive integer.
# Default is 0.
# --logo-padding 0
# Logo padding left option:
# Adds a padding to the left side of the logo.
# Must be a positive integer.
# Default is 0.
# --logo-padding-left 0
# Logo padding right option:
# Adds a padding to the right side of the logo.
# Must be a positive integer.
# Default is 0.
#--logo-padding-right 0
# Logo print remaining option:
# Sets if the remaining logo should be printed, it is has more lines than modules to show.
# Must be true or false.
# Default is true.
# --logo-print-remaining true
# Color option:
# Sets the color of the keys.
# Must be linux console color codes or the name of a color.
# Default is the primary color of the logo.
# Use "fastfetch --help color" to learn more and see examples.
#--color magenta
# Separator option:
# Sets the string placed between a key and its value.
# Can be any string.
# Default is ": ".
--separator ": "
# Separator string option:
# Sets the string printed by the "separator" module (usually between title and rest of output)
# Must be any string. It is repated / cut to fit perfectly.
# Default is "-"
--separator-string -
# Public IP timeout option:
# Sets the time to wait for the public ip server to respond.
# Must be a positive integer.
# Default is 0 (disabled).
#--public-ip-timeout 0
# OS file option
# Sets the path to the file containing the operating system information.
# Should be a valid path to an existing file.
# Note that you might need to run fastfetch with --recache once for it to take affect.
# Default is /etc/os-release.
#--os-file /etc/os-release
# Player name option
# Sets the name of the player. This is also used in song detection
# Must be the exact name of the player or a dbus address (e.g. org.mpris.MediaPlayer2.spotify)
# Default is the first match starting with org.mpris.MediaPlayer2.
--player-name spotify
# Key options:
# Sets the displayed key of a module
# Can be any string. Some of theme take an argument like a format string. See "fastfetch --help format" for help.
# --os-key OS
# --os-key OS
# --os-key ""
--os-key BTW I use
# --host-key Host
# --host-key ""
--host-key Mainframe
# --kernel-key Kernel
# --kernel-key ""
--kernel-key Penguin
# --uptime-key Uptime
--uptime-key Time without touching grass
# --processes-key Processes
# --packages-key Packages
# --packages-key ""
--packages-key Bloat amount
# --shell-key Shell
# --wm-key ""
# --shell-key ""
--shell-key Krab
# --resolution-key Resolution {1}
# --resolution-key Flex {1}
# --de-key DE
# --wm-key WM
# --wm-theme-key WM Theme
# --theme-key Theme
# --icons-key Icons
# --font-key Font
# --cursor-key Cursor
# --terminal-key Terminal
# --terminal-key ""
# --terminal-font-key Terminal Font
# --terminal-font-key ""
# --cpu-key CPU
# --cpu-key ""
--cpu-key Toaster
# --cpu-usage-key CPU Usage
# --gpu-key GPU {1}
# --gpu-key "﬙"
--gpu-key Crypto Miner
# --memory-key Memory
--memory-key I forgot
# --disk-key Disk ({1})
--disk-key Floppy {1}
# --battery-key Battery {1}
--battery-key Juice
# --locale-key Locale
# --local-ip-key Local IP ({1})
# --public-ip-key Public IP
# --public-ip-key Doxxed
# --public-ip-key AAA Server
--player-key Media Player
# --song-key Song
# --song-key Earrape
--datetime-key Spacetime
# Format options:
# Sets the format string for module values.
# For information on format strings, see "fastfetch --help format".
# To see the parameter they take and their default value, see "fastfetch --help *-format", e.g. "fastfetch --help os-format".
# An empty format string (As they are currently below) will behave as if it was not set.
# --os-format
# --host-format
# --kernel-format
# --uptime-format
# --processes-format
# --packages-format
# --shell-format
# --resolution-format
# --de-format
# --wm-format
# --wm-theme-format
# --theme-format
# --icons-format
# --font-format
# --cursor-format
# --terminal-format
# --terminal-font-format
# --cpu-format
# --cpu-usage-format
# --gpu-format
# --memory-format
# --disk-format
# --battery-format
# --locale-format
# --local-ip-format
# --public-ip-format
# --player-format
# --song-format
# --datetime-format
# Library options:
# Sets an user specific path to a library to load.
# Must be a valid path to a library.
#--lib-PCI /usr/lib/libpci.so
#--lib-vulkan /usr/lib/libvulkan.so
#--lib-wayland /usr/lib/libwayland-client.so
#--lib-xcb-randr /usr/lib/libxcb-randr.so
#--lib-xcb /usr/lib/libxcb.so
#--lib-Xrandr /usr/lib/libXrandr.so
#--lib-X11 /usr/lib/libX11.so
#--lib-gio /usr/lib/libgio-2.0.so
#--lib-DConf /usr/lib/libdconf.so
#--lib-DBus /usr/lib/libdbus-1.so
#--lib-XFConf /usr/lib/libxfconf-0.so
#--lib-rpm /usr/lib/librpm.so
#--lib-imagemagick /usr/lib/libMagickCore-7.Q16HDRI.so
#--lib-z /usr/lib/libz.so

View File

@@ -1,19 +1,263 @@
{ {
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json", "$schema": "https://github.com/fastfetch-cli/fastfetch/raw/master/doc/json_schema.json",
"logo": {
"type": "auto",
"source": "",
"color": {
"1": "",
"2": "",
"3": "",
"4": "",
"5": "",
"6": "",
"7": "",
"8": "",
"9": ""
},
"width": null,
"height": null,
"padding": {
"top": 0,
"left": 0,
"right": 4
},
"printRemaining": true,
"preserveAspectRatio": false,
"recache": false,
"position": "left",
"chafa": {
"fgOnly": false,
"symbols": "block+border+space-wide-inverted"
}
},
"display": {
"stat": false,
"pipe": false,
"showErrors": false,
"disableLinewrap": true,
"hideCursor": false,
"separator": ": ",
"color": {
"keys": "",
"title": "",
"output": "",
"separator": ""
},
"brightColor": true,
"duration": {
"abbreviation": false,
"spaceBeforeUnit": "default"
},
"size": {
"maxPrefix": "YB",
"binaryPrefix": "iec",
"ndigits": 2,
"spaceBeforeUnit": "default"
},
"temp": {
"unit": "D",
"ndigits": 1,
"color": {
"green": "32",
"yellow": "93",
"red": "91"
},
"spaceBeforeUnit": "default"
},
"percent": {
"type": [
"num",
"num-color"
],
"ndigits": 0,
"color": {
"green": "32",
"yellow": "93",
"red": "91"
},
"spaceBeforeUnit": "default",
"width": 0
},
"bar": {
"char": {
"elapsed": "■",
"total": "-"
},
"border": {
"left": "[ ",
"right": " ]",
"leftElapsed": "",
"rightElapsed": ""
},
"color": {
"elapsed": "auto",
"total": "97",
"border": "97"
},
"width": 10
},
"fraction": {
"ndigits": 2
},
"noBuffer": false,
"key": {
"width": 0,
"type": "string",
"paddingLeft": 0
},
"freq": {
"ndigits": 2,
"spaceBeforeUnit": "default"
},
"constants": []
},
"general": {
"thread": true,
"processingTimeout": 5000,
"detectVersion": true,
"playerName": "",
"dsForceDrm": false
},
"modules": [ "modules": [
"title", {
"separator", "type": "title",
"os", "key": " ",
"host", "keyIcon": "",
"kernel", "fqdn": false,
"uptime", "color": {
"user": "",
"at": "",
"host": ""
}
},
{
"type": "separator",
"string": "-",
"outputColor": "",
"times": 0
},
{
"type": "os",
"key": "BTW I use",
"keyIcon": ""
},
{
"type": "host",
"key": "Mainframe",
"keyIcon": "󰌢"
},
{
"type": "kernel",
"key": "Penguin",
"keyIcon": ""
},
{
"type": "uptime",
"key": "Time without touching grass",
"keyIcon": ""
},
"break", "break",
"packages", {
"type": "packages",
"keyIcon": "󰏖",
"key": "Bloat amount",
"disabled": [
"apk"
],
"combined": false
},
"break", "break",
"memory", {
"disk", "type": "cpu",
"battery", "keyIcon": "",
"key": "Toaster",
"temp": false,
"showPeCoreCount": false
},
{
"type": "gpu",
"keyIcon": "󰾲",
"key": "Crypto Miner",
"driverSpecific": false,
"detectionMethod": "pci",
"temp": false,
"hideType": "none",
"percent": {
"green": 50,
"yellow": 80,
"type": 0
}
},
{
"type": "memory",
"keyIcon": "",
"key": "I forgot",
"percent": {
"green": 50,
"yellow": 80,
"type": 0
}
},
{
"type": "disk",
"key": "Floppy",
"keyIcon": "",
"showRegular": true,
"showExternal": true,
"showHidden": false,
"showSubvolumes": false,
"showReadOnly": true,
"showUnknown": false,
"folders": "",
"hideFolders": "/efi:/boot:/boot/*",
"hideFS": "",
"useAvailable": false,
"percent": {
"green": 50,
"yellow": 80,
"type": 0
}
},
{
"type": "battery",
"keyIcon": "",
"key": "Juice",
"temp": false,
"percent": {
"green": 50,
"yellow": 20,
"type": 0
}
},
{
"type": "poweradapter",
"keyIcon": "󰚥"
},
"break", "break",
"colors" {
"type": "shell",
"key": "Krab",
"keyIcon": ""
},
{
"type": "wm",
"keyIcon": "",
"detectPlugin": false
},
"break",
{
"type": "colors",
"key": " ",
"keyIcon": "",
"symbol": "block",
"paddingLeft": 0,
"block": {
"width": 3,
"range": [
0,
15
]
}
}
] ]
} }

View File

@@ -0,0 +1,88 @@
// Load with --config examples/2.jsonc
// Note that you must replace the image path to an existing image to display it.
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
// "logo": {
// "type": "iterm",
// "source": "~/Desktop/apple1.png",
// "width": 28,
// "height": 12
// },
"display": {
"separator": "  ",
"constants": [
"─────────────────" // {$1}, used in Custom module
],
"key": {
"type": "icon",
"paddingLeft": 2
}
},
"modules": [
{
"type": "custom", // HardwareStart
// {#1} is equivalent to `\u001b[1m`. {#} is equivalent to `\u001b[m`
"format": "┌{$1} {#1}Hardware Information{#} {$1}┐"
},
"host",
"cpu",
"gpu",
"disk",
"memory",
"swap",
"display",
"brightness",
"battery",
"poweradapter",
"bluetooth",
"sound",
"gamepad",
{
"type": "custom", // SoftwareStart
"format": "├{$1} {#1}Software Information{#} {$1}┤"
},
{
"type": "title",
"keyIcon": "",
"key": "Title", // Title module has no key by default, so that icon is not displayed
"format": "{user-name}@{host-name}"
},
"os",
"kernel",
"lm",
"de",
"wm",
"shell",
"terminal",
"terminalfont",
"theme",
"icons",
"wallpaper",
"packages",
"uptime",
"media",
{
"type": "localip",
"compact": true
},
{
"type": "publicip",
"timeout": 1000
},
{
"type": "wifi",
"format": "{ssid}"
},
"locale",
{
"type": "custom", // InformationEnd
"format": "└{$1}──────────────────────{$1}┘"
},
{
"type": "colors",
"paddingLeft": 2,
"symbol": "circle"
}
]
}

View File

@@ -0,0 +1,24 @@
// Load with --config examples/3.jsonc
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": {
"type": "small"
},
"display": {
"size": {
"binaryPrefix": "si"
}
},
"modules": [
"vulkan",
"opengl",
"opencl",
"memory",
{
"type": "disk",
"folders": "/:/home:/boot:/efi"
},
"localip"
]
}

View File

@@ -0,0 +1,33 @@
// Load with --config examples/4.jsonc
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": {
"type": "small",
"padding": {
"right": 1
}
},
"display": {
"size": {
"binaryPrefix": "si"
},
"color": "blue",
"separator": "  "
},
"modules": [
{
"type": "datetime",
"key": "Date",
"format": "{1}-{3}-{11}"
},
{
"type": "datetime",
"key": "Time",
"format": "{14}:{17}:{20}"
},
"break",
"player",
"media"
]
}

View File

@@ -0,0 +1,27 @@
// Load with --config examples/5.jsonc
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": null,
"display": {
"color": "magenta"
},
"modules": [
{
"type": "theme",
"key": "T"
},
{
"type": "icons",
"key": "I"
},
{
"type": "font",
"key": "F"
},
{
"type": "cursor",
"key": "C"
}
]
}

View File

@@ -0,0 +1,179 @@
// Load with --config examples/2.jsonc
// Note that you must replace the image path to an existing image to display it.
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"display": {
"separator": " "
},
"modules": [
{
"type": "host",
"key": "╭─󰌢",
"keyColor": "green"
},
{
"type": "cpu",
"key": "├─󰻠",
"keyColor": "green"
},
{
"type": "gpu",
"key": "├─󰍛",
"keyColor": "green"
},
{
"type": "disk",
"key": "├─",
"keyColor": "green"
},
{
"type": "memory",
"key": "├─󰑭",
"keyColor": "green"
},
{
"type": "swap",
"key": "├─󰓡",
"keyColor": "green"
},
{
"type": "display",
"key": "├─󰍹",
"keyColor": "green"
},
{
"type": "brightness",
"key": "├─󰃞",
"keyColor": "green"
},
{
"type": "battery",
"key": "├─",
"keyColor": "green"
},
{
"type": "poweradapter",
"key": "├─",
"keyColor": "green"
},
{
"type": "gamepad",
"key": "├─",
"keyColor": "green"
},
{
"type": "bluetooth",
"key": "├─",
"keyColor": "green"
},
{
"type": "sound",
"key": "╰─",
"keyColor": "green"
},
"break",
{
"type": "shell",
"key": "╭─",
"keyColor": "yellow"
},
{
"type": "terminal",
"key": "├─",
"keyColor": "yellow"
},
{
"type": "terminalfont",
"key": "├─",
"keyColor": "yellow"
},
{
"type": "lm",
"key": "├─󰧨",
"keyColor": "yellow"
},
{
"type": "de",
"key": "├─",
"keyColor": "yellow"
},
{
"type": "wm",
"key": "├─",
"keyColor": "yellow"
},
{
"type": "theme",
"key": "├─󰉼",
"keyColor": "yellow"
},
{
"type": "icons",
"key": "├─󰀻",
"keyColor": "yellow"
},
{
"type": "wallpaper",
"key": "╰─󰸉",
"keyColor": "yellow"
},
"break",
{
"type": "title",
"key": "╭─",
"format": "{user-name}@{host-name}",
"keyColor": "blue"
},
{
"type": "os",
"key": "├─{icon}", // Just get your distro's logo off nerdfonts.com
"keyColor": "blue"
},
{
"type": "kernel",
"key": "├─",
"keyColor": "blue"
},
{
"type": "packages",
"key": "├─󰏖",
"keyColor": "blue"
},
{
"type": "uptime",
"key": "├─󰅐",
"keyColor": "blue"
},
{
"type": "media",
"key": "├─󰝚",
"keyColor": "blue"
},
{
"type": "localip",
"key": "├─󰩟",
"compact": true,
"keyColor": "blue"
},
{
"type": "publicip",
"key": "├─󰩠",
"keyColor": "blue",
"timeout": 1000
},
{
"type": "wifi",
"key": "├─",
"format": "{ssid}",
"keyColor": "blue"
},
{
"type": "locale",
"key": "╰─",
"keyColor": "blue"
}
]
}

View File

@@ -0,0 +1,138 @@
// Load with --config examples/2.jsonc
// Note that you must replace the image path to an existing image to display it.
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": {
"padding": {
"top": 2
}
},
"display": {
"separator": " -> "
},
"modules": [
"title",
"separator",
{
"type": "os",
"key": " OS",
"keyColor": "yellow",
"format": "{2}"
},
{
"type": "os",
"key": "├{icon}", // Just get your distro's logo off nerdfonts.com
"keyColor": "yellow"
},
{
"type": "kernel",
"key": "├",
"keyColor": "yellow"
},
{
"type": "packages",
"key": "├󰏖",
"keyColor": "yellow"
},
{
"type": "shell",
"key": "└",
"keyColor": "yellow"
},
"break",
{
"type": "wm",
"key": " DE/WM",
"keyColor": "blue"
},
{
"type": "lm",
"key": "├󰧨",
"keyColor": "blue"
},
{
"type": "wmtheme",
"key": "├󰉼",
"keyColor": "blue"
},
{
"type": "icons",
"key": "├󰀻",
"keyColor": "blue"
},
{
"type": "terminal",
"key": "├",
"keyColor": "blue"
},
{
"type": "wallpaper",
"key": "└󰸉",
"keyColor": "blue"
},
"break",
{
"type": "host",
"key": "󰌢 PC",
"keyColor": "green"
},
{
"type": "cpu",
"key": "├󰻠",
"keyColor": "green"
},
{
"type": "gpu",
"key": "├󰍛",
"keyColor": "green"
},
{
"type": "disk",
"key": "├",
"keyColor": "green"
},
{
"type": "memory",
"key": "├󰑭",
"keyColor": "green"
},
{
"type": "swap",
"key": "├󰓡",
"keyColor": "green"
},
{
"type": "display",
"key": "├󰍹",
"keyColor": "green"
},
{
"type": "uptime",
"key": "└󰅐",
"keyColor": "green"
},
"break",
{
"type": "sound",
"key": " SOUND",
"keyColor": "cyan"
},
{
"type": "player",
"key": "├󰥠",
"keyColor": "cyan"
},
{
"type": "media",
"key": "└󰝚",
"keyColor": "cyan"
},
"break",
"colors"
]
}

View File

@@ -0,0 +1,41 @@
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": {
"type": "small"
},
"display": {
"separator": " ",
"color": {
"keys": "magenta"
},
"size": {
"ndigits": 0,
"maxPrefix": "MB"
},
"key": {
"type": "icon"
}
},
"modules": [
{
"type": "title",
"color": {
"user": "green",
"at": "red",
"host": "blue"
}
},
"os",
"kernel",
"memory",
"packages",
"uptime",
{
"type": "colors",
"key": "Colors", // For printing icon
"block": {
"range": [1, 6]
}
}
]
}

View File

@@ -0,0 +1,40 @@
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": {
"type": "small"
},
"display": {
"key": {
"width": 11
},
"bar": {
"char": {
"elapsed": "=",
"total": "-"
},
"width": 13
},
"percent": {
"type": 2
}
},
"modules": [
"title",
"separator",
"memory",
"swap",
{
"type": "disk",
"folders": "/"
},
{
"type": "battery",
"key": "Battery"
},
{
"type": "colors",
"paddingLeft": 10,
"symbol": "circle"
}
]
}

View File

@@ -0,0 +1,157 @@
// Load with --config examples/2.jsonc
// Note that you must replace the image path to an existing image to display it.
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": {
"padding": {
"top": 2
}
},
"display": {
"separator": " -> ",
"constants": [
"──────────────────────────────"
]
},
"modules": [
{
"type": "custom",
"format": "┌{$1}{$1}┐",
"outputColor": "90"
},
{
"type": "title",
"keyWidth": 10
},
{
"type": "custom",
"format": "└{$1}{$1}┘",
"outputColor": "90"
},
{
"type": "custom",
"format": " {#90} {#31} {#32} {#33} {#34} {#35} {#36} {#37} {#38} {#39}  {#38} {#37} {#36} {#35} {#34} {#33} {#32} {#31} {#90}"
},
{
"type": "custom",
"format": "┌{$1}{$1}┐",
"outputColor": "90"
},
{
"type": "os",
"key": "{icon} OS",
"keyColor": "yellow"
},
{
"type": "kernel",
"key": "│ ├",
"keyColor": "yellow"
},
{
"type": "packages",
"key": "│ ├󰏖",
"keyColor": "yellow"
},
{
"type": "shell",
"key": "│ └",
"keyColor": "yellow"
},
{
"type": "wm",
"key": " DE/WM",
"keyColor": "blue"
},
{
"type": "lm",
"key": "│ ├󰧨",
"keyColor": "blue"
},
{
"type": "wmtheme",
"key": "│ ├󰉼",
"keyColor": "blue"
},
{
"type": "icons",
"key": "│ ├󰀻",
"keyColor": "blue"
},
{
"type": "terminal",
"key": "│ ├",
"keyColor": "blue"
},
{
"type": "wallpaper",
"key": "│ └󰸉",
"keyColor": "blue"
},
{
"type": "host",
"key": "󰌢 PC",
"keyColor": "green"
},
{
"type": "cpu",
"key": "│ ├󰻠",
"keyColor": "green"
},
{
"type": "gpu",
"key": "│ ├󰍛",
"keyColor": "green"
},
{
"type": "disk",
"key": "│ ├",
"keyColor": "green"
},
{
"type": "memory",
"key": "│ ├󰑭",
"keyColor": "green"
},
{
"type": "swap",
"key": "│ ├󰓡",
"keyColor": "green"
},
{
"type": "uptime",
"key": "│ ├󰅐",
"keyColor": "green"
},
{
"type": "display",
"key": "│ └󰍹",
"keyColor": "green"
},
{
"type": "sound",
"key": " SND",
"keyColor": "cyan"
},
{
"type": "player",
"key": "│ ├󰥠",
"keyColor": "cyan"
},
{
"type": "media",
"key": "│ └󰝚",
"keyColor": "cyan"
},
{
"type": "custom",
"format": "└{$1}{$1}┘",
"outputColor": "90"
},
"break",
{
"type": "custom",
"format": " {#90} {#31} {#32} {#33} {#34} {#35} {#36} {#37} {#38} {#39}  {#38} {#37} {#36} {#35} {#34} {#33} {#32} {#31} {#90}"
}
]
}

View File

@@ -0,0 +1,40 @@
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": {
"type": "small"
},
"display": {
"separator": "-> ",
"color": {
"separator": "red"
}
},
"modules": [
{
"key": "Distro ",
"type": "os"
},
{
"key": "Shell ",
"type": "shell"
},
{
"key": "Terminal ",
"type": "terminal"
},
{
"key": "Display ",
"type": "display"
},
{
"key": "Backlight ",
"type": "brightness"
},
"break",
{
"type": "colors",
"paddingLeft": 6,
"symbol": "circle"
}
]
}

View File

@@ -0,0 +1,115 @@
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": {
"type": "none"
},
"display": {
"separator": "-> ",
"color": {
"separator": "1" // Bold
},
"constants": [
"───────────────────────────"
],
"key": {
"type": "both",
"paddingLeft": 4
}
},
"modules": [
{
"type": "title",
"format": " {user-name-colored}{at-symbol-colored}{host-name-colored}"
},
"break",
{
"type": "custom",
"format": "┌{$1} {#1}System Information{#} {$1}┐"
},
"break",
{
"key": "OS ",
"keyColor": "red",
"type": "os"
},
{
"key": "Machine ",
"keyColor": "green",
"type": "host"
},
{
"key": "Kernel ",
"keyColor": "magenta",
"type": "kernel"
},
{
"key": "Uptime ",
"keyColor": "red",
"type": "uptime"
},
{
"key": "Resolution ",
"keyColor": "yellow",
"type": "display",
"compactType": "original-with-refresh-rate"
},
{
"key": "WM ",
"keyColor": "blue",
"type": "wm"
},
{
"key": "DE ",
"keyColor": "green",
"type": "de"
},
{
"key": "Shell ",
"keyColor": "cyan",
"type": "shell"
},
{
"key": "Terminal ",
"keyColor": "red",
"type": "terminal"
},
{
"key": "CPU ",
"keyColor": "yellow",
"type": "cpu"
},
{
"key": "GPU ",
"keyColor": "blue",
"type": "gpu"
},
{
"key": "Memory ",
"keyColor": "magenta",
"type": "memory"
},
{
"key": "Local IP ",
"keyColor": "red",
"type": "localip",
"compact": true
},
{
"key": "Public IP ",
"keyColor": "cyan",
"type": "publicip",
"timeout": 1000
},
"break",
{
"type": "custom",
"format": "└{$1}────────────────────{$1}┘"
},
"break",
{
"type": "colors",
"paddingLeft": 34,
"symbol": "circle"
}
]
}

View File

@@ -0,0 +1,85 @@
// Inspired by Catnap
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": {
"type": "small",
"padding": {
"top": 1
}
},
"display": {
"separator": " "
},
"modules": [
{
"key": "╭───────────╮",
"type": "custom"
},
{
"key": "│ {#31} user {#keys}│",
"type": "title",
"format": "{user-name}"
},
{
"key": "│ {#32}󰇅 hname {#keys}│",
"type": "title",
"format": "{host-name}"
},
{
"key": "│ {#33}󰅐 uptime {#keys}│",
"type": "uptime"
},
{
"key": "│ {#34}{icon} distro {#keys}│",
"type": "os"
},
{
"key": "│ {#35} kernel {#keys}│",
"type": "kernel"
},
{
"key": "│ {#36}󰇄 desktop {#keys}│",
"type": "de"
},
{
"key": "│ {#31} term {#keys}│",
"type": "terminal"
},
{
"key": "│ {#32} shell {#keys}│",
"type": "shell"
},
{
"key": "│ {#33}󰍛 cpu {#keys}│",
"type": "cpu",
"showPeCoreCount": true
},
{
"key": "│ {#34}󰉉 disk {#keys}│",
"type": "disk",
"folders": "/"
},
{
"key": "│ {#35} memory {#keys}│",
"type": "memory"
},
{
"key": "│ {#36}󰩟 network {#keys}│",
"type": "localip",
"format": "{ipv4} ({ifname})"
},
{
"key": "├───────────┤",
"type": "custom"
},
{
"key": "│ {#39} colors {#keys}│",
"type": "colors",
"symbol": "circle"
},
{
"key": "╰───────────╯",
"type": "custom"
}
]
}

View File

@@ -0,0 +1,88 @@
// Inspired by Catnap
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": {
"type": "small"
},
"display": {
"separator": "",
"key": {
"width": 15
}
},
"modules": [
{
// draw borders first to make colors of left and right border consistant
"key": " user",
"type": "title",
"format": "{user-name}",
"keyColor": "31"
},
{
"key": "󰇅 hname",
"type": "title",
"format": "{host-name}",
"keyColor": "32"
},
{
"key": "󰅐 uptime",
"type": "uptime",
"keyColor": "33"
},
{
"key": "{icon} distro",
"type": "os",
"keyColor": "34"
},
{
"key": " kernel",
"type": "kernel",
"keyColor": "35"
},
{
"key": "󰇄 desktop",
"type": "de",
"keyColor": "36"
},
{
"key": " term",
"type": "terminal",
"keyColor": "31"
},
{
"key": " shell",
"type": "shell",
"keyColor": "32"
},
{
"key": "󰍛 cpu",
"type": "cpu",
"showPeCoreCount": true,
"keyColor": "33"
},
{
"key": "󰉉 disk",
"type": "disk",
"folders": "/",
"keyColor": "34"
},
{
"key": " memory",
"type": "memory",
"keyColor": "35"
},
{
"key": "󰩟 network",
"type": "localip",
"format": "{ipv4} ({ifname})",
"keyColor": "36"
},
{
"key": " colors",
"type": "colors",
"symbol": "circle",
"keyColor": "39"
}
]
}

View File

@@ -0,0 +1,85 @@
// Inspired by Catnap
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": {
"type": "small",
"padding": {
"top": 1
}
},
"display": {
"separator": " "
},
"modules": [
{
"key": "•••••••••••••",
"type": "custom"
},
{
"key": "• {#31} user {#keys}•",
"type": "title",
"format": "{user-name}"
},
{
"key": "• {#32}󰇅 hname {#keys}•",
"type": "title",
"format": "{host-name}"
},
{
"key": "• {#33}󰅐 uptime {#keys}•",
"type": "uptime"
},
{
"key": "• {#34}{icon} distro {#keys}•",
"type": "os"
},
{
"key": "• {#35} kernel {#keys}•",
"type": "kernel"
},
{
"key": "• {#36}󰇄 desktop {#keys}•",
"type": "de"
},
{
"key": "• {#31} term {#keys}•",
"type": "terminal"
},
{
"key": "• {#32} shell {#keys}•",
"type": "shell"
},
{
"key": "• {#33}󰍛 cpu {#keys}•",
"type": "cpu",
"showPeCoreCount": true
},
{
"key": "• {#34}󰉉 disk {#keys}•",
"type": "disk",
"folders": "/"
},
{
"key": "• {#35} memory {#keys}•",
"type": "memory"
},
{
"key": "• {#36}󰩟 network {#keys}•",
"type": "localip",
"format": "{ipv4} ({ifname})"
},
{
"key": "•••••••••••••",
"type": "custom"
},
{
"key": "• {#39} colors {#keys}•",
"type": "colors",
"symbol": "circle"
},
{
"key": "•••••••••••••",
"type": "custom"
}
]
}

View File

@@ -0,0 +1,85 @@
// Inspired by Catnap
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": {
"type": "small",
"padding": {
"top": 1
}
},
"display": {
"separator": " "
},
"modules": [
{
"key": "╔═══════════╗",
"type": "custom"
},
{
"key": "║ {#31} user {#keys}║",
"type": "title",
"format": "{user-name}"
},
{
"key": "║ {#32}󰇅 hname {#keys}║",
"type": "title",
"format": "{host-name}"
},
{
"key": "║ {#33}󰅐 uptime {#keys}║",
"type": "uptime"
},
{
"key": "║ {#34}{icon} distro {#keys}║",
"type": "os"
},
{
"key": "║ {#35} kernel {#keys}║",
"type": "kernel"
},
{
"key": "║ {#36}󰇄 desktop {#keys}║",
"type": "de"
},
{
"key": "║ {#31} term {#keys}║",
"type": "terminal"
},
{
"key": "║ {#32} shell {#keys}║",
"type": "shell"
},
{
"key": "║ {#33}󰍛 cpu {#keys}║",
"type": "cpu",
"showPeCoreCount": true
},
{
"key": "║ {#34}󰉉 disk {#keys}║",
"type": "disk",
"folders": "/"
},
{
"key": "║ {#35} memory {#keys}║",
"type": "memory"
},
{
"key": "║ {#36}󰩟 network {#keys}║",
"type": "localip",
"format": "{ipv4} ({ifname})"
},
{
"key": "╠═══════════╣",
"type": "custom"
},
{
"key": "║ {#39} colors {#keys}║",
"type": "colors",
"symbol": "circle"
},
{
"key": "╚═══════════╝",
"type": "custom"
}
]
}

View File

@@ -0,0 +1,87 @@
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": {
"type": "small",
"padding": {
"top": 1,
"right": 2
}
},
"display": {
"separator": "> ",
"color": {
"separator": "red"
},
"constants": [
"───────────────────────────────────────────────────────────────────────────",
"│\u001b[75C│\u001b[75D"
]
},
"modules": [
{
"format": "{#1}{#keys}╭{$1}╮\u001b[76D {user-name-colored}{at-symbol-colored}{host-name-colored} 🖥 ",
"type": "title"
},
{
"key": "{$2}{#31} kernel ",
"type": "kernel"
},
{
"key": "{$2}{#32}󰅐 uptime ",
"type": "uptime"
},
{
"key": "{$2}{#33}{icon} distro ",
"type": "os"
},
{
"key": "{$2}{#34}󰇄 desktop ",
"type": "de"
},
{
"key": "{$2}{#35} term ",
"type": "terminal"
},
{
"key": "{$2}{#36} shell ",
"type": "shell"
},
{
"key": "{$2}{#35}󰍛 cpu ",
"type": "cpu",
"showPeCoreCount": true,
"temp": true
},
{
"key": "{$2}{#34}󰍛 gpu ",
"type": "gpu"
},
{
"key": "{$2}{#33}󰉉 disk ",
"type": "disk",
"folders": "/"
},
{
"key": "{$2}{#32} memory ",
"type": "memory"
},
{
"key": "{$2}{#31}󰩟 network ",
"type": "localip",
"format": "{ipv4} ({ifname})"
},
{
"format": "{#1}{#keys}├{$1}┤",
"type": "custom"
},
{
"key": "{$2}{#39} colors ",
"type": "colors",
"symbol": "circle"
},
{
"format": "{#1}{#keys}╰{$1}╯",
"type": "custom"
}
]
}

View File

@@ -0,0 +1,87 @@
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": {
"type": "small",
"padding": {
"top": 1,
"right": 2
}
},
"display": {
"separator": "> ",
"color": {
"separator": "red"
},
"constants": [
"═══════════════════════════════════════════════════════════════════════════",
"║\u001b[75C║\u001b[75D"
]
},
"modules": [
{
"format": "{#1}{#keys}╔{$1}╗\u001b[76D {user-name-colored}{at-symbol-colored}{host-name-colored} 💻 ",
"type": "title"
},
{
"key": "{$2}{#31} kernel ",
"type": "kernel"
},
{
"key": "{$2}{#32}󰅐 uptime ",
"type": "uptime"
},
{
"key": "{$2}{#33}{icon} distro ",
"type": "os"
},
{
"key": "{$2}{#34}󰇄 desktop ",
"type": "de"
},
{
"key": "{$2}{#35} term ",
"type": "terminal"
},
{
"key": "{$2}{#36} shell ",
"type": "shell"
},
{
"key": "{$2}{#35}󰍛 cpu ",
"type": "cpu",
"showPeCoreCount": true,
"temp": true
},
{
"key": "{$2}{#34}󰍛 gpu ",
"type": "gpu"
},
{
"key": "{$2}{#33}󰉉 disk ",
"type": "disk",
"folders": "/"
},
{
"key": "{$2}{#32} memory ",
"type": "memory"
},
{
"key": "{$2}{#31}󰩟 network ",
"type": "localip",
"format": "{ipv4} ({ifname})"
},
{
"format": "{#1}{#keys}╠{$1}╣",
"type": "custom"
},
{
"key": "{$2}{#39} colors ",
"type": "colors",
"symbol": "circle"
},
{
"format": "{#1}{#keys}╚{$1}╝",
"type": "custom"
}
]
}

View File

@@ -0,0 +1,189 @@
// _____ _____ _____ _____ _____ _____ _____ _____ _____
// | __| _ | __|_ _| __| __|_ _| | | |
// | __| |__ | | | | __| __| | | | --| |
// |__| |__|__|_____| |_| |__| |_____| |_| |_____|__|__|
//
// By CarterLi - https://github.com/CarterLi
// Homepage - https://github.com/fastfetch-cli/fastfetch
// config.jsonc - ニリ @niri-san
// pokemon-colorscripts - https://gitlab.com/phoneybadger/pokemon-colorscripts
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": {
"source": " _____ _____ _____ _____ _____ _____ _____ _____ _____\n| __| _ | __|_ _| __| __|_ _| | | |\n| __| |__ | | | | __| __| | | | --| |\n|__| |__|__|_____| |_| |__| |_____| |_| |_____|__|__|",
"type": "data",
"position": "top",
"padding": {
"right": 2
}
},
"display": {
"separator": " - "
},
"modules": [
{
"type": "custom", // HardwareInfo
"format": "• {#green}SYSTEM INFORMATION"
},
{
"type": "host",
"key": "HOST",
"format": "{name}{?vendor} ({vendor}){?}",
"keyColor": "green"
},
{
"type": "chassis",
"key": "COMPUTER TYPE",
"keyColor": "green"
},
{
"type": "cpu",
"key": "CPU",
"keyColor": "green"
},
{
"type": "gpu",
"key": "GPU",
"keyColor": "green"
},
{
"type": "memory",
"key": "MEMORY USED",
"keyColor": "green"
},
{
"type": "swap",
"key": "SWAP USED",
"keyColor": "green"
},
{
"type": "disk",
"key": "DISK",
"folders": "/",
"keyColor": "green"
},
{
"type": "custom", // SoftwareInfo
"format": "• {#red}SOFTWARE INFORMATION"
},
{
"type": "os",
"key": "DISTRO",
"keyColor": "red"
},
{
"type": "disk",
"folders": "/", // Use "/System/Volumes/VM" or something else on macOS
"format": "{create-time}",
"key": "INSTALLED DATE",
"keyColor": "red"
},
{
"type": "kernel",
"key": "KERNEL",
"keyColor": "red"
},
{
"type": "packages",
"key": "PACKAGES",
"keyColor": "red"
},
{
"type": "uptime",
"key": "UPTIME",
"keyColor": "red"
},
{
"type": "custom", // DisplayInfo
"format": "• {#blue}DISPLAY INFORMATION"
},
{
"type": "de",
"key": "DESKTOP ENVIRONMENT",
"keyColor": "blue"
},
{
"type": "lm",
"key": "LOGIN MANAGER",
"format": "{type}",
"keyColor": "blue"
},
{
"type": "wm",
"key": "WM",
"keyColor": "blue"
},
{
"type": "wmtheme",
"key": "WM THEME",
"keyColor": "blue"
},
{
"type": "display",
"key": "MONITOR ({name})",
"keyColor": "blue",
"format": "{width}x{height} @ {refresh-rate} Hz - {physical-width}x{physical-height} mm ({inch} inches, {ppi} ppi)"
},
{
"type": "custom", // DesignInfo
"format": "• {#yellow}DESIGN INFORMATION"
},
{
"type": "wallpaper",
"key": "WALLPAPER",
"keyColor": "yellow"
},
{
"type": "theme",
"key": "KDE THEME",
"format": "{1}",
"keyColor": "yellow"
},
{
"type": "icons",
"key": "ICON THEME",
"format": "{1}",
"keyColor": "yellow"
},
{
"type": "font",
"key": "FONT",
"format": "{?1}{1} [Qt]{?}{/1}Unknown", // Remove "[Qt]" if not using Qt
"keyColor": "yellow"
},
{
"type": "terminalfont",
"key": "TERMINAL FONT",
"keyColor": "yellow"
},
{
"type": "cursor",
"key": "CURSOR",
"keyColor": "yellow"
},
{
"type": "custom", // OtherInfo
"format": "• {#cyan}VARIOUS INFORMATION"
},
{
"type": "media",
"key": "NOW PLAYING",
"format": "{?artist}{artist} - {?}{title}",
"keyColor": "cyan"
},
{
"type": "weather",
"key": "WEATHER",
"timeout": 1000,
"keyColor": "cyan"
},
{
"type": "version",
"key": "INFO",
"keyColor": "cyan"
},
"break",
"colors",
"break"
]
}

View File

@@ -0,0 +1,177 @@
// Inspired by https://github.com/usgraphics/TR-100
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": null,
"display": {
"pipe": true,
"key": {
"width": 16
},
"separator": "│ ",
"percent": {
"type": ["bar", "hide-others"]
},
"bar": {
"border": null,
"char": {
"elapsed": "█",
"total": "░"
},
"width": 40
},
"constants": [
"\u001b[42C"
]
},
"modules": [
{
"type": "custom",
"format": "┌┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┐"
},
{
"type": "custom",
"format": "├┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┤"
},
{
"type": "version",
"key": " ",
"format": "│ FASTFETCH v{version} │"
},
{
"type": "custom",
"format": "│ TR-100 MACHINE REPORT │"
},
{
"type": "custom",
"format": "├────────────┬──────────────────────────────────────────┤"
},
{
"type": "os",
"key": "│ OS │{$1}"
},
{
"type": "kernel",
"key": "│ KERNEL │{$1}"
},
{
"type": "custom",
"format": "├────────────┼──────────────────────────────────────────┤"
},
{
"type": "title",
"key": "│ HOSTNAME │{$1}",
"format": "{host-name}"
},
{
"type": "localip",
"key": "│ CLIENT IP │{$1}",
"format": "{ipv4}"
},
{
"type": "localip",
"key": "│ MAC ADDR │{$1}",
"format": "{mac} ({ifname})",
"showIpv4": false,
"showMac": true
},
{
"type": "dns",
"key": "│ DNS │{$1}",
"showType": "ipv4"
},
{
"type": "title",
"key": "│ USER │{$1}",
"format": "{user-name}"
},
{
"type": "host",
"key": "│ MACHINE │{$1}",
"format": "{name}"
},
{
"type": "custom",
"format": "├────────────┼──────────────────────────────────────────┤"
},
{
"type": "cpu",
"key": "│ PROCESSOR │{$1}",
"format": "{name}"
},
{
"type": "cpu",
"key": "│ CORES │{$1}",
"format": "{cores-physical} PHYSICAL CORES / {cores-logical} THREADS",
"showPeCoreCount": false
},
{
"type": "cpu",
"key": "│ CPU FREQ │{$1}",
"format": "{freq-max}{/freq-max}{freq-base}{/}"
},
{
"type": "loadavg",
"compact": false,
"key": "│ LOAD {duration>2}m │{$1}" // pad duration to 2 chars
},
{
"type": "custom",
"format": "├────────────┼──────────────────────────────────────────┤"
},
{
"type": "memory",
"key": "│ MEMORY │{$1}",
"format": "{used} / {total} [{percentage}]",
"percent": {
"type": ["num"]
}
},
{
"type": "memory",
"key": "│ USAGE │{$1}",
"format": "",
"percent": {
"type": ["bar", "hide-others"]
}
},
{
"type": "custom",
"format": "├────────────┼──────────────────────────────────────────┤"
},
{
"type": "disk",
"key": "│ VOLUME │{$1}",
"format": "{size-used} / {size-total} [{size-percentage}]",
"folders": "/",
"percent": {
"type": ["num"]
}
},
{
"type": "disk",
"key": "│ DISK USAGE │{$1}",
"format": "",
"percent": {
"type": ["bar", "hide-others"]
}
},
{
"type": "custom",
"format": "├────────────┼──────────────────────────────────────────┤"
},
{
"type": "users",
"key": "│ LAST LOGIN │{$1}",
"format": "{login-time}{?client-ip} ({client-ip})",
"myselfOnly": true
},
{
"type": "uptime",
"key": "│ UPTIME │{$1}"
},
{
"type": "custom",
"format": "└────────────┴──────────────────────────────────────────┘"
}
]
}

View File

@@ -0,0 +1,48 @@
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": {
"type": "small"
},
"display": {
"constants": [
"██ "
]
},
"modules": [
{
"key": "{$1}Distro",
"keyColor": "38;5;210",
"type": "os"
},
{
"key": "{$1}Kernel",
"keyColor": "38;5;84",
"type": "kernel"
},
{
"key": "{$1}Shell",
"keyColor": "38;5;147",
"type": "shell"
},
{
"key": "{$1}Packages",
"keyColor": "38;5;200",
"type": "packages"
},
{
"key": "{$1}WM",
"keyColor": "38;5;44",
"type": "wm"
},
{
"key": "{$1}CPU",
"keyColor": "38;5;75",
"type": "cpu"
},
{
"key": "{$1}Memory",
"keyColor": "38;5;123",
"type": "memory"
}
]
}

View File

@@ -0,0 +1,113 @@
// Designed for Arch Linux
// Modified from: https://github.com/fastfetch-cli/fastfetch/pull/1025#issuecomment-2177566138
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": {
"source": "arch3",
"color": {
"1": "red",
"2": "yellow"
}
},
"display": {
"color": {
"separator": "blue"
},
"separator": " | ",
"constants": [
">-----------<+>---------------------------------------------<"
]
},
"modules": [
{
"type": "kernel",
"key": " /\\rch Linux",
"keyColor": "magenta"
},
{
"type": "custom",
"format": "{$1}",
"outputColor": "separator"
},
{
"type": "uptime",
"key": " Uptime ",
"keyColor": "green"
},
{
"type": "shell",
"key": " Shell ",
"keyColor": "green"
},
{
"type": "terminal",
"key": " Terminal ",
"keyColor": "green"
},
{
"type": "terminalfont",
"key": " Font ",
"keyColor": "green"
},
{
"type": "packages",
"key": " Packages ",
"keyColor": "green"
},
{
"type": "localip",
"key": " Local IP ",
"keyColor": "green"
},
{
"type": "custom",
"format": "{$1}",
"outputColor": "separator"
},
{
"type": "display",
"key": " Display ",
"keyColor": "cyan"
},
{
"type": "cpu",
"key": " CPU ",
"keyColor": "cyan"
},
{
"type": "gpu",
"key": " GPU ",
"keyColor": "cyan"
},
{
"type": "memory",
"key": " RAM ",
"keyColor": "cyan"
},
{
"type": "swap",
"key": " SWAP ",
"keyColor": "cyan"
},
{
"type": "disk",
"key": " Disk ",
"keyColor": "cyan"
},
{
"type": "battery",
"key": " Battery ",
"keyColor": "cyan"
},
{
"type": "custom",
"format": "{$1}",
"outputColor": "separator"
},
"break",
{
"type": "colors",
"paddingLeft": 15
}
]
}

View File

@@ -0,0 +1,63 @@
// designed for presenting Vanilla Linux
// inspired from imstilllearnin's Vanilla Logo Ultra
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": {
"type": "small"
},
"display": {
"color": {
"output": "cyan"
},
"separator": ""
},
"modules": [
{
"type": "kernel",
"key": "[_Kernel___> ",
"keyColor": "blue"
},
{
"type": "packages",
"outputColor": "white",
"key": " [_Packages_> ",
"keyColor": "green"
},
{
"type": "localip",
"outputColor": "white",
"key": " [_Local_IP_> ",
"keyColor": "green"
},
{
"type": "memory",
"format": "[{3}] {1} / {2}",
"key": " [_RAM______> ",
"keyColor": "magenta"
},
{
"type": "swap",
"format": "[{3}] {1} / {2}",
"key": " [_SWAP_____> ",
"keyColor": "magenta"
},
{
"type": "disk",
"format": "[{3}] {1} / {2} {9}",
"key": " [_Disk_____> ",
"keyColor": "magenta"
},
{
"type": "battery",
"format": "[{4}] {5}",
"key": " [_Battery__> ",
"keyColor": "magenta"
},
"break",
{
"type": "colors",
"paddingLeft": 9,
"symbol": "circle"
}
]
}

View File

@@ -0,0 +1,152 @@
// By jan-rex
// Modified from: https://github.com/fastfetch-cli/fastfetch/discussions/1269
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": {
"padding": {
"top": 2
}
},
"display": {
"separator": "",
"constants": [
// CONSTANT {$1} - COLOR BACKGROUND FOR KEY
"\u001b[48;2;43;43;69m",
// CONSTANT {$2} - COLOR BACKGROUND FOR OUTPUT
"\u001b[48;2;56;59;78m",
// CONSTANT {$3} - VERTICAL BARS AT START AND 75th CHARACTERS FORWARD AND BACKWARD
"\u001b[90m│ │\u001b[60D\u001b[39m",
]
},
"modules": [
// CUSTOM - Top UI bar
{
"type": "custom",
"key": "{#90}{$1}╭─────────────╮",
"format": "{#90}{$2}╭────────────────────────────────────────────────────────────╮",
},
{
"type": "title",
"key": "{#90}{$1}│ {#92}User {#90}│",
"format": "{$2}{$3}{user-name} {#2}[{home-dir}]"
},
{
"type": "users",
"key": "{#90}{$1}│ {#92}Users {#90}│",
"myselfOnly": false,
"format": "{$2}{$3}{1}@{host-name}{/host-name}localhost{/}{?client-ip} {#2}[IP:{client-ip}]{?} [Login time: {login-time}]"
},
{
"type": "datetime",
"key": "{#90}{$1}│ {#92}Datetime {#90}│",
"format": "{$2}{$3}{year}-{month-pretty}-{day-in-month} {hour-pretty}:{minute-pretty}:{second-pretty} [{weekday}] [W{week}] [UTC{offset-from-utc}]"
},
{
"type": "title",
"key": "{#90}{$1}│ {#93}Host {#90}│",
"format": "{$2}{$3}{host-name}"
},
{
"type": "host",
"key": "{#90}{$1}│ {#93}Machine {#90}│",
"format": "{$2}{$3}{name} {#2}{version}"
},
{
"type": "os",
"key": "{#90}{$1}│ {#93}OS {#90}│",
"format": "{$2}{$3}{?pretty-name}{pretty-name}{?}{/pretty-name}{name}{/} {codename} {#2}[v{version}] [{arch}]"
},
{
"type": "kernel",
"key": "{#90}{$1}│ {#93}Kernel {#90}│",
"format": "{$2}{$3}{sysname} {#2}[v{release}]"
},
{
"type": "uptime",
"key": "{#90}{$1}│ {#93}Uptime {#90}│",
"format": "{$2}{$3}{?days}{days} Days + {?}{hours}:{minutes}:{seconds}"
},
{
"type": "cpu",
"key": "{#90}{$1}│ {#91}CPU {#90}│",
"showPeCoreCount": true,
"temp": true,
"format": "{$2}{$3}{name} {#2}[C:{core-types}] [{freq-max}]"
},
{
"type": "gpu",
"key": "{#90}{$1}│ {#91}GPU {#90}│",
"detectionMethod": "auto",
"driverSpecific": true,
"format": "{$2}{$3}{name} {#2}[C:{core-count}]{?frequency} [{frequency}]{?} [{type}]"
},
{
"type": "memory",
"key": "{#90}{$1}│ {#91}Memory {#90}│",
"format": "{$2}{$3}{used} / {total} ({percentage}{$2})"
},
{
"type": "disk",
"key": "{#90}{$1}│ {#91}Disk {#90}│",
"format": "{$2}{$3}{size-used} / {size-total} ({size-percentage}{$2})"
},
{
"type": "poweradapter",
"key": "{#90}{$1}│ {#91}Power {#90}│",
"format": "{$2}{$3}{name}"
},
{
"type": "terminal",
"key": "{#90}{$1}│ {#95}Terminal {#90}│",
"format": "{$2}{$3}{pretty-name} {#2}[{version}] [PID:{pid}]"
},
{
"type": "terminalfont",
"key": "{#90}{$1}│ {#95}Font {#90}│",
"format": "{$2}{$3}{name} {#2}[{size}]"
},
{
"type": "shell",
"key": "{#90}{$1}│ {#95}Shell {#90}│",
"format": "{$2}{$3}{pretty-name} {#2}[v{version}] [PID:{pid}]"
},
{
// localip IPv4
"type": "localip",
"key": "{#90}{$1}│ {#94}Local IPv4 {#90}│",
"showPrefixLen": true,
"showIpv4": true,
"showIpv6": false,
"showMtu": true,
"format": "{$2}{$3}{ifname}: {ipv4} {#2}[MTU:{mtu}]"
},
{
// localip IPv6
"type": "localip",
"key": "{#90}{$1}│ {#94}Local IPv6 {#90}│",
"showPrefixLen": true,
"showIpv4": false,
"showIpv6": true,
"showMtu": true,
"format": "{$2}{$3}{ifname}: {ipv6} {#2}[MTU:{mtu}]"
},
{
"type": "publicip",
"key": "{#90}{$1}│ {#94}Public IPv4 {#90}│",
"ipv6": false,
"format": "{$2}{$3}{ip} {#2}[{location}]"
},
{
"type": "publicip",
"key": "{#90}{$1}│ {#94}Public IPv6 {#90}│",
"ipv6": true,
"format": "{$2}{$3}{ip} {#2}[{location}]"
},
// CUSTOM - Button UI bar
{
"type": "custom",
"key": "{#90}{$1}╰─────────────╯",
"format": "{#90}{$2}╰────────────────────────────────────────────────────────────╯",
}
]
}

View File

@@ -0,0 +1,315 @@
// Based on #1576
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"display": {
"color": {
"keys": "blue"
},
"separator": "",
// Constants are reusable strings referenced by {$1}, {$2}, etc.
// These contain ANSI escape codes for cursor positioning
"constants": [
"──────────────────────────────────────────────", // {$1} - horizontal line for borders
"\u001b[47D", // {$2} - move cursor left 47 columns
"\u001b[47C", // {$3} - move cursor right 47 columns
"\u001b[46C" // {$4} - move cursor right 46 columns
],
"brightColor": false
},
"modules": [
{
"type": "version",
"key": "┌───────────────┬─{$1}┐\u001b[41D",
"format": "\u001b[1m{#keys} {1} - {2} "
},
{
"type": "os",
// Key format breakdown for OS module:
// "│ {icon} \u001b[s{sysname}\u001b[u\u001b[10C│{$3}│{$2}"
//
// │ - Left border of key block
// {icon} - OS icon (defined internally by fastfetch)
// \u001b[s - ANSI escape: save cursor position (ESC[s)
// {sysname} - Format variable: system name (e.g., "Linux", "Darwin")
// \u001b[u - ANSI escape: restore cursor to saved position (ESC[u)
// Necessary because the length of `{sysname}` differs between different platforms
// \u001b[10C - ANSI escape: move cursor right 10 columns (ESC[10C)
// │ - Right border of key block (always 10 columns from left border)
// {$3} - Reference to constants[2]: move cursor right 47 columns
// │ - Right border of value block
// {$2} - Reference to constants[1]: move cursor left 47 columns
//
// This creates a fixed-width layout where the key block is exactly 10 columns wide,
// regardless of the actual content length. The cursor manipulation ensures proper
// alignment for the table-like structure.
"key": "│ {icon} \u001b[s{sysname}\u001b[u\u001b[10C│{$3}│{$2}"
},
{
"type": "datetime",
"key": "│ {icon} Fetched │{$3}│{$2}",
"format": "{year}-{month-pretty}-{day-pretty} {hour-pretty}:{minute-pretty}:{second-pretty} {timezone-name}"
},
{
"type": "locale",
"key": "│ {icon} Locale │{$3}│{$2}"
},
// Hardware section with cyan color theme
{
"type": "custom",
"key": "│{#cyan}┌──────────────┬{$1}┐{#keys}│\u001b[37D",
"format": "{#bright_cyan} Hardware "
},
{
"type": "chassis",
// Similar structure but with cyan color formatting:
// │{#cyan}│ - Left border with cyan color
// {icon} - Chassis icon
// Chassis - Fixed label text
// │{$4}│{#keys}│{$2} - Positioning and borders for value area
"key": "│{#cyan}│ {icon} Chassis │{$4}│{#keys}│{$2}"
},
{
"type": "memory",
"key": "│{#cyan}│ {icon} RAM │{$4}│{#keys}│{$2}"
},
{
"type": "swap",
"key": "│{#cyan}│ {icon} SWAP │{$4}│{#keys}│{$2}"
},
{
"type": "cpu",
"key": "│{#cyan}│ {icon} CPU │{$4}│{#keys}│{$2}",
"showPeCoreCount": true
},
{
"type": "gpu",
"key": "│{#cyan}│ {icon} GPU │{$4}│{#keys}│{$2}"
},
{
"type": "disk",
"key": "│{#cyan}│ {icon} Disk │{$4}│{#keys}│{$2}",
"format": "{size-used} \/ {size-total} ({size-percentage}) - {filesystem}",
},
{
"type": "battery",
"key": "│{#cyan}│ {icon} Battery │{$4}│{#keys}│{$2}"
},
{
"type": "custom",
"key": "│{#cyan}└──────────────┴{$1}┘{#keys}│",
"format": ""
},
// Desktop section with green color theme
{
"type": "custom",
"key": "│{#green}┌──────────────┬{$1}┐{#keys}│\u001b[37D",
"format": "{#bright_green} Desktop "
},
{
"type": "de",
"key": "│{#green}│ {icon} Desktop │{$4}│{#keys}│{$2}"
},
{
"type": "wm",
"key": "│{#green}│ {icon} Session │{$4}│{#keys}│{$2}"
},
{
"type": "display",
"key": "│{#green}│ {icon} Display │{$4}│{#keys}│{$2}",
"compactType": "original-with-refresh-rate"
},
{
"type": "gpu",
"key": "│{#green}│ {icon} G-Driver │{$4}│{#keys}│{$2}",
"format": "{driver}"
},
{
"type": "custom",
"key": "│{#green}└──────────────┴{$1}┘{#keys}│",
"format": ""
},
// Terminal section with yellow color theme
{
"type": "custom",
"key": "│{#yellow}┌──────────────┬{$1}┐{#keys}│\u001b[37D",
"format": "{#bright_yellow} Terminal "
},
{
"type": "shell",
"key": "│{#yellow}│ {icon} Shell │{$4}│{#keys}│{$2}"
},
{
"type": "terminal",
"key": "│{#yellow}│ {icon} Terminal │{$4}│{#keys}│{$2}"
},
{
"type": "terminalfont",
"key": "│{#yellow}│ {icon} Term Font │{$4}│{#keys}│{$2}"
},
{
"type": "terminaltheme",
"key": "│{#yellow}│ {icon} Colors │{$4}│{#keys}│{$2}"
},
{
"type": "packages",
"key": "│{#yellow}│ {icon} Packages │{$4}│{#keys}│{$2}"
},
{
"type": "custom",
"key": "│{#yellow}└──────────────┴{$1}┘{#keys}│",
"format": ""
},
// Development section with red color theme
{
"type": "custom",
"key": "│{#red}┌──────────────┬{$1}┐{#keys}│\u001b[39D",
"format": "{#bright_red} Development "
},
{
"type": "command",
"keyIcon": "", // Custom icon override
"key": "│{#red}│ {icon} Rust │{$4}│{#keys}│{$2}",
"text": "rustc --version",
"format": "rustc {~6,13}" // Print 6th to 13th characters (version number)
},
{
"type": "command",
"condition": {
"!system": "Windows" // Posix version
},
"keyIcon": "",
"key": "│{#red}│ {icon} Clang │{$4}│{#keys}│{$2}",
"text": "clang --version | sed -n 's/.*version \\([0-9][0-9.]*\\).*/\\1/p'",
"format": "clang {}"
},
{
"type": "command",
"condition": {
"system": "Windows" // Windows version
},
"keyIcon": "",
"key": "│{#red}│ {icon} Clang │{$4}│{#keys}│{$2}",
"text": "clang --version | findstr version", // Finds the line with "version"
"format": "clang {~-6}" // Prints the last 6 characters (version number)
},
{
"type": "command",
"keyIcon": "",
"key": "│{#red}│ {icon} NodeJS │{$4}│{#keys}│{$2}",
"text": "node --version",
"format": "node {~1}" // {~1} removes first character (v)
},
{
"type": "command",
"keyIcon": "",
"key": "│{#red}│ {icon} Go │{$4}│{#keys}│{$2}",
"text": "go version | cut -d' ' -f3",
"format": "go {~2}" // {~2} removes first 2 characters (go)
},
{
"type": "command",
"keyIcon": "",
"key": "│{#red}│ {icon} Zig │{$4}│{#keys}│{$2}",
"text": "zig version",
"format": "zig {}"
},
{
"type": "editor",
"key": "│{#red}│ {icon} Editor │{$4}│{#keys}│{$2}"
},
{
"type": "command",
"keyIcon": "󰊢",
"key": "│{#red}│ {icon} Git │{$4}│{#keys}│{$2}",
"text": "git version",
"format": "git {~12}"
},
{
"type": "font",
"key": "│{#red}│ {icon} Interface │{$4}│{#keys}│{$2}"
},
{
"type": "custom",
"key": "│{#red}└──────────────┴{$1}┘{#keys}│",
"format": ""
},
// Uptime section with magenta color theme
{
"type": "custom",
"key": "│{#magenta}┌──────────────┬{$1}┐{#keys}│\u001b[36D",
"format": "{#bright_magenta} Uptime "
},
{
"type": "uptime",
"key": "│{#magenta}│ {icon} Uptime │{$4}│{#keys}│{$2}"
},
{
"type": "users",
"myselfOnly": true, // Only show current user
"keyIcon": "",
"key": "│{#magenta}│ {icon} Login │{$4}│{#keys}│{$2}"
},
{
"condition": { // Conditional module: only show on non-macOS
"!system": "macOS"
},
"type": "disk",
"keyIcon": "",
"key": "│{#magenta}│ {icon} OS Age │{$4}│{#keys}│{$2}",
"folders": "/", // Check root filesystem
"format": "{create-time:10} [{days} days]" // Show creation time and age in days
},
{
"condition": { // Conditional module: only show on macOS
"system": "macOS"
},
"type": "disk",
"keyIcon": "",
"key": "│{#magenta}│ {icon} OS Age │{$4}│{#keys}│{$2}",
"folders": "/System/Volumes/VM", // Work around for APFS on macOS
"format": "{create-time:10} [{days} days]"
},
{
"type": "custom",
"key": "│{#magenta}└──────────────┴{$1}┘{#keys}│",
"format": ""
},
{
"type": "custom",
"key": "└─────────────────{$1}┘", // Bottom border of the entire layout
"format": ""
},
// End with color palette and line break
"break", // Add a blank line
"colors" // Display color palette
]
}
/*
Key Format Structure Explanation:
The key format uses a combination of:
1. Unicode box drawing characters ( ) for borders
2. ANSI escape codes for cursor positioning (\u001b[...)
3. Format variables ({icon}, {sysname}, etc.)
4. Constant references ({$1}, {$2}, etc.)
5. Color formatting ({#color})
ANSI Escape Codes Used:
- \u001b[s - Save cursor position (ESC[s)
- \u001b[u - Restore cursor position (ESC[u)
- \u001b[nC - Move cursor right n columns (ESC[nC)
- \u001b[nD - Move cursor left n columns (ESC[nD)
This creates a table-like layout with fixed column widths and proper alignment,
regardless of the actual content length in each field.
For more ANSI escape code reference, see:
https://gist.github.com/fnky/458719343aabd01cfb17a3a4f7296797#cursor-controls
*/

View File

@@ -0,0 +1,165 @@
// Modified from: 24.jsonc
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": {
"padding": {
"top": 2
}
},
"display": {
"separator": "",
"constants": [
// CONSTANT {$1} - VERTICAL BARS AT START AND 75th CHARACTERS FORWARD AND BACKWARD
"\u001b[90m│ │\u001b[60D\u001b[39m"
]
},
"modules": [
// CUSTOM - Top UI bar
{
"type": "custom",
"key": "{#90}╭ Keys ───────╮",
"format": "{#90}╭ Values ────────────────────────────────────────────────────╮",
},
{
"type": "title",
"key": "{#90}│ {#92}User {#90}│",
"format": "{$1}{user-name} {#2}[{home-dir}]"
},
{
"type": "users",
"key": "{#90}│ {#92}Users {#90}│",
"myselfOnly": false,
"format": "{$1}{1}@{host-name}{/host-name}localhost{/}{?client-ip} {#2}[IP:{client-ip}]{?} [Login time: {login-time}]"
},
{
"type": "datetime",
"key": "{#90}│ {#92}Datetime {#90}│",
"format": "{$1}{year}-{month-pretty}-{day-in-month} {hour-pretty}:{minute-pretty}:{second-pretty} {#2}[{weekday}] [W{week}] [UTC{offset-from-utc}]"
},
{
"type": "title",
"key": "{#90}│ {#93}Host {#90}│",
"format": "{$1}{host-name}"
},
{
"type": "host",
"key": "{#90}│ {#93}Machine {#90}│",
"format": "{$1}{name} {#2}{version}"
},
{
"type": "os",
"key": "{#90}│ {#93}OS {#90}│",
"format": "{$1}{?pretty-name}{pretty-name}{?}{/pretty-name}{name}{/} {codename} {#2}[v{version}] [{arch}]"
},
{
"type": "kernel",
"key": "{#90}│ {#93}Kernel {#90}│",
"format": "{$1}{sysname} {#2}[v{release}]"
},
{
"type": "uptime",
"key": "{#90}│ {#93}Uptime {#90}│",
"format": "{$1}{?days}{days} Days + {?}{hours}:{minutes}:{seconds}"
},
{
"type": "cpu",
"key": "{#90}│ {#91}CPU {#90}│",
"showPeCoreCount": true,
"temp": true,
"format": "{$1}{name} {#2}[C:{core-types}] [{freq-max}]"
},
{
"type": "gpu",
"key": "{#90}│ {#91}GPU {#90}│",
"detectionMethod": "auto",
"driverSpecific": true,
"format": "{$1}{name} {#2}[C:{core-count}]{?frequency} [{frequency}]{?} {#2}[{type}]"
},
{
"type": "memory",
"key": "{#90}│ {#91}Memory {#90}│",
"format": "{$1}{used} / {total} ({percentage})"
},
{
"type": "disk",
"key": "{#90}│ {#91}Disk {#90}│",
"format": "{$1}{size-used} / {size-total} ({size-percentage})"
},
{
"type": "poweradapter",
"key": "{#90}│ {#91}Power {#90}│",
"format": "{$1}{name}"
},
{
"type": "terminal",
"key": "{#90}│ {#95}Terminal {#90}│",
"format": "{$1}{pretty-name} {#2}[{version}] [PID:{pid}]"
},
{
"type": "terminalfont",
"key": "{#90}│ {#95}Font {#90}│",
"format": "{$1}{name} {#2}[{size}]"
},
{
"type": "shell",
"key": "{#90}│ {#95}Shell {#90}│",
"format": "{$1}{pretty-name} {#2}[v{version}] [PID:{pid}]"
},
{
// localip IPv4
"type": "localip",
"key": "{#90}│ {#94}Local IPv4 {#90}│",
"showPrefixLen": true,
"showIpv4": true,
"showIpv6": false,
"showMtu": true,
"format": "{$1}{ifname}: {ipv4} {#2}[MTU:{mtu}]"
},
{
// localip IPv6
"type": "localip",
"key": "{#90}│ {#94}Local IPv6 {#90}│",
"showPrefixLen": true,
"showIpv4": false,
"showIpv6": true,
"showMtu": true,
"format": "{$1}{ifname}: {ipv6} {#2}[MTU:{mtu}]"
},
{
"type": "publicip",
"key": "{#90}│ {#94}Public IPv4 {#90}│",
"ipv6": false,
"format": "{$1}{ip} {#2}[{location}]"
},
{
"type": "publicip",
"key": "{#90}│ {#94}Public IPv6 {#90}│",
"ipv6": true,
"format": "{$1}{ip} {#2}[{location}]"
},
// CUSTOM - Button UI bar
{
"type": "custom",
"key": "{#90}╰─────────────╯",
"format": "{#90}╰────────────────────────────────────────────────────────────╯",
},
"break",
{
"type": "custom",
"key": " ",
"format": "{#90}╭ Colors ───────────────────────────────────────────────────────────────────╮",
},
{
"type": "custom",
"format": "{#90}│ {#40} {#41} {#42} {#43} {#44} {#45} {#46} {#47} {#} {#90}│",
},
{
"type": "custom",
"format": "{#90}│ {#100} {#101} {#102} {#103} {#104} {#105} {#106} {#107} {#} {#90}│",
},
{
"type": "custom",
"format": "{#90}╰───────────────────────────────────────────────────────────────────────────╯",
},
]
}

View File

@@ -0,0 +1,49 @@
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": {
"type": "small",
"padding": {
"top": 1
}
},
"display": {
"separator": " "
},
"modules": [
"break",
"title",
{
"type": "os",
"key": "os ",
"keyColor": "red"
},
{
"type": "kernel",
"key": "kernel",
"keyColor": "green"
},
{
"type": "host",
"format": "{vendor} {family}",
"key": "host ",
"keyColor": "yellow"
},
{
"type": "packages",
"key": "pkgs ",
"keyColor": "blue"
},
{
"type": "uptime",
"format": "{?days}{days}d {?}{hours}h {minutes}m",
"key": "uptime",
"keyColor": "magenta"
},
{
"type": "memory",
"key": "memory",
"keyColor": "cyan"
},
"break"
]
}

View File

@@ -0,0 +1,63 @@
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": {
"type": "small"
},
"display": {
"separator": " ",
"key": {
"type": "both"
},
"bar": {
"border": {
"left": "\uee00",
"leftElapsed": "\uee03",
"right": "\uee02",
"rightElapsed": "\uee05"
},
"char": {
"total": "\uee01",
"elapsed": "\uee04"
},
"color": {
"total": null
}
},
"percent": {
"type": [
"bar",
"bar-monochrome"
]
}
},
"modules": [
"title",
"separator",
{
"type": "memory",
"key": "MEM"
},
{
"type": "swap",
"key": "SWP"
},
{
"type": "disk",
"folders": "/",
"key": "DSK"
},
{
"type": "battery",
"key": "BAT"
},
{
"type": "brightness",
"key": "BGT"
},
{
"type": "colors",
"paddingLeft": 6,
"symbol": "circle"
}
]
}

View File

@@ -0,0 +1,136 @@
// #1887
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": null,
"display": {
"constants": [
"\u001b[s\u001b[33C│\u001b[u",
" » "
],
"separator": "",
"percent": {
"type": ["num", "bar"]
},
"brightColor": false,
"bar": {
"border": {
"left": "[",
"leftElapsed": "[",
"right": "]",
"rightElapsed": "]"
},
"char": {
"elapsed": "─",
"total": "─"
},
"color": {
"elapsed": "default",
"total": "light_black"
},
"width": 16
},
"color": {
"separator": "default",
"keys": "default",
"output": "default"
}
},
"modules": [
"title",
{
"type": "custom",
"format": "┌────「 {#1}OS{#} 」────────────────────────────┐"
},
{
"type": "os",
"key": "│ {icon}{$2}{$1}"
},
{
"type": "disk",
"folders": "/",
"key": "│ {$1}",
"format": "{size-percentage-bar} {size-percentage}"
},
{
"type": "disk",
"folders": "/",
"key": "│ {$1}",
"format": "{size-used} / {size-total}"
},
{
"type": "custom",
"format": "└────────────────────────────────────────┘"
},
"break",
{
"type": "custom",
"format": "┌────「 {#1}UI{#} 」────────────────────────────┐"
},
{
"type": "wm",
"key": "│ {icon}{$2}{$1}"
},
{
"type": "wmtheme",
"key": "│ {icon}{$2}{$1}"
},
{
"type": "custom",
"key": "│ {$1}"
},
{
"type": "display",
"key": "│ {icon}{$2}{$1}",
"format": "{width}x{height} @ {refresh-rate} Hz"
},
{
"type": "custom",
"key": "│ {$1}"
},
{
"type": "terminal",
"key": "│ {icon}{$2}{$1}"
},
{
"type": "terminalfont",
"key": "│ {icon}{$2}{$1}"
},
{
"type": "custom",
"format": "└────────────────────────────────────────┘"
},
"break",
{
"type": "custom",
"format": "┌────「 {#1}HW{#} 」────────────────────────────┐"
},
{
"type": "cpu",
"key": "│ {icon}{$2}{$1}",
"format": "{name}"
},
{
"type": "gpu",
"key": "│ {icon}{$2}{$1}",
"format": "{name}"
},
{
"type": "custom",
"key": "│ {$1}"
},
{
"type": "memory",
"key": "│ {icon}{$2}{$1}",
"format": "{percentage-bar} {percentage}"
},
{
"type": "memory",
"key": "│ {$1}",
"format": "{used} / {total}"
},
{
"type": "custom",
"format": "└────────────────────────────────────────┘"
}
]
}

View File

@@ -0,0 +1,87 @@
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": null,
"display": {
"key": {
"type": "both",
"paddingLeft": 6,
"width": 17
}
},
"modules": [
{
"type": "custom",
"format": "|---------------------: {#1}Hardware{#} : ---------------------|"
},
"break",
{
"keyColor": "green",
"type": "host"
},
{
"keyColor": "green",
"type": "cpu"
},
{
"keyColor": "yellow",
"type": "memory"
},
{
"keyColor": "yellow",
"type": "swap"
},
{
"type": "custom",
"keyIcon": "",
"key": "Disks"
},
{
"type": "disk",
"key": " ",
"format": " [{mountpoint}] - {size-used} / {size-total} ({size-percentage})"
},
"break",
{
"type": "title",
"format": "|-------------------------------------------------------|\u001b[40D: {#1}{user-name} @ {host-name}{#} :"
},
"break",
{
"type": "os",
"keyColor": "cyan"
},
{
"type": "kernel",
"keyColor": "cyan"
},
{
"type": "packages",
"keyColor": "red",
"key": "Pkgs"
},
{
"type": "shell",
"keyColor": "red"
},
{
"type": "terminal",
"key": "Term",
"keyColor": "red"
},
{
"type": "locale",
"keyColor": "magenta"
},
"break",
{
"type": "custom",
"format": "|---------------------: {#1}Software{#} : ---------------------|"
},
"break",
{
"type": "colors",
"symbol": "circle",
"paddingLeft": 8
}
]
}

File diff suppressed because one or more lines are too long

View File

@@ -1,4 +1,4 @@
layer=top layer=overlay
background-color=#1e1e2eee background-color=#1e1e2eee
border-size=2 border-size=2
border-color=#74c7ec border-color=#74c7ec
@@ -8,15 +8,15 @@ font=Cantarell 12
#output=eDP-1 #output=eDP-1
[urgency=high] [urgency=high]
layer=overlay
border-color=#f38ba8 border-color=#f38ba8
[desktop-entry="org.telegram.desktop"] [desktop-entry="org.telegram.desktop"]
layer=top border-color=#74c7ec
[desktop-entry="com.ayugram.desktop"]
border-color=#74c7ec border-color=#74c7ec
[desktop-entry="org.gnome.Fractal"] [desktop-entry="org.gnome.Fractal"]
layer=top
border-color=#74c7ec border-color=#74c7ec
[mode=dnd] [mode=dnd]

View File

@@ -4,19 +4,19 @@
// https://github.com/YaLTeR/niri/wiki/Configuration:-Introduction // https://github.com/YaLTeR/niri/wiki/Configuration:-Introduction
workspace "browser" { workspace "browser" {
open-on-output "DP-1" open-on-output "DP-2"
} }
workspace "terminal" { workspace "terminal" {
open-on-output "DP-1" open-on-output "DP-2"
} }
workspace "chat" { workspace "chat" {
open-on-output "HDMI-A-1" open-on-output "DP-1"
} }
workspace "music" { workspace "music" {
open-on-output "HDMI-A-1" open-on-output "DP-1"
} }
environment { environment {
@@ -91,7 +91,7 @@ output "DP-1" {
// for the resolution. // for the resolution.
// If the mode is omitted altogether or is invalid, niri will pick one automatically. // 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. // Run `niri msg outputs` while inside a niri instance to list all outputs and their modes.
mode "1920x1080@74.973" mode "2560x1440@180.002"
// You can use integer or fractional scale, for example use 1.5 for 150% scale. // You can use integer or fractional scale, for example use 1.5 for 150% scale.
scale 1 scale 1
@@ -111,20 +111,21 @@ output "DP-1" {
// automatically. // automatically.
position x=0 y=0 position x=0 y=0
variable-refresh-rate on-demand=false variable-refresh-rate on-demand=true
focus-at-startup
background-color "#000" background-color "#000"
backdrop-color "#000" backdrop-color "#000"
} }
output "HDMI-A-1" { output "DP-2" {
// off mode "1920x1080@74.973"
mode "1920x1080@60.000"
scale 1 scale 1
transform "normal" transform "normal"
position x=-1920 y=0
position x=-1920 y=180
variable-refresh-rate on-demand=false variable-refresh-rate on-demand=false
focus-at-startup
background-color "#000" background-color "#000"
backdrop-color "#000" backdrop-color "#000"
} }
@@ -286,11 +287,11 @@ layout {
// This line starts waybar, a commonly used bar for Wayland compositors. // This line starts waybar, a commonly used bar for Wayland compositors.
spawn-at-startup "pipewire" spawn-at-startup "pipewire"
spawn-at-startup "pipewire"
spawn-at-startup "pipewire-pulse" spawn-at-startup "pipewire-pulse"
spawn-at-startup "wireplumber" spawn-at-startup "wireplumber"
spawn-at-startup "mako" spawn-at-startup "mako"
spawn-at-startup "waybar" // spawn-at-startup "waybar"
spawn-at-startup "ashell"
// spawn-sh-at-startup "dbus-update-activation-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP DISPLAY XAUTHORITY" // spawn-sh-at-startup "dbus-update-activation-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP DISPLAY XAUTHORITY"
spawn-at-startup "nextcloud" spawn-at-startup "nextcloud"
// spawn-at-startup "/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1" // spawn-at-startup "/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1"
@@ -404,6 +405,15 @@ window-rule {
exclude app-id=r#"^com\.ayugram\.desktop$"# title="^Media viewer$" exclude app-id=r#"^com\.ayugram\.desktop$"# title="^Media viewer$"
exclude app-id=r#"^org\.telegram\.desktop$"# title="^Media viewer$" exclude app-id=r#"^org\.telegram\.desktop$"# title="^Media viewer$"
open-on-workspace "chat" open-on-workspace "chat"
}
window-rule {
match app-id=r#"^org\.telegram\.desktop$"#
match app-id=r#"^com\.ayugram\.desktop$"#
match app-id=r#"^org\.gnome\.Fractal$"#
match app-id=r#"discord"#
match app-id=r#"vesktop"#
match app-id=r#"spotify"#
opacity 0.95 opacity 0.95
} }
@@ -467,8 +477,8 @@ binds {
// Example volume keys mappings for PipeWire & WirePlumber. // Example volume keys mappings for PipeWire & WirePlumber.
// The allow-when-locked=true property makes them work even when the session is locked. // The allow-when-locked=true property makes them work even when the session is locked.
XF86AudioRaiseVolume allow-when-locked=true { spawn-sh "wpctl set-volume $(get-spotify-id) 0.01+"; } XF86AudioRaiseVolume allow-when-locked=true { spawn-sh "wpctl set-volume $(get-spotify-id) 0.02+"; }
XF86AudioLowerVolume allow-when-locked=true { spawn-sh "wpctl set-volume $(get-spotify-id) 0.01-"; } XF86AudioLowerVolume allow-when-locked=true { spawn-sh "wpctl set-volume $(get-spotify-id) 0.02-"; }
XF86AudioMute allow-when-locked=true { spawn "sp" "play"; } XF86AudioMute allow-when-locked=true { spawn "sp" "play"; }
XF86AudioMicMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"; } XF86AudioMicMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"; }
Page_Down allow-when-locked=true {spawn "sp" "next"; } Page_Down allow-when-locked=true {spawn "sp" "next"; }
@@ -646,6 +656,8 @@ binds {
Mod+Ctrl+Space { toggle-window-floating; } Mod+Ctrl+Space { toggle-window-floating; }
Mod+Shift+V { switch-focus-between-floating-and-tiling; } Mod+Shift+V { switch-focus-between-floating-and-tiling; }
// Mod+Shift+Space { spawn "nsticky" "sticky" "toggle-active"; }
// Toggle tabbed column display mode. // Toggle tabbed column display mode.
// Windows in this column will appear as vertical tabs, // Windows in this column will appear as vertical tabs,
// rather than stacked on top of each other. // rather than stacked on top of each other.
@@ -681,7 +693,7 @@ binds {
// moving the mouse or pressing any other key. // moving the mouse or pressing any other key.
// Mod+Shift+P { power-off-monitors; } // Mod+Shift+P { power-off-monitors; }
Mod+Shift+P { spawn "swap-wallpaper"; } Mod+Shift+P { spawn-sh "swap-wallpaper -n"; }
Mod+B { spawn "{{browser}}"; } Mod+B { spawn "{{browser}}"; }
} }

View File

@@ -295,7 +295,8 @@ layout {
spawn-at-startup "pipewire" spawn-at-startup "pipewire"
spawn-at-startup "pipewire-pulse" spawn-at-startup "pipewire-pulse"
spawn-at-startup "wireplumber" spawn-at-startup "wireplumber"
spawn-at-startup "waybar" // spawn-at-startup "waybar"
spawn-at-startup "ashell"
spawn-at-startup "mako" spawn-at-startup "mako"
// spawn-at-startup "dbus-update-activation-environment" "WAYLAND_DISPLAY" "XDG_CURRENT_DESKTOP" "DISPLAY" "XAUTHORITY" // spawn-at-startup "dbus-update-activation-environment" "WAYLAND_DISPLAY" "XDG_CURRENT_DESKTOP" "DISPLAY" "XAUTHORITY"
spawn-at-startup "nextcloud" spawn-at-startup "nextcloud"
@@ -427,7 +428,7 @@ binds {
// Suggested binds for running programs: terminal, app launcher, screen locker. // Suggested binds for running programs: terminal, app launcher, screen locker.
Mod+Return hotkey-overlay-title="Open a Terminal: {{terminal}}" { spawn "{{terminal}}"; } Mod+Return hotkey-overlay-title="Open a Terminal: {{terminal}}" { spawn "{{terminal}}"; }
Mod+P hotkey-overlay-title="Run an Application: fuzzel" { spawn "fuzzel"; } Mod+P hotkey-overlay-title="Run an Application: fuzzel" { spawn "fuzzel"; }
Super+Space allow-when-locked=true hotkey-overlay-title="Lock the Screen: swaylock" { spawn "swaylock"; } Super+Space allow-when-locked=true hotkey-overlay-title="Lock the Screen: swaylock" { spawn-sh "playerctl --all-players pause && swaylock"; }
// Super+Space hotkey-overlay-title="Lock the Screen: hyprlock" { spawn "hyprlock"; } // 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. // You can also use a shell. Do this if you need pipes, multiple commands, etc.
@@ -651,7 +652,7 @@ binds {
// moving the mouse or pressing any other key. // moving the mouse or pressing any other key.
// Mod+Shift+P { power-off-monitors; } // Mod+Shift+P { power-off-monitors; }
Mod+Shift+P { spawn "swap-wallpaper"; } Mod+Shift+P { spawn-sh "swap-wallpaper -n"; }
Mod+B { spawn "{{browser}}"; } Mod+B { spawn "{{browser}}"; }
} }

View File

@@ -19,6 +19,7 @@ export BUN_INSTALL="$XDG_DATA_HOME/bun"
export PATH="$PATH:${$(find ~/.local/bin -type d -printf %p:)%%:}" export PATH="$PATH:${$(find ~/.local/bin -type d -printf %p:)%%:}"
export PATH="$PATH:~/.spicetify" export PATH="$PATH:~/.spicetify"
export PATH="$PATH:${$(find ~/.local/share/bun/bin -type d -printf %p:)%%:}" export PATH="$PATH:${$(find ~/.local/share/bun/bin -type d -printf %p:)%%:}"
export PATH="$PATH:$HOME/.lmstudio/bin"
export PATH="$JAVA_HOME/bin:$PATH" export PATH="$JAVA_HOME/bin:$PATH"
export PATH="$BUN_INSTALL/bin:$PATH" export PATH="$BUN_INSTALL/bin:$PATH"
@@ -96,6 +97,10 @@ export ZDOTDIR="$XDG_CONFIG_HOME/zsh"
# export _JAVA_OPTIONS="-Djava.util.prefs.userRoot=${XDG_CONFIG_HOME}/java - Djavafx.cachedir=${XDG_CACHE_HOME}/openjfx" # export _JAVA_OPTIONS="-Djava.util.prefs.userRoot=${XDG_CONFIG_HOME}/java - Djavafx.cachedir=${XDG_CACHE_HOME}/openjfx"
# export _JAVA_OPTIONS=-Djava.util.prefs.userRoot="$XDG_CONFIG_HOME/java" # export _JAVA_OPTIONS=-Djava.util.prefs.userRoot="$XDG_CONFIG_HOME/java"
export JAVA_HOME="/usr/lib/jvm/java-21-openjdk" export JAVA_HOME="/usr/lib/jvm/java-21-openjdk"
export WAKATIME_HOME="$XDG_CONFIG_HOME/wakatime"
export PSQL_HISTORY="$XDG_DATA_HOME/psql_history"
export STACK_ROOT="$XDG_DATA_HOME/stack"
export STACK_XDG=1
# Other program settings # Other program settings
export AWT_TOOLKIT="MToolkit wmname LG3D" # May have to install wmname export AWT_TOOLKIT="MToolkit wmname LG3D" # May have to install wmname

View File

@@ -1,14 +1,18 @@
# vim:fileencoding=utf-8:foldmethod=marker # vim:fileencoding=utf-8:foldmethod=marker
# : App {{{
[app]
overall = { bg = "#faf4ed" }
# : }}}
# : Manager {{{ # : Manager {{{
[mgr] [mgr]
cwd = { fg = "#56949f" } cwd = { fg = "#56949f" }
# Hovered
hovered = { reversed = true }
preview_hovered = { underline = true }
# Find # Find
find_keyword = { fg = "#ea9d34", bold = true, italic = true, underline = true } find_keyword = { fg = "#ea9d34", bold = true, italic = true, underline = true }
find_position = { fg = "#907aa9", bg = "reset", bold = true, italic = true } find_position = { fg = "#907aa9", bg = "reset", bold = true, italic = true }
@@ -17,9 +21,9 @@ find_position = { fg = "#907aa9", bg = "reset", bold = true, italic = true }
symlink_target = { italic = true } symlink_target = { italic = true }
# Marker # Marker
marker_copied = { fg = "#286983", bg = "#286983" } marker_copied = { fg = "#286983", bg = "#286983" }
marker_cut = { fg = "#b4637a", bg = "#b4637a" } marker_cut = { fg = "#b4637a", bg = "#b4637a" }
marker_marked = { fg = "#d7827e", bg = "#d7827e" } marker_marked = { fg = "#d7827e", bg = "#d7827e" }
marker_selected = { fg = "#ea9d34", bg = "#ea9d34" } marker_selected = { fg = "#ea9d34", bg = "#ea9d34" }
# Count # Count
@@ -67,6 +71,17 @@ unset_alt = { fg = "#faf4ed", bg = "#575279", bold = true }
# : }}} # : }}}
# : Indicator of hovered file {{{
[indicator]
parent = { reversed = true }
current = { reversed = true }
preview = { underline = true }
padding = { open = "", close = "" }
# : }}}
# : Status bar {{{ # : Status bar {{{
[status] [status]
@@ -137,6 +152,10 @@ title_info = { fg = "#286983" }
title_warn = { fg = "#ea9d34" } title_warn = { fg = "#ea9d34" }
title_error = { fg = "#b4637a" } title_error = { fg = "#b4637a" }
# Icons
icon_info = ""
icon_warn = ""
icon_error = ""
# : }}} # : }}}
@@ -146,7 +165,7 @@ title_error = { fg = "#b4637a" }
[pick] [pick]
border = { fg = "#286983" } border = { fg = "#286983" }
active = { fg = "#907aa9", bold = true } active = { fg = "#907aa9", bold = true }
inactive = { fg = "#797593"} inactive = { fg = "#797593" }
# : }}} # : }}}
@@ -156,7 +175,7 @@ inactive = { fg = "#797593"}
[input] [input]
border = { fg = "#286983" } border = { fg = "#286983" }
title = { bold = true } title = { bold = true }
value = { fg = "#575279"} value = { fg = "#575279" }
selected = { reversed = true } selected = { reversed = true }
# : }}} # : }}}
@@ -169,6 +188,10 @@ border = { fg = "#286983" }
active = { bg = "#575279", fg = "#faf4ed", bold = true } active = { bg = "#575279", fg = "#faf4ed", bold = true }
inactive = { fg = "#797593" } inactive = { fg = "#797593" }
# Icons
icon_file = ""
icon_folder = ""
icon_command = ""
# : }}} # : }}}
@@ -177,7 +200,7 @@ inactive = { fg = "#797593" }
[tasks] [tasks]
border = { fg = "#286983" } border = { fg = "#286983" }
title = { bold = true} title = { bold = true }
hovered = { fg = "#907aa9", bold = true, reversed = true } hovered = { fg = "#907aa9", bold = true, reversed = true }
# : }}} # : }}}
@@ -188,7 +211,7 @@ hovered = { fg = "#907aa9", bold = true, reversed = true }
[help] [help]
on = { fg = "#56949f" } on = { fg = "#56949f" }
run = { fg = "#907aa9" } run = { fg = "#907aa9" }
desc = { fg = "#ea9d34"} desc = { fg = "#ea9d34" }
hovered = { reversed = true, bold = true } hovered = { reversed = true, bold = true }
footer = { fg = "#faf4ed", bg = "#575279" } footer = { fg = "#faf4ed", bg = "#575279" }
@@ -199,32 +222,32 @@ footer = { fg = "#faf4ed", bg = "#575279" }
[filetype] [filetype]
rules = [ rules = [
# Images # Images
{ mime = "image/*", fg = "#907aa9" }, { mime = "image/*", fg = "#907aa9" },
# Media # Media
{ mime = "{audio,video}/*", fg = "#ea9d34" }, { mime = "{audio,video}/*", fg = "#ea9d34" },
# Archives # Archives
{ mime = "application/{zip,rar,7z*,tar,gzip,xz,zstd,bzip*,lzma,compress,archive,cpio,arj,xar,ms-cab*}", fg = "#b4637a" }, { mime = "application/{zip,rar,7z*,tar,gzip,xz,zstd,bzip*,lzma,compress,archive,cpio,arj,xar,ms-cab*}", fg = "#b4637a" },
# Documents # Documents
{ mime = "application/{pdf,doc,rtf}", fg = "#d7827e" }, { mime = "application/{pdf,doc,rtf}", fg = "#d7827e" },
# Empty files # Empty files
# { mime = "inode/empty", fg = "#b4637a" }, # { mime = "inode/empty", fg = "#b4637a" },
# Special files # Special files
{ name = "*", is = "orphan", fg = "#faf4ed", bg = "#b4637a" }, { url = "*", is = "orphan", fg = "#faf4ed", bg = "#b4637a" },
{ name = "*", is = "exec" , fg = "#56949f" }, { url = "*", is = "exec", fg = "#56949f" },
# Dummy files # Dummy files
{ name = "*", is = "dummy", fg = "#faf4ed", bg = "#b4637a" }, { url = "*", is = "dummy", fg = "#faf4ed", bg = "#b4637a" },
{ name = "*/", is = "dummy", fg = "#faf4ed", bg = "#b4637a" }, { url = "*/", is = "dummy", fg = "#faf4ed", bg = "#b4637a" },
# Fallback # Fallback
{ name = "*", fg = "#575279" }, { url = "*", fg = "#575279" },
{ name = "*/", fg = "#286983" } { url = "*/", fg = "#286983" }
] ]
# : }}} # : }}}

View File

@@ -1,14 +1,18 @@
# vim:fileencoding=utf-8:foldmethod=marker # vim:fileencoding=utf-8:foldmethod=marker
# : App {{{
[app]
overall = { bg = "#232136" }
# : }}}
# : Manager {{{ # : Manager {{{
[mgr] [mgr]
cwd = { fg = "#9ccfd8" } cwd = { fg = "#9ccfd8" }
# Hovered
hovered = { reversed = true }
preview_hovered = { underline = true }
# Find # Find
find_keyword = { fg = "#f6c177", bold = true, italic = true, underline = true } find_keyword = { fg = "#f6c177", bold = true, italic = true, underline = true }
find_position = { fg = "#c4a7e7", bg = "reset", bold = true, italic = true } find_position = { fg = "#c4a7e7", bg = "reset", bold = true, italic = true }
@@ -17,9 +21,9 @@ find_position = { fg = "#c4a7e7", bg = "reset", bold = true, italic = true }
symlink_target = { italic = true } symlink_target = { italic = true }
# Marker # Marker
marker_copied = { fg = "#3e8fb0", bg = "#3e8fb0" } marker_copied = { fg = "#3e8fb0", bg = "#3e8fb0" }
marker_cut = { fg = "#eb6f92", bg = "#eb6f92" } marker_cut = { fg = "#eb6f92", bg = "#eb6f92" }
marker_marked = { fg = "#ea9a97", bg = "#ea9a97" } marker_marked = { fg = "#ea9a97", bg = "#ea9a97" }
marker_selected = { fg = "#f6c177", bg = "#f6c177" } marker_selected = { fg = "#f6c177", bg = "#f6c177" }
# Count # Count
@@ -67,6 +71,17 @@ unset_alt = { fg = "#232136", bg = "#e0def4", bold = true }
# : }}} # : }}}
# : Indicator of hovered file {{{
[indicator]
parent = { reversed = true }
current = { reversed = true }
preview = { underline = true }
padding = { open = "", close = "" }
# : }}}
# : Status bar {{{ # : Status bar {{{
[status] [status]
@@ -137,6 +152,10 @@ title_info = { fg = "#3e8fb0" }
title_warn = { fg = "#f6c177" } title_warn = { fg = "#f6c177" }
title_error = { fg = "#eb6f92" } title_error = { fg = "#eb6f92" }
# Icons
icon_info = ""
icon_warn = ""
icon_error = ""
# : }}} # : }}}
@@ -146,7 +165,7 @@ title_error = { fg = "#eb6f92" }
[pick] [pick]
border = { fg = "#3e8fb0" } border = { fg = "#3e8fb0" }
active = { fg = "#c4a7e7", bold = true } active = { fg = "#c4a7e7", bold = true }
inactive = { fg = "#908caa"} inactive = { fg = "#908caa" }
# : }}} # : }}}
@@ -156,7 +175,7 @@ inactive = { fg = "#908caa"}
[input] [input]
border = { fg = "#3e8fb0" } border = { fg = "#3e8fb0" }
title = { bold = true } title = { bold = true }
value = { fg = "#e0def4"} value = { fg = "#e0def4" }
selected = { reversed = true } selected = { reversed = true }
# : }}} # : }}}
@@ -169,6 +188,10 @@ border = { fg = "#3e8fb0" }
active = { bg = "#e0def4", fg = "#232136", bold = true } active = { bg = "#e0def4", fg = "#232136", bold = true }
inactive = { fg = "#908caa" } inactive = { fg = "#908caa" }
# Icons
icon_file = ""
icon_folder = ""
icon_command = ""
# : }}} # : }}}
@@ -177,7 +200,7 @@ inactive = { fg = "#908caa" }
[tasks] [tasks]
border = { fg = "#3e8fb0" } border = { fg = "#3e8fb0" }
title = { bold = true} title = { bold = true }
hovered = { fg = "#c4a7e7", bold = true, reversed = true } hovered = { fg = "#c4a7e7", bold = true, reversed = true }
# : }}} # : }}}
@@ -188,7 +211,7 @@ hovered = { fg = "#c4a7e7", bold = true, reversed = true }
[help] [help]
on = { fg = "#9ccfd8" } on = { fg = "#9ccfd8" }
run = { fg = "#c4a7e7" } run = { fg = "#c4a7e7" }
desc = { fg = "#f6c177"} desc = { fg = "#f6c177" }
hovered = { reversed = true, bold = true } hovered = { reversed = true, bold = true }
footer = { fg = "#232136", bg = "#e0def4" } footer = { fg = "#232136", bg = "#e0def4" }
@@ -199,32 +222,32 @@ footer = { fg = "#232136", bg = "#e0def4" }
[filetype] [filetype]
rules = [ rules = [
# Images # Images
{ mime = "image/*", fg = "#c4a7e7" }, { mime = "image/*", fg = "#c4a7e7" },
# Media # Media
{ mime = "{audio,video}/*", fg = "#f6c177" }, { mime = "{audio,video}/*", fg = "#f6c177" },
# Archives # Archives
{ mime = "application/{zip,rar,7z*,tar,gzip,xz,zstd,bzip*,lzma,compress,archive,cpio,arj,xar,ms-cab*}", fg = "#eb6f92" }, { mime = "application/{zip,rar,7z*,tar,gzip,xz,zstd,bzip*,lzma,compress,archive,cpio,arj,xar,ms-cab*}", fg = "#eb6f92" },
# Documents # Documents
{ mime = "application/{pdf,doc,rtf}", fg = "#ea9a97" }, { mime = "application/{pdf,doc,rtf}", fg = "#ea9a97" },
# Empty files # Empty files
# { mime = "inode/empty", fg = "#eb6f92" }, # { mime = "inode/empty", fg = "#eb6f92" },
# Special files # Special files
{ name = "*", is = "orphan", fg = "#232136", bg = "#eb6f92" }, { url = "*", is = "orphan", fg = "#232136", bg = "#eb6f92" },
{ name = "*", is = "exec" , fg = "#9ccfd8" }, { url = "*", is = "exec", fg = "#9ccfd8" },
# Dummy files # Dummy files
{ name = "*", is = "dummy", fg = "#232136", bg = "#eb6f92" }, { url = "*", is = "dummy", fg = "#232136", bg = "#eb6f92" },
{ name = "*/", is = "dummy", fg = "#232136", bg = "#eb6f92" }, { url = "*/", is = "dummy", fg = "#232136", bg = "#eb6f92" },
# Fallback # Fallback
{ name = "*", fg = "#e0def4" }, { url = "*", fg = "#e0def4" },
{ name = "*/", fg = "#3e8fb0" } { url = "*/", fg = "#3e8fb0" }
] ]
# : }}} # : }}}

View File

@@ -10,58 +10,58 @@ hash = "e02a788e5b8ae0fb47fd0193dda589cc"
[[plugin.deps]] [[plugin.deps]]
use = "hankertrix/augment-command" use = "hankertrix/augment-command"
rev = "120406f" rev = "7c12bdf"
hash = "e83ccc99739cd500fb1b1014dc45824a" hash = "f7e6d377e4efee567ec6d1c2355f2ca3"
[[plugin.deps]] [[plugin.deps]]
use = "kirasok/torrent-preview" use = "kirasok/torrent-preview"
rev = "f465282" rev = "f465282"
hash = "b89b46a15035a51d010a254858ba9741" hash = "d849ad596b8a77902e62a42403aeba40"
[[plugin.deps]] [[plugin.deps]]
use = "ndtoan96/ouch" use = "ndtoan96/ouch"
rev = "0742fff" rev = "594b8a2"
hash = "2bd799b42b8e42b8ef100310be71f8d1" hash = "c9e628fc0312d198db22ae2fa74883b"
[[plugin.deps]] [[plugin.deps]]
use = "pirafrank/what-size" use = "pirafrank/what-size"
rev = "d896656" rev = "179ebf6"
hash = "62251f94eb67648d42cdfcfb8be0fad2" hash = "57056b9728006881d580ccabe8154a9c"
[[plugin.deps]] [[plugin.deps]]
use = "yazi-rs/plugins:git" use = "yazi-rs/plugins:git"
rev = "8f1d971" rev = "e07bf41"
hash = "63b6c222bf2103b3023389dde5e2ecfe" hash = "270915fa8282a19908449530ff66f7e2"
[[plugin.deps]] [[plugin.deps]]
use = "yazi-rs/plugins:chmod" use = "yazi-rs/plugins:chmod"
rev = "8f1d971" rev = "e07bf41"
hash = "8ad3e90b079190b4905f24a44f4ca06b" hash = "8da0b15a97b5dfd13941d1ecc617ac7c"
[[plugin.deps]] [[plugin.deps]]
use = "yazi-rs/plugins:full-border" use = "yazi-rs/plugins:full-border"
rev = "8f1d971" rev = "e07bf41"
hash = "3996fc74044bc44144b323686f887e1" hash = "3996fc74044bc44144b323686f887e1"
[[plugin.deps]] [[plugin.deps]]
use = "yazi-rs/plugins:mount" use = "yazi-rs/plugins:mount"
rev = "8f1d971" rev = "e07bf41"
hash = "4fccaaf10c36dc2466e2438a386ff017" hash = "563e4068979d1466d3dfc2e70a296947"
[[plugin.deps]] [[plugin.deps]]
use = "yazi-rs/plugins:smart-filter" use = "yazi-rs/plugins:smart-filter"
rev = "8f1d971" rev = "e07bf41"
hash = "bcda8eeb3f4013bae156aecabfc745e8" hash = "407d19bc4fb46eff5fa8ff8337644847"
[[plugin.deps]] [[plugin.deps]]
use = "yazi-rs/plugins:diff" use = "yazi-rs/plugins:diff"
rev = "8f1d971" rev = "e07bf41"
hash = "82376c3381ae915fd799d40f4dd4c6cd" hash = "2f08b8249b57737e7257298a3b2a2edc"
[[plugin.deps]] [[plugin.deps]]
use = "AnirudhG07/rich-preview" use = "AnirudhG07/rich-preview"
rev = "831234e" rev = "573b275"
hash = "ed3363e256e210593f0f8e4cec3e36a9" hash = "c3e2871c9ef244fd181f203791f9b0d2"
[[plugin.deps]] [[plugin.deps]]
use = "macydnah/office" use = "macydnah/office"
@@ -70,30 +70,30 @@ hash = "5805affd3ae8adcb3c72b6997d21c0a6"
[[plugin.deps]] [[plugin.deps]]
use = "boydaihungst/mediainfo" use = "boydaihungst/mediainfo"
rev = "7543154" rev = "dc61636"
hash = "212fe977a845f44da073a397e0170e60" hash = "2fa34959353b6f1a1c33659f50e098fd"
[[plugin.deps]] [[plugin.deps]]
use = "iynaix/time-travel" use = "iynaix/time-travel"
rev = "7e0179e" rev = "aaec6e2"
hash = "69967963fba96295a07b68354fc91ea9" hash = "3d52b2b88c91a4ece2f7ed68ff39bb7b"
[[plugin.deps]] [[plugin.deps]]
use = "imsi32/yatline" use = "imsi32/yatline"
rev = "88bd1c5" rev = "c5d4b48"
hash = "981acbe9b758b1af3a8154c932bb936d" hash = "e6e98d12b1648d1894c2b560d85eeaa7"
[[flavor.deps]]
use = "Mintass/rose-pine"
rev = "8343340"
hash = "e2336631865c0f90276dcbc553d532fc"
[[flavor.deps]] [[flavor.deps]]
use = "Mintass/rose-pine-moon" use = "Mintass/rose-pine-moon"
rev = "aa2d937" rev = "94385fe"
hash = "97cd4819252cb1a9d0f55daa14e481e" hash = "edbe0dfb5db8ff37281dba62adc7e750"
[[flavor.deps]] [[flavor.deps]]
use = "Mintass/rose-pine-dawn" use = "Mintass/rose-pine-dawn"
rev = "5c6d353" rev = "d82f54f"
hash = "d9d9463d5d43ced18e18986d05439ace" hash = "15ae5f83d3770b9ffc276af77f642e2b"
[[flavor.deps]]
use = "Mintass/rose-pine"
rev = "d91f8f2"
hash = "87da3630653b6d272e43658418599188"

View File

@@ -47,7 +47,7 @@ plugin.
## Requirements ## Requirements
- [Yazi][yazi-link] v25.5.31+ - [Yazi][yazi-link] v25.12.29+
- [`7z` or `7zz` command][7z-link] - [`7z` or `7zz` command][7z-link]
- [`file` command][file-command-link] - [`file` command][file-command-link]
@@ -191,7 +191,6 @@ then it will operate on the selected items.
[this section above][augment-section]. [this section above][augment-section].
Videos: Videos:
- When `prompt` is set to `true`: - When `prompt` is set to `true`:
[open-prompt-video] [open-prompt-video]
@@ -258,7 +257,6 @@ then it will operate on the selected items.
[this section above][augment-section]. [this section above][augment-section].
Videos: Videos:
- When `must_have_hovered_item` is `true`: - When `must_have_hovered_item` is `true`:
[extract-must-have-hovered-item-video] [extract-must-have-hovered-item-video]
@@ -304,27 +302,19 @@ then it will operate on the selected items.
[opener] [opener]
extract = [ extract = [
{ run = 'ya pub augmented-extract --list "$@"', desc = "Extract here", for = "unix" }, { run = "ya pub augmented-extract --list %s", desc = "Extract here" },
{ run = 'ya pub augmented-extract --list %*', desc = "Extract here", for = "windows" },
] ]
``` ```
If that exceeds your editor's line length limit, Alternatively, another way to do it is:
another way to do it is:
```toml ```toml
# ~/.config/yazi/yazi.toml for Linux and macOS # ~/.config/yazi/yazi.toml for Linux and macOS
# %AppData%\yazi\config\yazi.toml for Windows # %AppData%\yazi\config\yazi.toml for Windows
[[opener.extract]] [[opener.extract]]
run = 'ya pub augmented-extract --list "$@"' run = "ya pub augmented-extract --list %s"
desc = "Extract here" desc = "Extract here"
for = "unix"
[[opener.extract]]
run = 'ya pub augmented-extract --list %*'
desc = "Extract here"
for = "windows"
``` ```
- The `extract` command supports recursively extracting archives, - The `extract` command supports recursively extracting archives,
@@ -467,7 +457,6 @@ then it will operate on the selected items.
[this section above][augment-section]. [this section above][augment-section].
Videos: Videos:
- When `must_have_hovered_item` is `true`: - When `must_have_hovered_item` is `true`:
[rename-must-have-hovered-item-video] [rename-must-have-hovered-item-video]
@@ -490,7 +479,6 @@ then it will operate on the selected items.
[this section above][augment-section]. [this section above][augment-section].
Videos: Videos:
- When `must_have_hovered_item` is `true`: - When `must_have_hovered_item` is `true`:
[remove-must-have-hovered-item-video] [remove-must-have-hovered-item-video]
@@ -513,7 +501,6 @@ then it will operate on the selected items.
[this section above][augment-section]. [this section above][augment-section].
Videos: Videos:
- When `must_have_hovered_item` is `true`: - When `must_have_hovered_item` is `true`:
[copy-must-have-hovered-item-video] [copy-must-have-hovered-item-video]
@@ -604,7 +591,6 @@ then it will operate on the selected items.
use the default `shell` command provided by Yazi. use the default `shell` command provided by Yazi.
Videos: Videos:
- When `must_have_hovered_item` is `true`: - When `must_have_hovered_item` is `true`:
[shell-must-have-hovered-item-video] [shell-must-have-hovered-item-video]
@@ -623,8 +609,8 @@ then it will operate on the selected items.
- To use this command, the syntax is exactly the same as the default - To use this command, the syntax is exactly the same as the default
`shell` command provided by Yazi. You just provide `shell` command provided by Yazi. You just provide
the command you want and provide any Yazi shell variable, the command you want and provide any Yazi shell variable that
which is documented [here][yazi-shell-variables]. **provides the file path**, which is [documented here][yazi-shell-variables].
The plugin will automatically replace the shell variable you give The plugin will automatically replace the shell variable you give
with the file paths for the item group before executing the command. with the file paths for the item group before executing the command.
@@ -650,7 +636,7 @@ then it will operate on the selected items.
[[mgr.prepend_keymap]] [[mgr.prepend_keymap]]
on = "i" on = "i"
run = "plugin augment-command -- shell '$PAGER $@' --block --exit-if-dir" run = "plugin augment-command -- shell '$PAGER %s' --block --exit-if-dir"
desc = "Open the pager" desc = "Open the pager"
``` ```
@@ -667,7 +653,7 @@ then it will operate on the selected items.
[[mgr.prepend_keymap]] [[mgr.prepend_keymap]]
on = "o" on = "o"
run = "plugin augment-command -- shell '$EDITOR $@' --block --exit-if-dir" run = "plugin augment-command -- shell '$EDITOR %s' --block --exit-if-dir"
desc = "Open the editor" desc = "Open the editor"
``` ```
@@ -692,18 +678,10 @@ the shell command arguments, so here are a few ways to do it:
# %AppData%\yazi\config\keymap.toml on Windows # %AppData%\yazi\config\keymap.toml on Windows
[[mgr.prepend_keymap]] [[mgr.prepend_keymap]]
on = "i" on = "i"
run = "plugin augment-command -- shell --block 'bat -p --pager less $@'" run = "plugin augment-command -- shell --block 'bat -p --pager less %s'"
desc = "Open with bat" desc = "Open with bat"
``` ```
Even though the `$@` argument above is considered
a shell variable in Linux and macOS,
the plugin automatically replaces it with the full path
of the items in the item group,
so it does not need to be quoted with
double quotes `"`, as it is expanded by the plugin,
and not meant to be expanded by the shell.
2. If the arguments to the `shell` command have special 2. If the arguments to the `shell` command have special
shell variables on Linux and macOS, like `$SHELL`, shell variables on Linux and macOS, like `$SHELL`,
or special shell characters like `>`, `|`, or spaces, or special shell characters like `>`, `|`, or spaces,
@@ -765,16 +743,12 @@ the shell command arguments, so here are a few ways to do it:
on = "<C-e>" on = "<C-e>"
run = '''plugin augment-command -- run = '''plugin augment-command --
shell -- shell --
paths=$(for p in $@; do echo "$p"; done | paste -s -d,) paths=$(for p in %s; do echo "$p"; done | paste -s -d,)
thunderbird -compose "attachment='$paths'" thunderbird -compose "attachment='$paths'"
''' '''
desc = "Email files using Mozilla Thunderbird" desc = "Email files using Mozilla Thunderbird"
``` ```
Once again, the `$@` variable above does not need to be quoted
in double quotes `"` as it is expanded by the plugin
instead of the shell.
If the above few methods to avoid using backslashes If the above few methods to avoid using backslashes
within your shell command to escape the quotes are within your shell command to escape the quotes are
still insufficient for your use case, still insufficient for your use case,
@@ -1043,7 +1017,6 @@ in your `keymap.toml` file.
[this section above][augment-section]. [this section above][augment-section].
Videos: Videos:
- When `must_have_hovered_item` is `true`: - When `must_have_hovered_item` is `true`:
[archive-must-have-hovered-item-video] [archive-must-have-hovered-item-video]
@@ -1149,7 +1122,6 @@ in your `keymap.toml` file.
[this section above][augment-section]. [this section above][augment-section].
Videos: Videos:
- When `must_have_hovered_item` is `true`: - When `must_have_hovered_item` is `true`:
[editor-must-have-hovered-item-video] [editor-must-have-hovered-item-video]
@@ -1181,7 +1153,6 @@ in your `keymap.toml` file.
causing a flash and causing Yazi to send a notification. causing a flash and causing Yazi to send a notification.
Videos: Videos:
- When `must_have_hovered_item` is `true`: - When `must_have_hovered_item` is `true`:
[pager-must-have-hovered-item-video] [pager-must-have-hovered-item-video]

View File

@@ -1,4 +1,4 @@
--- @since 25.5.31 --- @since 25.12.29
-- Plugin to make some Yazi commands smarter -- Plugin to make some Yazi commands smarter
-- Written in Lua 5.4 -- Written in Lua 5.4
@@ -24,29 +24,50 @@
-- The type for the archiver list items command -- The type for the archiver list items command
---@alias Archiver.ListItemsCommand fun( ---@alias Archiver.ListItemsCommand fun(
--- self: Archiver, --- self: Archiver,
---): output: CommandOutput|nil, error: Error|nil ---): output: Output?, error: Error?
-- The type for the archiver get items function -- The type for the archiver get items function
---@alias Archiver.GetItems fun( ---@alias Archiver.GetItems fun(
--- self: Archiver, --- self: Archiver,
---): files: string[], directories: string[], error: string|nil ---): files: string[], dirs: string[], result: Archiver.Result
-- The type for the archiver extract function -- The type for the archiver extract function
---@alias Archiver.Extract fun( ---@alias Archiver.Extract fun(
--- self: Archiver, --- self: Archiver,
--- has_only_one_file: boolean|nil, --- has_only_one_file: boolean?,
---): Archiver.Result ---): Archiver.Result
-- The type for the archiver archive function -- The type for the archiver archive function
---@alias Archiver.Archive fun( ---@alias Archiver.Archive fun(
--- self: Archiver, --- self: Archiver,
--- item_paths: string[], --- item_paths: string[],
--- password: string|nil, --- password: string?,
--- encrypt_headers: boolean|nil, --- encrypt_headers: boolean?,
---): Archiver.Result ---): Archiver.Result
-- The type for the archiver command function -- The type for the archiver command function
---@alias Archiver.Command fun(): output: CommandOutput|nil, error: Error|nil ---@alias Archiver.Command fun(): output: Output?, error: Error?
-- The type for the Yazi input options
---@alias YaziInputOptions {
--- title: string,
--- value: string?,
--- obscure: boolean?,
--- pos: AsPos,
--- realtime: boolean?,
--- debounce: number?,
---}
-- The type for the Yazi notification options
---@alias YaziNotificationOptions {
--- title: string,
--- content: string,
--- timeout: number,
--- level: "info"|"warn"|"error"|nil,
---}
-- The type for the Yazi confirm options
---@alias YaziConfirmOptions { pos: AsPos, title: AsLine, body: AsText }
-- The type of the function to get the password options -- The type of the function to get the password options
---@alias GetPasswordOptions fun(is_confirm_password: boolean): YaziInputOptions ---@alias GetPasswordOptions fun(is_confirm_password: boolean): YaziInputOptions
@@ -93,13 +114,13 @@
-- The type for the archiver function result -- The type for the archiver function result
---@class (exact) Archiver.Result ---@class (exact) Archiver.Result
---@field successful boolean Whether the archiver function was successful ---@field successful boolean Whether the archiver function was successful
---@field output string|nil The output of the archiver function ---@field output string? The output of the archiver function
---@field cancelled boolean|nil boolean Whether the archiver was cancelled ---@field cancelled boolean? boolean Whether the archiver was cancelled
---@field error string|nil The error message ---@field error string? The error message
---@field archive_path string|nil The path to the archive ---@field archive_path string? The path to the archive
---@field destination_path string|nil The path to the destination ---@field destination_path string? The path to the destination
---@field extracted_items_path string|nil The path to the extracted items ---@field extracted_items_path string? The path to the extracted items
---@field archiver_name string|nil The name of the archiver ---@field archiver_name string? The name of the archiver
-- The module table -- The module table
---@class AugmentCommandPlugin ---@class AugmentCommandPlugin
@@ -168,7 +189,7 @@ local INPUT_AND_CONFIRM_OPTIONS = {
"title", "title",
"origin", "origin",
"offset", "offset",
"content", "body",
} }
-- The default configuration for the plugin -- The default configuration for the plugin
@@ -221,7 +242,7 @@ local DEFAULT_NOTIFICATION_OPTIONS = {
-- The values are just dummy values -- The values are just dummy values
-- so that I don't have to maintain two -- so that I don't have to maintain two
-- different types for the same thing. -- different types for the same thing.
---@type tab.Preference ---@type tab__Pref
local TAB_PREFERENCE_KEYS = { local TAB_PREFERENCE_KEYS = {
sort_by = "alphabetical", sort_by = "alphabetical",
sort_sensitive = false, sort_sensitive = false,
@@ -300,7 +321,7 @@ local BASE_ARCHIVER_ERROR = table.concat({
-- The base archiver that all archivers inherit from -- The base archiver that all archivers inherit from
---@class Archiver ---@class Archiver
---@field name string The name of the archiver ---@field name string The name of the archiver
---@field command string|nil The shell command for the archiver ---@field command string? The shell command for the archiver
---@field commands string[] The possible archiver commands ---@field commands string[] The possible archiver commands
--- ---
--- Whether the archiver supports preserving file permissions --- Whether the archiver supports preserving file permissions
@@ -334,7 +355,12 @@ end
-- The method to get the archive items -- The method to get the archive items
---@type Archiver.GetItems ---@type Archiver.GetItems
function Archiver:get_items() return {}, {}, BASE_ARCHIVER_ERROR end function Archiver:get_items()
return {}, {}, {
successful = false,
error = BASE_ARCHIVER_ERROR,
}
end
-- The method to extract the archive -- The method to extract the archive
---@type Archiver.Extract ---@type Archiver.Extract
@@ -424,7 +450,7 @@ local get_mime_type_without_prefix_template_pattern =
-- The pattern to get the shell variables in a command -- The pattern to get the shell variables in a command
---@type string ---@type string
local shell_variable_pattern = "[%$%%][%*@0]" local shell_variable_pattern = "%%[hs]%d?"
-- The pattern to match the bat command -- The pattern to match the bat command
---@type string ---@type string
@@ -446,8 +472,8 @@ local bat_command_pattern = "%f[%a]bat%f[%A]"
-- Pass true as the first parameter to get the function -- Pass true as the first parameter to get the function
-- to merge the tables recursively. -- to merge the tables recursively.
---@param deep_or_target table<any, any>|boolean|nil Recursively merge or not ---@param deep_or_target table<any, any>|boolean|nil Recursively merge or not
---@param target table<any, any> The target table to merge ---@param target table<any, any>? The target table to merge
---@param ... table<any, any>[] The tables to merge ---@param ... table<any, any>[]? The tables to merge
---@return table<any, any> merged_table The merged table ---@return table<any, any> merged_table The merged table
local function merge_tables(deep_or_target, target, ...) local function merge_tables(deep_or_target, target, ...)
-- --
@@ -489,6 +515,9 @@ local function merge_tables(deep_or_target, target, ...)
args = { target, ... } args = { target, ... }
end end
-- The target table will not be nil after the checks above
---@cast target_table table<any, any>
-- Initialise the index variable -- Initialise the index variable
local index = #target_table + 1 local index = #target_table + 1
@@ -549,7 +578,7 @@ end
-- Function to split a string into a list -- Function to split a string into a list
---@param given_string string The string to split ---@param given_string string The string to split
---@param separator string|nil The character to split the string by ---@param separator string? The character to split the string by
---@return string[] splitted_strings The list of strings split by the character ---@return string[] splitted_strings The list of strings split by the character
local function string_split(given_string, separator) local function string_split(given_string, separator)
-- --
@@ -705,7 +734,7 @@ end
-- Function to show a warning -- Function to show a warning
---@param warning_message any The warning message ---@param warning_message any The warning message
---@param options YaziNotificationOptions|nil Options for the notification ---@param options YaziNotificationOptions? Options for the notification
---@return nil ---@return nil
local function show_warning(warning_message, options) local function show_warning(warning_message, options)
return ya.notify( return ya.notify(
@@ -718,7 +747,7 @@ end
-- Function to show an error -- Function to show an error
---@param error_message any The error message ---@param error_message any The error message
---@param options YaziNotificationOptions|nil Options for the notification ---@param options YaziNotificationOptions? Options for the notification
---@return nil ---@return nil
local function show_error(error_message, options) local function show_error(error_message, options)
return ya.notify( return ya.notify(
@@ -737,7 +766,7 @@ local function throw_error(error_message, ...)
end end
-- Function to get the theme from an async function -- Function to get the theme from an async function
---@type fun(): Th The theme object ---@type fun(): th The theme object
local get_theme = ya.sync(function(state) return state.theme end) local get_theme = ya.sync(function(state) return state.theme end)
-- Function to get the component option string -- Function to get the component option string
@@ -752,13 +781,13 @@ end
---@param component BuiltInComponents|PluginComponents The name of the component ---@param component BuiltInComponents|PluginComponents The name of the component
---@param defaults { ---@param defaults {
--- prompts: string|string[], -- The default prompts --- prompts: string|string[], -- The default prompts
--- content: string|ui.Line|ui.Text|nil, -- The default contents --- body: string|ui.Line|ui.Text|nil, -- The default body
--- origin: string|nil, -- The default origin --- origin: string?, -- The default origin
--- offset: Position|nil, -- The default offset --- offset: ui.Pos?, -- The default offset
---} ---}
---@param is_plugin_options boolean|nil Whether the options are plugin specific ---@param is_plugin_options boolean? Whether the options are plugin specific
---@param is_confirm boolean|nil Whether the component is the confirm component ---@param is_confirm boolean? Whether the component is the confirm component
---@param title_index integer|nil The index to get the title ---@param title_index integer? The index to get the title
---@return YaziInputOptions|YaziConfirmOptions options The resolved options ---@return YaziInputOptions|YaziConfirmOptions options The resolved options
local function get_user_input_or_confirm_options( local function get_user_input_or_confirm_options(
component, component,
@@ -808,7 +837,7 @@ local function get_user_input_or_confirm_options(
end end
-- Unpack the options -- Unpack the options
local title_option, origin_option, offset_option, content_option = local title_option, origin_option, offset_option, body_option =
table.unpack(option_list) table.unpack(option_list)
-- Get the value of all the options -- Get the value of all the options
@@ -818,7 +847,7 @@ local function get_user_input_or_confirm_options(
or defaults.origin or defaults.origin
or default_options[1] or default_options[1]
local offset = theme_config[offset_option or ""] or {} local offset = theme_config[offset_option or ""] or {}
local content = theme_config[content_option or ""] or defaults.content local body = theme_config[body_option or ""] or defaults.body
-- Get the title -- Get the title
local title = type(raw_title) == "string" and raw_title local title = type(raw_title) == "string" and raw_title
@@ -837,16 +866,16 @@ local function get_user_input_or_confirm_options(
-- Return the options -- Return the options
return { return {
title = title, title = title,
[is_confirm and "pos" or "position"] = position, pos = position,
content = content, body = body,
} }
end end
-- Function to get a password from the user -- Function to get a password from the user
---@param get_password_options GetPasswordOptions Get password options function ---@param get_password_options GetPasswordOptions Get password options function
---@param want_confirmation boolean|nil Whether to get a confirmation password ---@param want_confirmation boolean? Whether to get a confirmation password
---@return string|nil password The password or nil if the user cancelled ---@return string? password The password or nil if the user cancelled
---@return InputEvent|nil event The event for the input function ---@return number? event The event for the input function
local function get_password(get_password_options, want_confirmation) local function get_password(get_password_options, want_confirmation)
-- --
@@ -920,40 +949,38 @@ local function show_overwrite_prompt(file_path_to_overwrite)
ConfigurableComponents.BuiltIn.Overwrite, ConfigurableComponents.BuiltIn.Overwrite,
{ {
prompts = "Overwrite file?", prompts = "Overwrite file?",
content = ui.Line("Will overwrite the following file:"), body = ui.Line("Will overwrite the following file:"),
}, },
false, false,
true true
) )
-- Get the type of the overwrite content -- Get the type of the overwrite body
local overwrite_content_type = type(overwrite_confirm_options.content) ---@cast overwrite_confirm_options YaziConfirmOptions
local overwrite_body_type = type(overwrite_confirm_options.body)
-- Initialise the first line of the content -- Initialise the first line of the body
local first_line = nil local first_line = nil
-- If the content section is a string -- If the body section is a string
if if overwrite_body_type == "string" or overwrite_body_type == "table" then
overwrite_content_type == "string"
or overwrite_content_type == "table"
then
-- --
-- Wrap the string in a line and align it to the center. -- Wrap the string in a line and align it to the center.
first_line = ui.Line(overwrite_confirm_options.content) first_line = ui.Line(overwrite_confirm_options.body)
:align(ui.Align.CENTER) :align(ui.Align.CENTER)
-- Otherwise, just set the first line to the content given -- Otherwise, just set the first line to the body given
else else
first_line = overwrite_confirm_options.content first_line = overwrite_confirm_options.body
end end
-- Create the content for the overwrite prompt -- Create the body for the overwrite prompt
---@cast first_line ui.Line|ui.Span ---@cast first_line ui.Line|ui.Span
overwrite_confirm_options.content = ui.Text({ overwrite_confirm_options.body = ui.Text({
first_line, first_line,
ui.Line(string.rep("", overwrite_confirm_options.pos.w - 2)) ui.Line(string.rep("", overwrite_confirm_options.pos.w - 2))
:style(ui.Style(th.confirm.border)) :style(th.confirm.border)
:align(ui.Align.LEFT), :align(ui.Align.LEFT),
ui.Line(tostring(file_path_to_overwrite)):align(ui.Align.LEFT), ui.Line(tostring(file_path_to_overwrite)):align(ui.Align.LEFT),
}):wrap(ui.Wrap.TRIM) }):wrap(ui.Wrap.TRIM)
@@ -967,7 +994,7 @@ local function show_overwrite_prompt(file_path_to_overwrite)
end end
-- Function to merge the given configuration table with the default one -- Function to merge the given configuration table with the default one
---@param config UserConfiguration|nil The configuration table to merge ---@param config UserConfiguration? The configuration table to merge
---@return UserConfiguration merged_config The merged configuration table ---@return UserConfiguration merged_config The merged configuration table
local function merge_configuration(config) local function merge_configuration(config)
-- --
@@ -1069,7 +1096,7 @@ end
-- Function to initialise the configuration -- Function to initialise the configuration
---@type fun( ---@type fun(
--- user_config: UserConfiguration|nil, -- The configuration object --- user_config: UserConfiguration?, -- The configuration object
---): Configuration The initialised configuration object ---): Configuration The initialised configuration object
local initialise_config = ya.sync(function(state, user_config) local initialise_config = ya.sync(function(state, user_config)
-- --
@@ -1090,7 +1117,7 @@ local initialise_config = ya.sync(function(state, user_config)
end) end)
-- Function to initialise the theme configuration -- Function to initialise the theme configuration
---@type fun(): Th ---@type fun(): th
local initialise_theme = ya.sync(function(state) local initialise_theme = ya.sync(function(state)
-- --
@@ -1130,9 +1157,9 @@ end)
-- Function to try if a shell command exists -- Function to try if a shell command exists
---@param shell_command string The shell command to check ---@param shell_command string The shell command to check
---@param args string[]|nil The arguments to the shell command ---@param args string[]? The arguments to the shell command
---@return boolean shell_command_exists Whether the shell command exists ---@return boolean shell_command_exists Whether the shell command exists
---@return CommandOutput|nil output The output of the shell command ---@return Output? output The output of the shell command
local function async_shell_command_exists(shell_command, args) local function async_shell_command_exists(shell_command, args)
-- --
@@ -1194,9 +1221,9 @@ local subscribe_to_augmented_extract_event = ya.sync(function(_)
end) end)
-- Function to initialise the plugin -- Function to initialise the plugin
---@param opts UserConfiguration|nil The options given to the plugin ---@param opts UserConfiguration? The options given to the plugin
---@return Configuration config The initialised configuration object ---@return Configuration config The initialised configuration object
---@return Th theme The saved theme object ---@return th theme The saved theme object
local function initialise_plugin(opts) local function initialise_plugin(opts)
-- --
@@ -1246,7 +1273,7 @@ local function standardise_mime_type(mime_type)
end end
-- Function to check if a given mime type is an archive -- Function to check if a given mime type is an archive
---@param mime_type string|nil The mime type of the file ---@param mime_type string? The mime type of the file
---@return boolean is_archive Whether the mime type is an archive ---@return boolean is_archive Whether the mime type is an archive
local function is_archive_mime_type(mime_type) local function is_archive_mime_type(mime_type)
-- --
@@ -1266,7 +1293,7 @@ end
-- Function to check if a given file extension -- Function to check if a given file extension
-- is an archive file extension -- is an archive file extension
---@param file_extension string|nil The file extension of the file ---@param file_extension string? The file extension of the file
---@return boolean is_archive Whether the file extension is an archive ---@return boolean is_archive Whether the file extension is an archive
local function is_archive_file_extension(file_extension) local function is_archive_file_extension(file_extension)
-- --
@@ -1335,8 +1362,8 @@ end
-- Function to get a temporary directory url -- Function to get a temporary directory url
-- for the given file path -- for the given file path
---@param path string The path to the item to create a temporary directory ---@param path string The path to the item to create a temporary directory
---@param destination_given boolean|nil Whether the destination was given ---@param destination_given boolean? Whether the destination was given
---@return Url|nil url The url of the temporary directory ---@return Url? url The url of the temporary directory
local function get_temporary_directory_url(path, destination_given) local function get_temporary_directory_url(path, destination_given)
-- --
@@ -1377,8 +1404,8 @@ local get_current_directory = ya.sync(
-- Function to get the path of the hovered item -- Function to get the path of the hovered item
---@type fun( ---@type fun(
--- quote: boolean|nil, -- Whether to escape the characters in the path --- quote: boolean?, -- Whether to escape the characters in the path
---): string|nil The path of the hovered item ---): string? The path of the hovered item
local get_path_of_hovered_item = ya.sync(function(_, quote) local get_path_of_hovered_item = ya.sync(function(_, quote)
-- --
@@ -1425,8 +1452,8 @@ end)
-- Function to get the paths of the selected items -- Function to get the paths of the selected items
---@type fun( ---@type fun(
--- quote: boolean|nil, -- Whether to escape the characters in the path --- quote: boolean?, -- Whether to escape the characters in the path
---): string[]|nil The list of paths of the selected items ---): string[]? The list of paths of the selected items
local get_paths_of_selected_items = ya.sync(function(_, quote) local get_paths_of_selected_items = ya.sync(function(_, quote)
-- --
@@ -1463,7 +1490,7 @@ end)
local get_number_of_tabs = ya.sync(function() return #cx.tabs end) local get_number_of_tabs = ya.sync(function() return #cx.tabs end)
-- Function to get the tab preferences -- Function to get the tab preferences
---@type fun(): tab.Preference ---@type fun(): tab__Pref
local get_tab_preferences = ya.sync(function(_) local get_tab_preferences = ya.sync(function(_)
-- --
@@ -1488,7 +1515,7 @@ end)
-- ItemGroup.Selected for the selected items, -- ItemGroup.Selected for the selected items,
-- and ItemGroup.Prompt to tell the calling function -- and ItemGroup.Prompt to tell the calling function
-- to prompt the user. -- to prompt the user.
---@type fun(): ItemGroup|nil The desired item group ---@type fun(): ItemGroup? The desired item group
local get_item_group_from_state = ya.sync(function(state) local get_item_group_from_state = ya.sync(function(state)
-- --
@@ -1539,7 +1566,7 @@ local get_item_group_from_state = ya.sync(function(state)
end) end)
-- Function to prompt the user for their desired item group -- Function to prompt the user for their desired item group
---@return ItemGroup|nil item_group The item group selected by the user ---@return ItemGroup? item_group The item group selected by the user
local function prompt_for_desired_item_group() local function prompt_for_desired_item_group()
-- --
@@ -1547,7 +1574,7 @@ local function prompt_for_desired_item_group()
local config = get_config() local config = get_config()
-- Get the default item group -- Get the default item group
---@type ItemGroup|nil ---@type ItemGroup?
local default_item_group = config.default_item_group_for_prompt local default_item_group = config.default_item_group_for_prompt
-- Get the input options, which the (h/s) options -- Get the input options, which the (h/s) options
@@ -1598,7 +1625,7 @@ local function prompt_for_desired_item_group()
end end
-- Function to get the item group -- Function to get the item group
---@return ItemGroup|nil item_group The desired item group ---@return ItemGroup? item_group The desired item group
local function get_item_group() local function get_item_group()
-- --
@@ -1619,7 +1646,7 @@ end
-- Function to get all the items in the given directory -- Function to get all the items in the given directory
---@param directory_path string The path to the directory ---@param directory_path string The path to the directory
---@param get_hidden_items boolean Whether to get hidden items ---@param get_hidden_items boolean Whether to get hidden items
---@param directories_only boolean|nil Whether to only get directories ---@param directories_only boolean? Whether to only get directories
---@return string[] directory_items The list of urls to the directory items ---@return string[] directory_items The list of urls to the directory items
local function get_directory_items( local function get_directory_items(
directory_path, directory_path,
@@ -1716,8 +1743,8 @@ end
-- The function to create a new instance of the archiver -- The function to create a new instance of the archiver
---@param archive_path string The path to the archive ---@param archive_path string The path to the archive
---@param config Configuration The configuration object ---@param config Configuration The configuration object
---@param destination_path string|nil The path to extract to ---@param destination_path string? The path to extract to
---@return Archiver|nil instance An instance of the archiver if available ---@return Archiver? instance An instance of the archiver if available
function Archiver:new(archive_path, config, destination_path) function Archiver:new(archive_path, config, destination_path)
-- --
@@ -1774,7 +1801,7 @@ end
-- Function to retry the archiver -- Function to retry the archiver
---@private ---@private
---@param archiver_function Archiver.Command Archiver command to retry ---@param archiver_function Archiver.Command Archiver command to retry
---@param clean_up_wanted boolean|nil Whether to clean up the destination path ---@param clean_up_wanted boolean? Whether to clean up the destination path
---@return Archiver.Result result Result of the archiver function ---@return Archiver.Result result Result of the archiver function
function SevenZip:retry_archiver(archiver_function, clean_up_wanted) function SevenZip:retry_archiver(archiver_function, clean_up_wanted)
-- --
@@ -1898,7 +1925,7 @@ function SevenZip:retry_archiver(archiver_function, clean_up_wanted)
-- Set the width of the component to the input width -- Set the width of the component to the input width
---@cast password_input_options YaziInputOptions ---@cast password_input_options YaziInputOptions
password_input_options.position.w = input_width password_input_options.pos.w = input_width
-- Return the password input options -- Return the password input options
return password_input_options return password_input_options
@@ -1992,15 +2019,11 @@ function SevenZip:get_items()
-- Get the output -- Get the output
local output = archiver_result.output local output = archiver_result.output
-- Get the error
local error = archiver_result.error
-- If the archiver command was not successful, -- If the archiver command was not successful,
-- or the output was nil, -- or the output was nil,
-- then return nil the error message, -- then return the result
-- and nil as the correct password
if not archiver_result.successful or not output then if not archiver_result.successful or not output then
return files, directories, error return files, directories, archiver_result
end end
-- Otherwise, split the output at the newline character -- Otherwise, split the output at the newline character
@@ -2042,16 +2065,15 @@ function SevenZip:get_items()
::continue:: ::continue::
end end
-- Return the list of files, the list of directories, -- Return the list of files, the list of directories and the result
-- the error message, and the password return files, directories, archiver_result
return files, directories, error
end end
-- Function to extract an archive using the command -- Function to extract an archive using the command
---@param extract_files_only boolean|nil Extract the files only or not ---@param extract_files_only boolean? Extract the files only or not
---@param extract_behaviour ExtractBehaviour|nil The extraction behaviour ---@param extract_behaviour ExtractBehaviour? The extraction behaviour
---@return CommandOutput|nil output The output of the command ---@return Output? output The output of the command
---@return Error|nil error The error if any ---@return Error? error The error if any
function SevenZip:extract_command(extract_files_only, extract_behaviour) function SevenZip:extract_command(extract_files_only, extract_behaviour)
-- --
@@ -2128,10 +2150,10 @@ end
-- Function to call the command to add items to an archive -- Function to call the command to add items to an archive
---@param item_paths string[] The path to the items being added to the archive ---@param item_paths string[] The path to the items being added to the archive
---@param password string|nil The password to encrypt the archive with ---@param password string? The password to encrypt the archive with
---@param encrypt_headers boolean|nil Whether to encrypt the archive headers ---@param encrypt_headers boolean? Whether to encrypt the archive headers
---@return CommandOutput|nil output The output of the command ---@return Output? output The output of the command
---@return Error|nil error The error if any ---@return Error? error The error if any
function SevenZip:archive_command(item_paths, password, encrypt_headers) function SevenZip:archive_command(item_paths, password, encrypt_headers)
-- --
@@ -2241,8 +2263,15 @@ function Tar:get_items()
---@type string[] ---@type string[]
local directories = {} local directories = {}
-- If there is no output, return the empty lists and the error -- If there is no output, return the empty lists and the result
if not output then return files, directories, tostring(error) end if not output then
return files,
directories,
{
successful = false,
error = tostring(error),
}
end
-- Otherwise, split the output into lines and iterate over it -- Otherwise, split the output into lines and iterate over it
for _, line in ipairs(string_split(output.stdout, "\n")) do for _, line in ipairs(string_split(output.stdout, "\n")) do
@@ -2268,11 +2297,16 @@ function Tar:get_items()
end end
-- Return the list of files and directories and the error -- Return the list of files and directories and the error
return files, directories, output.stderr return files,
directories,
{
successful = true,
error = output.stderr,
}
end end
-- Function to extract an archive using the command -- Function to extract an archive using the command
---@param extract_behaviour ExtractBehaviour|nil The extract behaviour to use ---@param extract_behaviour ExtractBehaviour? The extract behaviour to use
function Tar:extract_command(extract_behaviour) function Tar:extract_command(extract_behaviour)
-- --
@@ -2437,8 +2471,8 @@ end
---@param archive_path string The path to the archive file ---@param archive_path string The path to the archive file
---@param command SupportedCommands The command the archiver is used for ---@param command SupportedCommands The command the archiver is used for
---@param config Configuration The configuration for the plugin ---@param config Configuration The configuration for the plugin
---@param destination_path string|nil The path to the destination directory ---@param destination_path string? The path to the destination directory
---@return Archiver|nil archiver The archiver for the file type ---@return Archiver? archiver The archiver for the file type
---@return Archiver.Result result The results of getting the archiver ---@return Archiver.Result result The results of getting the archiver
local function get_archiver(archive_path, command, config, destination_path) local function get_archiver(archive_path, command, config, destination_path)
-- --
@@ -2536,7 +2570,7 @@ local function move_extracted_items(archive_url, destination_url)
-- The function to clean up the destination directory -- The function to clean up the destination directory
-- and return the archiver result in the event of an error -- and return the archiver result in the event of an error
---@param error string The error message to return ---@param error string The error message to return
---@param empty_dir_only boolean|nil Whether to remove the empty dir only ---@param empty_dir_only boolean? Whether to remove the empty dir only
---@return Archiver.Result ---@return Archiver.Result
local function fail(error, empty_dir_only) local function fail(error, empty_dir_only)
-- --
@@ -2675,7 +2709,7 @@ end
---@param archive_path string The path to the archive ---@param archive_path string The path to the archive
---@param args Arguments The arguments passed to the plugin ---@param args Arguments The arguments passed to the plugin
---@param config Configuration The configuration object ---@param config Configuration The configuration object
---@param destination_path string|nil The destination path to extract to ---@param destination_path string? The destination path to extract to
---@return Archiver.Result extraction_result The extraction results ---@return Archiver.Result extraction_result The extraction results
local function recursively_extract_archive( local function recursively_extract_archive(
archive_path, archive_path,
@@ -2739,21 +2773,13 @@ local function recursively_extract_archive(
-- Get the list of archive files and directories, -- Get the list of archive files and directories,
-- the error message and the password -- the error message and the password
local archive_files, archive_directories, error = archiver:get_items() local archive_files, archive_directories, archiver_result =
archiver:get_items()
-- If there are no are no archive files and directories -- If there are no are no archive files and directories,
-- return the extraction result
if #archive_files == 0 and #archive_directories == 0 then if #archive_files == 0 and #archive_directories == 0 then
-- return add_additional_info(archiver_result)
-- The extraction result
---@type Archiver.Result
local extraction_result = {
successful = false,
error = error or "Archive is empty",
}
-- Return the extraction result
return add_additional_info(extraction_result)
end end
-- Get if the archive has only one file -- Get if the archive has only one file
@@ -3274,7 +3300,7 @@ end
-- Function to enter or open the created file -- Function to enter or open the created file
---@param item_url Url The url of the item to create ---@param item_url Url The url of the item to create
---@param is_directory boolean|nil Whether the item to create is a directory ---@param is_directory boolean? Whether the item to create is a directory
---@param args Arguments The arguments passed to the plugin ---@param args Arguments The arguments passed to the plugin
---@param config Configuration The configuration object ---@param config Configuration The configuration object
---@return nil ---@return nil
@@ -3890,18 +3916,18 @@ local function handle_quit(args, config)
local quit_confirm_options = local quit_confirm_options =
get_user_input_or_confirm_options(ConfigurableComponents.Plugin.Quit, { get_user_input_or_confirm_options(ConfigurableComponents.Plugin.Quit, {
prompts = "Quit?", prompts = "Quit?",
content = ui.Text({ body = ui.Text({
"There are multiple tabs open.", "There are multiple tabs open.",
"Are you sure you want to quit?", "Are you sure you want to quit?",
}):wrap(ui.Wrap.TRIM), }):wrap(ui.Wrap.TRIM),
}, true, true) }, true, true)
-- Get the type of the quit content -- Get the type of the quit body
local quit_content_type = type(quit_confirm_options.content) local quit_body_type = type(quit_confirm_options.body)
-- If the type of the quit content is a string or a list of strings -- If the type of the quit body is a string or a list of strings
if quit_content_type == "string" or quit_content_type == "table" then if quit_body_type == "string" or quit_body_type == "table" then
quit_confirm_options.content = ui.Text(quit_confirm_options.content) quit_confirm_options.body = ui.Text(quit_confirm_options.body)
:wrap(ui.Wrap.TRIM) :wrap(ui.Wrap.TRIM)
end end
@@ -4641,7 +4667,7 @@ local function handle_editor(args, config)
if not editor then return end if not editor then return end
-- Initialise the shell command -- Initialise the shell command
local shell_command = string.format(editor .. " $@") local shell_command = editor .. " %s"
-- Get the cha object of the hovered file -- Get the cha object of the hovered file
local hovered_item_cha = fs.cha( local hovered_item_cha = fs.cha(
@@ -4653,7 +4679,7 @@ local function handle_editor(args, config)
-- and sudo edit is supported, -- and sudo edit is supported,
-- set the shell command to "sudo -e" -- set the shell command to "sudo -e"
if config.sudo_edit_supported and hovered_item_cha.uid == 0 then if config.sudo_edit_supported and hovered_item_cha.uid == 0 then
shell_command = "sudo -e $@" shell_command = "sudo -e %s"
end end
-- Call the handle shell function -- Call the handle shell function
@@ -4683,7 +4709,7 @@ local function handle_pager(args, config)
-- with the pager command -- with the pager command
handle_shell( handle_shell(
merge_tables({ merge_tables({
pager .. " $@", pager .. " %s",
block = true, block = true,
exit_if_dir = true, exit_if_dir = true,
}, args), }, args),
@@ -4725,7 +4751,7 @@ local function run_command_func(command, args, config)
} }
-- Get the function for the command -- Get the function for the command
---@type CommandFunction|nil ---@type CommandFunction?
local command_func = command_table[command] local command_func = command_table[command]
-- If the function isn't found, notify the user and exit the function -- If the function isn't found, notify the user and exit the function
@@ -4738,7 +4764,7 @@ local function run_command_func(command, args, config)
end end
-- The setup function to setup the plugin -- The setup function to setup the plugin
---@param opts UserConfiguration|nil The options given to the plugin ---@param opts UserConfiguration? The options given to the plugin
---@return nil ---@return nil
function M:setup(opts) function M:setup(opts)
-- --

View File

@@ -1,4 +1,4 @@
--- @since 25.5.31 --- @since 25.12.29
local selected_or_hovered = ya.sync(function() local selected_or_hovered = ya.sync(function()
local tab, paths = cx.active, {} local tab, paths = cx.active, {}
@@ -11,6 +11,15 @@ local selected_or_hovered = ya.sync(function()
return paths return paths
end) end)
local function fail(s, ...)
ya.notify {
title = "Chmod",
content = string.format(s, ...),
level = "error",
timeout = 5,
}
end
return { return {
entry = function() entry = function()
ya.emit("escape", { visual = true }) ya.emit("escape", { visual = true })
@@ -23,20 +32,16 @@ return {
local value, event = ya.input { local value, event = ya.input {
title = "Chmod:", title = "Chmod:",
pos = { "top-center", y = 3, w = 40 }, pos = { "top-center", y = 3, w = 40 },
position = { "top-center", y = 3, w = 40 }, -- TODO: remove
} }
if event ~= 1 then if event ~= 1 then
return return
end end
local status, err = Command("chmod"):arg(value):arg(urls):spawn():wait() local output, err = Command("chmod"):arg(value):arg(urls):stderr(Command.PIPED):output()
if not status or not status.success then if not output then
ya.notify { fail("Failed to run chmod: %s", err)
title = "Chmod", elseif not output.status.success then
content = string.format("Chmod on selected files failed, error: %s", status and status.code or err), fail("Chmod failed with stderr:\n%s", output.stderr:gsub("^chmod:%s*", ""))
level = "error",
timeout = 5,
}
end end
end, end,
} }

View File

@@ -1,4 +1,4 @@
--- @since 25.2.7 --- @since 26.1.22
local function info(content) local function info(content)
return ya.notify { return ya.notify {
@@ -8,20 +8,20 @@ local function info(content)
} }
end end
local selected_url = ya.sync(function() local selected_path = ya.sync(function()
for _, u in pairs(cx.active.selected) do for _, u in pairs(cx.active.selected) do
return u return u.cache or u
end end
end) end)
local hovered_url = ya.sync(function() local hovered_path = ya.sync(function()
local h = cx.active.current.hovered local h = cx.active.current.hovered
return h and h.url return h and h.path
end) end)
return { return {
entry = function() entry = function()
local a, b = selected_url(), hovered_url() local a, b = selected_path(), hovered_path()
if not a then if not a then
return info("No file selected") return info("No file selected")
elseif not b then elseif not b then

View File

@@ -15,21 +15,24 @@ ya pkg add yazi-rs/plugins:git
Add the following to your `~/.config/yazi/init.lua`: Add the following to your `~/.config/yazi/init.lua`:
```lua ```lua
require("git"):setup() require("git"):setup {
-- Order of status signs showing in the linemode
order = 1500,
}
``` ```
And register it as fetchers in your `~/.config/yazi/yazi.toml`: And register it as fetchers in your `~/.config/yazi/yazi.toml`:
```toml ```toml
[[plugin.prepend_fetchers]] [[plugin.prepend_fetchers]]
id = "git" id = "git"
name = "*" url = "*"
run = "git" run = "git"
[[plugin.prepend_fetchers]] [[plugin.prepend_fetchers]]
id = "git" id = "git"
name = "*/" url = "*/"
run = "git" run = "git"
``` ```
## Advanced ## Advanced
@@ -39,12 +42,14 @@ run = "git"
You can customize the [Style](https://yazi-rs.github.io/docs/plugins/layout#style) of the status sign with: You can customize the [Style](https://yazi-rs.github.io/docs/plugins/layout#style) of the status sign with:
- `th.git.modified` - `th.git.unknown` - status cannot/not yet determined
- `th.git.added` - `th.git.modified` - modified file
- `th.git.untracked` - `th.git.added` - added file
- `th.git.ignored` - `th.git.untracked` - untracked file
- `th.git.deleted` - `th.git.ignored` - ignored file
- `th.git.updated` - `th.git.deleted` - deleted file
- `th.git.updated` - updated file
- `th.git.clean` - clean file
For example: For example:
@@ -57,20 +62,24 @@ th.git.deleted = ui.Style():fg("red"):bold()
You can also customize the text of the status sign with: You can also customize the text of the status sign with:
- `th.git.modified_sign` - `th.git.unknown_sign` - status cannot/not yet determined
- `th.git.added_sign` - `th.git.modified_sign` - modified file
- `th.git.untracked_sign` - `th.git.added_sign` - added file
- `th.git.ignored_sign` - `th.git.untracked_sign` - untracked file
- `th.git.deleted_sign` - `th.git.ignored_sign` - ignored file
- `th.git.updated_sign` - `th.git.deleted_sign` - deleted file
- `th.git.updated_sign` - updated file
- `th.git.clean_sign` - clean file
For example: For example:
```lua ```lua
-- ~/.config/yazi/init.lua -- ~/.config/yazi/init.lua
th.git = th.git or {} th.git = th.git or {}
th.git.unknown_sign = " "
th.git.modified_sign = "M" th.git.modified_sign = "M"
th.git.deleted_sign = "D" th.git.deleted_sign = "D"
th.git.clean_sign = ""
``` ```
## License ## License

View File

@@ -1,4 +1,4 @@
--- @since 25.5.31 --- @since 25.12.29
local WINDOWS = ya.target_family() == "windows" local WINDOWS = ya.target_family() == "windows"
@@ -7,14 +7,15 @@ local WINDOWS = ya.target_family() == "windows"
-- see `bubble_up` -- see `bubble_up`
---@enum CODES ---@enum CODES
local CODES = { local CODES = {
excluded = 100, -- ignored directory unknown = 100, -- status cannot/not yet determined
excluded = 99, -- ignored directory
ignored = 6, -- ignored file ignored = 6, -- ignored file
untracked = 5, untracked = 5,
modified = 4, modified = 4,
added = 3, added = 3,
deleted = 2, deleted = 2,
updated = 1, updated = 1,
unknown = 0, clean = 0,
} }
local PATTERNS = { local PATTERNS = {
@@ -79,7 +80,7 @@ local function bubble_up(changed)
local url = Url(path).parent local url = Url(path).parent
while url and url ~= empty do while url and url ~= empty do
local s = tostring(url) local s = tostring(url)
new[s] = (new[s] or CODES.unknown) > code and new[s] or code new[s] = (new[s] or CODES.clean) > code and new[s] or code
url = url.parent url = url.parent
end end
end end
@@ -116,7 +117,7 @@ local add = ya.sync(function(st, cwd, repo, changed)
st.dirs[cwd] = repo st.dirs[cwd] = repo
st.repos[repo] = st.repos[repo] or {} st.repos[repo] = st.repos[repo] or {}
for path, code in pairs(changed) do for path, code in pairs(changed) do
if code == CODES.unknown then if code == CODES.clean then
st.repos[repo][path] = nil st.repos[repo][path] = nil
elseif code == CODES.excluded then elseif code == CODES.excluded then
-- Mark the directory with a special value `excluded` so that it can be distinguished during UI rendering -- Mark the directory with a special value `excluded` so that it can be distinguished during UI rendering
@@ -125,12 +126,7 @@ local add = ya.sync(function(st, cwd, repo, changed)
st.repos[repo][path] = code st.repos[repo][path] = code
end end
end end
-- TODO: remove this ui.render()
if ui.render then
ui.render()
else
ya.render()
end
end) end)
---@param cwd string ---@param cwd string
@@ -142,12 +138,7 @@ local remove = ya.sync(function(st, cwd)
return return
end end
-- TODO: remove this ui.render()
if ui.render then
ui.render()
else
ya.render()
end
st.dirs[cwd] = nil st.dirs[cwd] = nil
if not st.repos[repo] then if not st.repos[repo] then
return return
@@ -172,31 +163,39 @@ local function setup(st, opts)
local t = th.git or {} local t = th.git or {}
local styles = { local styles = {
[CODES.ignored] = t.ignored and ui.Style(t.ignored) or ui.Style():fg("darkgray"), [CODES.unknown] = t.unknown or ui.Style(),
[CODES.untracked] = t.untracked and ui.Style(t.untracked) or ui.Style():fg("magenta"), [CODES.ignored] = t.ignored or ui.Style():fg("darkgray"),
[CODES.modified] = t.modified and ui.Style(t.modified) or ui.Style():fg("yellow"), [CODES.untracked] = t.untracked or ui.Style():fg("magenta"),
[CODES.added] = t.added and ui.Style(t.added) or ui.Style():fg("green"), [CODES.modified] = t.modified or ui.Style():fg("yellow"),
[CODES.deleted] = t.deleted and ui.Style(t.deleted) or ui.Style():fg("red"), [CODES.added] = t.added or ui.Style():fg("green"),
[CODES.updated] = t.updated and ui.Style(t.updated) or ui.Style():fg("yellow"), [CODES.deleted] = t.deleted or ui.Style():fg("red"),
[CODES.updated] = t.updated or ui.Style():fg("yellow"),
[CODES.clean] = t.clean or ui.Style(),
} }
local signs = { local signs = {
[CODES.ignored] = t.ignored_sign or "", [CODES.unknown] = t.unknown_sign or "",
[CODES.untracked] = t.untracked_sign or "?", [CODES.ignored] = t.ignored_sign or "",
[CODES.modified] = t.modified_sign or "", [CODES.untracked] = t.untracked_sign or "? ",
[CODES.added] = t.added_sign or "", [CODES.modified] = t.modified_sign or "",
[CODES.deleted] = t.deleted_sign or "", [CODES.added] = t.added_sign or "",
[CODES.updated] = t.updated_sign or "", [CODES.deleted] = t.deleted_sign or "",
[CODES.updated] = t.updated_sign or "",
[CODES.clean] = t.clean_sign or "",
} }
Linemode:children_add(function(self) Linemode:children_add(function(self)
local url = self._file.url if not self._file.in_current then
local repo = st.dirs[tostring(url.base)] return ""
local code
if repo then
code = repo == CODES.excluded and CODES.ignored or st.repos[repo][tostring(url):sub(#repo + 2)]
end end
if not code or signs[code] == "" then local url = self._file.url
local repo = st.dirs[tostring(url.base or url.parent)]
local code = CODES.unknown
if repo then
code = repo == CODES.excluded and CODES.ignored or st.repos[repo][tostring(url):sub(#repo + 2)] or CODES.clean
end
if signs[code] == "" then
return "" return ""
elseif self._file.is_hovered then elseif self._file.is_hovered then
return ui.Line { " ", signs[code] } return ui.Line { " ", signs[code] }
@@ -208,7 +207,7 @@ end
---@type UnstableFetcher ---@type UnstableFetcher
local function fetch(_, job) local function fetch(_, job)
local cwd = job.files[1].url.base local cwd = job.files[1].url.base or job.files[1].url.parent
local repo = root(cwd) local repo = root(cwd)
if not repo then if not repo then
remove(tostring(cwd)) remove(tostring(cwd))
@@ -246,11 +245,11 @@ local function fetch(_, job)
end end
ya.dict_merge(changed, propagate_down(excluded, cwd, Url(repo))) ya.dict_merge(changed, propagate_down(excluded, cwd, Url(repo)))
-- Reset the status of any files that don't appear in the output of `git status` to `unknown`, -- Reset the status of any files that don't appear in the output of `git status` to `clean`,
-- so that cleaning up outdated statuses from `st.repos` -- so that cleaning up outdated statuses from `st.repos`
for _, path in ipairs(paths) do for _, path in ipairs(paths) do
local s = path:sub(#repo + 2) local s = path:sub(#repo + 2)
changed[s] = changed[s] or CODES.unknown changed[s] = changed[s] or CODES.clean
end end
add(tostring(cwd), repo, changed) add(tostring(cwd), repo, changed)

View File

@@ -0,0 +1,12 @@
---@class State
---@field dirs table<string, string|CODES> Mapping between a directory and its corresponding repository
---@field repos table<string, Changes> Mapping between a repository and the status of each of its files
---@class Options
---@field order number The order in which the status is displayed
---@field renamed boolean Whether to include renamed files in the status (or treat them as modified)
-- TODO: move this to `types.yazi` once it's get stable
---@alias UnstableFetcher fun(self: unknown, job: { files: File[] }): boolean, Error?
---@alias Changes table<string, CODES>

View File

@@ -40,7 +40,6 @@ using `ffmpeg` if available and media metadata using `mediainfo`.
## Installation ## Installation
- Install mediainfo CLI: - Install mediainfo CLI:
- [https://mediaarea.net/en/MediaInfo/Download](https://mediaarea.net/en/MediaInfo/Download) - [https://mediaarea.net/en/MediaInfo/Download](https://mediaarea.net/en/MediaInfo/Download)
- Run this command in terminal to check if it's installed correctly: - Run this command in terminal to check if it's installed correctly:
@@ -52,7 +51,6 @@ using `ffmpeg` if available and media metadata using `mediainfo`.
- Install ImageMagick (for linux, you can use your distro package manager to install): - Install ImageMagick (for linux, you can use your distro package manager to install):
https://imagemagick.org/script/download.php https://imagemagick.org/script/download.php
- Install this plugin: - Install this plugin:
```bash ```bash
@@ -74,7 +72,7 @@ Create `.../yazi/yazi.toml` and add:
> [!IMPORTANT] > [!IMPORTANT]
> >
> For yazi nightly replace `name` with `url` > For yazi (>=v25.12.29) replace `name` with `url`
```toml ```toml
[plugin] [plugin]
@@ -120,3 +118,18 @@ title = { fg = "green" }
# Example: `Format: FLAC` with blue color in preview images above # Example: `Format: FLAC` with blue color in preview images above
tbl_col = { fg = "blue" } tbl_col = { fg = "blue" }
``` ```
## (Optional) Keymaps to hide metadata and to preview images in full screen
> [!IMPORTANT]
> Use any key you want, but make sure there is no conflicts with [default Keybindings](https://github.com/sxyazi/yazi/blob/main/yazi-config/preset/keymap-default.toml).
Since Yazi prioritizes the first matching key, `prepend_keymap` takes precedence over defaults.
Or you can use `keymap` to replace all other keys
```toml
[mgr]
prepend_keymap = [
{ on = "<F9>", run = "plugin mediainfo -- toggle-metadata", desc = "Toggle media preview metadata" },
]
```

View File

@@ -10,6 +10,16 @@ local skip_labels = {
["MD5 of the unencoded content"] = true, ["MD5 of the unencoded content"] = true,
} }
local ENTRY_ACTION = {
toggle_metadata = "toggle-metadata",
}
local STATE_KEY = {
units = "units",
hide_metadata = "hide_metadata",
prev_metadata_area = "prev_metadata_area",
}
local magick_image_mimes = { local magick_image_mimes = {
avif = true, avif = true,
hei = true, hei = true,
@@ -18,8 +28,10 @@ local magick_image_mimes = {
["heif-sequence"] = true, ["heif-sequence"] = true,
["heic-sequence"] = true, ["heic-sequence"] = true,
jxl = true, jxl = true,
tiff = true,
xml = true, xml = true,
["svg+xml"] = true, ["svg+xml"] = true,
["canon-cr2"] = true,
} }
local seekable_mimes = { local seekable_mimes = {
@@ -76,7 +88,9 @@ local function image_layer_count(job)
if layer_count then if layer_count then
return layer_count return layer_count
end end
local output, err = Command("identify"):arg({ tostring(job.file.url) }):output() local output, err = Command("identify")
:arg({ tostring(job.file.path or job.file.cache or job.file.url.path or job.file.url) })
:output()
if err then if err then
return 0 return 0
end end
@@ -110,73 +124,85 @@ function M:peek(job)
return return
end end
ya.sleep(math.max(0, rt.preview.image_delay / 1000 + start - os.clock())) ya.sleep(math.max(0, rt.preview.image_delay / 1000 + start - os.clock()))
local cache_mediainfo_path = tostring(cache_img_url_no_skip) .. suffix local hide_metadata = get_state(STATE_KEY.hide_metadata)
local output = read_mediainfo_cached_file(cache_mediainfo_path) local mediainfo_height = 0
local lines = {} local lines = {}
local limit = job.area.h local limit = job.area.h
local last_line = 0 local last_line = 0
local is_wrap = rt.preview.wrap == "yes" local is_wrap = rt.preview.wrap == "yes"
if not hide_metadata then
if output then local cache_mediainfo_path = tostring(cache_img_url_no_skip) .. suffix
local max_width = math.max(1, job.area.w) local output = read_mediainfo_cached_file(cache_mediainfo_path)
if output:match("^Error:") then if output then
job.args.force_reload_mediainfo = true local max_width = math.max(1, job.area.w)
preload_status, preload_err = self:preload(job) if output:match("^Error:") then
if not preload_status or preload_err then job.args.force_reload_mediainfo = true
return preload_status, preload_err = self:preload(job)
end if not preload_status or preload_err then
output = read_mediainfo_cached_file(cache_mediainfo_path) return
end
for str in output:gsub("\n+$", ""):gmatch("[^\n]*") do
local label, value = str:match("(.*[^ ]) +: (.*)")
local line
if label then
if not skip_labels[label] then
line = ui.Line({
ui.Span(label .. ": "):style(ui.Style():fg("reset"):bold()),
ui.Span(value):style(th.spot.tbl_col or ui.Style():fg("blue")),
})
end end
elseif str ~= "General" then output = read_mediainfo_cached_file(cache_mediainfo_path)
line = ui.Line({ ui.Span(str):style(th.spot.title or ui.Style():fg("green")) })
end end
if line then for str in output:gsub("\n+$", ""):gmatch("[^\n]*") do
local line_height = math.max(1, is_wrap and math.ceil(ui.width(line) / max_width) or 1) local label, value = str:match("(.*[^ ]) +: (.*)")
if (last_line + line_height) > job.skip then local line
table.insert(lines, line) if label then
if not skip_labels[label] then
line = ui.Line({
ui.Span(label .. ": "):style(ui.Style():fg("reset"):bold()),
ui.Span(value):style(th.spot.tbl_col or ui.Style():fg("blue")),
})
end
elseif str ~= "General" then
line = ui.Line({ ui.Span(str):style(th.spot.title or ui.Style():fg("green")) })
end end
if (last_line + line_height) >= job.skip + limit then
last_line = job.skip + limit if line then
break local line_height = math.max(1, is_wrap and math.ceil(ui.width(line) / max_width) or 1)
if (last_line + line_height) > job.skip then
table.insert(lines, line)
end
if (last_line + line_height) >= job.skip + limit then
last_line = job.skip + limit
break
end
last_line = last_line + line_height
end end
last_line = last_line + line_height
end end
end end
mediainfo_height = math.min(limit, last_line)
end end
local mediainfo_height = math.min(limit, last_line)
if if
(job.skip > 0 and #lines == 0) (job.skip > 0 and #lines == 0 and not hide_metadata)
and ( and (
not is_seekable not is_seekable
or (is_video and job.skip >= 90) or (is_video and job.skip >= 90)
or ( or (
(job.mime == "image/adobe.photoshop" or job.mime == "application/postscript") (job.mime == "image/adobe.photoshop" or job.mime == "application/postscript")
and image_layer_count(job) and image_layer_count(job)
< (1 + math.floor(math.max(0, get_state("units") and (job.skip / get_state("units")) or 0))) < (1 + math.floor(
math.max(0, get_state(STATE_KEY.units) and (job.skip / get_state(STATE_KEY.units)) or 0)
))
) )
) )
then then
ya.emit( ya.emit("peek", {
"peek", math.max(0, job.skip - (get_state(STATE_KEY.units) or limit)),
{ math.max(0, job.skip - (get_state("units") or limit)), only_if = job.file.url, upper_bound = true } only_if = job.file.url,
) upper_bound = true,
})
return return
end end
force_render() force_render()
-- NOTE: Hacky way to prevent image overlap with old metadata area
if hide_metadata and get_state(STATE_KEY.prev_metadata_area) then
ya.preview_widget(job, {
ui.Clear(ui.Rect(get_state(STATE_KEY.prev_metadata_area))),
})
ya.sleep(0.1)
end
local rendered_img_rect = cache_img_url local rendered_img_rect = cache_img_url
and fs.cha(cache_img_url) and fs.cha(cache_img_url)
and ya.image_show( and ya.image_show(
@@ -189,7 +215,6 @@ function M:peek(job)
}) })
) )
or nil or nil
local image_height = rendered_img_rect and rendered_img_rect.h or 0 local image_height = rendered_img_rect and rendered_img_rect.h or 0
-- NOTE: Workaround case audio has no cover image. Prevent regenerate preview image -- NOTE: Workaround case audio has no cover image. Prevent regenerate preview image
@@ -220,12 +245,19 @@ function M:peek(job)
})) }))
:wrap(is_wrap and ui.Wrap.YES or ui.Wrap.NO), :wrap(is_wrap and ui.Wrap.YES or ui.Wrap.NO),
}) })
-- NOTE: Hacky way to prevent image overlap with old metadata area
set_state(STATE_KEY.prev_metadata_area, not hide_metadata and {
x = job.area.x,
y = job.area.y + image_height,
w = job.area.w,
h = job.area.h - image_height,
} or nil)
end end
function M:seek(job) function M:seek(job)
local h = cx.active.current.hovered local h = cx.active.current.hovered
if h and h.url == job.file.url then if h and h.url == job.file.url then
set_state("units", job.units) set_state(STATE_KEY.units, job.units)
ya.emit("peek", { ya.emit("peek", {
math.max(0, cx.active.preview.skip + job.units), math.max(0, cx.active.preview.skip + job.units),
only_if = job.file.url, only_if = job.file.url,
@@ -242,7 +274,7 @@ function M:preload(job)
cache_img_url = seekable_mimes[job.mime] and ya.file_cache(job) or cache_img_url cache_img_url = seekable_mimes[job.mime] and ya.file_cache(job) or cache_img_url
local cache_img_url_cha = cache_img_url and fs.cha(cache_img_url) local cache_img_url_cha = cache_img_url and fs.cha(cache_img_url)
local err_msg = "" local err_msg = ""
local is_valid_utf8_path = is_valid_utf8(tostring(job.file.url)) local is_valid_utf8_path = is_valid_utf8(tostring(job.file.path or job.file.cache or job.file.url))
-- video mimetype -- video mimetype
if job.mime then if job.mime then
if string.find(job.mime, "^video/") then if string.find(job.mime, "^video/") then
@@ -261,15 +293,11 @@ function M:preload(job)
"error", "error",
"-threads", "-threads",
1, 1,
"-hwaccel",
"auto",
"-skip_frame",
"nokey",
"-an", "-an",
"-sn", "-sn",
"-dn", "-dn",
"-i", "-i",
tostring(job.file.url), tostring(job.file.path or job.file.cache or job.file.url.path or job.file.url),
"-vframes", "-vframes",
1, 1,
"-q:v", "-q:v",
@@ -283,13 +311,17 @@ function M:preload(job)
}):output() }):output()
-- NOTE: Some audio types doesn't have cover image -> error "" -- NOTE: Some audio types doesn't have cover image -> error ""
if if
(audio_preload_output and audio_preload_output.stderr ~= nil and audio_preload_output.stderr ~= "") (
or audio_preload_err audio_preload_output
and audio_preload_output.stderr ~= nil
and audio_preload_output.stderr ~= ""
and not audio_preload_output.stderr:find("Output file does not contain any stream")
) or audio_preload_err
then then
err_msg = err_msg err_msg = err_msg
.. string.format("Failed to start `%s`, Do you have `%s` installed?\n", "ffmpeg", "ffmpeg") .. string.format("Failed to start `%s`, Do you have `%s` installed?\n", "ffmpeg", "ffmpeg")
else else
cache_img_url_cha = fs.cha(cache_img_url) cache_img_url_cha, _ = fs.cha(cache_img_url)
if not cache_img_url_cha then if not cache_img_url_cha then
-- NOTE: Workaround case audio has no cover image. Prevent regenerate preview image -- NOTE: Workaround case audio has no cover image. Prevent regenerate preview image
audio_preload_output, audio_preload_err = require("magick") audio_preload_output, audio_preload_err = require("magick")
@@ -317,18 +349,18 @@ function M:preload(job)
-- image -- image
elseif string.find(job.mime, "^image/") or job.mime == "application/postscript" then elseif string.find(job.mime, "^image/") or job.mime == "application/postscript" then
local svg_plugin_ok, svg_plugin = pcall(require, "svg") local svg_plugin_ok, svg_plugin = pcall(require, "svg")
local _, magick_plugin = pcall(require, "magick") local magick_plugin_ok, magick_plugin = pcall(require, "magick")
local mime = job.mime:match(".*/(.*)$") local mime = job.mime:match(".*/(.*)$")
local image_plugin = magick_image_mimes[mime] local image_plugin = magick_image_mimes[mime]
and ((mime == "svg+xml" and svg_plugin_ok) and svg_plugin or magick_plugin) and ((mime == "svg+xml" and svg_plugin_ok) and svg_plugin or (magick_plugin_ok and magick_plugin))
or require("image") or require("image")
local cache_img_status, image_preload_err local cache_img_status, image_preload_err
-- psd, ai, eps -- psd, ai, eps
if mime == "adobe.photoshop" or job.mime == "application/postscript" then if mime == "adobe.photoshop" or job.mime == "application/postscript" then
local layer_index = 0 local layer_index = 0
local units = get_state("units") local units = get_state(STATE_KEY.units)
if units ~= nil then if units ~= nil then
local max_layer = image_layer_count(job) local max_layer = image_layer_count(job)
layer_index = math.floor(math.max(0, job.skip / units)) layer_index = math.floor(math.max(0, job.skip / units))
@@ -346,7 +378,10 @@ function M:preload(job)
:arg({ :arg({
"-background", "-background",
"none", "none",
tostring(job.file.url) .. "[" .. tostring(layer_index) .. "]", tostring(job.file.path or job.file.cache or job.file.url.path or job.file.url)
.. "["
.. tostring(layer_index)
.. "]",
"-auto-orient", "-auto-orient",
"-strip", "-strip",
"-resize", "-resize",
@@ -371,7 +406,7 @@ function M:preload(job)
:arg({ :arg({
"-background", "-background",
"none", "none",
tostring(job.file.url), tostring(job.file.path or job.file.cache or job.file.url.path or job.file.url),
"-auto-orient", "-auto-orient",
"-strip", "-strip",
"-flatten", "-flatten",
@@ -403,15 +438,20 @@ function M:preload(job)
local cmd = "mediainfo" local cmd = "mediainfo"
local output, err local output, err
if is_valid_utf8_path then if is_valid_utf8_path then
output, err = Command(cmd):arg({ tostring(job.file.url) }):output() output, err = Command(cmd)
:arg({ tostring(job.file.path or job.file.cache or job.file.url.path or job.file.url) })
:output()
else else
cmd = "cd " cmd = "cd "
.. path_quote(job.file.url.parent) .. path_quote(job.file.path or job.file.cache or (job.file.url.path or job.file.url).parent)
.. " && " .. " && "
.. cmd .. cmd
.. " " .. " "
.. path_quote(tostring(job.file.url.name)) .. path_quote(tostring(job.file.path or job.file.cache or job.file.url.name))
output, err = Command(SHELL):arg({ "-c", cmd }):arg({ tostring(job.file.url) }):output() output, err = Command(SHELL)
:arg({ "-c", cmd })
:arg({ tostring(job.file.path or job.file.cache or (job.file.url.path or job.file.url)) })
:output()
end end
if err then if err then
err_msg = err_msg .. string.format("Failed to start `%s`, Do you have `%s` installed?\n", cmd, cmd) err_msg = err_msg .. string.format("Failed to start `%s`, Do you have `%s` installed?\n", cmd, cmd)
@@ -422,4 +462,15 @@ function M:preload(job)
) )
end end
function M:entry(job)
local action = job.args[1]
if action == ENTRY_ACTION.toggle_metadata then
set_state(STATE_KEY.hide_metadata, not get_state(STATE_KEY.hide_metadata))
ya.emit("peek", {
force = true,
})
end
end
return M return M

View File

@@ -1,4 +1,4 @@
--- @since 25.5.31 --- @since 25.12.29
local toggle_ui = ya.sync(function(self) local toggle_ui = ya.sync(function(self)
if self.children then if self.children then
@@ -7,12 +7,7 @@ local toggle_ui = ya.sync(function(self)
else else
self.children = Modal:children_add(self, 10) self.children = Modal:children_add(self, 10)
end end
-- TODO: remove this ui.render()
if ui.render then
ui.render()
else
ya.render()
end
end) end)
local subscribe = ya.sync(function(self) local subscribe = ya.sync(function(self)
@@ -23,12 +18,7 @@ end)
local update_partitions = ya.sync(function(self, partitions) local update_partitions = ya.sync(function(self, partitions)
self.partitions = partitions self.partitions = partitions
self.cursor = math.max(0, math.min(self.cursor or 0, #self.partitions - 1)) self.cursor = math.max(0, math.min(self.cursor or 0, #self.partitions - 1))
-- TODO: remove this ui.render()
if ui.render then
ui.render()
else
ya.render()
end
end) end)
local active_partition = ya.sync(function(self) return self.partitions[self.cursor + 1] end) local active_partition = ya.sync(function(self) return self.partitions[self.cursor + 1] end)
@@ -39,12 +29,7 @@ local update_cursor = ya.sync(function(self, cursor)
else else
self.cursor = ya.clamp(0, self.cursor + cursor, #self.partitions - 1) self.cursor = ya.clamp(0, self.cursor + cursor, #self.partitions - 1)
end end
-- TODO: remove this ui.render()
if ui.render then
ui.render()
else
ya.render()
end
end) end)
local M = { local M = {
@@ -272,24 +257,33 @@ function M.operate(type)
return -- TODO: mount/unmount main disk return -- TODO: mount/unmount main disk
end end
local output, err local cmd
if ya.target_os() == "macos" then if ya.target_os() == "macos" then
output, err = Command("diskutil"):arg({ type, active.src }):output() cmd = Command("diskutil"):arg { type, active.src }
end end
if ya.target_os() == "linux" then if ya.target_os() == "linux" then
if type == "eject" and active.src:match("^/dev/sr%d+") then if type == "eject" and active.src:match("^/dev/sr%d+") then
Command("udisksctl"):arg({ "unmount", "-b", active.src }):status() Command("udisksctl"):arg({ "unmount", "-b", active.src }):status()
output, err = Command("eject"):arg({ "--traytoggle", active.src }):output() cmd = Command("eject"):arg { "--traytoggle", active.src }
elseif type == "eject" then elseif type == "eject" then
Command("udisksctl"):arg({ "unmount", "-b", active.src }):status() Command("udisksctl"):arg({ "unmount", "-b", active.src }):status()
output, err = Command("udisksctl"):arg({ "power-off", "-b", active.src }):output() cmd = Command("udisksctl"):arg { "power-off", "-b", active.src }
else else
output, err = Command("udisksctl"):arg({ type, "-b", active.src }):output() cmd = Command("udisksctl"):arg { type, "-b", active.src }
end end
end end
if not cmd then
return M.fail("mount.yazi is not currently supported on your platform")
end
local output, err = cmd:output()
if not output then if not output then
M.fail("Failed to %s `%s`: %s", type, active.src, err) if cmd.program then
M.fail("Failed to spawn `%s`: %s", cmd.program, err)
else
M.fail("Failed to spawn `udisksctl`: %s", err) -- TODO: remove
end
elseif not output.status.success then elseif not output.status.success then
M.fail("Failed to %s `%s`: %s", type, active.src, output.stderr) M.fail("Failed to %s `%s`: %s", type, active.src, output.stderr)
end end

View File

@@ -35,29 +35,38 @@ Make sure you have [ouch](https://github.com/ouch-org/ouch) installed and in you
For archive preview, add this to your `yazi.toml`: For archive preview, add this to your `yazi.toml`:
```toml ```toml
[plugin] [[plugin.prepend_previewers]]
prepend_previewers = [ mime = "application/{*zip,tar,bzip2,7z*,rar,xz,zstd,java-archive}"
# Archive previewer run = "ouch"
{ mime = "application/*zip", run = "ouch" },
{ mime = "application/x-tar", run = "ouch" },
{ mime = "application/x-bzip2", run = "ouch" },
{ mime = "application/x-7z-compressed", run = "ouch" },
{ mime = "application/x-rar", run = "ouch" },
{ mime = "application/vnd.rar", run = "ouch" },
{ mime = "application/x-xz", run = "ouch" },
{ mime = "application/xz", run = "ouch" },
{ mime = "application/x-zstd", run = "ouch" },
{ mime = "application/zstd", run = "ouch" },
{ mime = "application/java-archive", run = "ouch" },
]
``` ```
Now go to an archive on Yazi, you should see the archive's content in the preview pane. You can use `J` and `K` to roll up and down the preview. Now go to an archive on Yazi, you should see the archive's content in the preview pane. You can use `J` and `K` to roll up and down the preview.
If you want to change the icon or the style of text, you can modify the `peek` function in `init.lua` file (all of them are stored in the `lines` variable). #### Customization
Previews can be customized by adding extra arguments in the `run` string:
```toml
[plugin]
prepend_previewers = [
# Change the top-level archive icon
{ ..., run = "ouch --archive-icon='🗄️ '" },
# Or remove it by setting it to ''
{ ..., run = "ouch --archive-icon=''" },
# Enable file icons
{ ..., run = "ouch --show-file-icons" },
# Disable tree view
{ ..., run = "ouch --list-view" },
# These can be combined
{ ..., run = "ouch --archive-icon='🗄️ ' --show-file-icons --list-view" },
]
```
### Compression ### Compression
For compession, add this to your `keymap.toml`: For compression, add this to your `keymap.toml`:
```toml ```toml
[[mgr.prepend_keymap]] [[mgr.prepend_keymap]]

View File

@@ -1,15 +1,50 @@
local M = {} local M = {}
-- Extract the tree prefix (if any) from a line
local function get_tree_prefix(line)
local _, prefix_len = line:find("", 1, true)
if prefix_len then
return line:sub(1, prefix_len)
else
return ""
end
end
-- Add a filetype icon to a line
local function line_with_icon(line)
line = line:gsub("[\r\n]+$", "") -- Trailing newlines mess with filetype detection
local tree_prefix = get_tree_prefix(line)
local url = line:sub(#tree_prefix + 1)
local icon = File({
url = Url(url),
cha = Cha {
mode = tonumber(url:sub(-1) == "/" and "40700" or "100644", 8),
kind = url:sub(-1) == "/" and 1 or 0, -- For Yazi <25.9.x compatibility
}
}):icon()
if icon then
line = ui.Line { tree_prefix, ui.Span(icon.text .. " "):style(icon.style), url }
end
return line
end
function M:peek(job) function M:peek(job)
local child = Command("ouch") local cmd = Command("ouch"):arg("l")
:arg({ "l", "-t", "-y", tostring(job.file.url) }) if not job.args.list_view then
cmd:arg("-t")
end
cmd:arg({ "-y", tostring(job.file.url) })
:stdout(Command.PIPED) :stdout(Command.PIPED)
:stderr(Command.PIPED) :stderr(Command.PIPED)
:spawn()
local child = cmd:spawn()
local limit = job.area.h local limit = job.area.h
local archive_icon = job.args.archive_icon or "\u{1f4c1} "
local file_name = string.match(tostring(job.file.url), ".*[/\\](.*)") local file_name = string.match(tostring(job.file.url), ".*[/\\](.*)")
local lines = string.format("\u{1f4c1} %s\n", file_name) local lines = { string.format(" %s%s", archive_icon, file_name) }
local num_lines = 1
local num_skip = 0 local num_skip = 0
repeat repeat
local line, event = child:read_line() local line, event = child:read_line()
@@ -21,19 +56,29 @@ function M:peek(job)
if line:find('Archive', 1, true) ~= 1 and line:find('[INFO]', 1, true) ~= 1 then if line:find('Archive', 1, true) ~= 1 and line:find('[INFO]', 1, true) ~= 1 then
if num_skip >= job.skip then if num_skip >= job.skip then
lines = lines .. line if job.args.show_file_icons then
num_lines = num_lines + 1 if line:find ('[ERROR]', 1, true) == 1 then
-- On error, disable file icons for the rest of the output
job.args.show_file_icons = false
elseif line:find ('[WARNING]', 1, true) ~= 1 then
-- Show icons for non-warning lines only
line = line_with_icon(line)
end
end
line = ui.Line { " ", line } -- One space padding
table.insert(lines, line)
else else
num_skip = num_skip + 1 num_skip = num_skip + 1
end end
end end
until num_lines >= limit until #lines >= limit
child:start_kill() child:start_kill()
if job.skip > 0 and num_lines < limit then if job.skip > 0 and #lines < limit then
ya.emit( ya.emit(
"peek", "peek",
{ tostring(math.max(0, job.skip - (limit - num_lines))), only_if = tostring(job.file.url), upper_bound = "" } { tostring(math.max(0, job.skip - (limit - #lines))), only_if = tostring(job.file.url), upper_bound = "" }
) )
else else
ya.preview_widget(job, { ui.Text(lines):area(job.area) }) ya.preview_widget(job, { ui.Text(lines):area(job.area) })
@@ -125,7 +170,6 @@ function M:entry(job)
local output_name, name_event = ya.input({ local output_name, name_event = ya.input({
title = "Create archive:", title = "Create archive:",
value = default_name .. "." .. default_fmt, value = default_name .. "." .. default_fmt,
position = { "top-center", y = 3, w = 40 },
pos = { "top-center", y = 3, w = 40 }, pos = { "top-center", y = 3, w = 40 },
}) })
if name_event ~= 1 then if name_event ~= 1 then
@@ -136,7 +180,6 @@ function M:entry(job)
if file_exists(output_name) then if file_exists(output_name) then
local confirm, confirm_event = ya.input({ local confirm, confirm_event = ya.input({
title = "Overwrite " .. output_name .. "? (y/N)", title = "Overwrite " .. output_name .. "? (y/N)",
position = { "top-center", y = 3, w = 40 },
pos = { "top-center", y = 3, w = 40 }, pos = { "top-center", y = 3, w = 40 },
}) })
if not (confirm_event == 1 and confirm:lower() == "y") then if not (confirm_event == 1 and confirm:lower() == "y") then

View File

@@ -40,12 +40,12 @@ Add the below to your `yazi.toml` file to allow the respective file to previewed
[plugin] [plugin]
prepend_previewers = [ prepend_previewers = [
{ name = "*.csv", run = "rich-preview"}, # for csv files { url = "*.csv", run = "rich-preview"}, # for csv files
{ name = "*.md", run = "rich-preview" }, # for markdown (.md) files { url = "*.md", run = "rich-preview" }, # for markdown (.md) files
{ name = "*.rst", run = "rich-preview"}, # for restructured text (.rst) files { url = "*.rst", run = "rich-preview"}, # for restructured text (.rst) files
{ name = "*.ipynb", run = "rich-preview"}, # for jupyter notebooks (.ipynb) { url = "*.ipynb", run = "rich-preview"}, # for jupyter notebooks (.ipynb)
{ name = "*.json", run = "rich-preview"}, # for json (.json) files { url = "*.json", run = "rich-preview"}, # for json (.json) files
# { name = "*.lang_type", run = "rich-preview"} # for particular language files eg. .py, .go., .lua, etc. # { url = "*.lang_type", run = "rich-preview"} # for particular language files eg. .py, .go., .lua, etc.
] ]
``` ```
@@ -78,7 +78,7 @@ To use `rich` with piper, you can add this in your `yazi.toml` file:
```toml ```toml
[[plugin.prepend_previewers]] [[plugin.prepend_previewers]]
name = "*.md" url = "*.md"
run = 'piper -- rich -j --left --panel=rounded --guides --line-numbers --force-terminal "$1"' run = 'piper -- rich -j --left --panel=rounded --guides --line-numbers --force-terminal "$1"'
``` ```

View File

@@ -1,4 +1,4 @@
--- @since 25.5.31 --- @since 25.12.29
local hovered = ya.sync(function() local hovered = ya.sync(function()
local h = cx.active.current.hovered local h = cx.active.current.hovered
@@ -17,7 +17,6 @@ local function prompt()
return ya.input { return ya.input {
title = "Smart filter:", title = "Smart filter:",
pos = { "center", w = 50 }, pos = { "center", w = 50 },
position = { "center", w = 50 }, -- TODO: remove
realtime = true, realtime = true,
debounce = 0.1, debounce = 0.1,
} }

View File

@@ -8,11 +8,11 @@ https://github.com/user-attachments/assets/6d2fc9e7-f86e-4444-aab6-4e11e51e8b34
## Installation ## Installation
```sh ```sh
ya pack -a iynaix/time-travel ya pkg add iynaix/time-travel
``` ```
> [!NOTE] > [!NOTE]
> The minimum required yazi version is 25.2.7. > The minimum required yazi version is 25.12.29.
## Usage ## Usage
@@ -21,17 +21,17 @@ Add keymaps similar to the following to your `~/.config/yazi/keymap.toml`:
```toml ```toml
[[manager.prepend_keymap]] [[manager.prepend_keymap]]
on = ["z", "h"] on = ["z", "h"]
run = "plugin time-travel --args=prev" run = "plugin time-travel prev"
desc = "Go to previous snapshot" desc = "Go to previous snapshot"
[[manager.prepend_keymap]] [[manager.prepend_keymap]]
on = ["z", "l"] on = ["z", "l"]
run = "plugin time-travel --args=next" run = "plugin time-travel next"
desc = "Go to next snapshot" desc = "Go to next snapshot"
[[manager.prepend_keymap]] [[manager.prepend_keymap]]
on = ["z", "e"] on = ["z", "e"]
run = "plugin time-travel --args=exit" run = "plugin time-travel exit"
desc = "Exit browsing snapshots" desc = "Exit browsing snapshots"
``` ```

View File

@@ -23,7 +23,7 @@ end
--- Verify if `sudo` is already authenticated --- Verify if `sudo` is already authenticated
--- @return boolean --- @return boolean
local function sudo_already() local function sudo_already()
local status = Command("sudo"):args({ "--validate", "--non-interactive" }):status() local status = Command("sudo"):arg({ "--validate", "--non-interactive" }):status()
assert(status, "Failed to run `sudo --validate --non-interactive`") assert(status, "Failed to run `sudo --validate --non-interactive`")
return status.success return status.success
end end
@@ -36,12 +36,12 @@ end
--- nil: no error --- nil: no error
--- 1: sudo failed --- 1: sudo failed
local function run_with_sudo(program, args) local function run_with_sudo(program, args)
local cmd = Command("sudo"):args({ program, table.unpack(args) }):stdout(Command.PIPED):stderr(Command.PIPED) local cmd = Command("sudo"):arg({ program, table.unpack(args) }):stdout(Command.PIPED):stderr(Command.PIPED)
if sudo_already() then if sudo_already() then
return cmd:output() return cmd:output()
end end
local permit = ya.hide() local permit = ui.hide()
print(string.format("Sudo password required to run: `%s %s`", program, table.concat(args, " "))) print(string.format("Sudo password required to run: `%s %s`", program, table.concat(args, " ")))
local output = cmd:output() local output = cmd:output()
permit:drop() permit:drop()
@@ -67,7 +67,7 @@ end
---@param cwd string ---@param cwd string
---@return string|nil ---@return string|nil
local get_filesystem_type = function(cwd) local get_filesystem_type = function(cwd)
local stat, _ = Command("stat"):args({ "-f", "-c", "%T", cwd }):output() local stat, _ = Command("stat"):arg({ "-f", "-c", "%T", cwd }):output()
if not stat.status.success then if not stat.status.success then
return nil return nil
end end
@@ -77,7 +77,7 @@ end
---@param cwd string ---@param cwd string
---@return string|nil ---@return string|nil
local zfs_dataset = function(cwd) local zfs_dataset = function(cwd)
local df, _ = Command("df"):args({ "--output=source", cwd }):output() local df, _ = Command("df"):arg({ "--output=source", cwd }):output()
local dataset = nil local dataset = nil
for line in df.stdout:gmatch("[^\r\n]+") do for line in df.stdout:gmatch("[^\r\n]+") do
-- dataset is last line in output -- dataset is last line in output
@@ -89,7 +89,7 @@ end
---@param dataset string ---@param dataset string
---@return string|nil ---@return string|nil
local zfs_mountpoint = function(dataset) local zfs_mountpoint = function(dataset)
local zfs, _ = Command("zfs"):args({ "get", "-H", "-o", "value", "mountpoint", dataset }):output() local zfs, _ = Command("zfs"):arg({ "get", "-H", "-o", "value", "mountpoint", dataset }):output()
-- not a dataset! -- not a dataset!
if not zfs.status.success then if not zfs.status.success then
@@ -157,7 +157,7 @@ end
---@return Snapshot[] ---@return Snapshot[]
local zfs_snapshots = function(dataset, mountpoint, relative) local zfs_snapshots = function(dataset, mountpoint, relative)
-- -S is for reverse order -- -S is for reverse order
local zfs_snapshots, _ = Command("zfs"):args({ "list", "-H", "-t", "snapshot", "-o", "name", "-S", "creation", local zfs_snapshots, _ = Command("zfs"):arg({ "list", "-H", "-t", "snapshot", "-o", "name", "-S", "creation",
dataset }) dataset })
:output() :output()
@@ -183,7 +183,7 @@ end
---@param cwd string ---@param cwd string
---@return string|nil ---@return string|nil
local function btrfs_mountpoint(cwd) local function btrfs_mountpoint(cwd)
local cmd, _ = Command("findmnt"):args({ "-no", "TARGET", "-T", cwd }):output() local cmd, _ = Command("findmnt"):arg({ "-no", "TARGET", "-T", cwd }):output()
if not cmd.status.success then if not cmd.status.success then
return nil return nil
end end
@@ -329,7 +329,7 @@ return {
end end
if action == "exit" then if action == "exit" then
ya.manager_emit("cd", { latest_path }) ya.emit("cd", { latest_path })
return return
end end
@@ -343,7 +343,7 @@ return {
local find_and_goto_snapshot = function(start_idx, end_idx, step) local find_and_goto_snapshot = function(start_idx, end_idx, step)
if start_idx == 0 then if start_idx == 0 then
-- going from newest snapshot to current state -- going from newest snapshot to current state
return ya.manager_emit("cd", { latest_path }) return ya.emit("cd", { latest_path })
elseif start_idx < 0 then elseif start_idx < 0 then
return notify_warn("No earlier snapshots found.") return notify_warn("No earlier snapshots found.")
elseif start_idx > #snapshots then elseif start_idx > #snapshots then
@@ -353,7 +353,7 @@ return {
for i = start_idx, end_idx, step do for i = start_idx, end_idx, step do
local snapshot_dir = snapshots[i].path local snapshot_dir = snapshots[i].path
if io.open(snapshot_dir, "r") then if io.open(snapshot_dir, "r") then
return ya.manager_emit("cd", { snapshot_dir }) return ya.emit("cd", { snapshot_dir })
end end
end end

View File

@@ -0,0 +1,43 @@
local M = {}
function M:peek(job)
local child = Command("transmission-show")
:arg(tostring(job.file.url))
:stdout(Command.PIPED)
:stderr(Command.PIPED)
:spawn()
if not child then
return require("code"):peek(job)
end
local limit = job.area.h
local i, lines = 0, ""
repeat
local next, event = child:read_line()
if event == 1 then
return require("code"):peek(job)
elseif event ~= 0 then
break
end
i = i + 1
if i > job.skip then
lines = lines .. next
end
until i >= job.skip + limit
child:start_kill()
if job.skip > 0 and i < job.skip + limit then
ya.manager_emit("peek", { math.max(0, i - limit), only_if = job.file.url, upper_bound = true })
else
lines = lines:gsub("\t", string.rep(" ", rt.preview.tab_size))
ya.preview_widget(job, { ui.Text.parse(lines):area(job.area) })
end
end
function M:seek(job)
require("code"):seek(job)
end
return M

View File

@@ -14,31 +14,46 @@ what-size supports Yazi on Linux, macOS, and Windows.
### Yazi ### Yazi
- yazi `25.5.28` and onwards since commit `c5c939b` ([link](https://github.com/pirafrank/what-size.yazi/commit/c5c939bb37ec1d132c942cf5724d4e847acc2977)) In an effort to make things easy, I keep `compatibility/yazi-x.y.z` branches with each pointing to the most up-to-date commit compatible with yazi release `x.y.z`. Full table below.
- yazi `25.x`-`25.4.8` since commit `fce1778` ([link](https://github.com/pirafrank/what-size.yazi/commit/fce1778d911621dc57796cdfdf11dcda3c2e28de))
- yazi `0.4.x` since commit `2780de5` ([link](https://github.com/pirafrank/what-size.yazi/commit/2780de5aeef1ed16d1973dd6e0cd4d630c900d56)) |Yazi releases|what-size branch name|
- yazi `0.3.x` up to commit `f08f7f2` ([link](https://github.com/pirafrank/what-size.yazi/commit/f08f7f2d5c94958ac4cb66c51a7c24b4319c6c93)) |---|---|
|*[latest stable](https://github.com/sxyazi/yazi/releases/latest)*|`main`|
|`25.5.28`|`compatibility/yazi-25.5.28`|
|`25.x`-`25.4.8`|`compatibility/yazi-25.4.8`|
|`0.4.x`|`compatibility/yazi-0.4.x`|
|`0.3.x`|`compatibility/yazi-0.3.x`|
Please notice that `nightly` releses may work but are not explicitly supported.
## Requirements ## Requirements
### Before Yazi's version 25.5.28
- Use this commit: [Old version](https://github.com/pirafrank/what-size.yazi/commit/d8966568f2a80394bf1f9a1ace6708ddd4cc8154)
- `du` on Linux and macOS - `du` on Linux and macOS
- PowerShell on Windows - PowerShell on Windows
### On Yazi's version 25.5.28 or newer
- No requirement
## Installation ## Installation
```sh ```sh
ya pkg add pirafrank/what-size ya pkg add pirafrank/what-size
``` ```
or or (**DEPRECATED** - use only for yazi `25.4.8` and older):
**DEPRECATED**
```sh ```sh
ya pack -a 'pirafrank/what-size' ya pack -a 'pirafrank/what-size'
``` ```
## Usage ## Usage
### Keymap
Add this to your `~/.config/yazi/keymap.toml`: Add this to your `~/.config/yazi/keymap.toml`:
```toml ```toml
@@ -54,18 +69,30 @@ If you want to copy the result to clipboard, you can add `--clipboard` or `-c` a
[[mgr.prepend_keymap]] [[mgr.prepend_keymap]]
on = [ ".", "s" ] on = [ ".", "s" ]
run = "plugin what-size -- '--clipboard'" run = "plugin what-size -- '--clipboard'"
desc = "Calc size of selection or cwd" desc = "Calc size of sel/cwd + paste to clipboard"
``` ```
```toml ```toml
[[mgr.prepend_keymap]] [[mgr.prepend_keymap]]
on = [ ".", "s" ] on = [ ".", "s" ]
run = "plugin what-size -- '-c'" run = "plugin what-size -- '-c'"
desc = "Calc size of selection or cwd" desc = "Calc size of sel/cwd + paste to clipboard"
``` ```
Change to whatever keybinding you like. Change to whatever keybinding you like.
### User interface (optional)
If you want to place the size value exactly where you want, modify the priority value. Also changing two strings `LEFT` and `RIGHT` will add them to the left and right side of the value. Remember to add to and change these lines inside your `init.lua` file if you want to customize, or the plugin will use this configuration by default:
```lua
require("what-size"):setup({
priority = 400,
LEFT = "",
RIGHT = " ",
})
```
## Feedback ## Feedback
If you have any feedback, suggestions, or ideas please let me know by opening an issue. If you have any feedback, suggestions, or ideas please let me know by opening an issue.
@@ -82,6 +109,16 @@ YAZI_LOG=debug yazi
Logs will be saved to `~.local/state/yazi/yazi.log` file. Logs will be saved to `~.local/state/yazi/yazi.log` file.
### Plugin definition
The repo already has a `.luarc.json` file. You only need to run the following to add the `types` plugin dependency:
```sh
ya pkg add yazi-rs/plugins:types
```
as per the [docs](https://github.com/yazi-rs/plugins/tree/main/types.yazi).
## Contributing ## Contributing
Contributions are welcome. Please fork the repository and submit a PR. Contributions are welcome. Please fork the repository and submit a PR.

View File

@@ -1,102 +1,238 @@
--- @since 25.5.28
-- This plugin is now only supporting Yazi's version 25.5.28 or newer
-- since commit https://github.com/sxyazi/yazi/pull/2695
-- function to get paths of selected elements or current directory -- TODO: Asynchronous calculating and dynamic displaying in statusline,
-- if no elements are selected -- perhaps by using this:
local get_paths = ya.sync(function() -- https://yazi-rs.github.io/docs/plugins/utils/#ps.sub
local paths = {} -- and by using ui.render() method
-- get selected files -- See also:
for _, u in pairs(cx.active.selected) do -- https://github.com/sxyazi/yazi/pull/1903
paths[#paths + 1] = tostring(u) -- https://yazi-rs.github.io/docs/dds/#kinds
end -- https://github.com/sxyazi/yazi/pull/2210
-- if no files are selected, get current directory -- https://github.com/imsi32/yatline.yazi
if #paths == 0 then -- TODO: Add options to choose displaying in popup box or in statusline
if cx.active.current.cwd then -- TODO: Add spotter and previewer widget to support simpler displaying
paths[1] = tostring(cx.active.current.cwd) -- TODO: Remove note [1] and [2] after add them to the setup
else -- configuration
ya.err("what-size would return nil paths")
-- Get selected paths {{{1
local get_selected_paths = ya.sync(function(state)
local result = {}
if cx and cx.active and cx.active.selected then
for _, url in pairs(cx.active.selected) do
result[#result + 1] = url
end
end end
end return result
return paths
end) end)
-- }}}1
-- Function to get total size from output -- Get current working directory in sync context {{{1
-- Unix use `du`, Windows use PowerShell local get_cwd = ya.sync(function(state)
if cx and cx.active and cx.active.current and cx.active.current.cwd then
return cx.active.current.cwd
end
return nil
end)
-- }}}1
-- Function to get paths of selected files or current directory {{{1
--- @param selected table Table of selected urls
--- @return paths table Table of selected urls
local function get_paths(selected)
-- If no files are selected, get current directory
if #selected == 0 then
local paths = {}
-- Try fs.cwd() first (async, optimized for slow devices)
local cwd, err = fs.cwd()
if cwd then
paths[1] = cwd
else
-- Fallback to cx.active.current.cwd (via sync block)
local sync_cwd = get_cwd()
if sync_cwd then
paths[1] = sync_cwd
else
ya.notify {
title = "What size",
content = "Cannot get current working directory: " .. (err or "unknown error"),
timeout = 5,
level = "error",
}
end
end
return paths
else
-- This variable is a table of urls already
return selected
end
end
-- }}}1
-- Function to get total size using Yazi's fs.calc_size API {{{1
-- See: https://github.com/sxyazi/yazi/pull/2695
-- See: https://github.com/sxyazi/yazi/blob/main/yazi-plugin/preset/plugins/folder.lua
local function get_total_size(items) local function get_total_size(items)
local is_windows = package.config:sub(1,1) == '\\'
if is_windows then
local total = 0 local total = 0
for _, path in ipairs(items) do for _, url in ipairs(items) do
path = path:gsub('"', '\\"') local it = fs.calc_size(url)
local ps_cmd = string.format( while true do
[[powershell -Command "& { $p = '%s'; if (Test-Path $p) { if ((Get-ChildItem -Path $p -Recurse -Force -ErrorAction SilentlyContinue | Measure-Object Length -Sum).Sum) { (Get-ChildItem -Path $p -Recurse -Force -ErrorAction SilentlyContinue | Measure-Object Length -Sum).Sum } else { (Get-Item $p).Length } } }"]], local next = it:recv()
path if next then
) total = total + next
local pipe = io.popen(ps_cmd) else
local result = pipe:read("*a") break
-- Debug end
-- ya.notify { end
-- title = "Debug Output",
-- content = result,
-- timeout = 5,
-- }
pipe:close()
local num = tonumber(result)
if num then total = total + num end
end end
return total return total
else
local arg = ya.target_os() == "macos" and "-scA" or "-scb"
-- pass args as string
local cmd = Command("du"):arg(arg)
for _, path in ipairs(items) do
cmd = cmd:arg(path)
end
local output, err = cmd:output()
if not output then
ya.err("Failed to run du: " .. err)
end
local lines = {}
for line in output.stdout:gmatch("[^\n]+") do
lines[#lines + 1] = line
end
local last_line = lines[#lines]
local size = tonumber(last_line:match("^(%d+)"))
return ya.target_os() == "macos" and size * 512 or size
end
end end
-- }}}1
-- Function to format file size -- Function to format files/folders size {{{1
local function format_size(size) local function format_size(size)
local units = { "B", "KB", "MB", "GB", "TB" } local units = { "B", "KB", "MB", "GB", "TB" }
local unit_index = 1 local unit_index = 1
while size > 1024 and unit_index < #units do while size > 1024 and unit_index < #units do
size = size / 1024 size = size / 1024
unit_index = unit_index + 1 unit_index = unit_index + 1
end
return string.format("%.2f %s", size, units[unit_index])
end
return {
-- as per doc: https://yazi-rs.github.io/docs/plugins/overview#functional-plugin
entry = function(_, job)
-- defaults not to use clipboard, use it only if required by the user
local clipboard = job.args.clipboard == true or job.args[1] == "--clipboard" or job.args[1] == "-c"
local items = get_paths()
local total_size = get_total_size(items)
local formatted_size = format_size(total_size)
local notification_content = "Total size: " .. formatted_size
if clipboard then
ya.clipboard(formatted_size)
notification_content = notification_content .. "\nCopied to clipboard."
end end
return string.format("%.2f %s", size, units[unit_index])
end
-- }}}1
-- Generic setter for any state field {{{1
local set_state = ya.sync(function(state, field, value)
state[field] = value
end)
-- }}}1
-- Generic getter for any state field {{{1
local get_state = ya.sync(function(state, field)
return state[field] or nil
end)
-- }}}1
-- Get selecting state {{{1
local get_selected = ya.sync(function()
return (not cx.active.mode.is_visual) and (#cx.active.selected ~= 0)
end)
-- }}}1
-- Set separators {{{1
local set_separator = ya.sync(function(state, table)
if table and table.LEFT and table.RIGHT then
state.LEFT = table.LEFT
state.RIGHT = table.RIGHT
else
state.LEFT = " "
state.RIGHT = " "
end
end)
-- }}}1
-- Get separators {{{1
local get_separator = ya.sync(function(state)
return {state.LEFT, state.RIGHT}
end)
-- }}}1
-- Redraw statusline {{{1
local redraw_statusline = ya.sync(function(state)
ui.render()
end)
-- }}}1
-- Set ui line in statusline for size, clean up when no selection exists {{{1
-- @return of get_state("renewed_state") number or nil Returning -1
-- means never show the size - suitable for setup function;
-- returning 0 means the size will be shown after triggering the
-- calculation, but without unselect the selections, or it will be
-- hidden after nothing is selected; returning 1 means hidden when
-- nothing is selected as said.
local set_ui_line = function(state)
local sep_left, sep_right = table.unpack(get_separator())
ya.notify { if get_state("renewed_state") == -1 then
title = "What size", return ""
content = notification_content, else
timeout = 4, if not get_selected() then
} if not get_state("is_held") then
end, set_state("renewed_state", 1)
return ""
end
-- NOTE [1]: Set this line if DON'T want to clear the value
-- in the statusline when move the cursor, after calculating
-- with NO selection(s). Or just return ""
return ui.Span(sep_left .. get_state("size") .. sep_right)
end
if get_state("renewed_state") == 0 then
return ui.Span(sep_left .. get_state("size") .. sep_right)
else
-- NOTE [2]: Set this line if want to clear the value in the
-- statusline when move the cursor, after calculating WITH
-- selection: return ui.Span(sep_left .. get_state("size") .. sep_right)
-- or just remove after the unselection like below
return ""
end
end
end
-- }}}1
--- @since 25.12.29
return {
entry = function(self, job)
local clipboard = job.args.clipboard or job.args[1] == '-c'
local selected = get_selected_paths()
local prepend_msg
-- Keep showing the size after CWD calculation (no selections)
if #selected == 0 then
set_state("is_held", true)
prepend_msg = "Current Dir: "
else
set_state("is_held", false)
prepend_msg = "Selected: "
end
local items = get_paths(selected)
if not items or #items == 0 then
ya.notify {
title = "What size",
content = "Failed to get paths",
timeout = 5,
}
return
end
local total_size = get_total_size(items)
if not total_size then
ya.notify {
title = "What size",
content = "Failed to calculate size",
timeout = 5,
}
return
end
local formatted_size = format_size(total_size)
local notification_content = prepend_msg .. formatted_size
if clipboard then
ya.clipboard(formatted_size)
notification_content = notification_content .. "\nCopied to clipboard."
end
ya.notify {
title = "What size",
content = notification_content,
timeout = 4,
}
set_state("size", formatted_size)
set_state("renewed_state", 0)
redraw_statusline()
end,
setup = function(state, opts)
opts = opts or {}
local priority = opts.priority or 400
set_separator(opts)
set_state("renewed_state", -1)
if Status and type(Status.children_add) == "function" then
Status:children_add(set_ui_line, priority, Status.RIGHT)
else
ya.err("Failed to initialize status bar: Status or children_add not available")
end
end,
} }

View File

@@ -1,4 +1,5 @@
# yatline.yazi # yatline.yazi
The first Yazi plugin for customizing both header-line and status-line. The first Yazi plugin for customizing both header-line and status-line.
![yatline](https://github.com/user-attachments/assets/61013ec8-7fd9-42df-a9f4-f254663871fe) ![yatline](https://github.com/user-attachments/assets/61013ec8-7fd9-42df-a9f4-f254663871fe)
@@ -7,13 +8,16 @@ The first Yazi plugin for customizing both header-line and status-line.
> Check out [wiki](https://github.com/imsi32/yatline.yazi/wiki) for installation steps, configuration and further information. > Check out [wiki](https://github.com/imsi32/yatline.yazi/wiki) for installation steps, configuration and further information.
## Features ## Features
- Lualine-like Design - Lualine-like Design
- Flexible - Flexible
- Simple - Simple
- Automatic Configuration - Automatic Configuration
- Support for Yazi Plugins
- Themes (See: [yatline-themes](https://github.com/imsi32/yatline-themes)) - Themes (See: [yatline-themes](https://github.com/imsi32/yatline-themes))
- Add-ons (See: [yatline-addons](https://github.com/imsi32/yatline-addons)) - Add-ons (See: [yatline-addons](https://github.com/imsi32/yatline-addons))
## Credits ## Credits
- [Lualine](https://github.com/nvim-lualine/lualine.nvim) - [Lualine](https://github.com/nvim-lualine/lualine.nvim)
- [Yazi](https://github.com/sxyazi/yazi) - [Yazi](https://github.com/sxyazi/yazi)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -56,7 +56,7 @@ play = [
[open] [open]
rules = [ rules = [
# Folder # Folder
{name = "*/", use = [ "edit", "open", "reveal" ]}, {url = "*/", use = [ "edit", "open", "reveal" ]},
# Text # Text
{mime = "text/*", use = [ "edit", "reveal" ]}, {mime = "text/*", use = [ "edit", "reveal" ]},
# Image # Image
@@ -71,7 +71,7 @@ rules = [
# Empty file # Empty file
{mime = "inode/empty", use = [ "edit", "reveal" ]}, {mime = "inode/empty", use = [ "edit", "reveal" ]},
# Fallback # Fallback
{name = "*", use = [ "open", "reveal" ]}, {url = "*", use = [ "open", "reveal" ]},
] ]
[tasks] [tasks]
@@ -89,14 +89,14 @@ preloaders = [
{mime = "application/pdf", run = "pdf"}, {mime = "application/pdf", run = "pdf"},
] ]
previewers = [ previewers = [
{name = "*/", run = "folder", sync = true}, {url = "*/", run = "folder", sync = true},
{mime = "text/*", run = "code"}, {mime = "text/*", run = "code"},
{mime = "*/{xml,javascript,x-wine-extension-ini}", run = "code"}, {mime = "*/{xml,javascript,x-wine-extension-ini}", run = "code"},
{mime = "application/json", run = "code"}, {mime = "application/json", run = "code"},
{mime = "image/vnd.djvu", run = "noop"}, {mime = "image/vnd.djvu", run = "noop"},
{mime = "application/pdf", run = "pdf"}, {mime = "application/pdf", run = "pdf"},
# Fallback # Fallback
{name = "*", run = "file"}, {url = "*", run = "file"},
] ]
prepend_previewers = [ prepend_previewers = [
{mime = "text/csv", run = "miller"}, {mime = "text/csv", run = "miller"},
@@ -104,11 +104,11 @@ prepend_previewers = [
{mime = "{audio,video,image}/*", run = "mediainfo"}, {mime = "{audio,video,image}/*", run = "mediainfo"},
{mime = "application/subrip", run = "mediainfo"}, {mime = "application/subrip", run = "mediainfo"},
# rich preview # rich preview
{name = "*.csv", run = "rich-preview"}, # for csv files {url = "*.csv", run = "rich-preview"}, # for csv files
{name = "*.{md,mdx,markdown}", run = "rich-preview"}, # for markdown (.md) files {url = "*.{md,mdx,markdown}", run = "rich-preview"}, # for markdown (.md) files
{name = "*.rst", run = "rich-preview"}, # for restructured text (.rst) files {url = "*.rst", run = "rich-preview"}, # for restructured text (.rst) files
{name = "*.ipynb", run = "rich-preview"}, # for jupyter notebooks (.ipynb) {url = "*.ipynb", run = "rich-preview"}, # for jupyter notebooks (.ipynb)
{name = "*.json", run = "rich-preview"}, # for json (.json) files {url = "*.json", run = "rich-preview"}, # for json (.json) files
{mime = "application/bittorrent", run = "torrent-preview"}, {mime = "application/bittorrent", run = "torrent-preview"},
# Archive previewer # Archive previewer
{mime = "application/*zip", run = "ouch"}, {mime = "application/*zip", run = "ouch"},
@@ -127,16 +127,16 @@ prepend_previewers = [
{mime = "application/oasis.opendocument.*", run = "office"}, {mime = "application/oasis.opendocument.*", run = "office"},
{mime = "application/ms-*", run = "office"}, {mime = "application/ms-*", run = "office"},
{mime = "application/msword", run = "office"}, {mime = "application/msword", run = "office"},
{name = "*.docx", run = "office"}, {url = "*.docx", run = "office"},
] ]
append_previewers = [ append_previewers = [
{name = "*", run = "hexyl"}, {url = "*", run = "hexyl"},
] ]
prepend_fetchers = [ prepend_fetchers = [
{id = "git", name = "*", run = "git"}, {id = "git", url = "*", run = "git"},
{id = "git", name = "*/", run = "git"}, {id = "git", url = "*/", run = "git"},
] ]
[input] [input]

View File

@@ -1,116 +0,0 @@
#compdef bat
local curcontext="$curcontext" ret=1
local -a state state_descr line
typeset -A opt_args
(( $+functions[_bat_cache_subcommand] )) ||
_bat_cache_subcommand() {
local -a args
args=(
'(-b --build -c --clear)'{-b,--build}'[initialize or update the syntax/theme cache]'
'(-b --build -c --clear)'{-c,--clear}'[remove the cached syntax definitions and themes]'
--source='[specify directory to load syntaxes and themes from]:directory:_files -/'
--target='[specify directory to store the cached syntax and theme set in]:directory:_files -/'
--blank'[create completely new syntax and theme sets]'
--acknowledgements'[build acknowledgements.bin]'
'(: -)'{-h,--help}'[show help information]'
)
_arguments -S -s $args
}
(( $+functions[_bat_main] )) ||
_bat_main() {
local -a args
args=(
'(-A --show-all)'{-A,--show-all}'[show non-printable characters (space, tab, newline, ..)]'
--nonprintable-notation='[specify how to display non-printable characters when using --show-all]:notation:(caret unicode)'
\*{-p,--plain}'[show plain style (alias for `--style=plain`), repeat twice to disable automatic paging (alias for `--paging=never`)]'
'(-l --language)'{-l+,--language=}'[set the language for syntax highlighting]:language:->languages'
\*{-H+,--highlight-line=}'[highlight specified block of lines]:start\:end'
\*--file-name='[specify the name to display for a file]:name:_files'
'(-d --diff)'--diff'[only show lines that have been added/removed/modified]'
--diff-context='[specify lines of context around added/removed/modified lines when using `--diff`]:lines'
--tabs='[set the tab width]:tab width [4]'
--wrap='[specify the text-wrapping mode]:mode [auto]:(auto never character)'
'!(--wrap)'{-S,--chop-long-lines}
--terminal-width='[explicitly set the width of the terminal instead of determining it automatically]:width'
'(-n --number --diff --diff-context)'{-n,--number}'[show line numbers]'
--color='[specify when to use colors]:when:(auto never always)'
--italic-text='[use italics in output]:when:(always never)'
--decorations='[specify when to show the decorations]:when:(auto never always)'
--paging='[specify when to use the pager]:when:(auto never always)'
'(-m --map-syntax)'{-m+,--map-syntax=}'[map a glob pattern to an existing syntax name]: :->syntax-maps'
'(--theme)'--theme='[set the color theme for syntax highlighting]:theme:->theme_preferences'
'(--theme-dark)'--theme-dark='[set the color theme for syntax highlighting for dark backgrounds]:theme:->themes'
'(--theme-light)'--theme-light='[set the color theme for syntax highlighting for light backgrounds]:theme:->themes'
'(: --list-themes --list-languages -L)'--list-themes'[show all supported highlighting themes]'
--style='[comma-separated list of style elements to display]: : _values "style [default]"
default auto full plain changes header header-filename header-filesize grid rule numbers snip'
\*{-r+,--line-range=}'[only print the specified line range]:start\:end'
'(* -)'{-L,--list-languages}'[display all supported languages]'
-P'[disable paging]'
"--no-config[don't use the configuration file]"
"--no-custom-assets[don't load custom assets]"
'(--no-lessopen)'--lessopen'[enable the $LESSOPEN preprocessor]'
'(--lessopen)'--no-lessopen'[disable the $LESSOPEN preprocessor if enabled (overrides --lessopen)]'
'(* -)'--config-dir"[show bat's configuration directory]"
'(* -)'--config-file'[show path to the configuration file]'
'(* -)'--generate-config-file'[generate a default configuration file]'
'(* -)'--cache-dir"[show bat's cache directory]"
'(* -)'{-h,--help}'[show help information]'
'(* -)'{-V,--version}'[show version information]'
'*: :{ _files || compadd cache }'
)
_arguments -S -s $args && ret=0
case "$state" in
syntax-maps)
if ! compset -P '*:'; then
_message -e patterns 'glob pattern:language'
return
fi
;& # fall-through
languages)
local IFS=$'\n'
local -a languages
languages=( $(bat --list-languages | awk -F':|,' '{ for (i = 1; i <= NF; ++i) printf("%s:%s\n", $i, $1) }') )
_describe 'language' languages && ret=0
;;
themes)
local -a themes expl
themes=(${(f)"$(_call_program themes bat --list-themes)"} )
_wanted themes expl 'theme' compadd -a themes && ret=0
;;
theme_preferences)
local -a themes expl
themes=(auto dark light auto:always auto:system ${(f)"$(_call_program themes bat --list-themes)"} )
_wanted themes expl 'theme' compadd -a themes && ret=0
;;
esac
return ret
}
case $words[2] in
cache)
## Completion of the 'cache' command itself is removed for better UX
## See https://github.com/sharkdp/bat/issues/2085#issuecomment-1271646802
shift words
(( CURRENT-- ))
curcontext="${curcontext%:*}-${words[1]}:"
_bat_cache_subcommand
;;
*)
_bat_main
;;
esac

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,355 @@
#compdef cargo-leptos
autoload -U is-at-least
_cargo-leptos() {
typeset -A opt_args
typeset -a _arguments_options
local ret=1
if is-at-least 5.2; then
_arguments_options=(-s -S -C)
else
_arguments_options=(-s -C)
fi
local context curcontext="$curcontext" state line
_arguments "${_arguments_options[@]}" : \
'--manifest-path=[Path to Cargo.toml]:MANIFEST_PATH:_default' \
'*--log=[Output logs from dependencies (multiple --log accepted)]:LOG:((wasm\:"WASM build (wasm, wasm-opt, walrus)"
server\:"Internal reload and csr server (hyper, axum)"))' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
":: :_cargo-leptos_commands" \
"*::: :->cargo-leptos" \
&& ret=0
case $state in
(cargo-leptos)
words=($line[1] "${words[@]}")
(( CURRENT += 1 ))
curcontext="${curcontext%:*:*}:cargo-leptos-command-$line[1]:"
case $line[1] in
(build)
_arguments "${_arguments_options[@]}" : \
'-p+[Which project to use, from a list of projects defined in a workspace]:PROJECT:_default' \
'--project=[Which project to use, from a list of projects defined in a workspace]:PROJECT:_default' \
'*--features=[The features to use when compiling all targets]:FEATURES:_default' \
'*--lib-features=[The features to use when compiling the lib target]:LIB_FEATURES:_default' \
'*--lib-cargo-args=[The cargo flags to pass to cargo when compiling the lib target]:LIB_CARGO_ARGS:_default' \
'*--bin-features=[The features to use when compiling the bin target]:BIN_FEATURES:_default' \
'*--bin-cargo-args=[The cargo flags to pass to cargo when compiling the bin target]:BIN_CARGO_ARGS:_default' \
'--js-minify=[Minify javascript assets with swc. Applies to release builds only]:JS_MINIFY:(true false)' \
'-r[Build artifacts in release mode, with optimizations]' \
'--release[Build artifacts in release mode, with optimizations]' \
'-P[Precompress static assets with gzip and brotli. Applies to release builds only]' \
'--precompress[Precompress static assets with gzip and brotli. Applies to release builds only]' \
'--hot-reload[Turn on partial hot-reloading. Requires rust nightly \[beta\]]' \
'--wasm-debug[Include debug information in Wasm output. Includes source maps and DWARF debug info]' \
'*-v[Verbosity (none\: info, errors & warnings, -v\: verbose, -vv\: very verbose)]' \
'-c[Clear the terminal before rebuilding]' \
'--clear[Clear the terminal before rebuilding]' \
'--split[Split WASM binary based on #\[lazy\] macros]' \
'--frontend-only[Only build the frontend]' \
'(--frontend-only)--server-only[Only build the server]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(test)
_arguments "${_arguments_options[@]}" : \
'-p+[Which project to use, from a list of projects defined in a workspace]:PROJECT:_default' \
'--project=[Which project to use, from a list of projects defined in a workspace]:PROJECT:_default' \
'*--features=[The features to use when compiling all targets]:FEATURES:_default' \
'*--lib-features=[The features to use when compiling the lib target]:LIB_FEATURES:_default' \
'*--lib-cargo-args=[The cargo flags to pass to cargo when compiling the lib target]:LIB_CARGO_ARGS:_default' \
'*--bin-features=[The features to use when compiling the bin target]:BIN_FEATURES:_default' \
'*--bin-cargo-args=[The cargo flags to pass to cargo when compiling the bin target]:BIN_CARGO_ARGS:_default' \
'--js-minify=[Minify javascript assets with swc. Applies to release builds only]:JS_MINIFY:(true false)' \
'-r[Build artifacts in release mode, with optimizations]' \
'--release[Build artifacts in release mode, with optimizations]' \
'-P[Precompress static assets with gzip and brotli. Applies to release builds only]' \
'--precompress[Precompress static assets with gzip and brotli. Applies to release builds only]' \
'--hot-reload[Turn on partial hot-reloading. Requires rust nightly \[beta\]]' \
'--wasm-debug[Include debug information in Wasm output. Includes source maps and DWARF debug info]' \
'*-v[Verbosity (none\: info, errors & warnings, -v\: verbose, -vv\: very verbose)]' \
'-c[Clear the terminal before rebuilding]' \
'--clear[Clear the terminal before rebuilding]' \
'--split[Split WASM binary based on #\[lazy\] macros]' \
'--frontend-only[Only build the frontend]' \
'(--frontend-only)--server-only[Only build the server]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(end-to-end)
_arguments "${_arguments_options[@]}" : \
'-p+[Which project to use, from a list of projects defined in a workspace]:PROJECT:_default' \
'--project=[Which project to use, from a list of projects defined in a workspace]:PROJECT:_default' \
'*--features=[The features to use when compiling all targets]:FEATURES:_default' \
'*--lib-features=[The features to use when compiling the lib target]:LIB_FEATURES:_default' \
'*--lib-cargo-args=[The cargo flags to pass to cargo when compiling the lib target]:LIB_CARGO_ARGS:_default' \
'*--bin-features=[The features to use when compiling the bin target]:BIN_FEATURES:_default' \
'*--bin-cargo-args=[The cargo flags to pass to cargo when compiling the bin target]:BIN_CARGO_ARGS:_default' \
'--js-minify=[Minify javascript assets with swc. Applies to release builds only]:JS_MINIFY:(true false)' \
'-r[Build artifacts in release mode, with optimizations]' \
'--release[Build artifacts in release mode, with optimizations]' \
'-P[Precompress static assets with gzip and brotli. Applies to release builds only]' \
'--precompress[Precompress static assets with gzip and brotli. Applies to release builds only]' \
'--hot-reload[Turn on partial hot-reloading. Requires rust nightly \[beta\]]' \
'--wasm-debug[Include debug information in Wasm output. Includes source maps and DWARF debug info]' \
'*-v[Verbosity (none\: info, errors & warnings, -v\: verbose, -vv\: very verbose)]' \
'-c[Clear the terminal before rebuilding]' \
'--clear[Clear the terminal before rebuilding]' \
'--split[Split WASM binary based on #\[lazy\] macros]' \
'--frontend-only[Only build the frontend]' \
'(--frontend-only)--server-only[Only build the server]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(serve)
_arguments "${_arguments_options[@]}" : \
'-p+[Which project to use, from a list of projects defined in a workspace]:PROJECT:_default' \
'--project=[Which project to use, from a list of projects defined in a workspace]:PROJECT:_default' \
'*--features=[The features to use when compiling all targets]:FEATURES:_default' \
'*--lib-features=[The features to use when compiling the lib target]:LIB_FEATURES:_default' \
'*--lib-cargo-args=[The cargo flags to pass to cargo when compiling the lib target]:LIB_CARGO_ARGS:_default' \
'*--bin-features=[The features to use when compiling the bin target]:BIN_FEATURES:_default' \
'*--bin-cargo-args=[The cargo flags to pass to cargo when compiling the bin target]:BIN_CARGO_ARGS:_default' \
'--js-minify=[Minify javascript assets with swc. Applies to release builds only]:JS_MINIFY:(true false)' \
'-r[Build artifacts in release mode, with optimizations]' \
'--release[Build artifacts in release mode, with optimizations]' \
'-P[Precompress static assets with gzip and brotli. Applies to release builds only]' \
'--precompress[Precompress static assets with gzip and brotli. Applies to release builds only]' \
'--hot-reload[Turn on partial hot-reloading. Requires rust nightly \[beta\]]' \
'--wasm-debug[Include debug information in Wasm output. Includes source maps and DWARF debug info]' \
'*-v[Verbosity (none\: info, errors & warnings, -v\: verbose, -vv\: very verbose)]' \
'-c[Clear the terminal before rebuilding]' \
'--clear[Clear the terminal before rebuilding]' \
'--split[Split WASM binary based on #\[lazy\] macros]' \
'--frontend-only[Only build the frontend]' \
'(--frontend-only)--server-only[Only build the server]' \
'-h[Print help]' \
'--help[Print help]' \
'*::bin_args:_default' \
&& ret=0
;;
(watch)
_arguments "${_arguments_options[@]}" : \
'-p+[Which project to use, from a list of projects defined in a workspace]:PROJECT:_default' \
'--project=[Which project to use, from a list of projects defined in a workspace]:PROJECT:_default' \
'*--features=[The features to use when compiling all targets]:FEATURES:_default' \
'*--lib-features=[The features to use when compiling the lib target]:LIB_FEATURES:_default' \
'*--lib-cargo-args=[The cargo flags to pass to cargo when compiling the lib target]:LIB_CARGO_ARGS:_default' \
'*--bin-features=[The features to use when compiling the bin target]:BIN_FEATURES:_default' \
'*--bin-cargo-args=[The cargo flags to pass to cargo when compiling the bin target]:BIN_CARGO_ARGS:_default' \
'--js-minify=[Minify javascript assets with swc. Applies to release builds only]:JS_MINIFY:(true false)' \
'-r[Build artifacts in release mode, with optimizations]' \
'--release[Build artifacts in release mode, with optimizations]' \
'-P[Precompress static assets with gzip and brotli. Applies to release builds only]' \
'--precompress[Precompress static assets with gzip and brotli. Applies to release builds only]' \
'--hot-reload[Turn on partial hot-reloading. Requires rust nightly \[beta\]]' \
'--wasm-debug[Include debug information in Wasm output. Includes source maps and DWARF debug info]' \
'*-v[Verbosity (none\: info, errors & warnings, -v\: verbose, -vv\: very verbose)]' \
'-c[Clear the terminal before rebuilding]' \
'--clear[Clear the terminal before rebuilding]' \
'--split[Split WASM binary based on #\[lazy\] macros]' \
'--frontend-only[Only build the frontend]' \
'(--frontend-only)--server-only[Only build the server]' \
'-h[Print help]' \
'--help[Print help]' \
'*::bin_args:_default' \
&& ret=0
;;
(new)
_arguments "${_arguments_options[@]}" : \
'-g+[Git repository to clone template from. Can be a full URL (like \`https\://github.com/leptos-rs/start\`), or a shortcut for one of our built-in templates\: \`leptos-rs/start\`, \`leptos-rs/start-axum\`, \`leptos-rs/start-axum-workspace\`, or \`leptos-rs/start-aws\`]:GIT:_default' \
'--git=[Git repository to clone template from. Can be a full URL (like \`https\://github.com/leptos-rs/start\`), or a shortcut for one of our built-in templates\: \`leptos-rs/start\`, \`leptos-rs/start-axum\`, \`leptos-rs/start-axum-workspace\`, or \`leptos-rs/start-aws\`]:GIT:_default' \
'(-t --tag)-b+[Branch to use when installing from git]:BRANCH:_default' \
'(-t --tag)--branch=[Branch to use when installing from git]:BRANCH:_default' \
'(-b --branch)-t+[Tag to use when installing from git]:TAG:_default' \
'(-b --branch)--tag=[Tag to use when installing from git]:TAG:_default' \
'-p+[Local path to copy the template from. Can not be specified together with --git]:PATH:_default' \
'--path=[Local path to copy the template from. Can not be specified together with --git]:PATH:_default' \
'-n+[Directory to create / project name; if the name isn'\''t in kebab-case, it will be converted to kebab-case unless \`--force\` is given]:NAME:_default' \
'--name=[Directory to create / project name; if the name isn'\''t in kebab-case, it will be converted to kebab-case unless \`--force\` is given]:NAME:_default' \
'-f[Don'\''t convert the project name to kebab-case before creating the directory. Note that cargo generate won'\''t overwrite an existing directory, even if \`--force\` is given]' \
'--force[Don'\''t convert the project name to kebab-case before creating the directory. Note that cargo generate won'\''t overwrite an existing directory, even if \`--force\` is given]' \
'-v[Enables more verbose output]' \
'--verbose[Enables more verbose output]' \
'--init[Generate the template directly into the current dir. No subfolder will be created and no vcs is initialized]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(completions)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
':shell:(bash elvish fish powershell zsh)' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_cargo-leptos__help_commands" \
"*::: :->help" \
&& ret=0
case $state in
(help)
words=($line[1] "${words[@]}")
(( CURRENT += 1 ))
curcontext="${curcontext%:*:*}:cargo-leptos-help-command-$line[1]:"
case $line[1] in
(build)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(test)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(end-to-end)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(serve)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(watch)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(new)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(completions)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
esac
;;
esac
;;
esac
;;
esac
}
(( $+functions[_cargo-leptos_commands] )) ||
_cargo-leptos_commands() {
local commands; commands=(
'build:Build the server (feature ssr) and the client (wasm with feature hydrate)' \
'test:Run the cargo tests for app, client and server' \
'end-to-end:Start the server and end-2-end tests' \
'serve:Serve. Defaults to hydrate mode' \
'watch:Serve and automatically reload when files change' \
'new:Start a wizard for creating a new project (using cargo-generate)' \
'completions:Generate shell for \`cargo-leptos\`' \
'help:Print this message or the help of the given subcommand(s)' \
)
_describe -t commands 'cargo-leptos commands' commands "$@"
}
(( $+functions[_cargo-leptos__build_commands] )) ||
_cargo-leptos__build_commands() {
local commands; commands=()
_describe -t commands 'cargo-leptos build commands' commands "$@"
}
(( $+functions[_cargo-leptos__completions_commands] )) ||
_cargo-leptos__completions_commands() {
local commands; commands=()
_describe -t commands 'cargo-leptos completions commands' commands "$@"
}
(( $+functions[_cargo-leptos__end-to-end_commands] )) ||
_cargo-leptos__end-to-end_commands() {
local commands; commands=()
_describe -t commands 'cargo-leptos end-to-end commands' commands "$@"
}
(( $+functions[_cargo-leptos__help_commands] )) ||
_cargo-leptos__help_commands() {
local commands; commands=(
'build:Build the server (feature ssr) and the client (wasm with feature hydrate)' \
'test:Run the cargo tests for app, client and server' \
'end-to-end:Start the server and end-2-end tests' \
'serve:Serve. Defaults to hydrate mode' \
'watch:Serve and automatically reload when files change' \
'new:Start a wizard for creating a new project (using cargo-generate)' \
'completions:Generate shell for \`cargo-leptos\`' \
'help:Print this message or the help of the given subcommand(s)' \
)
_describe -t commands 'cargo-leptos help commands' commands "$@"
}
(( $+functions[_cargo-leptos__help__build_commands] )) ||
_cargo-leptos__help__build_commands() {
local commands; commands=()
_describe -t commands 'cargo-leptos help build commands' commands "$@"
}
(( $+functions[_cargo-leptos__help__completions_commands] )) ||
_cargo-leptos__help__completions_commands() {
local commands; commands=()
_describe -t commands 'cargo-leptos help completions commands' commands "$@"
}
(( $+functions[_cargo-leptos__help__end-to-end_commands] )) ||
_cargo-leptos__help__end-to-end_commands() {
local commands; commands=()
_describe -t commands 'cargo-leptos help end-to-end commands' commands "$@"
}
(( $+functions[_cargo-leptos__help__help_commands] )) ||
_cargo-leptos__help__help_commands() {
local commands; commands=()
_describe -t commands 'cargo-leptos help help commands' commands "$@"
}
(( $+functions[_cargo-leptos__help__new_commands] )) ||
_cargo-leptos__help__new_commands() {
local commands; commands=()
_describe -t commands 'cargo-leptos help new commands' commands "$@"
}
(( $+functions[_cargo-leptos__help__serve_commands] )) ||
_cargo-leptos__help__serve_commands() {
local commands; commands=()
_describe -t commands 'cargo-leptos help serve commands' commands "$@"
}
(( $+functions[_cargo-leptos__help__test_commands] )) ||
_cargo-leptos__help__test_commands() {
local commands; commands=()
_describe -t commands 'cargo-leptos help test commands' commands "$@"
}
(( $+functions[_cargo-leptos__help__watch_commands] )) ||
_cargo-leptos__help__watch_commands() {
local commands; commands=()
_describe -t commands 'cargo-leptos help watch commands' commands "$@"
}
(( $+functions[_cargo-leptos__new_commands] )) ||
_cargo-leptos__new_commands() {
local commands; commands=()
_describe -t commands 'cargo-leptos new commands' commands "$@"
}
(( $+functions[_cargo-leptos__serve_commands] )) ||
_cargo-leptos__serve_commands() {
local commands; commands=()
_describe -t commands 'cargo-leptos serve commands' commands "$@"
}
(( $+functions[_cargo-leptos__test_commands] )) ||
_cargo-leptos__test_commands() {
local commands; commands=()
_describe -t commands 'cargo-leptos test commands' commands "$@"
}
(( $+functions[_cargo-leptos__watch_commands] )) ||
_cargo-leptos__watch_commands() {
local commands; commands=()
_describe -t commands 'cargo-leptos watch commands' commands "$@"
}
if [ "$funcstack[1]" = "_cargo-leptos" ]; then
_cargo-leptos "$@"
else
compdef _cargo-leptos cargo-leptos
fi

View File

@@ -1,635 +0,0 @@
#compdef sqlx
autoload -U is-at-least
_sqlx() {
typeset -A opt_args
typeset -a _arguments_options
local ret=1
if is-at-least 5.2; then
_arguments_options=(-s -S -C)
else
_arguments_options=(-s -C)
fi
local context curcontext="$curcontext" state line
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
":: :_sqlx_commands" \
"*::: :->sqlx-cli" \
&& ret=0
case $state in
(sqlx-cli)
words=($line[1] "${words[@]}")
(( CURRENT += 1 ))
curcontext="${curcontext%:*:*}:sqlx-command-$line[1]:"
case $line[1] in
(database)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
":: :_sqlx__database_commands" \
"*::: :->database" \
&& ret=0
case $state in
(database)
words=($line[1] "${words[@]}")
(( CURRENT += 1 ))
curcontext="${curcontext%:*:*}:sqlx-database-command-$line[1]:"
case $line[1] in
(create)
_arguments "${_arguments_options[@]}" : \
'-D+[Location of the DB, by default will be read from the DATABASE_URL env var or \`.env\` files]:DATABASE_URL:_default' \
'--database-url=[Location of the DB, by default will be read from the DATABASE_URL env var or \`.env\` files]:DATABASE_URL:_default' \
'--connect-timeout=[The maximum time, in seconds, to try connecting to the database server before returning an error]:CONNECT_TIMEOUT:_default' \
'--no-dotenv[Do not automatically load \`.env\` files]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(drop)
_arguments "${_arguments_options[@]}" : \
'-D+[Location of the DB, by default will be read from the DATABASE_URL env var or \`.env\` files]:DATABASE_URL:_default' \
'--database-url=[Location of the DB, by default will be read from the DATABASE_URL env var or \`.env\` files]:DATABASE_URL:_default' \
'--connect-timeout=[The maximum time, in seconds, to try connecting to the database server before returning an error]:CONNECT_TIMEOUT:_default' \
'-y[Automatic confirmation. Without this option, you will be prompted before dropping your database]' \
'--no-dotenv[Do not automatically load \`.env\` files]' \
'-f[PostgreSQL only\: force drops the database]' \
'--force[PostgreSQL only\: force drops the database]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(reset)
_arguments "${_arguments_options[@]}" : \
'--source=[Path to folder containing migrations]:SOURCE:_default' \
'-D+[Location of the DB, by default will be read from the DATABASE_URL env var or \`.env\` files]:DATABASE_URL:_default' \
'--database-url=[Location of the DB, by default will be read from the DATABASE_URL env var or \`.env\` files]:DATABASE_URL:_default' \
'--connect-timeout=[The maximum time, in seconds, to try connecting to the database server before returning an error]:CONNECT_TIMEOUT:_default' \
'-y[Automatic confirmation. Without this option, you will be prompted before dropping your database]' \
'--no-dotenv[Do not automatically load \`.env\` files]' \
'-f[PostgreSQL only\: force drops the database]' \
'--force[PostgreSQL only\: force drops the database]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(setup)
_arguments "${_arguments_options[@]}" : \
'--source=[Path to folder containing migrations]:SOURCE:_default' \
'-D+[Location of the DB, by default will be read from the DATABASE_URL env var or \`.env\` files]:DATABASE_URL:_default' \
'--database-url=[Location of the DB, by default will be read from the DATABASE_URL env var or \`.env\` files]:DATABASE_URL:_default' \
'--connect-timeout=[The maximum time, in seconds, to try connecting to the database server before returning an error]:CONNECT_TIMEOUT:_default' \
'--no-dotenv[Do not automatically load \`.env\` files]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_sqlx__database__help_commands" \
"*::: :->help" \
&& ret=0
case $state in
(help)
words=($line[1] "${words[@]}")
(( CURRENT += 1 ))
curcontext="${curcontext%:*:*}:sqlx-database-help-command-$line[1]:"
case $line[1] in
(create)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(drop)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(reset)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(setup)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
esac
;;
esac
;;
esac
;;
esac
;;
(prepare)
_arguments "${_arguments_options[@]}" : \
'-D+[Location of the DB, by default will be read from the DATABASE_URL env var or \`.env\` files]:DATABASE_URL:_default' \
'--database-url=[Location of the DB, by default will be read from the DATABASE_URL env var or \`.env\` files]:DATABASE_URL:_default' \
'--connect-timeout=[The maximum time, in seconds, to try connecting to the database server before returning an error]:CONNECT_TIMEOUT:_default' \
'--check[Run in '\''check'\'' mode. Exits with 0 if the query metadata is up-to-date. Exits with 1 if the query metadata needs updating]' \
'--all[Prepare query macros in dependencies that exist outside the current crate or workspace]' \
'--workspace[Generate a single workspace-level \`.sqlx\` folder]' \
'--no-dotenv[Do not automatically load \`.env\` files]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'*::args -- Arguments to be passed to `cargo rustc ...`:_default' \
&& ret=0
;;
(migrate)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
":: :_sqlx__migrate_commands" \
"*::: :->migrate" \
&& ret=0
case $state in
(migrate)
words=($line[1] "${words[@]}")
(( CURRENT += 1 ))
curcontext="${curcontext%:*:*}:sqlx-migrate-command-$line[1]:"
case $line[1] in
(add)
_arguments "${_arguments_options[@]}" : \
'--source=[Path to folder containing migrations]:SOURCE:_default' \
'-r[If true, creates a pair of up and down migration files with same version else creates a single sql file]' \
'-t[If set, use timestamp versioning for the new migration. Conflicts with \`--sequential\`]' \
'--timestamp[If set, use timestamp versioning for the new migration. Conflicts with \`--sequential\`]' \
'(-t --timestamp)-s[If set, use sequential versioning for the new migration. Conflicts with \`--timestamp\`]' \
'(-t --timestamp)--sequential[If set, use sequential versioning for the new migration. Conflicts with \`--timestamp\`]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':description:_default' \
&& ret=0
;;
(run)
_arguments "${_arguments_options[@]}" : \
'--source=[Path to folder containing migrations]:SOURCE:_default' \
'-D+[Location of the DB, by default will be read from the DATABASE_URL env var or \`.env\` files]:DATABASE_URL:_default' \
'--database-url=[Location of the DB, by default will be read from the DATABASE_URL env var or \`.env\` files]:DATABASE_URL:_default' \
'--connect-timeout=[The maximum time, in seconds, to try connecting to the database server before returning an error]:CONNECT_TIMEOUT:_default' \
'--target-version=[Apply migrations up to the specified version. If unspecified, apply all pending migrations. If already at the target version, then no-op]:TARGET_VERSION:_default' \
'--dry-run[List all the migrations to be run without applying]' \
'--ignore-missing[Ignore applied migrations that are missing in the resolved migrations]' \
'--no-dotenv[Do not automatically load \`.env\` files]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(revert)
_arguments "${_arguments_options[@]}" : \
'--source=[Path to folder containing migrations]:SOURCE:_default' \
'-D+[Location of the DB, by default will be read from the DATABASE_URL env var or \`.env\` files]:DATABASE_URL:_default' \
'--database-url=[Location of the DB, by default will be read from the DATABASE_URL env var or \`.env\` files]:DATABASE_URL:_default' \
'--connect-timeout=[The maximum time, in seconds, to try connecting to the database server before returning an error]:CONNECT_TIMEOUT:_default' \
'--target-version=[Revert migrations down to the specified version. If unspecified, revert only the last migration. Set to 0 to revert all migrations. If already at the target version, then no-op]:TARGET_VERSION:_default' \
'--dry-run[List the migration to be reverted without applying]' \
'--ignore-missing[Ignore applied migrations that are missing in the resolved migrations]' \
'--no-dotenv[Do not automatically load \`.env\` files]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(info)
_arguments "${_arguments_options[@]}" : \
'--source=[Path to folder containing migrations]:SOURCE:_default' \
'-D+[Location of the DB, by default will be read from the DATABASE_URL env var or \`.env\` files]:DATABASE_URL:_default' \
'--database-url=[Location of the DB, by default will be read from the DATABASE_URL env var or \`.env\` files]:DATABASE_URL:_default' \
'--connect-timeout=[The maximum time, in seconds, to try connecting to the database server before returning an error]:CONNECT_TIMEOUT:_default' \
'--no-dotenv[Do not automatically load \`.env\` files]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(build-script)
_arguments "${_arguments_options[@]}" : \
'--source=[Path to folder containing migrations]:SOURCE:_default' \
'--force[Overwrite the build script if it already exists]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_sqlx__migrate__help_commands" \
"*::: :->help" \
&& ret=0
case $state in
(help)
words=($line[1] "${words[@]}")
(( CURRENT += 1 ))
curcontext="${curcontext%:*:*}:sqlx-migrate-help-command-$line[1]:"
case $line[1] in
(add)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(run)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(revert)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(info)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(build-script)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
esac
;;
esac
;;
esac
;;
esac
;;
(completions)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
':shell:(bash elvish fish powershell zsh)' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_sqlx__help_commands" \
"*::: :->help" \
&& ret=0
case $state in
(help)
words=($line[1] "${words[@]}")
(( CURRENT += 1 ))
curcontext="${curcontext%:*:*}:sqlx-help-command-$line[1]:"
case $line[1] in
(database)
_arguments "${_arguments_options[@]}" : \
":: :_sqlx__help__database_commands" \
"*::: :->database" \
&& ret=0
case $state in
(database)
words=($line[1] "${words[@]}")
(( CURRENT += 1 ))
curcontext="${curcontext%:*:*}:sqlx-help-database-command-$line[1]:"
case $line[1] in
(create)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(drop)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(reset)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(setup)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
esac
;;
esac
;;
(prepare)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(migrate)
_arguments "${_arguments_options[@]}" : \
":: :_sqlx__help__migrate_commands" \
"*::: :->migrate" \
&& ret=0
case $state in
(migrate)
words=($line[1] "${words[@]}")
(( CURRENT += 1 ))
curcontext="${curcontext%:*:*}:sqlx-help-migrate-command-$line[1]:"
case $line[1] in
(add)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(run)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(revert)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(info)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(build-script)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
esac
;;
esac
;;
(completions)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
esac
;;
esac
;;
esac
;;
esac
}
(( $+functions[_sqlx_commands] )) ||
_sqlx_commands() {
local commands; commands=(
'database:Group of commands for creating and dropping your database' \
'prepare:Generate query metadata to support offline compile-time verification' \
'migrate:Group of commands for creating and running migrations' \
'completions:Generate shell completions for the specified shell' \
'help:Print this message or the help of the given subcommand(s)' \
)
_describe -t commands 'sqlx commands' commands "$@"
}
(( $+functions[_sqlx__completions_commands] )) ||
_sqlx__completions_commands() {
local commands; commands=()
_describe -t commands 'sqlx completions commands' commands "$@"
}
(( $+functions[_sqlx__database_commands] )) ||
_sqlx__database_commands() {
local commands; commands=(
'create:Creates the database specified in your DATABASE_URL' \
'drop:Drops the database specified in your DATABASE_URL' \
'reset:Drops the database specified in your DATABASE_URL, re-creates it, and runs any pending migrations' \
'setup:Creates the database specified in your DATABASE_URL and runs any pending migrations' \
'help:Print this message or the help of the given subcommand(s)' \
)
_describe -t commands 'sqlx database commands' commands "$@"
}
(( $+functions[_sqlx__database__create_commands] )) ||
_sqlx__database__create_commands() {
local commands; commands=()
_describe -t commands 'sqlx database create commands' commands "$@"
}
(( $+functions[_sqlx__database__drop_commands] )) ||
_sqlx__database__drop_commands() {
local commands; commands=()
_describe -t commands 'sqlx database drop commands' commands "$@"
}
(( $+functions[_sqlx__database__help_commands] )) ||
_sqlx__database__help_commands() {
local commands; commands=(
'create:Creates the database specified in your DATABASE_URL' \
'drop:Drops the database specified in your DATABASE_URL' \
'reset:Drops the database specified in your DATABASE_URL, re-creates it, and runs any pending migrations' \
'setup:Creates the database specified in your DATABASE_URL and runs any pending migrations' \
'help:Print this message or the help of the given subcommand(s)' \
)
_describe -t commands 'sqlx database help commands' commands "$@"
}
(( $+functions[_sqlx__database__help__create_commands] )) ||
_sqlx__database__help__create_commands() {
local commands; commands=()
_describe -t commands 'sqlx database help create commands' commands "$@"
}
(( $+functions[_sqlx__database__help__drop_commands] )) ||
_sqlx__database__help__drop_commands() {
local commands; commands=()
_describe -t commands 'sqlx database help drop commands' commands "$@"
}
(( $+functions[_sqlx__database__help__help_commands] )) ||
_sqlx__database__help__help_commands() {
local commands; commands=()
_describe -t commands 'sqlx database help help commands' commands "$@"
}
(( $+functions[_sqlx__database__help__reset_commands] )) ||
_sqlx__database__help__reset_commands() {
local commands; commands=()
_describe -t commands 'sqlx database help reset commands' commands "$@"
}
(( $+functions[_sqlx__database__help__setup_commands] )) ||
_sqlx__database__help__setup_commands() {
local commands; commands=()
_describe -t commands 'sqlx database help setup commands' commands "$@"
}
(( $+functions[_sqlx__database__reset_commands] )) ||
_sqlx__database__reset_commands() {
local commands; commands=()
_describe -t commands 'sqlx database reset commands' commands "$@"
}
(( $+functions[_sqlx__database__setup_commands] )) ||
_sqlx__database__setup_commands() {
local commands; commands=()
_describe -t commands 'sqlx database setup commands' commands "$@"
}
(( $+functions[_sqlx__help_commands] )) ||
_sqlx__help_commands() {
local commands; commands=(
'database:Group of commands for creating and dropping your database' \
'prepare:Generate query metadata to support offline compile-time verification' \
'migrate:Group of commands for creating and running migrations' \
'completions:Generate shell completions for the specified shell' \
'help:Print this message or the help of the given subcommand(s)' \
)
_describe -t commands 'sqlx help commands' commands "$@"
}
(( $+functions[_sqlx__help__completions_commands] )) ||
_sqlx__help__completions_commands() {
local commands; commands=()
_describe -t commands 'sqlx help completions commands' commands "$@"
}
(( $+functions[_sqlx__help__database_commands] )) ||
_sqlx__help__database_commands() {
local commands; commands=(
'create:Creates the database specified in your DATABASE_URL' \
'drop:Drops the database specified in your DATABASE_URL' \
'reset:Drops the database specified in your DATABASE_URL, re-creates it, and runs any pending migrations' \
'setup:Creates the database specified in your DATABASE_URL and runs any pending migrations' \
)
_describe -t commands 'sqlx help database commands' commands "$@"
}
(( $+functions[_sqlx__help__database__create_commands] )) ||
_sqlx__help__database__create_commands() {
local commands; commands=()
_describe -t commands 'sqlx help database create commands' commands "$@"
}
(( $+functions[_sqlx__help__database__drop_commands] )) ||
_sqlx__help__database__drop_commands() {
local commands; commands=()
_describe -t commands 'sqlx help database drop commands' commands "$@"
}
(( $+functions[_sqlx__help__database__reset_commands] )) ||
_sqlx__help__database__reset_commands() {
local commands; commands=()
_describe -t commands 'sqlx help database reset commands' commands "$@"
}
(( $+functions[_sqlx__help__database__setup_commands] )) ||
_sqlx__help__database__setup_commands() {
local commands; commands=()
_describe -t commands 'sqlx help database setup commands' commands "$@"
}
(( $+functions[_sqlx__help__help_commands] )) ||
_sqlx__help__help_commands() {
local commands; commands=()
_describe -t commands 'sqlx help help commands' commands "$@"
}
(( $+functions[_sqlx__help__migrate_commands] )) ||
_sqlx__help__migrate_commands() {
local commands; commands=(
'add:Create a new migration with the given description' \
'run:Run all pending migrations' \
'revert:Revert the latest migration with a down file' \
'info:List all available migrations' \
'build-script:Generate a \`build.rs\` to trigger recompilation when a new migration is added' \
)
_describe -t commands 'sqlx help migrate commands' commands "$@"
}
(( $+functions[_sqlx__help__migrate__add_commands] )) ||
_sqlx__help__migrate__add_commands() {
local commands; commands=()
_describe -t commands 'sqlx help migrate add commands' commands "$@"
}
(( $+functions[_sqlx__help__migrate__build-script_commands] )) ||
_sqlx__help__migrate__build-script_commands() {
local commands; commands=()
_describe -t commands 'sqlx help migrate build-script commands' commands "$@"
}
(( $+functions[_sqlx__help__migrate__info_commands] )) ||
_sqlx__help__migrate__info_commands() {
local commands; commands=()
_describe -t commands 'sqlx help migrate info commands' commands "$@"
}
(( $+functions[_sqlx__help__migrate__revert_commands] )) ||
_sqlx__help__migrate__revert_commands() {
local commands; commands=()
_describe -t commands 'sqlx help migrate revert commands' commands "$@"
}
(( $+functions[_sqlx__help__migrate__run_commands] )) ||
_sqlx__help__migrate__run_commands() {
local commands; commands=()
_describe -t commands 'sqlx help migrate run commands' commands "$@"
}
(( $+functions[_sqlx__help__prepare_commands] )) ||
_sqlx__help__prepare_commands() {
local commands; commands=()
_describe -t commands 'sqlx help prepare commands' commands "$@"
}
(( $+functions[_sqlx__migrate_commands] )) ||
_sqlx__migrate_commands() {
local commands; commands=(
'add:Create a new migration with the given description' \
'run:Run all pending migrations' \
'revert:Revert the latest migration with a down file' \
'info:List all available migrations' \
'build-script:Generate a \`build.rs\` to trigger recompilation when a new migration is added' \
'help:Print this message or the help of the given subcommand(s)' \
)
_describe -t commands 'sqlx migrate commands' commands "$@"
}
(( $+functions[_sqlx__migrate__add_commands] )) ||
_sqlx__migrate__add_commands() {
local commands; commands=()
_describe -t commands 'sqlx migrate add commands' commands "$@"
}
(( $+functions[_sqlx__migrate__build-script_commands] )) ||
_sqlx__migrate__build-script_commands() {
local commands; commands=()
_describe -t commands 'sqlx migrate build-script commands' commands "$@"
}
(( $+functions[_sqlx__migrate__help_commands] )) ||
_sqlx__migrate__help_commands() {
local commands; commands=(
'add:Create a new migration with the given description' \
'run:Run all pending migrations' \
'revert:Revert the latest migration with a down file' \
'info:List all available migrations' \
'build-script:Generate a \`build.rs\` to trigger recompilation when a new migration is added' \
'help:Print this message or the help of the given subcommand(s)' \
)
_describe -t commands 'sqlx migrate help commands' commands "$@"
}
(( $+functions[_sqlx__migrate__help__add_commands] )) ||
_sqlx__migrate__help__add_commands() {
local commands; commands=()
_describe -t commands 'sqlx migrate help add commands' commands "$@"
}
(( $+functions[_sqlx__migrate__help__build-script_commands] )) ||
_sqlx__migrate__help__build-script_commands() {
local commands; commands=()
_describe -t commands 'sqlx migrate help build-script commands' commands "$@"
}
(( $+functions[_sqlx__migrate__help__help_commands] )) ||
_sqlx__migrate__help__help_commands() {
local commands; commands=()
_describe -t commands 'sqlx migrate help help commands' commands "$@"
}
(( $+functions[_sqlx__migrate__help__info_commands] )) ||
_sqlx__migrate__help__info_commands() {
local commands; commands=()
_describe -t commands 'sqlx migrate help info commands' commands "$@"
}
(( $+functions[_sqlx__migrate__help__revert_commands] )) ||
_sqlx__migrate__help__revert_commands() {
local commands; commands=()
_describe -t commands 'sqlx migrate help revert commands' commands "$@"
}
(( $+functions[_sqlx__migrate__help__run_commands] )) ||
_sqlx__migrate__help__run_commands() {
local commands; commands=()
_describe -t commands 'sqlx migrate help run commands' commands "$@"
}
(( $+functions[_sqlx__migrate__info_commands] )) ||
_sqlx__migrate__info_commands() {
local commands; commands=()
_describe -t commands 'sqlx migrate info commands' commands "$@"
}
(( $+functions[_sqlx__migrate__revert_commands] )) ||
_sqlx__migrate__revert_commands() {
local commands; commands=()
_describe -t commands 'sqlx migrate revert commands' commands "$@"
}
(( $+functions[_sqlx__migrate__run_commands] )) ||
_sqlx__migrate__run_commands() {
local commands; commands=()
_describe -t commands 'sqlx migrate run commands' commands "$@"
}
(( $+functions[_sqlx__prepare_commands] )) ||
_sqlx__prepare_commands() {
local commands; commands=()
_describe -t commands 'sqlx prepare commands' commands "$@"
}
if [ "$funcstack[1]" = "_sqlx" ]; then
_sqlx "$@"
else
compdef _sqlx sqlx
fi

View File

@@ -0,0 +1,74 @@
#compdef trash
# AUTOMATICALLY GENERATED by `shtab`
_shtab_trash_commands() {
local _commands=(
)
_describe 'trash commands' _commands
}
_shtab_trash_options=(
"(- : *)"{-h,--help}"[show this help message and exit]"
"(- : *)--print-completion[print shell completion script]:print_completion:(bash zsh tcsh)"
{-d,--directory}"[ignored (for GNU rm compatibility)]"
{-f,--force}"[silently ignore nonexistent files]"
{-i,--interactive}"[prompt before every removal]"
{-r,-R,--recursive}"[ignored (for GNU rm compatibility)]"
"--trash-dir[use TRASHDIR as trash folder]:trashdir:(\${\$(trash-list --trash-dirs)#parent_*})"
"*"{-v,--verbose}"[explain what is being done]"
"(- : *)--version[show program\'s version number and exit]"
"(*)::files:_trash_files"
)
# guard to ensure default positional specs are added only once per session
_shtab_trash_defaults_added=0
_shtab_trash() {
local context state line curcontext="$curcontext" one_or_more='(*)' remainder='(-)*' default='*::: :->trash'
# Add default positional/remainder specs only if none exist, and only once per session
if (( ! _shtab_trash_defaults_added )); then
if (( ${_shtab_trash_options[(I)${(q)one_or_more}*]} + ${_shtab_trash_options[(I)${(q)remainder}*]} + ${_shtab_trash_options[(I)${(q)default}]} == 0 )); then
_shtab_trash_options+=(': :_shtab_trash_commands' '*::: :->trash')
fi
_shtab_trash_defaults_added=1
fi
_arguments -C -s $_shtab_trash_options
case $state in
trash)
words=($line[1] "${words[@]}")
(( CURRENT += 1 ))
curcontext="${curcontext%:*:*}:_shtab_trash-$line[1]:"
case $line[1] in
esac
esac
}
# Custom Preamble
# https://github.com/zsh-users/zsh/blob/19390a1ba8dc983b0a1379058e90cd51ce156815/Completion/Unix/Command/_rm#L72-L74
_trash_files() {
(( CURRENT > 0 )) && line[CURRENT]=()
line=( ${line//(#m)[\[\]()\\*?#<>~\^\|]/\\$MATCH} )
_files -F line
}
# End Custom Preamble
typeset -A opt_args
if [[ $zsh_eval_context[-1] == eval ]]; then
# eval/source/. command, register function for later
compdef _shtab_trash -N trash
else
# autoload from fpath, call function directly
_shtab_trash "$@"
fi

150
local/bin/any2av1mkv Executable file
View File

@@ -0,0 +1,150 @@
#!/usr/bin/env bash
set -euo pipefail
# any2av1mkv - Convert provided files to MKV with AV1 video (VAAPI on AMD),
# keeping ALL audio tracks, subtitles (including PGS), and attachments.
#
# Default is bitrate-controlled VBR, tuned for 1080p and "not inflating".
#
# Usage:
# any2av1mkv input1.mkv input2.mp4 "weird name.avi"
# any2av1mkv * # skips directories
#
# Options:
# -d, --dry-run print ffmpeg command(s) only
# --no-skip overwrite output if it already exists
# --cqp use constant-quality mode instead of VBR
# --audio-encode aac re-encode ALL audio tracks to AAC (default: copy)
# -h, --help
#
# Env vars:
# DEV=/dev/dri/renderD128
#
# VBR mode (default):
# B=3500k target video bitrate (1080p 10-bit starting point)
# MAX=5000k max video bitrate
# BUF=10000k VBV buffer
#
# CQP mode (with --cqp):
# QP=42 higher = smaller / lower quality (try 40-46 for 1080p)
DEV="${DEV:-/dev/dri/renderD128}"
B="${B:-1500k}"
MAX="${MAX:-2200k}"
BUF="${BUF:-4400k}"
QP="${QP:-46}"
dry_run=0
skip_existing=1
audio_mode="acc" # or "copy"
use_cqp=0
args=()
while [[ $# -gt 0 ]]; do
case "$1" in
-d | --dry-run)
dry_run=1
shift
;;
--no-skip)
skip_existing=0
shift
;;
--cqp)
use_cqp=1
shift
;;
--audio-encode)
[[ "${2:-}" == "aac" ]] || {
echo "Error: --audio-encode only supports: aac" >&2
exit 1
}
audio_mode="aac"
shift 2
;;
-h | --help)
sed -n '1,220p' "$0"
exit 0
;;
--)
shift
args+=("$@")
break
;;
*)
args+=("$1")
shift
;;
esac
done
command -v ffmpeg >/dev/null 2>&1 || {
echo "Error: ffmpeg not found." >&2
exit 1
}
if [[ ${#args[@]} -eq 0 ]]; then
echo "No input files. Provide file names/globs (e.g. *.mkv, *)."
exit 2
fi
for f in "${args[@]}"; do
[[ -e "$f" ]] || {
echo "Skip (missing): $f"
continue
}
[[ -f "$f" ]] || {
echo "Skip (not a file): $f"
continue
}
base="${f##*/}"
stem="${base%.*}"
out_dir="$(dirname -- "$f")"
out="${out_dir}/${stem}.av1.mkv"
if [[ $skip_existing -eq 1 && -e "$out" ]]; then
echo "Skip (exists): $out"
continue
fi
echo "Transcoding: $f -> $out"
if [[ "$audio_mode" == "aac" ]]; then
aopts=(-c:a aac -b:a 192k)
else
aopts=(-c:a copy)
fi
# Video options:
# - Use p010le to preserve 10-bit sources (and avoid 8-bit nv12 forcing).
# - If your source is 8-bit, VAAPI will still handle it; p010le is generally safe.
if [[ $use_cqp -eq 1 ]]; then
vopts=(-c:v av1_vaapi -rc_mode CQP -qp "$QP")
else
vopts=(-c:v av1_vaapi -rc_mode VBR -b:v "$B" -maxrate "$MAX" -bufsize "$BUF")
fi
cmd=(
ffmpeg -hide_banner -nostdin -y
-vaapi_device "$DEV"
-i "$f"
-map 0
-vf 'format=p010le,hwupload'
"${vopts[@]}"
"${aopts[@]}"
-c:s copy
-c:t copy
-c:d copy
"$out"
)
if [[ $dry_run -eq 1 ]]; then
printf '%q ' "${cmd[@]}"
printf '\n'
else
"${cmd[@]}"
fi
done

View File

@@ -1,14 +1,52 @@
#!/usr/bin/env bash #!/usr/bin/env bash
WALLPAPER_DIR="$HOME/Pictures/wallpapers/Linux-Dynamic-Wallpapers/" BG_DIR_PATH="$HOME/Pictures/wallpapers/Linux-Dynamic-Wallpapers/"
PICK_CMD="shuf -n 1"
if pgrep -x "Hyprland" >/dev/null; then if pgrep -x "Hyprland" >/dev/null; then
CURRENT_WALL=$(hyprctl hyprpaper listloaded) CURRENT_WALL=$(hyprctl hyprpaper listloaded)
WALLPAPER=$(fd --type file --exclude "$(basename "$CURRENT_WALL")" . "$WALLPAPER_DIR" | shuf -nz 1) WALLPAPER=$(fd --type file --exclude "$(basename "$CURRENT_WALL")" . "$BG_DIR_PATH" | $PICK_CMD)
hyprctl hyprpaper reload ,"$WALLPAPER" hyprctl hyprpaper reload ,"$WALLPAPER"
elif pgrep -x "niri" >/dev/null; then
# Read script flags
FLAG_NOTIFY=false
FLAG_DELAY=false
while [[ $# -gt 0 ]]; do
case "$1" in
-n | --notify) FLAG_NOTIFY=true ;;
-d | --delay) FLAG_DELAY=true ;;
*) echo "Unknown option: $1" ;;
esac
shift
done
# Choose most-recent accessed file by default or least-recent to cycle
BG_SELECT_PATH=$(fd --type file . "$BG_DIR_PATH" | $PICK_CMD)
# Notify if needed
if $FLAG_NOTIFY; then
notify-send "Wallpaper Changed" $(basename "$BG_SELECT_PATH")
fi
# Get previous swaybg so we can stop it once we start a new instance
PREV_SWAYBG_PID=$(pidof swaybg)
# Update access on selected file, for cycling
touch -ac $BG_SELECT_PATH
swaybg -i "$BG_SELECT_PATH" &
# Wait a bit and then stop prior swaybg instances (if present)
# -> Delay because it can take a moment for new bg to load
# -> If user spams this script, we can end up creating many instances of sway because of this delay!
# The kill command will clean them all up, but it's a bit messy
if $FLAG_DELAY; then
sleep 0.5
fi
# Close all prior swaybg instances (would be 'behind' current wallpaper)
if [[ -n "$PREV_SWAYBG_PID" ]]; then
kill $PREV_SWAYBG_PID
fi
else else
WALLPAPER=$(fd --type file . "$WALLPAPER_DIR" | shuf -n 1) notify-send --urgency critical --icon dialog-error "Wallpaper Script Error" "No compatible window manager found (Hyprland or Niri required)"
pkill swaybg 2>/dev/null || true
swaybg -m fill -i "$WALLPAPER" &
disown
fi fi