Update 2024-12-23

This commit is contained in:
Kristofers Solo 2024-12-23 22:36:35 +02:00
parent 56d085310f
commit 9ae599446b
42 changed files with 1412 additions and 412 deletions

View File

@ -1,7 +1,7 @@
[helpers]
[default]
depends = []
depends = [ ]
[default.files]
LICENSE = ""
@ -13,38 +13,36 @@ LICENSE = ""
default_target_type = "symbolic"
[base]
depends = ["default", "zsh", "spotify", "terminal", "local", "misc"]
depends = [ "default", "zsh", "spotify", "terminal", "local", "misc" ]
[x11]
depends = ["base", "awesome", "picom", "dunst"]
depends = [ "base", "awesome", "picom", "dunst", "rofi" ]
[x11.files]
"config/zsh/.zprofile-x11" = "~/.config/zsh/.zprofile"
"config/x11/" = "~/.config/x11/"
"config/x11/xresources" = { target = "~/.config/x11/xresources", type = "template" }
"config/x11/xresources" = {target = "~/.config/x11/xresources", type = "template"}
[x11-laptop]
depends = ["base", "awesome_laptop", "picom", "dunst"]
depends = [ "base", "awesome_laptop", "picom", "dunst", "rofi" ]
[x11-laptop.files]
"config/zsh/.zprofile-x11" = "~/.config/zsh/.zprofile"
"config/x11/" = "~/.config/x11/"
"config/x11/xresources" = { target = "~/.config/x11/xresources", type = "template" }
"config/x11/xresources" = {target = "~/.config/x11/xresources", type = "template"}
[wayland]
depends = ["base", "hyprland", "dunst"]
depends = [ "base", "hyprland", "dunst" ]
[wayland.files]
"config/zsh/.zprofile-wayland" = "~/.config/zsh/.zprofile"
"config/x11/xresources" = { target = "~/.config/x11/xresources", type = "template" }
"config/x11/xresources" = {target = "~/.config/x11/xresources", type = "template"}
[shell.files]
"config/shell/" = "~/.config/shell/"
[zsh]
depends = ["shell"]
depends = [ "shell" ]
[zsh.files]
"config/shell/env" = "~/.zshenv"
@ -54,8 +52,11 @@ depends = ["shell"]
"local/bin/" = "~/.local/bin/"
"local/share/" = "~/.local/share/"
[rofi.files]
"config/rofi/" = "~/.config/rofi/"
[misc]
depends = ["torrent", "zathura"]
depends = [ "torrent", "zathura" ]
[misc.files]
"config/batrc" = "~/.config/bat/config"
@ -93,7 +94,7 @@ depends = ["torrent", "zathura"]
"config/dunst/" = "~/.config/dunst/"
[hyprland]
depends = ["dunst", "misc", "local", "eww", "lock"]
depends = [ "misc", "local", "eww", "lock" ]
[hyprland.files]
"config/hypr/" = "~/.config/hypr/"
@ -121,11 +122,11 @@ depends = ["dunst", "misc", "local", "eww", "lock"]
"config/spotify-tui.yml" = "~/.config/spotify-tui/config.yml"
[terminal]
depends = ["zsh", "tmux", "yazi"]
depends = [ "zsh", "tmux", "yazi" ]
[terminal.files]
"config/alacritty/" = "~/.config/alacritty/"
"config/alacritty/alacritty.toml" = { target = "~/.config/alacritty/alacritty.toml", type = "template" }
"config/alacritty/alacritty.toml" = {target = "~/.config/alacritty/alacritty.toml", type = "template"}
"config/starship.toml" = "~/.config/starship/starship.toml"
[tmux.files]

0
config/HybridBar/scripts/change-active-workspace Normal file → Executable file
View File

0
config/HybridBar/scripts/get-active-workspace Normal file → Executable file
View File

0
config/HybridBar/scripts/get-window-title Normal file → Executable file
View File

0
config/HybridBar/scripts/get-workspaces Normal file → Executable file
View File

View File

@ -489,7 +489,8 @@ local globalkeys = gears.table.join(
end, { description = "lua execute prompt", group = "awesome" }),
-- Menubar
awful.key({ modkey }, "p", function()
menubar.show()
-- menubar.show()
awful.spawn("rofi -show drun -show-icons")
end, { description = "show the menubar", group = "launcher" })
)

View File

@ -57,7 +57,7 @@ update_ms = 500
#* 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.
proc_sorting = "cpu direct"
proc_sorting = "user"
#* Reverse sorting order, True or False.
proc_reversed = False

View File

@ -82,7 +82,7 @@
separator_height = 1
# Padding between text and separator.
padding = 10
padding = 5
# Horizontal padding.
horizontal_padding = 5

0
config/eww/scripts/change-active-workspace Normal file → Executable file
View File

0
config/eww/scripts/get-active-workspace Normal file → Executable file
View File

0
config/eww/scripts/get-music Normal file → Executable file
View File

0
config/eww/scripts/get-network Normal file → Executable file
View File

0
config/eww/scripts/get-window-title Normal file → Executable file
View File

0
config/eww/scripts/get-workspaces Normal file → Executable file
View File

0
config/eww/scripts/getvol Normal file → Executable file
View File

0
config/eww/scripts/github Normal file → Executable file
View File

View File

@ -1,35 +1,178 @@
# This is an example Hyprland config file.
#
# Refer to the wiki for more information.
# https://wiki.hyprland.org/Configuring/
#
# Please note not all available settings / options are set here.
# For a full list, see the wiki
#
# You can split this configuration into multiple files
# Create your files separately and then link them to this file like this:
# source = ~/.config/hypr/myColors.conf
################
### MONITORS ###
################
# See https://wiki.hyprland.org/Configuring/Monitors/
monitor=eDP-1,2880x1800@75,auto,1.5
#monitor=,preferred,auto-up,1
# monitor=,preferred,auto,auto
monitor=,prefered,auto,1.5
monitor=DP-1,disable
#monitor=HDMI-A-1,highres,auto-up,1,mirror,eDP-1
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
###################
### MY PROGRAMS ###
###################
env = HYPRLAND_INSTANCE_SIGNATURE,/tmp/hypr
# See https://wiki.hyprland.org/Configuring/Keywords/
# Execute your favorite apps at launch
# exec-once = waybar & hyprpaper & firefox
exec-once = pipewire & pipewire-pulse & wireplumber & eww daemon & eww open bar & nextcloud & /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 & xrdb "$XDG_CONFIG_HOME/x11/xresources" & spotifyd --no-daemon & syncthing & transmission-daemon & dunst & dbus-update-activation-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP DISPLAY XAUTHORITY & hyprpaper
# Set programs that you use
$terminal = alacritty
$fileManager = $terminal -e yazi
$menu = wofi --show drun -ib
#################
### AUTOSTART ###
#################
# Autostart necessary processes (like notifications daemons, status bars, etc.)
# Or execute your favorite apps at launch like this:
exec-once=pipewire & pipewire-pulse & wireplumber & eww daemon & eww open bar & dbus-update-activation-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP DISPLAY XAUTHORITY
exec-once=nextcloud & /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 & xrdb "$XDG_CONFIG_HOME/x11/xresources" & syncthing & transmission-daemon & dunst & hyprpaper
exec-once=[workspace 1 silent] floorp
exec-once=[workspace 8 silent] discord & kotatogram-desktop
exec-once=[workspace 9 silent] spotify
# Source a file (multi-file configs)
# source = ~/.config/hypr/myColors.conf
source=~/.config/hypr/rose-pine.conf
# For all categories, see https://wiki.hyprland.org/Configuring/Variables/
#############################
### ENVIRONMENT VARIABLES ###
#############################
# See https://wiki.hyprland.org/Configuring/Environment-variables/
env = XCURSOR_SIZE,24
env = HYPRCURSOR_SIZE,24
#####################
### LOOK AND FEEL ###
#####################
# Refer to https://wiki.hyprland.org/Configuring/Variables/
# https://wiki.hyprland.org/Configuring/Variables/#general
general {
gaps_in = 5
gaps_out = 20
border_size = 2
# https://wiki.hyprland.org/Configuring/Variables/#variable-types for info about colors
col.active_border = $rose
col.inactive_border = $muted
# Set to true enable resizing windows by clicking and dragging on borders and gaps
resize_on_border = false
# Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on
allow_tearing = false
layout = master
}
# https://wiki.hyprland.org/Configuring/Variables/#decoration
decoration {
rounding = 5
# Change transparency of focused and unfocused windows
active_opacity = 1.0
inactive_opacity = 1.0
shadow {
enabled = true
range = 4
render_power = 3
color = $highlightMed
}
# https://wiki.hyprland.org/Configuring/Variables/#blur
blur {
enabled = true
size = 3
passes = 1
vibrancy = 0.1696
}
}
# https://wiki.hyprland.org/Configuring/Variables/#animations
animations {
enabled = no, please :)
# Default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more
bezier = easeOutQuint,0.23,1,0.32,1
bezier = easeInOutCubic,0.65,0.05,0.36,1
bezier = linear,0,0,1,1
bezier = almostLinear,0.5,0.5,0.75,1.0
bezier = quick,0.15,0,0.1,1
animation = global, 1, 10, default
animation = border, 1, 5.39, easeOutQuint
animation = windows, 1, 4.79, easeOutQuint
animation = windowsIn, 1, 4.1, easeOutQuint, popin 87%
animation = windowsOut, 1, 1.49, linear, popin 87%
animation = fadeIn, 1, 1.73, almostLinear
animation = fadeOut, 1, 1.46, almostLinear
animation = fade, 1, 3.03, quick
animation = layers, 1, 3.81, easeOutQuint
animation = layersIn, 1, 4, easeOutQuint, fade
animation = layersOut, 1, 1.5, linear, fade
animation = fadeLayersIn, 1, 1.79, almostLinear
animation = fadeLayersOut, 1, 1.39, almostLinear
animation = workspaces, 1, 1.94, almostLinear, fade
animation = workspacesIn, 1, 1.21, almostLinear, fade
animation = workspacesOut, 1, 1.94, almostLinear, fade
}
# Ref https://wiki.hyprland.org/Configuring/Workspace-Rules/
# "Smart gaps" / "No gaps when only"
# uncomment all if you wish to use that.
# workspace = w[tv1], gapsout:0, gapsin:0
# workspace = f[1], gapsout:0, gapsin:0
# windowrulev2 = bordersize 0, floating:0, onworkspace:w[tv1]
# windowrulev2 = rounding 0, floating:0, onworkspace:w[tv1]
# windowrulev2 = bordersize 0, floating:0, onworkspace:f[1]
# windowrulev2 = rounding 0, floating:0, onworkspace:f[1]
# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
dwindle {
pseudotile = true # Master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
preserve_split = true # You probably want this
}
# See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
master {
new_status = master
}
# https://wiki.hyprland.org/Configuring/Variables/#misc
misc {
force_default_wallpaper = -1 # Set to 0 or 1 to disable the anime mascot wallpapers
disable_hyprland_logo = false # If true disables the random hyprland logo / anime girl background. :(
}
#############
### INPUT ###
#############
# https://wiki.hyprland.org/Configuring/Variables/#input
input {
kb_layout = lv
kb_variant =
@ -42,89 +185,155 @@ input {
follow_mouse = 1
sensitivity = 0 # -1.0 - 1.0, 0 means no modification.
touchpad {
natural_scroll = yes
disable_while_typing = false
}
sensitivity = 0 # -1.0 - 1.0, 0 means no modification.
}
debug {
disable_logs = false
enable_stdout_logs = true
}
general {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
gaps_in = 5
gaps_out = 10
border_size = 2
col.active_border = $rose
col.inactive_border = $muted
layout = master
}
plugin {
split-monitor-workspaces {
count = 10
}
}
decoration {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
rounding = 5
# blur = yes
# blur_size = 4
# blur_passes = 1
# blur_new_optimizations = on
drop_shadow = yes
shadow_range = 4
shadow_render_power = 3
col.shadow = $highlightMed
}
animations {
enabled = no
# Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for moreqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ct
bezier = myBezier, 0.05, 0.9, 0.1, 1.05
animation = windows, 1, 7, myBezier
animation = windowsOut, 1, 7, default, popin 80%
animation = border, 1, 10, default
animation = fade, 1, 7, default
animation = workspaces, 1, 6, default
}
dwindle {
# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
preserve_split = yes # you probably want this
}
master {
# See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
new_status = master
}
# https://wiki.hyprland.org/Configuring/Variables/#gestures
gestures {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
workspace_swipe = on
workspace_swipe = true
}
# Example per-device config
# See https://wiki.hyprland.org/Configuring/Keywords/#executing for more
#device:epic mouse V1 {
#sensitivity = -0.5
#}
# See https://wiki.hyprland.org/Configuring/Keywords/#per-device-input-configs for more
device {
name = epic-mouse-v1
sensitivity = -0.5
}
###################
### KEYBINDINGS ###
###################
# See https://wiki.hyprland.org/Configuring/Keywords/
$mainMod = SUPER # Sets "Windows" key as main modifier
# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
bind = $mainMod, Return, exec, $terminal
bind = $mainMod SHIFT, Q, killactive
bind = $mainMod, N, exec, $fileManager
bind = $mainMod CTRL, SPACE, togglefloating
bind = $mainMod, P, exec, $menu
bind = $mainMod, F, fullscreen
bind = $mainMod, M, bringactivetotop
bind = $mainMod, A, pin
#bind = $mainMod, O, split-changemonitor, +1
# bind = $mainMod, P, pseudo, # dwindle
# bind = $mainMod, J, togglesplit, # dwindle
# Resize window
bind = $mainMod, L, splitratio, 0.05
bind = $mainMod, H, splitratio, -0.05
# Move focus with mainMod + arrow keys
bind = $mainMod, K, cyclenext
bind = $mainMod, J, cyclenext, prev
# Move focus with mainMod + arrow keys
bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod CTRL, mouse:272, resizewindow
bind = $mainMod SHIFT, J, movewindow, d
bind = $mainMod SHIFT, K, movewindow, u
bind = $mainMod SHIFT, L, movewindow, r
bind = $mainMod SHIFT, H, movewindow, l
# Switch workspaces with mainMod + [0-9]
bind = $mainMod, 1, workspace, 1
bind = $mainMod, 2, workspace, 2
bind = $mainMod, 3, workspace, 3
bind = $mainMod, 4, workspace, 4
bind = $mainMod, 5, workspace, 5
bind = $mainMod, 6, workspace, 6
bind = $mainMod, 7, workspace, 7
bind = $mainMod, 8, workspace, 8
bind = $mainMod, 9, workspace, 9
bind = $mainMod, 0, workspace, 10
# Move active window to a workspace with mainMod + SHIFT + [0-9]
bind = $mainMod SHIFT, 1, movetoworkspace, 1
bind = $mainMod SHIFT, 2, movetoworkspace, 2
bind = $mainMod SHIFT, 3, movetoworkspace, 3
bind = $mainMod SHIFT, 4, movetoworkspace, 4
bind = $mainMod SHIFT, 5, movetoworkspace, 5
bind = $mainMod SHIFT, 6, movetoworkspace, 6
bind = $mainMod SHIFT, 7, movetoworkspace, 7
bind = $mainMod SHIFT, 8, movetoworkspace, 8
bind = $mainMod SHIFT, 9, movetoworkspace, 9
bind = $mainMod SHIFT, 0, movetoworkspace, 10
# Example special workspace (scratchpad)
# bind = $mainMod, S, togglespecialworkspace, magic
# bind = $mainMod SHIFT, S, movetoworkspace, special:magic
# Scroll through existing workspaces with mainMod + scroll
bind = $mainMod, mouse_down, workspace, e+1
bind = $mainMod, mouse_up, workspace, e-1
# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow
bindm = $mainMod CTRL, mouse:272, resizewindow
bind = $mainMod SHIFT, J, movewindow, d
bind = $mainMod SHIFT, K, movewindow, u
bind = $mainMod SHIFT, L, movewindow, r
bind = $mainMod SHIFT, H, movewindow, l
# # Laptop multimedia keys for volume and LCD brightness
# bindel = ,XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+
bindel = , XF86AudioRaiseVolume, exec, pulsemixer --change-volume +2 # increase volume by 2
# bindel = ,XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-
bindel = , XF86AudioLowerVolume, exec, pulsemixer --change-volume -2 # decrease volume by 2
# bindel = ,XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
bindel = , XF86AudioMute, exec, pulsemixer --toggle-mute # mute volume
# bindel = ,XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle
bindel = ,XF86MonBrightnessUp, exec, doas brightnessctl set +2% # increase brightness by 2%
bindel = ,XF86MonBrightnessDown, exec, doas brightnessctl set 2%- # decrease brightness by 2%
# # Requires playerctl
bindl = , XF86AudioNext, exec, playerctl next
bindl = , XF86AudioPause, exec, playerctl play-pause
bindl = , XF86AudioPlay, exec, playerctl play-pause
bindl = , XF86AudioPrev, exec, playerctl previous
#
bindel = , XF86AudioPlay, exec, playerctl -a play-pause # pause/play everything
bindel = $mainMod, Space, exec, hyprlock
# bind = $mainMod CTRL, P, exec, wayshot -f "$(HOME)/Pictures/screenshots/$(date + '%s.png')" -s "$(slurp -f '%x %y %w %y')" --stdout | wl-copy
# bind = $mainMod CTRL, P, exec, wayshot -s "$(slurp -f '%x %y %w %y')" --stdout | wl-copy
# bind = $mainMod, , exec, wayshot -f "$(HOME)/Pictures/screenshots/$(date + '%s.png')"
bind = CTRL, PRINT, exec, hyprshot -m region
bind = , PRINT, exec, hyprshot -m output
bind = SHIFT, PRINT, exec, hyprshot -m window
bind = $mainMod ALT, P, exec, hyprpicker -a # colorpicker
##############################
### WINDOWS AND WORKSPACES ###
##############################
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
# See https://wiki.hyprland.org/Configuring/Workspace-Rules/ for workspace rules
# Example windowrule v1
# windowrule = float, ^(kitty)$
# Example windowrule v2
# windowrulev2 = float,class:^(kitty)$,title:^(kitty)$
# Ignore maximize requests from apps. You'll probably like this.
windowrulev2 = suppressevent maximize, class:.*
# Fix some dragging issues with XWayland
windowrulev2 = nofocus,class:^$,title:^$,xwayland:1,floating:1,fullscreen:0,pinned:0
windowrulev2 = fullscreen, class:mpv
windowrulev2 = opacity 0.95, class:thunderbird
@ -151,7 +360,6 @@ windowrulev2 = opacity 0.9, class:Bitwarden
windowrulev2 = opacity 0.9, class:kdeconnect
# windowrulev2 = workspace 8, class:^()$
# Example windowrule v2
windowrulev2 = move 100%-250 100%-250, class:galculator
windowrulev2 = size 250 250, class:galculator
windowrulev2 = float, class:galculator
@ -159,108 +367,3 @@ windowrulev2 = float, class:galculator
windowrulev2=float,title:^(flameshot)
windowrulev2=move 0 0,title:^(flameshot)
windowrulev2=suppressevent fullscreen,title:^(flameshot)
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
$mainMod = SUPER
# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
bind = $mainMod, B ,exec, floorp
bind = $mainMod, Return, exec, alacritty
bind = $mainMod SHIFT, Q, killactive
# bind = $mainMod SHIFT CTRL, Q, exit
bind = $mainMod, N, exec, alacritty -e lfrun
bind = $mainMod CTRL, SPACE, togglefloating
bind = $mainMod, P, exec, wofi --show drun -ib
bind = $mainMod, F, fullscreen
bind = $mainMod, M, bringactivetotop
bind = $mainMod, A, pin
#bind = $mainMod, O, split-changemonitor, +1
# Resize window
bind = $mainMod, L, splitratio, 0.05
bind = $mainMod, H, splitratio, -0.05
# Move focus with mainMod + arrow keys
bind = $mainMod, K, cyclenext
bind = $mainMod, J, cyclenext, prev
# Switch workspaces with mainMod + [0-9]
bind = $mainMod, 1, workspace, 1
bind = $mainMod, 2, workspace, 2
bind = $mainMod, 3, workspace, 3
bind = $mainMod, 4, workspace, 4
bind = $mainMod, 5, workspace, 5
bind = $mainMod, 6, workspace, 6
bind = $mainMod, 7, workspace, 7
bind = $mainMod, 8, workspace, 8
bind = $mainMod, 9, workspace, 9
bind = $mainMod, 0, workspace, 10
#bind = $mainMod, 1, split-workspace, 1
#bind = $mainMod, 2, split-workspace, 2
#bind = $mainMod, 3, split-workspace, 3
#bind = $mainMod, 4, split-workspace, 4
#bind = $mainMod, 5, split-workspace, 5
#bind = $mainMod, 6, split-workspace, 6
#bind = $mainMod, 7, split-workspace, 7
#bind = $mainMod, 8, split-workspace, 8
#bind = $mainMod, 9, split-workspace, 9
#bind = $mainMod, 0, split-workspace, 10
#
# Move active window to a workspace with mainMod + SHIFT + [0-9]
bind = $mainMod SHIFT, 1, movetoworkspacesilent, 1
bind = $mainMod SHIFT, 2, movetoworkspacesilent, 2
bind = $mainMod SHIFT, 3, movetoworkspacesilent, 3
bind = $mainMod SHIFT, 4, movetoworkspacesilent, 4
bind = $mainMod SHIFT, 5, movetoworkspacesilent, 5
bind = $mainMod SHIFT, 6, movetoworkspacesilent, 6
bind = $mainMod SHIFT, 7, movetoworkspacesilent, 7
bind = $mainMod SHIFT, 8, movetoworkspacesilent, 8
bind = $mainMod SHIFT, 9, movetoworkspacesilent, 9
bind = $mainMod SHIFT, 0, movetoworkspacesilent, 10
#bind = $mainMod SHIFT, 1, split-movetoworkspace, 1
#bind = $mainMod SHIFT, 2, split-movetoworkspace, 2
#bind = $mainMod SHIFT, 3, split-movetoworkspace, 3
#bind = $mainMod SHIFT, 4, split-movetoworkspace, 4
#bind = $mainMod SHIFT, 5, split-movetoworkspace, 5
#bind = $mainMod SHIFT, 6, split-movetoworkspace, 6
#bind = $mainMod SHIFT, 7, split-movetoworkspace, 7
#bind = $mainMod SHIFT, 8, split-movetoworkspace, 8
#bind = $mainMod SHIFT, 9, split-movetoworkspace, 9
#bind = $mainMod SHIFT, 0, split-movetoworkspace, 10
# Scroll through existing workspaces with mainMod + scroll
bind = $mainMod, right, workspace, e+1
bind = $mainMod, left, workspace, e-1
# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod CTRL, mouse:272, resizewindow
bind = $mainMod SHIFT, J, movewindow, d
bind = $mainMod SHIFT, K, movewindow, u
bind = $mainMod SHIFT, L, movewindow, r
bind = $mainMod SHIFT, H, movewindow, l
# bind = $mainMod CTRL, P, exec, wayshot -f "$(HOME)/Pictures/screenshots/$(date + '%s.png')" -s "$(slurp -f '%x %y %w %y')" --stdout | wl-copy
# bind = $mainMod CTRL, P, exec, wayshot -s "$(slurp -f '%x %y %w %y')" --stdout | wl-copy
# bind = $mainMod, , exec, wayshot -f "$(HOME)/Pictures/screenshots/$(date + '%s.png')"
bind = CTRL, PRINT, exec, hyprshot -m region
bind = , PRINT, exec, hyprshot -m output
bind = SHIFT, PRINT, exec, hyprshot -m window
bind = $mainMod ALT, P, exec, hyprpicker -a # colorpicker
# Control keybinds
bindel = , XF86MonBrightnessUp, exec, doas brightnessctl set +2% # increase brightness by 2%
bindel = , XF86MonBrightnessDown, exec, doas brightnessctl set 2%- # decrease brightness by 2%
bindel = , XF86AudioRaiseVolume, exec, pulsemixer --change-volume +2 # increase volume by 2
bindel = , XF86AudioLowerVolume, exec, pulsemixer --change-volume -2 # decrease volume by 2
bindel = , XF86AudioMute, exec, pulsemixer --toggle-mute # mute volume
bindel = , XF86AudioPlay, exec, playerctl -a play-pause # pause/play everything
bindel = $mainMod, Space, exec, hyprlock
bindl = , switch:Lid Switch, exec, hyprlock

View File

@ -0,0 +1,265 @@
# This is an example Hyprland config file.
#
# Refer to the wiki for more information.
#
# Please note not all available settings / options are set here.
# For a full list, see the wiki
#
# See https://wiki.hyprland.org/Configuring/Monitors/
monitor=eDP-1,2880x1800@120,auto,1.5
#monitor=,preferred,auto-up,1
monitor=DP-1,disable
#monitor=HDMI-A-1,highres,auto-up,1,mirror,eDP-1
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
env = HYPRLAND_INSTANCE_SIGNATURE,/tmp/hypr
# Execute your favorite apps at launch
# exec-once = waybar & hyprpaper & firefox
exec-once = pipewire & pipewire-pulse & wireplumber & eww daemon & eww open bar & nextcloud & /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 & xrdb "$XDG_CONFIG_HOME/x11/xresources" & spotifyd --no-daemon & syncthing & transmission-daemon & dunst & dbus-update-activation-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP DISPLAY XAUTHORITY & hyprpaper
exec-once=[workspace 1 silent] floorp
exec-once=[workspace 8 silent] discord & kotatogram-desktop
exec-once=[workspace 9 silent] spotify
# Source a file (multi-file configs)
# source = ~/.config/hypr/myColors.conf
source=~/.config/hypr/rose-pine.conf
# For all categories, see https://wiki.hyprland.org/Configuring/Variables/
input {
kb_layout = lv
kb_variant =
kb_model =
kb_options = caps:escape
kb_rules =
numlock_by_default = true
repeat_rate = 50
repeat_delay = 300
follow_mouse = 1
touchpad {
natural_scroll = yes
disable_while_typing = false
}
sensitivity = 0 # -1.0 - 1.0, 0 means no modification.
}
debug {
disable_logs = false
enable_stdout_logs = true
}
general {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
gaps_in = 5
gaps_out = 10
border_size = 2
col.active_border = $rose
col.inactive_border = $muted
layout = master
}
plugin {
split-monitor-workspaces {
count = 10
}
}
decoration {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
rounding = 5
# blur = yes
# blur_size = 4
# blur_passes = 1
# blur_new_optimizations = on
# drop_shadow = yes
# shadow_range = 4
# shadow_render_power = 3
# col.shadow = $highlightMed
}
animations {
enabled = no
# Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for moreqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ctqt6ct
bezier = myBezier, 0.05, 0.9, 0.1, 1.05
animation = windows, 1, 7, myBezier
animation = windowsOut, 1, 7, default, popin 80%
animation = border, 1, 10, default
animation = fade, 1, 7, default
animation = workspaces, 1, 6, default
}
dwindle {
# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
preserve_split = yes # you probably want this
}
master {
# See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
new_status = master
}
gestures {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
workspace_swipe = on
}
# Example per-device config
# See https://wiki.hyprland.org/Configuring/Keywords/#executing for more
#device:epic mouse V1 {
#sensitivity = -0.5
#}
# Example windowrule v1
windowrulev2 = fullscreen, class:mpv
windowrulev2 = opacity 0.95, class:thunderbird
windowrulev2 = workspace 8, class:discord
windowrulev2 = opacity 0.95, class:discord
windowrulev2 = workspace 8, class:Ripcord
windowrulev2 = workspace 8, class:TelegramDesktop
windowrulev2 = opacity 0.95, class:TelegramDesktop
windowrulev2 = workspace 8, class:kotatogramdesktop
windowrulev2 = opacity 0.95, class:kotatogramdesktop
windowrulev2 = opacity 0.9, class:teams-for-linux
windowrulev2 = workspace 5, class:Ferdium
windowrulev2 = opacity 0.9, class:Ferdium
windowrulev2 = workspace 9, class:Spotify
windowrulev2 = opacity 0.9, class:Spotify
windowrulev2 = tile, class:Spotify
windowrulev2 = opacity 0.95, class:qbittorrent
windowrulev2 = opacity 0.95, class:lutris
windowrulev2 = opacity 0.95, class:pacfinder
windowrulev2 = opacity 0.9, class:Bitwarden
windowrulev2 = opacity 0.9, class:kdeconnect
# windowrulev2 = workspace 8, class:^()$
# Example windowrule v2
windowrulev2 = move 100%-250 100%-250, class:galculator
windowrulev2 = size 250 250, class:galculator
windowrulev2 = float, class:galculator
windowrulev2=float,title:^(flameshot)
windowrulev2=move 0 0,title:^(flameshot)
windowrulev2=suppressevent fullscreen,title:^(flameshot)
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
$mainMod = SUPER
# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
bind = $mainMod, B ,exec, floorp
bind = $mainMod, Return, exec, alacritty
bind = $mainMod SHIFT, Q, killactive
# bind = $mainMod SHIFT CTRL, Q, exit
bind = $mainMod, N, exec, alacritty -e lfrun
bind = $mainMod CTRL, SPACE, togglefloating
bind = $mainMod, P, exec, wofi --show drun -ib
bind = $mainMod, F, fullscreen
bind = $mainMod, M, bringactivetotop
bind = $mainMod, A, pin
#bind = $mainMod, O, split-changemonitor, +1
# Resize window
bind = $mainMod, L, splitratio, 0.05
bind = $mainMod, H, splitratio, -0.05
# Move focus with mainMod + arrow keys
bind = $mainMod, K, cyclenext
bind = $mainMod, J, cyclenext, prev
# Switch workspaces with mainMod + [0-9]
bind = $mainMod, 1, workspace, 1
bind = $mainMod, 2, workspace, 2
bind = $mainMod, 3, workspace, 3
bind = $mainMod, 4, workspace, 4
bind = $mainMod, 5, workspace, 5
bind = $mainMod, 6, workspace, 6
bind = $mainMod, 7, workspace, 7
bind = $mainMod, 8, workspace, 8
bind = $mainMod, 9, workspace, 9
bind = $mainMod, 0, workspace, 10
#bind = $mainMod, 1, split-workspace, 1
#bind = $mainMod, 2, split-workspace, 2
#bind = $mainMod, 3, split-workspace, 3
#bind = $mainMod, 4, split-workspace, 4
#bind = $mainMod, 5, split-workspace, 5
#bind = $mainMod, 6, split-workspace, 6
#bind = $mainMod, 7, split-workspace, 7
#bind = $mainMod, 8, split-workspace, 8
#bind = $mainMod, 9, split-workspace, 9
#bind = $mainMod, 0, split-workspace, 10
#
# Move active window to a workspace with mainMod + SHIFT + [0-9]
bind = $mainMod SHIFT, 1, movetoworkspacesilent, 1
bind = $mainMod SHIFT, 2, movetoworkspacesilent, 2
bind = $mainMod SHIFT, 3, movetoworkspacesilent, 3
bind = $mainMod SHIFT, 4, movetoworkspacesilent, 4
bind = $mainMod SHIFT, 5, movetoworkspacesilent, 5
bind = $mainMod SHIFT, 6, movetoworkspacesilent, 6
bind = $mainMod SHIFT, 7, movetoworkspacesilent, 7
bind = $mainMod SHIFT, 8, movetoworkspacesilent, 8
bind = $mainMod SHIFT, 9, movetoworkspacesilent, 9
bind = $mainMod SHIFT, 0, movetoworkspacesilent, 10
#bind = $mainMod SHIFT, 1, split-movetoworkspace, 1
#bind = $mainMod SHIFT, 2, split-movetoworkspace, 2
#bind = $mainMod SHIFT, 3, split-movetoworkspace, 3
#bind = $mainMod SHIFT, 4, split-movetoworkspace, 4
#bind = $mainMod SHIFT, 5, split-movetoworkspace, 5
#bind = $mainMod SHIFT, 6, split-movetoworkspace, 6
#bind = $mainMod SHIFT, 7, split-movetoworkspace, 7
#bind = $mainMod SHIFT, 8, split-movetoworkspace, 8
#bind = $mainMod SHIFT, 9, split-movetoworkspace, 9
#bind = $mainMod SHIFT, 0, split-movetoworkspace, 10
# Scroll through existing workspaces with mainMod + scroll
bind = $mainMod, right, workspace, e+1
bind = $mainMod, left, workspace, e-1
# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod CTRL, mouse:272, resizewindow
bind = $mainMod SHIFT, J, movewindow, d
bind = $mainMod SHIFT, K, movewindow, u
bind = $mainMod SHIFT, L, movewindow, r
bind = $mainMod SHIFT, H, movewindow, l
# bind = $mainMod CTRL, P, exec, wayshot -f "$(HOME)/Pictures/screenshots/$(date + '%s.png')" -s "$(slurp -f '%x %y %w %y')" --stdout | wl-copy
# bind = $mainMod CTRL, P, exec, wayshot -s "$(slurp -f '%x %y %w %y')" --stdout | wl-copy
# bind = $mainMod, , exec, wayshot -f "$(HOME)/Pictures/screenshots/$(date + '%s.png')"
bind = CTRL, PRINT, exec, hyprshot -m region
bind = , PRINT, exec, hyprshot -m output
bind = SHIFT, PRINT, exec, hyprshot -m window
bind = $mainMod ALT, P, exec, hyprpicker -a # colorpicker
# Control keybinds
bindel = , XF86MonBrightnessUp, exec, doas brightnessctl set +2% # increase brightness by 2%
bindel = , XF86MonBrightnessDown, exec, doas brightnessctl set 2%- # decrease brightness by 2%
bindel = , XF86AudioRaiseVolume, exec, pulsemixer --change-volume +2 # increase volume by 2
bindel = , XF86AudioLowerVolume, exec, pulsemixer --change-volume -2 # decrease volume by 2
bindel = , XF86AudioMute, exec, pulsemixer --toggle-mute # mute volume
bindel = , XF86AudioPlay, exec, playerctl -a play-pause # pause/play everything
bindel = $mainMod, Space, exec, hyprlock
bindl = , switch:Lid Switch, exec, hyprlock

0
config/lf/cleaner Normal file → Executable file
View File

0
config/lf/lfrc Normal file → Executable file
View File

0
config/nsxiv/exec/image-info Normal file → Executable file
View File

0
config/nsxiv/exec/key-handler Normal file → Executable file
View File

0
config/nsxiv/exec/nsxiv-url Normal file → Executable file
View File

0
config/nsxiv/exec/thumb-info Normal file → Executable file
View File

0
config/nsxiv/exec/win-title Normal file → Executable file
View File

154
config/rofi/config.rasi Normal file
View File

@ -0,0 +1,154 @@
@theme "rose-pine"
configuration {
modes: "window,drun,run,ssh,filebrowser";
font: "JetBrainsMono NF 12";
// location: 0;
// yoffset: 0;
// xoffset: 0;
fixed-num-lines: true;
show-icons: true;
terminal: "alacritty";
ssh-clicnt: "ssh";
// ssh-command: "{terminal} -e {ssh-client} {host} [-p {port}]";
// run-command: "{cmd}";
// run-list-command: "";
// run-shell-command: "{terminal} -e {cmd}";
// window-command: "wmctrl -i -R {window}";
window-match-fields: "all";
// icon-theme: ;
// drun-match-fields: "name,generic,exec,categories,keywords";
// drun-categories: ;
drun-show-actions: false;
drun-display-format: "{name} [<span weight='light' size='small'><i>({generic})</i></span>]";
// drun-url-launcher: "xdg-open";
// disable-history: false;
// ignored-prefixes: "";
sort: true;
sorting-method: "fzf";
// case-sensitive: false;
// cycle: true;
// sidebar-mode: false;
// hover-select: false;
// eh: 1;
// auto-select: false;
// parse-hosts: false;
// parse-known-hosts: true;
// combi-modes: "window,run";
matching: "fuzzy";
// tokenize: true;
// m: "-5";
// filter: ;
// dpi: -1;
// threads: 0;
// scroll-method: 0;
window-format: "{w} {c} {t}";
// click-to-exit: true;
// max-history-size: 25;
// combi-hide-mode-prefix: false;
// combi-display-format: "{mode} {text}";
// matching-negate-char: '-' /* unsupported */;
// cache-dir: ;
// window-thumbnail: false;
// drun-use-desktop-cache: false;
// drun-reload-desktop-cache: false;
// normalize-match: false;
// steal-focus: false;
// application-fallback-icon: ;
// refilter-timeout-limit: 8192;
// xserver-i300-workaround: false;
// pid: "/home/kristofers/.cache/xdgr/rofi.pid";
// display-window: ;
// display-windowcd: ;
// display-run: ;
// display-ssh: ;
// display-drun: ;
// display-combi: ;
// display-keys: ;
// display-filebrowser: ;
// kb-primary-paste: "Control+V,Shift+Insert";
// kb-secondary-paste: "Control+v,Insert";
// kb-clear-line: "Control+w";
// kb-move-front: "Control+a";
// kb-move-end: "Control+e";
// kb-move-word-back: "Alt+b,Control+Left";
// kb-move-word-forward: "Alt+f,Control+Right";
// kb-move-char-back: "Left,Control+b";
// kb-move-char-forward: "Right,Control+f";
// kb-remove-word-back: "Control+Alt+h,Control+BackSpace";
// kb-remove-word-forward: "Control+Alt+d";
// kb-remove-char-forward: "Delete,Control+d";
// kb-remove-char-back: "BackSpace,Shift+BackSpace,Control+h";
// kb-remove-to-eol: "Control+k";
// kb-remove-to-sol: "Control+u";
// kb-accept-entry: "Control+j,Control+m,Return,KP_Enter";
// kb-accept-custom: "Control+Return";
// kb-accept-custom-alt: "Control+Shift+Return";
// kb-accept-alt: "Shift+Return";
// kb-delete-entry: "Shift+Delete";
// kb-mode-next: "Shift+Right,Control+Tab";
// kb-mode-previous: "Shift+Left,Control+ISO_Left_Tab";
// kb-mode-complete: "Control+l";
// kb-row-left: "Control+Page_Up";
// kb-row-right: "Control+Page_Down";
// kb-row-up: "Up,Control+p";
// kb-row-down: "Down,Control+n";
// kb-row-tab: "";
// kb-element-next: "Tab";
// kb-element-prev: "ISO_Left_Tab";
// kb-page-prev: "Page_Up";
// kb-page-next: "Page_Down";
// kb-row-first: "Home,KP_Home";
// kb-row-last: "End,KP_End";
// kb-row-select: "Control+space";
// kb-screenshot: "Alt+S";
// kb-ellipsize: "Alt+period";
// kb-toggle-case-sensitivity: "grave,dead_grave";
// kb-toggle-sort: "Alt+grave";
// kb-cancel: "Escape,Control+g,Control+bracketleft";
// kb-custom-1: "Alt+1";
// kb-custom-2: "Alt+2";
// kb-custom-3: "Alt+3";
// kb-custom-4: "Alt+4";
// kb-custom-5: "Alt+5";
// kb-custom-6: "Alt+6";
// kb-custom-7: "Alt+7";
// kb-custom-8: "Alt+8";
// kb-custom-9: "Alt+9";
// kb-custom-10: "Alt+0";
// kb-custom-11: "Alt+exclam";
// kb-custom-12: "Alt+at";
// kb-custom-13: "Alt+numbersign";
// kb-custom-14: "Alt+dollar";
// kb-custom-15: "Alt+percent";
// kb-custom-16: "Alt+dead_circumflex";
// kb-custom-17: "Alt+ampersand";
// kb-custom-18: "Alt+asterisk";
// kb-custom-19: "Alt+parenleft";
// kb-select-1: "Super+1";
// kb-select-2: "Super+2";
// kb-select-3: "Super+3";
// kb-select-4: "Super+4";
// kb-select-5: "Super+5";
// kb-select-6: "Super+6";
// kb-select-7: "Super+7";
// kb-select-8: "Super+8";
// kb-select-9: "Super+9";
// kb-select-10: "Super+0";
// ml-row-left: "ScrollLeft";
// ml-row-right: "ScrollRight";
// ml-row-up: "ScrollUp";
// ml-row-down: "ScrollDown";
// me-select-entry: "MousePrimary";
// me-accept-entry: "MouseDPrimary";
// me-accept-custom: "Control+MouseDPrimary";
timeout {
action: "kb-cancel";
delay: 0;
}
filebrowser {
directories-first: true;
sorting-method: "name";
}
}

135
config/rofi/rose-pine.rasi Normal file
View File

@ -0,0 +1,135 @@
@import "default"
* {
bg: #191724;
cur: #1f1d2e;
fgd: #e0def4;
cmt: #6e6a86;
cya: #9ccfd8;
grn: #31748f;
ora: #ebbcba;
pur: #c4a7e7;
red: #eb6f92;
yel: #f6c177;
font: "Cartograph CF 12";
foreground: @fgd;
background: @bg;
active-background: @grn;
urgent-background: @red;
selected-background: @active-background;
selected-urgent-background: @urgent-background;
selected-active-background: @active-background;
separatorcolor: @active-background;
bordercolor: @ora;
}
#window {
background-color: @background;
border: 3;
border-radius: 6;
border-color: @bordercolor;
padding: 5;
}
#mainbox {
border: 0;
padding: 5;
}
#message {
border: 1px dash 0px 0px ;
border-color: @separatorcolor;
padding: 1px ;
}
#textbox {
text-color: @foreground;
}
#listview {
fixed-height: 0;
border: 2px dash 0px 0px ;
border-color: @bordercolor;
spacing: 2px ;
scrollbar: false;
padding: 2px 0px 0px ;
}
#element {
border: 0;
padding: 1px ;
}
#element.normal.normal {
background-color: @background;
text-color: @foreground;
}
#element.normal.urgent {
background-color: @urgent-background;
text-color: @urgent-foreground;
}
#element.normal.active {
background-color: @active-background;
text-color: @background;
}
#element.selected.normal {
background-color: @selected-background;
text-color: @foreground;
}
#element.selected.urgent {
background-color: @selected-urgent-background;
text-color: @foreground;
}
#element.selected.active {
background-color: @selected-active-background;
text-color: @background;
}
#element.alternate.normal {
background-color: @background;
text-color: @foreground;
}
#element.alternate.urgent {
background-color: @urgent-background;
text-color: @foreground;
}
#element.alternate.active {
background-color: @active-background;
text-color: @foreground;
}
#scrollbar {
width: 2px ;
border: 0;
handle-width: 8px ;
padding: 0;
}
#sidebar {
border: 2px dash 0px 0px ;
border-color: @separatorcolor;
}
#button.selected {
background-color: @selected-background;
text-color: @foreground;
}
#inputbar {
spacing: 0;
text-color: @foreground;
padding: 1px ;
}
#case-indicator {
spacing: 0;
text-color: @foreground;
}
#entry {
spacing: 0;
text-color: @cya;
}
#prompt {
spacing: 0;
text-color: @grn;
}
#inputbar {
children: [ prompt,textbox-prompt-colon,entry,case-indicator ];
}
#textbox-prompt-colon {
expand: false;
str: ":";
margin: 0px 0.3em 0em 0em;
text-color: @grn;
}

View File

@ -16,6 +16,9 @@ export PATH="$PATH:${$(find ~/.cache/.bun/bin -type d -printf %p:)%%:}"
export LESSHISTFILE=-
export $(dbus-launch)
export LIBSEAT_BACKEND=logind
# export XDG_RUNTIME_DIR="/run/user/$UID"
unsetopt PROMPT_SP
@ -38,11 +41,6 @@ export XDG_RUNTIME_DIR="$HOME/.cache/xdgr"
export XDG_STATE_HOME="$HOME/.local/share"
export HYPRSHOT_DIR="$HOME/Pictures/screenshots"
# export XDG_CURRENT_DESKTOP=Hyprland
# export XDG_SESSION_TYPE=wayland
# export XDG_SESSION_DESKTOP=Hyprland
# export HYPRLAND_INSTANCE_SIGNATURE=/tmp/hypr
export ANDROID_HOME="$XDG_CONFIG_HOME/android"
export ANDROID_SDK_HOME="$XDG_CONFIG_HOME/android"
@ -112,6 +110,8 @@ export QT_QPA_PLATFORMTHEME="qt5ct"
export QT_SCREEN_SCALE_FACTORS="1;1"
export SUDO_ASKPASS="$HOME/.local/bin/dmenupass"
export _JAVA_AWT_WM_NONREPARENTING=1 # Fix for Java applications in dwm
. "$XDG_DATA_HOME/cargo/env"
. "$XDG_DATA_HOME/rye/env"
. "$XDG_CACHE_HOME/deno/.deno/env"

View File

@ -0,0 +1,122 @@
#!/bin/zsh
typeset -U PATH path
# profile file. Runs on login. Environmental variables are set here.
# If you don't plan on reverting to bash, you can remove the link in ~/.profile
# to clean up.
# Adds `~/.local/bin` to $PATH
export PATH="$PATH:${$(find ~/.local/bin -type d -printf %p:)%%:}"
export PATH="$PATH:~/.spicetify"
export PATH="$PATH:${$(find ~/.cache/.bun/bin -type d -printf %p:)%%:}"
# Disable files
export LESSHISTFILE=-
# export $(dbus-launch)
export LIBSEAT_BACKEND=logind
# export XDG_RUNTIME_DIR="/run/user/$UID"
unsetopt PROMPT_SP
# Default Apps
export BROWSER="floorp"
export EDITOR="nvim"
export IMAGE="nsxiv"
export READER="zathura"
export TERMINAL="alacritty"
export VIDEO="mpv"
export VISUAL="$EDITOR"
export WM="awesome"
# $HOME Clean-up
export XDG_CACHE_HOME="$HOME/.cache"
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_RUNTIME_DIR="$HOME/.cache/xdgr"
export XDG_STATE_HOME="$HOME/.local/share"
export HYPRSHOT_DIR="$HOME/Pictures/screenshots"
# export XDG_CURRENT_DESKTOP=Hyprland
# export XDG_SESSION_TYPE=wayland
# export XDG_SESSION_DESKTOP=Hyprland
# export HYPRLAND_INSTANCE_SIGNATURE=/tmp/hypr
export ANDROID_HOME="$XDG_CONFIG_HOME/android"
export ANDROID_SDK_HOME="$XDG_CONFIG_HOME/android"
export ANDROID_USER_HOME="$XDG_DATA_HOME/android"
export ANSIBLE_CONFIG="$XDG_CONFIG_HOME/ansible/ansible.cfg"
export CARGO_HOME="$XDG_DATA_HOME/cargo"
export CUDA_CACHE_PATH="$XDG_CACHE_HOME/nv"
export DOCKER_CONFIG="$XDG_CONFIG_HOME/docker"
export ELECTRUMDIR="$XDG_DATA_HOME/electrum"
export GNUPGHOME="$XDG_DATA_HOME/gnupg"
export GOPATH="$XDG_DATA_HOME/go"
export GRADLE_USER_HOME="$XDG_DATA_HOME/gradle"
export GTK2_RC_FILES="$XDG_CONFIG_HOME/gtk-2.0/gtkrc"
export HISTFILE="$XDG_CONFIG_HOME/zsh/history"
export HISTFILE="$XDG_DATA_HOME/history"
export HISTFILE="$XDG_STATE_HOME/bash/history"
export INPUTRC="$XDG_CONFIG_HOME/shell/inputrc"
export IPYTHONDIR="$XDG_CONFIG_HOME/ipython"
export KERAS_HOME="$XDG_DATA_HOME/keras"
export KODI_DATA="$XDG_DATA_HOME/kodi"
export MBSYNCRC="$XDG_CONFIG_HOME/mbsync/config"
export MYPY_CACHE_DIR="$XDG_CACHE_HOME/mypy"
export MYSQL_HISTFILE="$XDG_DATA_HOME/mysql_history"
export NODE_REPL_HISTORY="$XDG_DATA_HOME/node_repl_history"
export NOTMUCH_CONFIG="$XDG_CONFIG_HOME/notmuch-config"
export NPM_CONFIG_USERCONFIG="$XDG_CACHE_HOME/npm/npmrc"
export PARALLEL_HOME="$XDG_CONFIG_HOME/parallel"
export PASSWORD_STORE_DIR="$XDG_DATA_HOME/password-store"
export PYENV_ROOT="$XDG_DATA_HOME/pyenv"
export PYTHONSTARTUP="$HOME/python/pythonrc"
export REDISCLI_HISTFILE="$XDG_DATA_HOME/redis/rediscli_history"
export RUSTUP_HOME="$XDG_DATA_HOME/rustup"
export RYE_HOME="$XDG_DATA_HOME/rye"
export SSB_HOME="$XDG_DATA_HOME/zoom"
export STARSHIP_CONFIG="$XDG_CONFIG_HOME/starship/starship.toml"
export TEXMFVAR="$XDG_CACHE_HOME/texlive/texmf-var"
export TMUX_TMPDIR="$XDG_RUNTIME_DIR"
export UNISON="$XDG_DATA_HOME/unison"
export W3M_DIR="$XDG_DATA_HOME/w3m"
export WEECHAT_HOME="$XDG_CONFIG_HOME/weechat"
export WGETRC="$XDG_CONFIG_HOME/wget/wgetrc"
export WINEPREFIX="$XDG_DATA_HOME/wineprefixes/default"
export XAUTHORITY="$XDG_RUNTIME_DIR/Xauthority"
export XCURSOR_PATH="/usr/share/icons:$XDG_DATA_HOME/icons"
export XINITRC="$XDG_CONFIG_HOME/x11/xinitrc"
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"
# Other program settings
export AWT_TOOLKIT="MToolkit wmname LG3D" # May have to install wmname
export DICS="/usr/share/stardict/dic/"
export FZF_DEFAULT_OPTS="--layout=reverse --height 40%"
export LESS=-R
export LESSOPEN="| /usr/bin/highlight -O ansi %s 2>/dev/null"
export LESS_TERMCAP_mb="$(printf '%b' '')"
export LESS_TERMCAP_md="$(printf '%b' '')"
export LESS_TERMCAP_me="$(printf '%b' '')"
export LESS_TERMCAP_se="$(printf '%b' '')"
export LESS_TERMCAP_so="$(printf '%b' '')"
export LESS_TERMCAP_ue="$(printf '%b' '')"
export LESS_TERMCAP_us="$(printf '%b' '')"
export MOZ_USE_XINPUT2="1" # Mozilla smooth scrolling/touchpads.
# export QT_QPA_PLATFORMTHEME="gtk2" # Have QT use gtk2 theme.
# export QT_QPA_PLATFORMTHEME="gtk3" # Have QT use gtk3 theme.
export QT_QPA_PLATFORMTHEME="qt5ct"
export QT_SCREEN_SCALE_FACTORS="1;1"
export SUDO_ASKPASS="$HOME/.local/bin/dmenupass"
export _JAVA_AWT_WM_NONREPARENTING=1 # Fix for Java applications in dwm
. "$XDG_DATA_HOME/cargo/env"
. "$XDG_DATA_HOME/rye/env"
. "$XDG_CACHE_HOME/deno/.deno/env"

0
config/x11/opt-apps Normal file → Executable file
View File

View File

@ -15,4 +15,5 @@ else
fi
ssh-agent awesome
# ssh-agent dwm
# dbus-launch --sh-syntax --exit-with-session awesome

View File

@ -6,7 +6,7 @@ deps = [
{use = "Reledia/miller", rev = "40e0265" },
{use = "Sonico98/exifaudio", rev = "d794614" },
{use = "dedukun/relative-motions", rev = "df97039" },
{use = "hankertrix/augment-command", rev = "369f992" },
{use = "hankertrix/augment-command", rev = "3fa924a" },
{use = "imsi32/yatline", rev = "1b4a9a1" },
{use = "kirasok/torrent-preview", rev = "76970b6" },
{use = "ndtoan96/ouch", rev = "b869886" },

View File

@ -21,7 +21,7 @@ plugin.
## Requirements
- [Yazi](https://github.com/sxyazi/yazi) v0.3.0+
- [Yazi](https://github.com/sxyazi/yazi) v0.4.2+
- [`7z` or `7zz` command](https://github.com/p7zip-project/p7zip)
- [`file` command](https://www.darwinsys.com/file/)
@ -44,10 +44,13 @@ ya pack -u
| ----------------------------------- | ------------------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `prompt` | `true` or `false` | `false` | Create a prompt to choose between hovered and selected items when both exist. If this option is disabled, selected items will only be operated on when the hovered item is selected, otherwise the hovered item will be the default item that is operated on. |
| `default_item_group_for_prompt` | `hovered`, `selected` or `none` | `hovered` | The default item group to operate on when the prompt is submitted without any value. This only takes effect if `prompt` is set to `true`, otherwise this option doesn't do anything. `hovered` means the hovered item is operated on, `selected` means the selected items are operated on, and `none` just cancels the operation. |
| `smart_enter` | `true` or `false` | `true` | Use one command to open files or enter a directory. With this option set, the `enter` and `open` commands will both call the `enter` command when a directory is hovered and call the `open` command when a regular file is hovered. |
| `smart_enter` | `true` or `false` | `true` | Use one command to open files or enter a directory. With this option set, the `enter` and `open` commands will both call the `enter` command when a directory is hovered and call the `open` command when a regular file is hovered. You can also enable this behaviour by passing the `--smart` flag to the `enter` or `open` commands. |
| `smart_paste` | `true` or `false` | `false` | Paste items into a directory without entering it. The behaviour is exactly the same as the [smart paste tip on Yazi's documentation](https://yazi-rs.github.io/docs/tips#smart-paste). Setting this option to `false` will use the default `paste` behaviour. You can also enable this behaviour by passing the `--smart` flag to the `paste` command. |
| `smart_tab_create` | `true` or `false` | `false` | Create tabs in the directory that is being hovered instead of the current directory. The behaviour is exactly the same as the [smart tab tip on Yazi's documentation](https://yazi-rs.github.io/docs/tips#smart-tab). Setting this option to `false` will use the default `tab_create` behaviour, which means you need to pass the `--current` flag to the command. You can also enable this behaviour by passing the `--smart` flag to the `tab_create` command. |
| `smart_tab_switch` | `true` or `false` | `false` | If the tab that is being switched to does not exist yet, setting this option to `true` will create all the tabs in between the current number of open tabs, and the tab that is being switched to. The behaviour is exactly the same as [this tip](https://github.com/sxyazi/yazi/issues/918#issuecomment-2058157773). Setting this option to `false` will use the default `tab_switch` behaviour. You can also enable this behaviour by passing the `--smart` flag to the `tab_switch` command. |
| `open_file_after_creation` | `true` or `false` | `false` | This option determines whether the plugin will open a file after it has been created. Setting this option to `true` will cause the plugin to open created file. You can also enable this behaviour by passing the `--open` flag to the `create` command. |
| `enter_directory_after_creation` | `true` or `false` | `false` | This option determines whether the plugin will enter a directory after it has been created. Setting this option to `true` will cause the plugin enter the created directory. You can also enable this behaviour by passing the `--enter` flag to the `create` command. |
| `use_default_create_behaviour` | `true` or `false` | `false` | This option determines whether the plugin will use the behaviour of Yazi's `create` command. Setting this option to `true` will use the behaviour of Yazi's `create` command. You can also enable this behaviour by passing the `--default-behaviour` flag to the `create` command. |
| `enter_archives` | `true` or `false` | `true` | Automatically extract and enter archive files. This option requires the [7z or 7zz command](https://github.com/p7zip-project/p7zip) to be present. |
| `extract_retries` | An integer, like `1`, `3`, `10`, etc. | `3` | This option determines how many times the plugin will retry opening an encrypted or password-protected archive when a wrong password is given. This value plus 1 is the total number of times the plugin will try opening an encrypted or password-protected archive. |
| `extract_archives_recursively` | `true` or `false` | `true` | This option determines whether the plugin will extract all archives inside an archive file recursively. If this option is set to `false`, archive files inside an archive will not be extracted, and you will have to manually extract them yourself. |
@ -76,6 +79,9 @@ require("augment-command"):setup({
smart_paste = false,
smart_tab_create = false,
smart_tab_switch = false,
open_file_after_creation = false,
enter_directory_after_creation = false,
use_default_create_behaviour = false,
enter_archives = true,
extract_retries = 3,
extract_archives_recursively = true,
@ -105,6 +111,8 @@ An example configuration is shown below:
require("augment-command"):setup({
prompt = true,
default_item_group_for_prompt = "none",
open_file_after_creation = true,
enter_directory_after_creation = true,
extract_retries = 5,
ignore_hidden_items = true,
wraparound_file_navigation = true,
@ -137,6 +145,12 @@ then it will operate on the selected items.
- When `smart_enter` is set to `true`,
it calls the `enter` command when the hovered item is a directory.
- `--smart` flag to use one command to `open` files and `enter` directories.
This flag will cause the `open` command to call the `enter` command when
the hovered item is a directory even when `smart_enter` is set to `false`.
This allows you to set a key to use this behaviour
with the `open` command instead of using it for
every `open` command.
- `--no-skip` flag, which only applies
when `smart_enter` is used as it is passed to the `enter` command.
More details about this flag can be found at the documentation
@ -174,6 +188,13 @@ then it will operate on the selected items.
contain only one subdirectory when entering directories.
This can be turned off by setting
`skip_single_subdirectory_on_enter` to `false` in the configuration.
- `--smart` flag to use one command to `enter` directories and `open` files.
This flag will cause the `enter` command to call the `open` command when
the selected items or the hovered item is a file,
even when `smart_enter` is set to `false`.
This allows you to set a key to use this behaviour
with the `enter` command instead of using it for
every `enter` command.
- `--no-skip` flag. It stops the plugin from skipping directories
that contain only one subdirectory when entering directories,
even when `skip_single_subdirectory_on_enter` is set to `true`.
@ -203,6 +224,46 @@ then it will operate on the selected items.
- The `remove` command is augmented as stated in
[this section above](#what-about-the-commands-are-augmented).
### Create (`create`)
- You should use Yazi's default `create` command instead of this augmented
`create` command if you don't want the paths without file extensions to
be created as directories by default, and you don't care about automatically
opening and entering the created file and directory respectively.
- The `create` command has a different behaviour from Yazi's `create` command.
When the path given to the command doesn't have a file extension,
the `create` command will create a directory instead of a file,
unlike Yazi's `create` command. Other that this major difference,
the `create` command functions identically to Yazi's `create` command,
which means that you can use a trailing `/` on Linux and macOS,
or `\` on Windows to create a directory. It will also recursively
create directories to ensure that the path given exists.
It also supports all the options supported by Yazi's `create` command,
so you can pass them to the command and expect the same behaviour.
However, due to the
[`confirm` component](https://github.com/sxyazi/yazi/issues/2082)
currently not being exposed to plugin developers, it uses Yazi's input
component to prompt for a confirmation, like in Yazi v0.3.0 and below.
This is not ideal, but it shouldn't happen that often and
hopefully wouldn't be too annoying.
- The rationale for this behaviour is that creating a path without
a file extension usually means you intend to create a directory instead
of a file, as files usually have file extensions.
- When `open_file_after_creation` is set to `true`, the `create` command
will `open` the created file. This behaviour can also be enabled by
passing the `--open` flag to the `create` command.
Likewise, when `enter_directory_after_creation` is set to `true`,
the `create` command will `enter` the created directory.
This behaviour can also be enabled by passing the `--enter` flag
to the `create` command.
To enable both behaviours with flags, just pass both the `--open` flag
and the `--enter` flag to the `create` command.
- If you would like to use the behaviour of Yazi's `create` command,
probably because you would like to automatically open and enter the created
file and directory respectively, you can either set
`use_default_create_behaviour` to `true`,
or pass the `--default-behaviour` flag to the `create` command.
### Shell (`shell`)
- This command runs the shell command given with the augment stated in
@ -228,7 +289,7 @@ then it will operate on the selected items.
[[manager.prepend_keymap]]
on = [ "o" ]
run = 'plugin augment-command --args="shell \"$EDITOR $@\" --block --confirm"'
run = 'plugin augment-command --args="shell \"$EDITOR $@\" --block"'
desc = "Open the editor"
```
@ -242,12 +303,12 @@ then it will operate on the selected items.
[[manager.prepend_keymap]]
on = [ "o" ]
run = '''plugin augment-command --args='shell "$EDITOR $@" --block --confirm''''
run = '''plugin augment-command --args='shell "$EDITOR $@" --block''''
desc = "Open the editor"
[[manager.prepend_keymap]]
on = [ "i" ]
run = '''plugin augment-command --args="shell '$PAGER $@' --block --confirm"'''
run = '''plugin augment-command --args="shell '$PAGER $@' --block"'''
desc = "Open the pager"
```
@ -267,7 +328,7 @@ then it will operate on the selected items.
[[manager.prepend_keymap]]
on = [ "i" ]
run = '''plugin augment-command --args="shell '$PAGER $@' --block --confirm --exit-if-dir"'''
run = '''plugin augment-command --args="shell '$PAGER $@' --block --exit-if-dir"'''
desc = "Open the pager"
```

View File

@ -7,7 +7,7 @@
---@alias Arguments table<string|number, string|number|boolean>
-- The type for the job object
---@alias Job string[] | { args: Arguments }
---@alias Job { args: Arguments }
-- The type for the input event
--
@ -35,6 +35,9 @@
---@field smart_paste boolean Whether to use smart paste
---@field smart_tab_create boolean Whether to use smart tab create
---@field smart_tab_switch boolean Whether to use smart tab switch
---@field open_file_after_creation boolean Whether to open after creation
---@field enter_directory_after_creation boolean Whether to enter after creation
---@field use_default_create_behaviour boolean Use Yazi's create behaviour?
---@field enter_archives boolean Whether to enter archives
---@field extract_retries number How many times to retry extracting
---@field extract_archives_recursively boolean Re-extract inner archives or not
@ -70,13 +73,13 @@
---@field is_archive boolean
---@field is_absolute boolean
---@field has_root boolean
---@field name fun(): string|nil
---@field stem fun(): string|nil
---@field join fun(url: Url|string): Url
---@field parent fun(): Url|nil
---@field starts_with fun(url: Url|string): boolean
---@field ends_with fun(url: Url|string): boolean
---@field strip_prefix fun(url: Url|string): boolean
---@field name fun(self): string|nil
---@field stem fun(self): string|nil
---@field join fun(self, url: Url|string): Url
---@field parent fun(self): Url|nil
---@field starts_with fun(self, url: Url|string): boolean
---@field ends_with fun(self, url: Url|string): boolean
---@field strip_prefix fun(self, url: Url|string): boolean
-- The type for the extraction results
---@class (exact) ExtractionResult
@ -102,6 +105,7 @@ local Commands = {
Leave = "leave",
Rename = "rename",
Remove = "remove",
Create = "create",
Shell = "shell",
Paste = "paste",
TabCreate = "tab_create",
@ -122,8 +126,6 @@ local ExtractBehaviour = {
RenameExisting = "-aot",
}
-- The user configuration for the plugin
-- The default configuration for the plugin
---@type UserConfiguration
local DEFAULT_CONFIG = {
@ -133,6 +135,9 @@ local DEFAULT_CONFIG = {
smart_paste = false,
smart_tab_create = false,
smart_tab_switch = false,
open_file_after_creation = false,
enter_directory_after_creation = false,
use_default_create_behaviour = false,
enter_archives = true,
extract_retries = 3,
extract_archives_recursively = true,
@ -152,7 +157,7 @@ local DEFAULT_CONFIG = {
---@field level "info" | "warn" | "error"
local DEFAULT_NOTIFICATION_OPTIONS = {
title = "Augment Command Plugin",
timeout = 5.0,
timeout = 5,
}
-- The default input options for this plugin
@ -217,10 +222,6 @@ local MIME_TYPE_PREFIXES_TO_REMOVE = {
"vnd%.",
}
-- The pattern to get the double dash from the front of the argument
---@type string
local double_dash_pattern = "^%-%-"
-- The pattern template to get the mime type without a prefix
---@type string
local get_mime_type_without_prefix_template_pattern =
@ -342,7 +343,7 @@ local function string_split(given_string, separator)
return splitted_strings
end
-- The function to trim a string
-- Function to trim a string
---@param string string The string to trim
---@return string trimmed_string The trimmed string
local function string_trim(string)
@ -353,87 +354,58 @@ local function string_trim(string)
return string:match("^%s*(.-)%s*$")
end
-- Function to parse the arguments given.
-- This function takes the arguments passed to the entry function
---@param args string[] The list of string arguments given by Yazi
---@return Arguments parsed_args The list of arguments with the correct types
local function parse_args(args)
-- Function to pop a key from a table
---@param table table The table to pop from
---@param key string The key to pop
---@param default any The default value to return if the key doesn't exist
---@return any value The value of the key or the default value
local function table_pop(table, key, default)
--
-- The table of arguments to pass to ya.manager_emit
---@type table<(string|number), (string|number|boolean)>
local parsed_arguments = {}
-- Get the value of the key from the table
local value = table[key]
-- Iterates over the arguments given
for _, argument in ipairs(args) do
--
-- Remove the key from the table
table[key] = nil
-- If the argument doesn't start with a double dash
if not argument:find(double_dash_pattern) then
--
-- Try to convert the argument to a number
local number_argument = tonumber(argument)
-- Add the argument to the list of options
table.insert(
parsed_arguments,
number_argument and number_argument or argument
)
-- Continue the loop
goto continue
end
-- Otherwise, remove the double dash from the front of the argument
local cleaned_argument = argument:gsub(double_dash_pattern, "")
-- Replace all of the dashes with underscores
cleaned_argument = cleaned_argument:gsub("%-", "_")
-- Split the arguments at the = character
local arg_name, arg_value =
table.unpack(string_split(cleaned_argument, "="))
-- If the argument value is nil
if arg_value == nil then
--
-- Set the argument name to the cleaned argument
arg_name = cleaned_argument
-- Set the argument value to true
arg_value = true
-- Otherwise
else
--
-- Try to convert the argument value to a number
local number_arg_value = tonumber(arg_value)
-- Set the argument value to the number
-- if the the argument value can be converted to a number
arg_value = number_arg_value and number_arg_value or arg_value
end
-- Add the argument name and value to the options
parsed_arguments[arg_name] = arg_value
-- The label to continue the loop
::continue::
end
-- Return the table of arguments
return parsed_arguments
-- Return the value if it exist,
-- otherwise return the default value
return value or default
end
-- Function to warn the user
---@param warning string The warning message
-- Function to parse the number arguments to the number type
---@param args Arguments The arguments to parse
---@return Arguments parsed_args The parsed arguments
local function parse_number_arguments(args)
--
-- The parsed arguments
---@type Arguments
local parsed_args = {}
-- Iterate over the arguments given
for arg_name, arg_value in pairs(args) do
--
-- Try to convert the argument to a number
local number_arg_value = tonumber(arg_value)
-- Set the argument to the number argument value
-- if the argument is a number,
-- otherwise just set it to the given argument value
parsed_args[arg_name] = number_arg_value or arg_value
end
-- Return the parsed arguments
return parsed_args
end
-- Function to show a warning
---@param warning_message string The warning message
---@return nil
local function warn_user(warning)
local function show_warning(warning_message)
return ya.notify(merge_tables(DEFAULT_NOTIFICATION_OPTIONS, {
content = warning,
content = warning_message,
level = "warn",
}))
end
@ -458,6 +430,31 @@ local function get_user_input(prompt)
}))
end
-- Function to get the user's confirmation
-- TODO: Switch to `ya.confirm()` when it's available
---@param prompt string The prompt to show to the user
---@return boolean confirmation Whether the user has confirmed or not
local function get_user_confirmation(prompt)
--
-- Get the user's input
local user_input, event = get_user_input(prompt)
-- If the user has not confirmed the input,
-- or the user input is nil,
-- then return false
if not user_input or event ~= 1 then return false end
-- Lowercase the user's input
user_input = user_input:lower()
-- If the user input starts with a "y", then return true
if user_input:find("^y") then return true end
-- Otherwise, return false
return false
end
-- Function to merge the given configuration table with the default one
---@param config UserConfiguration|nil The configuration table to merge
---@return UserConfiguration merged_config The merged configuration table
@ -508,7 +505,7 @@ local function merge_configuration(config)
if #invalid_configuration_options <= 0 then return merged_config end
-- Otherwise, warn the user of the invalid configuration options
warn_user(
show_warning(
"Invalid configuration options: "
.. table.concat(invalid_configuration_options, ", ")
)
@ -535,7 +532,7 @@ local initialise_config = ya.sync(function(state, user_config, additional_data)
return state.config
end)
-- The 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
---@return boolean shell_command_exists Whether the shell command exists
local function shell_command_exists(shell_command)
@ -583,7 +580,7 @@ local function shell_command_exists(shell_command)
return successfully_executed
end
-- The function to initialise the plugin
-- Function to initialise the plugin
---@param opts Configuration|nil The options given to the plugin
---@return Configuration config The initialised configuration object
local function initialise_plugin(opts)
@ -785,6 +782,13 @@ local get_paths_of_selected_items = ya.sync(function(_, quote)
return paths_of_selected_items
end)
-- Function to get if Yazi is loading
---@param _ any
---@return boolean is_loading Whether Yazi is loading
local yazi_is_loading = ya.sync(
function(_) return cx.active.current.stage.is_loading end
)
-- Function to choose which group of items to operate on.
-- It returns ItemGroup.Hovered for the hovered item,
-- ItemGroup.Selected for the selected items,
@ -908,7 +912,7 @@ local function get_item_group()
end
end
-- The function to get all the items in the given directory
-- Function to get all the items in the given directory
---@param directory string The path to the directory
---@param ignore_hidden_items boolean Whether to ignore hidden items
---@param directories_only boolean|nil Whether to only get directories
@ -966,7 +970,10 @@ local function skip_single_child_directories(args, config, initial_directory)
-- If the user doesn't want to skip single subdirectories on enter,
-- or one of the arguments passed is no skip,
-- then exit the function
if not config.skip_single_subdirectory_on_enter or args.no_skip then
if
not config.skip_single_subdirectory_on_enter
or table_pop(args, "no_skip", false)
then
return
end
@ -1004,7 +1011,7 @@ local function skip_single_child_directories(args, config, initial_directory)
ya.manager_emit("cd", { directory })
end
-- The function to check if an archive is password protected
-- Function to check if an archive is password protected
---@param command_error_string string The error string from the extractor
---@return boolean is_encrypted Whether the archive is password protected
local function archive_is_encrypted(command_error_string)
@ -1019,12 +1026,12 @@ local function archive_is_encrypted(command_error_string)
end
end
-- The function to handle retrying the extractor command
-- Function to handle retrying the extractor command
--
-- The initial password is the password given to the extractor command
-- and the test encryption is to test the archive password without
-- actually executing the given extractor command.
---@param extractor_function ExtractorFunction The function to run the extractor
---@param extractor_function ExtractorFunction Function to run the extractor
---@param config Configuration The configuration object
---@param initial_password string|nil The initial password to try
---@param archive_path string|nil The path to the archive file
@ -1206,7 +1213,7 @@ local function list_archive_items_command(
:output()
end
-- The function to get if the archive
-- Function to get if the archive
-- file has more than one file in it.
---@param archive_path string The path to the archive file
---@param config Configuration The configuration object
@ -1217,7 +1224,7 @@ end
local function get_archive_items(archive_path, config)
--
-- The function to list the items in the archive
-- Function to list the items in the archive
local function list_items_in_archive(password, configuration, _)
return list_archive_items_command(
archive_path,
@ -1294,7 +1301,7 @@ end
---@return string temporary_name The temporary name for the item
local function get_temporary_name(path)
return ".tmp_"
.. ya.md5(string.format("extract//%s//%.10f", path, ya.time()))
.. ya.hash(string.format("extract//%s//%.10f", path, ya.time()))
end
-- Function to get a temporary directory url
@ -1305,6 +1312,7 @@ local function get_temporary_directory_url(path)
--
-- Get the parent directory of the file path
---@type Url
local parent_directory = Url(path):parent()
-- If the parent directory doesn't exist, then return nil
@ -1391,7 +1399,7 @@ local function extract_command(
:output()
end
-- The function to get the mime type of a file
-- Function to get the mime type of a file
---@param file_path string The path to the file
---@return string mime_type The mime type of the file
local function get_mime_type(file_path)
@ -1424,7 +1432,7 @@ local function get_mime_type(file_path)
return mime_type
end
-- The function to check if a file is an archive
-- Function to check if a file is an archive
---@param file_path string The path to the file
---@return boolean is_archive Whether the file is an archive
local function is_archive_file(file_path)
@ -1443,7 +1451,7 @@ local function is_archive_file(file_path)
return is_archive
end
-- The function to clean up the temporary directory
-- Function to clean up the temporary directory
-- after extracting an archive.
---@param temporary_directory_url Url The url of the temporary directory
---@param removal_mode "dir" | "dir_all" | "dir_clean" The removal mode
@ -1463,7 +1471,7 @@ local function clean_up_temporary_directory(
return ...
end
-- The function to move extracted items out of the temporary directory
-- Function to move extracted items out of the temporary directory
---@param archive_url Url The url of the archive
---@param temporary_directory_url Url The url of the temporary directory
---@return boolean move_successful Whether the move was successful
@ -1611,7 +1619,7 @@ local function move_extracted_items_to_archive_parent_directory(
)
end
--- The function to extract an archive.
--- Function to extract an archive.
---@param archive_path string The path to the archive
---@param config Configuration The configuration object
---@param has_only_one_file boolean Whether the archive has only one file
@ -1652,6 +1660,7 @@ local function extract_archive(
end
-- Get the url of the archive
---@type Url
local archive_url = Url(archive_path)
-- Get the name of the archive
@ -1728,7 +1737,7 @@ local function extract_archive(
return extraction_result
end
-- The function to recursively extract archives
-- Function to recursively extract archives
---@param archive_path string The path to the archive
---@param config Configuration The configuration object
---@return ExtractionResult[] extraction_results The list of extraction results
@ -1791,6 +1800,7 @@ local function recursively_extract_archives(archive_path, config)
end
-- Get the url of the extracted items path
---@type Url
local extracted_items_url = Url(extracted_items_path)
-- Initialise the base url for the extracted items
@ -1893,7 +1903,7 @@ local function handle_open(args, config, command_table)
-- If smart enter is wanted,
-- calls the function to enter the directory
-- and exit the function
if config.smart_enter then
if config.smart_enter or table_pop(args, "smart", false) then
return enter_command(args, config, command_table)
end
@ -1980,13 +1990,13 @@ local function handle_enter(args, config, command_table)
local open_command = command_table[Commands.Open]
-- If the hovered item is not a directory
if not hovered_item_is_dir() and config.smart_enter then
if not hovered_item_is_dir() then
--
-- If smart enter is wanted,
-- call the function for the open command
-- and exit the function
if config.smart_enter then
if config.smart_enter or table_pop(args, "smart", false) then
return open_command(args, config, command_table)
end
@ -2015,7 +2025,10 @@ local function handle_leave(args, config)
-- If the user doesn't want to skip single subdirectories on leave,
-- or one of the arguments passed is no skip,
-- then exit the function
if not config.skip_single_subdirectory_on_leave or args.no_skip then
if
not config.skip_single_subdirectory_on_leave
or table_pop(args, "no_skip", false)
then
return
end
@ -2035,6 +2048,7 @@ local function handle_leave(args, config)
if #directory_items ~= 1 then break end
-- Get the parent directory of the current directory
---@type Url
local parent_directory = Url(directory):parent()
-- If the parent directory is nil,
@ -2078,6 +2092,196 @@ local function handle_yazi_command(command, args)
end
end
-- Function to enter or open the created file
---@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 args Arguments The arguments passed to the plugin
---@param config Configuration The configuration object
---@return nil
local function enter_or_open_created_item(item_url, is_directory, args, config)
--
-- If the item is a directory
if is_directory then
--
-- If user does not want to enter the directory
-- after creating it, exit the function
if
not (
config.enter_directory_after_creation
or table_pop(args, "enter", false)
)
then
return
end
-- Otherwise, call the function change to the created directory
ya.manager_emit("cd", { tostring(item_url) })
-- Otherwise, the item is a file
else
--
-- If the user does not want to open the file
-- after creating it, exit the function
if
not (
config.open_file_after_creation
or table_pop(args, "open", false)
)
then
return
end
-- Otherwise, call the function to reveal the created file
ya.manager_emit("reveal", { tostring(item_url) })
-- Wait for Yazi to finish loading
while yazi_is_loading() do
end
-- Call the function to open the file
ya.manager_emit("open", { hovered = true })
end
end
-- Function to execute the create command
---@param item_url Url The url of the item to create
---@param args Arguments The arguments passed to the plugin
---@param config Configuration The configuration object
---@return nil
local function execute_create(item_url, is_directory, args, config)
--
-- Get the parent directory of the file to create
local parent_directory_url = item_url:parent()
-- If the parent directory doesn't exist,
-- then show an error and exit the function
if not parent_directory_url then
return show_error(
"Parent directory of the item to create doesn't exist"
)
end
-- If the item to create is a directory
if is_directory then
--
-- Call the function to create the directory
local successful, error_message = fs.create("dir_all", item_url)
-- If the function is not successful,
-- show the error message and exit the function
if not successful then return show_error(tostring(error_message)) end
-- Otherwise, the item to create is a file
else
--
-- Otherwise, create the parent directory if it doesn't exist
if not fs.cha(parent_directory_url, false) then
--
-- Call the function to create the parent directory
local successful, error_message =
fs.create("dir_all", parent_directory_url)
-- If the function is not successful,
-- show the error message and exit the function
if not successful then
return show_error(tostring(error_message))
end
end
-- Otherwise, create the file
local successful, error_message = fs.write(item_url, "")
-- If the function is not successful,
-- show the error message and exit the function
if not successful then return show_error(tostring(error_message)) end
end
-- Call the function to enter or open the created item
enter_or_open_created_item(item_url, is_directory, args, config)
end
-- Function to handle the create command
---@param args Arguments The arguments passed to the plugin
---@param config Configuration The configuration object
---@return nil
local function handle_create(args, config)
--
-- Otherwise, get the user's input for the item to create
local user_input, event = get_user_input("Create:")
-- If the user did not confirm the input,
-- or the user input is nil,
-- exit the function
if not user_input or event ~= 1 then return end
-- Get the current working directory as a url
local current_working_directory = fs.cwd()
-- If there's not current working directory,
-- then show an error and exit the function
if not current_working_directory then
return show_error("Current working directory doesn't exist")
end
-- Get whether the url ends with a path delimiter
local ends_with_path_delimiter = user_input:find("[/\\]$")
-- Get the whether the given item is a directory or not based
-- on the default conditions for a directory
local is_directory = ends_with_path_delimiter
or table_pop(args, "dir", false)
-- Get the url from the user's input
---@type Url
local item_url = Url(user_input)
-- If the user does not want to use the default Yazi create behaviour
if
not (
config.use_default_create_behaviour
or table_pop(args, "default_behaviour", false)
)
then
--
-- Get the file extension from the user's input
local file_extension = user_input:match(file_extension_pattern)
-- Set the is directory variable to the is directory condition
-- or if the file extension exists
is_directory = is_directory or not file_extension
end
-- Get the full url of the item to create
local full_url = current_working_directory:join(item_url)
-- If the path to the item to create already exists,
-- and the user did not pass the force flag
if fs.cha(full_url, false) and not table_pop(args, "force", false) then
--
-- Get the user's confirmation for
-- whether they want to overwrite the item
local user_confirmation =
get_user_confirmation("The item already exists, overwrite? (y/N)")
-- If the user did not confirm the overwrite,
-- then exit the function
if not user_confirmation then return end
end
-- Call the function to execute the create command
return execute_create(full_url, is_directory, args, config)
end
-- Function to remove the F flag from the less command
---@param command string The shell command containing the less command
---@return string command The command with the F flag removed
@ -2221,10 +2425,8 @@ end
-- Function to handle a shell command
---@param args Arguments The arguments passed to the plugin
---@param _ any
---@param exit_if_dir boolean|nil Whether to exit when all are directories
---@return nil
local function handle_shell(args, _, _, exit_if_dir)
local function handle_shell(args)
--
-- Get the first item of the arguments given
@ -2243,15 +2445,8 @@ local function handle_shell(args, _, _, exit_if_dir)
-- If no item group is returned, exit the function
if not item_group then return end
-- If the exit if directory flag is not given,
-- and the arguments contain the
-- exit if directory flag
if not exit_if_dir and args.exit_if_dir then
--
-- Set the exit if directory flag to true
exit_if_dir = true
end
-- Get whether the exit if directory flag is passed
local exit_if_dir = table_pop(args, "exit_if_dir", false)
-- If the item group is the selected items
if item_group == ItemGroup.Selected then
@ -2325,7 +2520,10 @@ local function handle_paste(args, config)
--
-- If the hovered item is not a directory or smart paste is not wanted
if not hovered_item_is_dir() or not (config.smart_paste or args.smart) then
if
not hovered_item_is_dir()
or not (config.smart_paste or table_pop(args, "smart", false))
then
--
-- Just paste the items inside the current directory
@ -2343,7 +2541,7 @@ local function handle_paste(args, config)
ya.manager_emit("leave", {})
end
-- The function to execute the tab create command
-- Function to execute the tab create command
---@param state State The state object
---@param args Arguments The arguments passed to the plugin
---@return nil
@ -2361,7 +2559,7 @@ local execute_tab_create = ya.sync(function(state, args)
-- in the hovered directory
if
hovered_item_is_directory
and (state.config.smart_tab_create or args.smart)
and (state.config.smart_tab_create or table_pop(args, "smart", false))
then
--
@ -2401,7 +2599,9 @@ local execute_tab_switch = ya.sync(function(state, args)
-- or the tab index is not given,
-- then just call the tab switch command
-- and exit the function
if not (state.config.smart_tab_switch or args.smart) then
if
not (state.config.smart_tab_switch or table_pop(args, "smart", false))
then
return ya.manager_emit("tab_switch", args)
end
@ -2642,9 +2842,8 @@ end
-- Function to handle the editor command
---@param args Arguments The arguments passed to the plugin
---@param config Configuration The configuration object
---@return nil
local function handle_editor(args, config)
local function handle_editor(args)
--
-- Call the function to get the item group
@ -2661,22 +2860,17 @@ local function handle_editor(args, config)
-- Call the handle shell function
-- with the editor command
handle_shell(
merge_tables({
editor .. " $@",
confirm = true,
block = true,
}, args),
config
)
handle_shell(merge_tables({
editor .. " $@",
block = true,
exit_if_dir = true,
}, args))
end
-- Function to handle the pager command
---@param args Arguments The arguments passed to the plugin
---@param config Configuration The configuration object
---@param command_table CommandTable The command table
---@return nil
local function handle_pager(args, config, command_table)
local function handle_pager(args)
--
-- Get the pager environment variable
@ -2695,16 +2889,11 @@ local function handle_pager(args, config, command_table)
-- Call the handle shell function
-- with the pager command
handle_shell(
merge_tables({
pager .. " $@",
confirm = true,
block = true,
}, args),
config,
command_table,
true
)
handle_shell(merge_tables({
pager .. " $@",
block = true,
exit_if_dir = true,
}, args))
end
-- Function to run the commands given
@ -2723,6 +2912,7 @@ local function run_command_func(command, args, config)
[Commands.Leave] = handle_leave,
[Commands.Rename] = function(_) handle_yazi_command("rename", args) end,
[Commands.Remove] = function(_) handle_yazi_command("remove", args) end,
[Commands.Create] = handle_create,
[Commands.Shell] = handle_shell,
[Commands.Paste] = handle_paste,
[Commands.TabCreate] = handle_tab_create,
@ -2745,39 +2935,6 @@ local function run_command_func(command, args, config)
command_func(args, config, command_table)
end
-- The function to handle the arguments from the job object
---@param job Job The job object given by Yazi
---@return Arguments args The arguments from the job object
local function get_args_from_job(job)
--
-- If the job object has no argument field
-- that means the arguments are given
-- as a list of strings (Yazi v0.3.x and below)
if not job.args then
return parse_args(job)
-- Otherwise, the arguments are given as a table (Yazi v0.4.x and above)
else
--
-- Get the string arguments from the job object
local string_args = job.args.args
-- If the string arguments are nil,
-- then return the job arguments
if not string_args then return job.args end
-- Otherwise, if the string arguments are not a string,
-- return an empty table of arguments
if type(string_args) ~= "string" then return {} end
-- Otherwise, split the string arguments, parse them,
-- and return the result
return parse_args(string_split(string_args, " "))
end
end
-- The setup function to setup the plugin
---@param _ any
---@param opts Configuration|nil The options given to the plugin
@ -2789,7 +2946,7 @@ local function setup(_, opts)
initialise_plugin(opts)
end
-- The function to be called to use the plugin
-- Function to be called to use the plugin
---@param _ any
---@param job Job The job object given by Yazi
---@return nil
@ -2798,7 +2955,7 @@ local function entry(_, job)
-- Get the arguments to the plugin
---@type Arguments
local args = get_args_from_job(job)
local args = parse_number_arguments(job.args)
-- Get the command passed to the plugin
local command = table.remove(args, 1)

View File

@ -92,12 +92,12 @@ previewers = [
# JSON
{mime = "application/json", run = "code"},
# Image
{mime = "image/vnd.djvu", run = "noop"},
{mime = "image/*", run = "image"},
# {mime = "image/vnd.djvu", run = "noop"},
# {mime = "image/*", run = "image"},
# Video
{mime = "video/*", run = "video"},
# {mime = "video/*", run = "video"},
# PDF
{mime = "application/pdf", run = "pdf"},
# {mime = "application/pdf", run = "pdf"},
# Fallback
{name = "*", run = "file"},
]

View File

@ -6,7 +6,6 @@ set synctex-editor-command "nvim --remote-silent +%{line} %{input}"
# Basic Settings
set highlight-transparency .1
set zoom-center "true"
set selection-clipboard clipboard
set render-loading "false"

View File

@ -1,8 +1,8 @@
#!/bin/sh
# export WM="Hyprland"
# export XDG_CURRENT_DESKTOP=Hyprland
# export XDG_SESSION_TYPE=wayland
# export XDG_SESSION_DESKTOP=Hyprland
export WM="Hyprland"
export XDG_CURRENT_DESKTOP=Hyprland
export XDG_SESSION_TYPE=wayland
export XDG_SESSION_DESKTOP=Hyprland
[ "$(tty)" = "/dev/tty1" ] && ! pidof -s Hyprland >/dev/null 2>&1 && Hyprland

View File

@ -1,3 +1,4 @@
#!/bin/sh
# fastfetch
# unix
# cmatrix

0
dotter Normal file → Executable file
View File

0
dotter.arm Normal file → Executable file
View File

0
dotter.exe Normal file → Executable file
View File

0
local/bin/typst-port Executable file → Normal file
View File