From eebada1bc0b17b76dce64b78f19bd471956acd42 Mon Sep 17 00:00:00 2001 From: desolate <...> Date: Wed, 13 May 2026 18:30:40 +0300 Subject: [PATCH] implement basic first install --- assign-groups.sh | 24 ++ boot.sh | 48 ++++ dotfiles/emptty/etc/emptty/conf | 79 ++++++ dotfiles/emptty/etc/emptty/motd | 7 + dotfiles/fuzzel/.config/fuzzel/fuzzel.ini | 19 ++ dotfiles/ghostty/.config/ghostty/config | 21 ++ .../.config/ghostty/shaders/cursor_tail.glsl | 236 ++++++++++++++++++ .../ghostty/shaders/in_game_crt_cursor.glsl | 158 ++++++++++++ dotfiles/helix/.config/helix/config.toml | 67 +++++ .../helix/themes/boo_berry_custom.toml | 2 + .../.config/helix/themes/default_custom.toml | 2 + dotfiles/install-emptty.sh | 3 + dotfiles/install-fuzzel.sh | 3 + dotfiles/install-ghostty.sh | 3 + dotfiles/install-helix.sh | 3 + dotfiles/install-river.sh | 3 + dotfiles/install-scooter.sh | 3 + dotfiles/install-yazi.sh | 3 + dotfiles/install-zsh.sh | 3 + dotfiles/install.sh | 14 ++ dotfiles/river/.config/river/init | 18 ++ dotfiles/river/.config/river/init-input | 13 + dotfiles/river/.config/river/init-keymaps | 47 ++++ dotfiles/scooter/.config/scooter/config.toml | 7 + dotfiles/yazi/.config/yazi/keymap.toml | 3 + dotfiles/zsh/.zsh/editor.sh | 1 + dotfiles/zsh/.zsh/llvm.sh | 3 + dotfiles/zsh/.zsh/prompt.sh | 68 +++++ dotfiles/zsh/.zshenv | 2 + dotfiles/zsh/.zshrc | 12 + groups/_seatd | 0 groups/audio | 0 groups/video | 0 helpers.sh | 81 ++++++ install.sh | 22 ++ packages/install-bash-completion.sh | 3 + packages/install-bat.sh | 3 + packages/install-btop.sh | 3 + packages/install-dbus.sh | 3 + packages/install-emptty.sh | 3 + packages/install-eza.sh | 3 + packages/install-fuzzel.sh | 3 + packages/install-ghostty.sh | 3 + packages/install-grim.sh | 0 packages/install-helix.sh | 3 + packages/install-less.sh | 3 + packages/install-light.sh | 6 + packages/install-noto-fonts.sh | 5 + packages/install-pipewire.sh | 3 + packages/install-ripgrep.sh | 3 + packages/install-river.sh | 8 + packages/install-seatd.sh | 3 + packages/install-slurp.sh | 0 packages/install-stow.sh | 3 + packages/install-udisks2.sh | 3 + packages/install-usbutils.sh | 3 + packages/install-waylock.sh | 3 + packages/install-wiremix.sh | 3 + packages/install-wl-clipboard.sh | 3 + packages/install-yazi.sh | 16 ++ packages/install-zsh.sh | 17 ++ packages/install.sh | 34 +++ services/install-dbus.sh | 3 + services/install-emptty.sh | 3 + services/install-river.sh | 3 + services/install-seatd.sh | 3 + services/install.sh | 11 + 67 files changed, 1144 insertions(+) create mode 100755 assign-groups.sh create mode 100755 boot.sh create mode 100644 dotfiles/emptty/etc/emptty/conf create mode 100644 dotfiles/emptty/etc/emptty/motd create mode 100644 dotfiles/fuzzel/.config/fuzzel/fuzzel.ini create mode 100644 dotfiles/ghostty/.config/ghostty/config create mode 100644 dotfiles/ghostty/.config/ghostty/shaders/cursor_tail.glsl create mode 100644 dotfiles/ghostty/.config/ghostty/shaders/in_game_crt_cursor.glsl create mode 100644 dotfiles/helix/.config/helix/config.toml create mode 100644 dotfiles/helix/.config/helix/themes/boo_berry_custom.toml create mode 100644 dotfiles/helix/.config/helix/themes/default_custom.toml create mode 100755 dotfiles/install-emptty.sh create mode 100755 dotfiles/install-fuzzel.sh create mode 100755 dotfiles/install-ghostty.sh create mode 100755 dotfiles/install-helix.sh create mode 100755 dotfiles/install-river.sh create mode 100755 dotfiles/install-scooter.sh create mode 100755 dotfiles/install-yazi.sh create mode 100755 dotfiles/install-zsh.sh create mode 100755 dotfiles/install.sh create mode 100755 dotfiles/river/.config/river/init create mode 100755 dotfiles/river/.config/river/init-input create mode 100755 dotfiles/river/.config/river/init-keymaps create mode 100644 dotfiles/scooter/.config/scooter/config.toml create mode 100644 dotfiles/yazi/.config/yazi/keymap.toml create mode 100644 dotfiles/zsh/.zsh/editor.sh create mode 100644 dotfiles/zsh/.zsh/llvm.sh create mode 100644 dotfiles/zsh/.zsh/prompt.sh create mode 100644 dotfiles/zsh/.zshenv create mode 100644 dotfiles/zsh/.zshrc create mode 100644 groups/_seatd create mode 100644 groups/audio create mode 100644 groups/video create mode 100755 helpers.sh create mode 100755 install.sh create mode 100755 packages/install-bash-completion.sh create mode 100755 packages/install-bat.sh create mode 100755 packages/install-btop.sh create mode 100755 packages/install-dbus.sh create mode 100755 packages/install-emptty.sh create mode 100755 packages/install-eza.sh create mode 100755 packages/install-fuzzel.sh create mode 100755 packages/install-ghostty.sh create mode 100755 packages/install-grim.sh create mode 100755 packages/install-helix.sh create mode 100755 packages/install-less.sh create mode 100755 packages/install-light.sh create mode 100755 packages/install-noto-fonts.sh create mode 100755 packages/install-pipewire.sh create mode 100755 packages/install-ripgrep.sh create mode 100755 packages/install-river.sh create mode 100755 packages/install-seatd.sh create mode 100755 packages/install-slurp.sh create mode 100755 packages/install-stow.sh create mode 100755 packages/install-udisks2.sh create mode 100755 packages/install-usbutils.sh create mode 100755 packages/install-waylock.sh create mode 100755 packages/install-wiremix.sh create mode 100755 packages/install-wl-clipboard.sh create mode 100755 packages/install-yazi.sh create mode 100755 packages/install-zsh.sh create mode 100755 packages/install.sh create mode 100755 services/install-dbus.sh create mode 100755 services/install-emptty.sh create mode 100755 services/install-river.sh create mode 100755 services/install-seatd.sh create mode 100755 services/install.sh diff --git a/assign-groups.sh b/assign-groups.sh new file mode 100755 index 0000000..895e2f9 --- /dev/null +++ b/assign-groups.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +sudo true + +gum style --foreground 4 " +ASSIGNING GROUPS: +" + +for file in "$GROUPS_DIR"/*; do + + [ ! -f "$file" ] && continue + + group="$(basename "$file")" + + if sudo usermod -aG $group $USER; then + gum style --foreground 10 "✓ $group" + else + gum style --foreground 9 "✗ $group" + fi +done + +gum style --foreground 6 " +Groups: +$(groups)" diff --git a/boot.sh b/boot.sh new file mode 100755 index 0000000..0e6dbd8 --- /dev/null +++ b/boot.sh @@ -0,0 +1,48 @@ +#!/bin/sh + +set -e + +sudo true +/bin/clear +echo " + + ██████╗ ███████╗███████╗ ██████╗ ██╗ █████╗ ████████╗███████╗ + ██╔══██╗██╔════╝██╔════╝██╔═══██╗██║ ██╔══██╗╚══██╔══╝██╔════╝ + ██║ ██║█████╗ ███████╗██║ ██║██║ ███████║ ██║ █████╗ + ██║ ██║██╔══╝ ╚════██║██║ ██║██║ ██╔══██║ ██║ ██╔══╝ + ██████╔╝███████╗███████║╚██████╔╝███████╗██║ ██║ ██║ ███████╗ + ╚═════╝ ╚══════╝╚══════╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝ ╚═╝ ╚══════╝ +" + +echo "INSTALLING PREREQUISITES +" + +echo "Installing git..." +if ! sudo xbps-install -Sy git >/dev/null 2>&1; then + echo "Failed to install git" >&2 + exit 1 +fi + +echo "Installing gum..." +if ! sudo xbps-install -Sy gum >/dev/null 2>&1; then + echo "Failed to install gum" >&2 + exit 1 +fi + +echo "" + +REPO_URL="https://git.desolate.land/desolate/land" +TARGET_DIR="$HOME/.desolate" + +if [ -d "$TARGET_DIR" ]; then + rm -rf "$TARGET_DIR" +fi + +if gum spin --title="Downloading repository..." --show-error -- git clone --depth 1 "$REPO_URL" "$TARGET_DIR"; then + "$TARGET_DIR/install.sh" +else + echo " +Failed to download repository +" +fi + diff --git a/dotfiles/emptty/etc/emptty/conf b/dotfiles/emptty/etc/emptty/conf new file mode 100644 index 0000000..417ded2 --- /dev/null +++ b/dotfiles/emptty/etc/emptty/conf @@ -0,0 +1,79 @@ +# TTY, where emptty will start. +TTY_NUMBER=7 + +# Enables switching to defined TTY number. +SWITCH_TTY=true + +# Enables printing of /etc/issue in daemon mode. +PRINT_ISSUE=false + +# Enables printing of default motd, /etc/emptty/motd or /etc/emptty/motd-gen.sh. +PRINT_MOTD=true + +# Preselected user, if AUTOLOGIN is enabled, this user is logged in. +#DEFAULT_USER=user + +# Enables Autologin, if DEFAULT_USER is defined and part of nopasswdlogin group. Possible values are "true" or "false". +AUTOLOGIN=false + +# The default session used, if Autologin is enabled. If session is not found in list of session, it proceeds to manual selection. +# AUTOLOGIN_SESSION=i3 + +# If Autologin is enabled and session does not start correctly, the number of retries in short period is kept to eventually stop the infinite loop of restarts. -1 is for infinite retries, 0 is for no retry. +# AUTOLOGIN_MAX_RETRY=2 + +AUTO_SELECTION=true + +# Default LANG, if user does not have set own in init script. +#LANG=en_US.UTF-8 + +# Starts desktop with calling "dbus-launch". +DBUS_LAUNCH=true + +# Starts Xorg desktop with calling "~/.xinitrc" script, if is true, file exists and selected WM/DE is Xorg session, it overrides DBUS_LAUNCH. +XINITRC_LAUNCH=false + +# Prints available WM/DE each on new line instead of printing on single line. +VERTICAL_SELECTION=false + +# Defines the way, how is logging handled. Possible values are "rotate", "appending" or "disabled". +#LOGGING=rotate + +# Overrides path of log file +#LOGGING_FILE=/var/log/emptty/[TTY_NUMBER].log + +# Arguments passed to Xorg server. +#XORG_ARGS= + +# Allows to use dynamic motd script to generate custom MOTD. +#DYNAMIC_MOTD=false + +# Allows to override default path to dynamic motd. +#DYNAMIC_MOTD_PATH=/etc/emptty/motd-gen.sh + +# Allows to override default path to static motd. +#MOTD_PATH=/etc/emptty/motd + +# Foreground color, available only in daemon mode. +#FG_COLOR=LIGHT_BLACK + +# Background color, available only in daemon mode. +#BG_COLOR=BLACK + +# Enables numlock in daemon mode. Possible values are "true" or "false". +#ENABLE_NUMLOCK=false + +# Defines the way, how is logging of session errors handled. Possible values are "rotate", "appending" or "disabled". +#SESSION_ERROR_LOGGING=disabled + +# Overrides path of session errors log file +#SESSION_ERROR_LOGGING_FILE=/var/log/emptty/session-errors.[TTY_NUMBER].log + +# If set true, it will not use `.emptty-xauth` file, but the standard `~/.Xauthority` file. This allows to handle xauth issues. +#DEFAULT_XAUTHORITY=false + +#If set true, Xorg will be started as rootless, if system allows and emptty is running in daemon mode. +#ROOTLESS_XORG=false + +#If set true, environmental groups are printed to differ Xorg/Wayland/Custom/UserCustom desktops. +IDENTIFY_ENVS=false diff --git a/dotfiles/emptty/etc/emptty/motd b/dotfiles/emptty/etc/emptty/motd new file mode 100644 index 0000000..95d30b0 --- /dev/null +++ b/dotfiles/emptty/etc/emptty/motd @@ -0,0 +1,7 @@ + + ██████╗ ███████╗███████╗ ██████╗ ██╗ █████╗ ████████╗███████╗ + ██╔══██╗██╔════╝██╔════╝██╔═══██╗██║ ██╔══██╗╚══██╔══╝██╔════╝ + ██║ ██║█████╗ ███████╗██║ ██║██║ ███████║ ██║ █████╗ + ██║ ██║██╔══╝ ╚════██║██║ ██║██║ ██╔══██║ ██║ ██╔══╝ + ██████╔╝███████╗███████║╚██████╔╝███████╗██║ ██║ ██║ ███████╗ + ╚═════╝ ╚══════╝╚══════╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝ ╚═╝ ╚══════╝ diff --git a/dotfiles/fuzzel/.config/fuzzel/fuzzel.ini b/dotfiles/fuzzel/.config/fuzzel/fuzzel.ini new file mode 100644 index 0000000..11fec09 --- /dev/null +++ b/dotfiles/fuzzel/.config/fuzzel/fuzzel.ini @@ -0,0 +1,19 @@ +[main] +image-size-ratio=1 +dpi-aware=no +lines=8 +inner-pad=8 + +[colors] +background=#000000ff +text=#888888ff +selection=#777777ff +selection-text=#000000ff +border=#777777ff +match=#ffffffff +selection-match=#ffffffff + +[border] +width=2 +radius=0 +selection-radius=0 diff --git a/dotfiles/ghostty/.config/ghostty/config b/dotfiles/ghostty/.config/ghostty/config new file mode 100644 index 0000000..3f4401b --- /dev/null +++ b/dotfiles/ghostty/.config/ghostty/config @@ -0,0 +1,21 @@ +theme = "LiquidCarbonTransparent" + +background-blur = 255 +background-opacity = 0.98 + +title = " " +window-height = 40 +window-width = 140 +window-decoration = none + +quit-after-last-window-closed = true +quit-after-last-window-closed-delay = 1s + +custom-shader-animation = always +custom-shader = ~/.config/ghostty/shaders/cursor_tail.glsl +custom-shader = ~/.config/ghostty/shaders/in_game_crt_cursor.glsl + +# keybind = cmd+shift+right=new_split:right +# keybind = cmd+shift+left=new_split:left +# keybind = cmd+shift+up=new_split:up +# keybind = cmd+shift+down=new_split:down diff --git a/dotfiles/ghostty/.config/ghostty/shaders/cursor_tail.glsl b/dotfiles/ghostty/.config/ghostty/shaders/cursor_tail.glsl new file mode 100644 index 0000000..672131c --- /dev/null +++ b/dotfiles/ghostty/.config/ghostty/shaders/cursor_tail.glsl @@ -0,0 +1,236 @@ +// Taken from https://github.com/sahaj-b/ghostty-cursor-shaders + +// -- CONFIGURATION -- +vec4 TRAIL_COLOR = iCurrentCursorColor; // can change to eg: vec4(0.2, 0.6, 1.0, 0.5); +const float DURATION = 0.09; // in seconds +const float MAX_TRAIL_LENGTH = 0.2; +const float THRESHOLD_MIN_DISTANCE = 1.5; // min distance to show trail (units of cursor width) +const float BLUR = 2.0; // blur size in pixels (for antialiasing) + +// --- CONSTANTS for easing functions --- +const float PI = 3.14159265359; +const float C1_BACK = 1.70158; +const float C2_BACK = C1_BACK * 1.525; +const float C3_BACK = C1_BACK + 1.0; +const float C4_ELASTIC = (2.0 * PI) / 3.0; +const float C5_ELASTIC = (2.0 * PI) / 4.5; +const float SPRING_STIFFNESS = 9.0; +const float SPRING_DAMPING = 0.9; + +// --- EASING FUNCTIONS --- + +// // Linear +// float ease(float x) { +// return x; +// } + +// // EaseOutQuad +// float ease(float x) { +// return 1.0 - (1.0 - x) * (1.0 - x); +// } + +// // EaseOutCubic +// float ease(float x) { +// return 1.0 - pow(1.0 - x, 3.0); +// } + + +// // EaseOutQuart +// float ease(float x) { +// return 1.0 - pow(1.0 - x, 4.0); +// } + +// // EaseOutQuint +// float ease(float x) { +// return 1.0 - pow(1.0 - x, 5.0); +// } + +// // EaseOutSine +// float ease(float x) { +// return sin((x * PI) / 2.0); +// } + +// // EaseOutExpo +// float ease(float x) { +// return x == 1.0 ? 1.0 : 1.0 - pow(2.0, -10.0 * x); +// } + +// EaseOutCirc +float ease(float x) { + return sqrt(1.0 - pow(x - 1.0, 2.0)); +} + +// // EaseOutBack +// float ease(float x) { +// return 1.0 + C3_BACK * pow(x - 1.0, 3.0) + C1_BACK * pow(x - 1.0, 2.0); +// } + +// // EaseOutElastic +// float ease(float x) { +// return x == 0.0 ? 0.0 +// : x == 1.0 ? 1.0 +// : pow(2.0, -10.0 * x) * sin((x * 10.0 - 0.75) * C4_ELASTIC) + 1.0; +// } + +// Parametric Spring +// float ease(float x) { +// x = clamp(x, 0.0, 1.0); +// float decay = exp(-SPRING_DAMPING * SPRING_STIFFNESS * x); +// float freq = sqrt(SPRING_STIFFNESS * (1.0 - SPRING_DAMPING * SPRING_DAMPING)); +// float osc = cos(freq * 6.283185 * x) + (SPRING_DAMPING * sqrt(SPRING_STIFFNESS) / freq) * sin(freq * 6.283185 * x); +// return 1.0 - decay * osc; +// } + +float getSdfRectangle(in vec2 p, in vec2 xy, in vec2 b) +{ + vec2 d = abs(p - xy) - b; + return length(max(d, 0.0)) + min(max(d.x, d.y), 0.0); +} + +// Based on Inigo Quilez's 2D distance functions article: https://iquilezles.org/articles/distfunctions2d/ +// Potencially optimized by eliminating conditionals and loops to enhance performance and reduce branching + +float seg(in vec2 p, in vec2 a, in vec2 b, inout float s, float d) { + vec2 e = b - a; + vec2 w = p - a; + vec2 proj = a + e * clamp(dot(w, e) / dot(e, e), 0.0, 1.0); + float segd = dot(p - proj, p - proj); + d = min(d, segd); + + float c0 = step(0.0, p.y - a.y); + float c1 = 1.0 - step(0.0, p.y - b.y); + float c2 = 1.0 - step(0.0, e.x * w.y - e.y * w.x); + float allCond = c0 * c1 * c2; + float noneCond = (1.0 - c0) * (1.0 - c1) * (1.0 - c2); + float flip = mix(1.0, -1.0, step(0.5, allCond + noneCond)); + s *= flip; + return d; +} + +float getSdfParallelogram(in vec2 p, in vec2 v0, in vec2 v1, in vec2 v2, in vec2 v3) { + float s = 1.0; + float d = dot(p - v0, p - v0); + + d = seg(p, v0, v3, s, d); + d = seg(p, v1, v0, s, d); + d = seg(p, v2, v1, s, d); + d = seg(p, v3, v2, s, d); + + return s * sqrt(d); +} + +vec2 normalize(vec2 value, float isPosition) { + return (value * 2.0 - (iResolution.xy * isPosition)) / iResolution.y; +} + +float antialising(float distance) { + return 1. - smoothstep(0., normalize(vec2(BLUR, BLUR), 0.).x, distance); +} + +float determineIfTopRightIsLeading(vec2 a, vec2 b) { + float condition1 = step(b.x, a.x) * step(a.y, b.y); // a.x < b.x && a.y > b.y + float condition2 = step(a.x, b.x) * step(b.y, a.y); // a.x > b.x && a.y < b.y + + // if neither condition is met, return 1 (else case) + return 1.0 - max(condition1, condition2); +} + +vec2 getRectangleCenter(vec4 rectangle) { + return vec2(rectangle.x + (rectangle.z / 2.), rectangle.y - (rectangle.w / 2.)); +} + + +void mainImage(out vec4 fragColor, in vec2 fragCoord){ + #if !defined(WEB) + fragColor = texture(iChannel0, fragCoord.xy / iResolution.xy); + #endif + + // normalization & setup(-1, 1 coords) + vec2 vu = normalize(fragCoord, 1.); + vec2 offsetFactor = vec2(-.5, 0.5); + + vec4 currentCursor = vec4(normalize(iCurrentCursor.xy, 1.), normalize(iCurrentCursor.zw, 0.)); + vec4 previousCursor = vec4(normalize(iPreviousCursor.xy, 1.), normalize(iPreviousCursor.zw, 0.)); + + vec2 centerCC = currentCursor.xy - (currentCursor.zw * offsetFactor); + vec2 centerCP = previousCursor.xy - (previousCursor.zw * offsetFactor); + + vec2 delta = centerCP - centerCC; + float lineLength = length(delta); + + float sdfCurrentCursor = getSdfRectangle(vu, centerCC, currentCursor.zw * 0.5); + + vec4 newColor = vec4(fragColor); + + float minDist = currentCursor.w * THRESHOLD_MIN_DISTANCE; + float progress = clamp((iTime - iTimeCursorChange) / DURATION, 0.0, 1.0); + if (lineLength > minDist) { + // ANIMATION logic + + float head_eased = 0.0; + float tail_eased = 0.0; + + float tail_delay_factor = MAX_TRAIL_LENGTH / lineLength; + + float isLongMove = step(MAX_TRAIL_LENGTH, lineLength); + + float head_eased_short = ease(progress); + float tail_eased_short = ease(smoothstep(tail_delay_factor, 1.0, progress)); + float head_eased_long = 1.0; + float tail_eased_long = ease(progress); + + head_eased = mix(head_eased_long, head_eased_short, isLongMove); + tail_eased = mix(tail_eased_long, tail_eased_short, isLongMove); + + // detect straight moves + vec2 delta_abs = abs(centerCC - centerCP); + float threshold = 0.001; + float isHorizontal = step(delta_abs.y, threshold); + float isVertical = step(delta_abs.x, threshold); + float isStraightMove = max(isHorizontal, isVertical); + + // -- Making the parallelogram sdf (diagonal move) -- + + // animate the TOP-LEFT corners + vec2 head_pos_tl = mix(previousCursor.xy, currentCursor.xy, head_eased); + vec2 tail_pos_tl = mix(previousCursor.xy, currentCursor.xy, tail_eased); + + float isTopRightLeading = determineIfTopRightIsLeading(currentCursor.xy, previousCursor.xy); + float isBottomLeftLeading = 1.0 - isTopRightLeading; + + // v0, v1 : "front" of the trail (head) + vec2 v0 = vec2(head_pos_tl.x + currentCursor.z * isTopRightLeading, head_pos_tl.y - currentCursor.w); + vec2 v1 = vec2(head_pos_tl.x + currentCursor.z * isBottomLeftLeading, head_pos_tl.y); + + // v2, v3: "back" of the trail (tail) + vec2 v2 = vec2(tail_pos_tl.x + currentCursor.z * isBottomLeftLeading, tail_pos_tl.y); + vec2 v3 = vec2(tail_pos_tl.x + currentCursor.z * isTopRightLeading, tail_pos_tl.y - previousCursor.w); + + float sdfTrail_diag = getSdfParallelogram(vu, v0, v1, v2, v3); + + // -- Making the rectangle sdf (straight move) -- + + vec2 head_center = mix(centerCP, centerCC, head_eased); + vec2 tail_center = mix(centerCP, centerCC, tail_eased); + + vec2 min_center = min(head_center, tail_center); + vec2 max_center = max(head_center, tail_center); + + vec2 box_size = (max_center - min_center) + currentCursor.zw; + vec2 box_center = (min_center + max_center) * 0.5; + + float sdfTrail_rect = getSdfRectangle(vu, box_center, box_size * 0.5); + + // -- FINAL SELECTING AND DRAWING -- + float sdfTrail = mix(sdfTrail_diag, sdfTrail_rect, isStraightMove); + + vec4 trail = TRAIL_COLOR; + float trailAlpha = antialising(sdfTrail); + newColor = mix(newColor, trail, trailAlpha); + + // punch hole + newColor = mix(newColor, fragColor, step(sdfCurrentCursor, 0.)); + } + + fragColor = newColor; +} diff --git a/dotfiles/ghostty/.config/ghostty/shaders/in_game_crt_cursor.glsl b/dotfiles/ghostty/.config/ghostty/shaders/in_game_crt_cursor.glsl new file mode 100644 index 0000000..578d5ef --- /dev/null +++ b/dotfiles/ghostty/.config/ghostty/shaders/in_game_crt_cursor.glsl @@ -0,0 +1,158 @@ +// In-game CRT shader +// Author: sarphiv +// License: CC BY-NC-SA 4.0 +// Description: +// Cursor shader for Ghostty designed to be applied before the accompanying in-game CRT shader. +// Highlights the cursor whenever it changes (line/block) or moves, and draws a glowing trail for large movements. +// The glow is colored based on cursor colors with an override for white-grey colors. + +// Taken from https://github.com/0xhckr/ghostty-shaders + +// Settings: +// Minimum distance in UV coordinates before drawing trail +// [0, sqrt(2)] +#define TRAIL_MIN_DISTANCE 0.0095 +// Use override colors when color channel brightness standard deviation is below threshold +// [0, sqrt(2)/3] +#define GLOW_COLOR_OVERRIDE_THRESHOLD 0.1 +// Override color for current cursor +// [0, 1]^3 +#define GLOW_COLOR_OVERRIDE_CURRENT 0.2, 0.4, 1.0 +// Override color for previous cursor +// [0, 1]^3 +#define GLOW_COLOR_OVERRIDE_PREVIOUS 0.4, 0.1, 1.0 +// Brightness offset for glow effect +// [0, 1] +#define GLOW_COLOR_OFFSET_BRIGHTNESS 0.5 +// Time slowdown factor for animations +// x \in R : x > 0 +#define TIME_DURATION_FACTOR 1.0 + + + +// Constants: +#define EPS 1e-9 + + + +// Functions: +float min_(float a, float b, float c) { return min(a, min(b, c)); } +float max_(float a, float b, float c) { return max(a, max(b, c)); } + +float sdRectangle(vec2 p, vec2 topLeft, vec2 size) { + vec2 center = topLeft + vec2(size.x, -size.y) * 0.5; + vec2 d = abs(p - center) - size * 0.5; + return length(max(d, 0.0)) + min(max(d.x, d.y), 0.0); +} + +float sdSeg(vec2 p, vec2 a) +{ + vec2 c = a * clamp(dot(p, a) / (dot(a, a) + EPS), 0., 1.) - p; + return sqrt(dot(c, c)); +} + +float sdTriangle(vec2 p, vec2 a, vec2 b, vec2 c) +{ + a -= p; b -= p; c -= p; + + vec3 t = cross(vec3(a.x, b.x, c.x), vec3(a.y, b.y, c.y)); + vec2 m = vec2(min_(t.x, t.y, t.z), max_(t.x, t.y, t.z)); + float s = -1. + 2. * step(m.x, 0.) * step(0., m.y); + + return s * min_( + sdSeg(a, a - b), + sdSeg(b, b - c), + sdSeg(c, c - a) + ); +} + +float sdTrail(vec2 p, vec2 currPos, vec2 currSize, vec2 prevPos, vec2 prevSize, float t) { + // Initialize points + vec2 currWidth = vec2(currSize.x, 0.0), currHeight = vec2(0.0, -currSize.y); + vec2 currTopLeft = currPos; + vec2 currTopRight = currTopLeft + currWidth; + vec2 currBottomLeft = currTopLeft + currHeight; + vec2 currBottomRight = currBottomLeft + currWidth; + vec2 currCenter = (currTopLeft + currBottomRight) * 0.5; + + vec2 prevWidth = vec2(prevSize.x, 0.0), prevHeight = vec2(0.0, -prevSize.y); + vec2 prevTopLeft = prevPos; + vec2 prevTopRight = prevTopLeft + prevWidth; + vec2 prevBottomLeft = prevTopLeft + prevHeight; + vec2 prevBottomRight = prevBottomLeft + prevWidth; + vec2 prevCenter = (prevTopLeft + prevBottomRight) * 0.5; + + // Check whether to only draw cursor + bool nearbyPrev = distance(currCenter, prevCenter) < TRAIL_MIN_DISTANCE; + bool insidePrev = ( + currCenter.x >= prevTopLeft.x && currCenter.x <= prevTopRight.x && + currCenter.y <= prevTopLeft.y && currCenter.y >= prevBottomLeft.y + ); + + float rectDist = max(sdRectangle(p, currTopLeft, currSize), 0.0); + + if (nearbyPrev || insidePrev) + return rectDist; + + // Draw trail and cursor + vec2[4] corners = { currTopLeft, currTopRight, currBottomRight, currBottomLeft }; + vec2 triB = corners[0], triC = corners[0], dir = normalize(currCenter - prevCenter); + float minRel = 1/EPS, maxRel = -minRel; + + for (int i = 0; i < 4; ++i) { + vec2 delta = corners[i] - prevCenter; + float rel = atan(dir.x * delta.y - dir.y * delta.x, dot(dir, delta)); + + if (rel < minRel) + minRel = rel, triB = corners[i]; + if (rel > maxRel) + maxRel = rel, triC = corners[i]; + } + + float triDist = max(sdTriangle(p, prevCenter, triB, triC), 0.0); + + + return min(rectDist, mix(triDist, rectDist, t)); +} + +vec4 colorOverride(vec4 baseColor, vec4 overrideColor) { + if (sqrt(pow(distance(baseColor.rgb, vec3(dot(baseColor.rgb, vec3(1.0)) / 3.0)), 2) / 3.0) < GLOW_COLOR_OVERRIDE_THRESHOLD) + return overrideColor; + else + return baseColor; +} + + +void mainImage(out vec4 fragColor, in vec2 fragCoord) { + vec2 uv = fragCoord.xy / iResolution.xy; + fragColor = texture(iChannel0, uv); + + vec2 currPos = iCurrentCursor.xy / iResolution.xy, currSize = iCurrentCursor.zw / iResolution.xy; + vec2 prevPos = iPreviousCursor.xy / iResolution.xy, prevSize = iPreviousCursor.zw / iResolution.xy; + vec2 currCenter = currPos + currSize * vec2(0.5, -0.5); + vec2 prevCenter = prevPos + prevSize * vec2(0.5, -0.5); + + float dCenter = distance(currCenter, prevCenter); + float dSeg = dot(uv - prevCenter, currCenter - prevCenter) * pow(dCenter + EPS, -2); + bool nearbyPrev = dCenter < TRAIL_MIN_DISTANCE; + + float tShape = 1.0 - pow(1.0 - clamp((iTime - iTimeCursorChange) / TIME_DURATION_FACTOR, 0.0, 1.0), 3); + float tVisible = exp(-(iTime - iTimeCursorChange) / TIME_DURATION_FACTOR * 50.0); + + float dTrail = sdTrail(uv, currPos, currSize, prevPos, prevSize, tShape); + float dTip = nearbyPrev ? 0.0 : clamp(1.0 - abs(dSeg - 1.0), 0.0, 1.0); + + vec4 currColor = colorOverride(iCurrentCursorColor, vec4(GLOW_COLOR_OVERRIDE_CURRENT, 1.0)); + vec4 prevColor = colorOverride(iPreviousCursorColor, vec4(GLOW_COLOR_OVERRIDE_PREVIOUS, 1.0)); + vec4 glowColor = mix(fragColor, mix(prevColor, currColor, dTip) + GLOW_COLOR_OFFSET_BRIGHTNESS, pow(dTip, 3)); + glowColor = mix(glowColor, fragColor, pow(smoothstep(0.0, 0.3, dTrail), 0.1)); + + vec4 trailColor = mix(vec4(1.0), glowColor, pow(smoothstep(0.0, 0.01, dTrail), 0.2)); + vec4 trail = mix(trailColor, fragColor, pow(smoothstep(0.0, nearbyPrev ? 0.01 : 0.1, dTrail), 0.2)); + if (!nearbyPrev) { + trail = mix(trailColor, trail, pow(smoothstep(0.0, 6.0, dTip), 0.05)); + trail = mix(trailColor, trail, pow(smoothstep(0.0, 8.0, dTip), 0.005)); + } + + fragColor = mix(fragColor, trail, tVisible); +} diff --git a/dotfiles/helix/.config/helix/config.toml b/dotfiles/helix/.config/helix/config.toml new file mode 100644 index 0000000..fe42b9d --- /dev/null +++ b/dotfiles/helix/.config/helix/config.toml @@ -0,0 +1,67 @@ +# ~/.config/helix/config.toml + +theme = "boo_berry_custom" + +[editor] +mouse = true +scrolloff = 1 +# line-number = "relative" +cursorline = true + +auto-completion = true +completion-timeout = 25 +preview-completion-insert = false +completion-trigger-len = 1 + +bufferline = "multiple" +color-modes = true +end-of-line-diagnostics = "hint" + +[editor.smart-tab] +enable = false + +[editor.statusline] +left = ["mode", "spinner", "version-control", "file-modification-indicator"] +center = ["file-name"] +right = ["diagnostics", "selections", "file-encoding", "file-line-ending", "file-type", "position"] +separator = "│" +mode.normal = "NORMAL" +mode.insert = "INSERT" +mode.select = "SELECT" +diagnostics = ["hint", "info", "warning", "error"] +workspace-diagnostics = ["hint", "info", "warning", "error"] + +[editor.lsp] +enable = true +display-messages = true +auto-signature-help = true +display-inlay-hints = true + +[editor.file-picker] +hidden = false + +[editor.whitespace] +render = "none" + +[editor.inline-diagnostics] +cursor-line = "hint" +other-lines = "hint" +prefix-len = 5 + +[keys.normal] + +# lazygit integration +C-g = [ + ":write-all", + ":insert-output lazygit >/dev/tty", + ":redraw", + ":reload-all" +] + +# scooter integration +C-r = [ + ":write-all", + ":insert-output scooter --no-stdin >/dev/tty", + ":redraw", + ":reload-all" +] diff --git a/dotfiles/helix/.config/helix/themes/boo_berry_custom.toml b/dotfiles/helix/.config/helix/themes/boo_berry_custom.toml new file mode 100644 index 0000000..94f667c --- /dev/null +++ b/dotfiles/helix/.config/helix/themes/boo_berry_custom.toml @@ -0,0 +1,2 @@ +inherits = "boo_berry" +"ui.background" = {} diff --git a/dotfiles/helix/.config/helix/themes/default_custom.toml b/dotfiles/helix/.config/helix/themes/default_custom.toml new file mode 100644 index 0000000..346c61d --- /dev/null +++ b/dotfiles/helix/.config/helix/themes/default_custom.toml @@ -0,0 +1,2 @@ +inherits = "default" +"ui.background" = {} diff --git a/dotfiles/install-emptty.sh b/dotfiles/install-emptty.sh new file mode 100755 index 0000000..c352d3c --- /dev/null +++ b/dotfiles/install-emptty.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +install_dotfiles "/" "$DOTFILES_DIR" "emptty" diff --git a/dotfiles/install-fuzzel.sh b/dotfiles/install-fuzzel.sh new file mode 100755 index 0000000..57cebfc --- /dev/null +++ b/dotfiles/install-fuzzel.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +install_dotfiles "$HOME" "$DOTFILES_DIR" "fuzzel" diff --git a/dotfiles/install-ghostty.sh b/dotfiles/install-ghostty.sh new file mode 100755 index 0000000..f385f54 --- /dev/null +++ b/dotfiles/install-ghostty.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +install_dotfiles "$HOME" "$DOTFILES_DIR" "ghostty" diff --git a/dotfiles/install-helix.sh b/dotfiles/install-helix.sh new file mode 100755 index 0000000..ae4ada0 --- /dev/null +++ b/dotfiles/install-helix.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +install_dotfiles "$HOME" "$DOTFILES_DIR" "helix" diff --git a/dotfiles/install-river.sh b/dotfiles/install-river.sh new file mode 100755 index 0000000..4288c78 --- /dev/null +++ b/dotfiles/install-river.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +install_dotfiles "$HOME" "$DOTFILES_DIR" "river" diff --git a/dotfiles/install-scooter.sh b/dotfiles/install-scooter.sh new file mode 100755 index 0000000..50ea777 --- /dev/null +++ b/dotfiles/install-scooter.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +install_dotfiles "$HOME" "$DOTFILES_DIR" "scooter" diff --git a/dotfiles/install-yazi.sh b/dotfiles/install-yazi.sh new file mode 100755 index 0000000..aeb47dd --- /dev/null +++ b/dotfiles/install-yazi.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +install_dotfiles "$HOME" "$DOTFILES_DIR" "yazi" diff --git a/dotfiles/install-zsh.sh b/dotfiles/install-zsh.sh new file mode 100755 index 0000000..6b49978 --- /dev/null +++ b/dotfiles/install-zsh.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +install_dotfiles "$HOME" "$DOTFILES_DIR" "zsh" diff --git a/dotfiles/install.sh b/dotfiles/install.sh new file mode 100755 index 0000000..57ca521 --- /dev/null +++ b/dotfiles/install.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +gum style --foreground 4 " +INSTALLING DOTFILES: +" + +. "$DOTFILES_DIR/install-emptty.sh" +. "$DOTFILES_DIR/install-fuzzel.sh" +. "$DOTFILES_DIR/install-ghostty.sh" +. "$DOTFILES_DIR/install-helix.sh" +. "$DOTFILES_DIR/install-river.sh" +. "$DOTFILES_DIR/install-scooter.sh" +. "$DOTFILES_DIR/install-yazi.sh" +. "$DOTFILES_DIR/install-zsh.sh" diff --git a/dotfiles/river/.config/river/init b/dotfiles/river/.config/river/init new file mode 100755 index 0000000..bdd07ec --- /dev/null +++ b/dotfiles/river/.config/river/init @@ -0,0 +1,18 @@ +#!/bin/sh + +# Tiled Layout + +rivertile -view-padding 4 -outer-padding 0 & +riverctl default-layout rivertile +riverctl default-attach-mode above + +# Move cursor to the center of focused window +riverctl set-cursor-warp on-focus-change + +. "$HOME/.config/river/init-keymaps" +. "$HOME/.config/river/init-input" + +# Background Color +riverctl background-color 0x000000 + +pipewire & diff --git a/dotfiles/river/.config/river/init-input b/dotfiles/river/.config/river/init-input new file mode 100755 index 0000000..5e762b5 --- /dev/null +++ b/dotfiles/river/.config/river/init-input @@ -0,0 +1,13 @@ +#!/bin/sh + +riverctl set-repeat 50 180 +riverctl keyboard-layout -options ctrl:nocaps us + +for device in $(riverctl list-inputs | grep -i touchpad); do + riverctl input "$device" tap-button-map left-right-middle + riverctl input "$device" tap enabled + riverctl input "$device" scroll-method two-finger + riverctl input "$device" natural-scroll enabled + riverctl input "$device" drag enabled + riverctl input "$device" disable-while-typing disabled +done diff --git a/dotfiles/river/.config/river/init-keymaps b/dotfiles/river/.config/river/init-keymaps new file mode 100755 index 0000000..4dd09d1 --- /dev/null +++ b/dotfiles/river/.config/river/init-keymaps @@ -0,0 +1,47 @@ +#!/bin/sh + + +# --------------------- +# KEYBOARD +# --------------------- + +riverctl map-pointer normal Super BTN_LEFT move-view +riverctl map-pointer normal Super BTN_RIGHT resize-view +riverctl map-pointer normal Super BTN_MIDDLE toggle-float + +# --------------------- +# KEYBOARD +# --------------------- + +mod=Mod1 + +riverctl map normal $mod Return spawn 'sh -c "ghostty & sleep 0.2 && riverctl focus-view next"' +riverctl map normal $mod Space spawn 'fuzzel' +riverctl map normal $mod q close +riverctl map normal $mod m spawn 'riverctl exit' +riverctl map normal $mod+Shift l spawn 'waylock -init-color 0x000000 -input-color 0x111111 -fail-color 0x220000' + +# Volume +riverctl map normal None XF86AudioRaiseVolume spawn 'wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+' +riverctl map normal None XF86AudioLowerVolume spawn 'wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-' +riverctl map normal None XF86AudioMute spawn 'wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle' + +# Brightness +riverctl map normal None XF86MonBrightnessUp spawn 'light -A 5' +riverctl map normal None XF86MonBrightnessDown spawn 'light -U 5' + +# Navigation +riverctl map normal $mod h focus-view left +riverctl map normal $mod j focus-view down +riverctl map normal $mod k focus-view up +riverctl map normal $mod l focus-view right + +riverctl map normal $mod Tab focus-view previous +riverctl map normal $mod+Shift Tab focus-view next + +# Tags Navigation +for i in $(seq 1 9); do + tag=$((1 << ($i - 1))) + riverctl map normal $mod $i set-focused-tags $tag + riverctl map normal $mod+Shift $i spawn "riverctl set-view-tags $tag && riverctl set-focused-tags $tag" +done diff --git a/dotfiles/scooter/.config/scooter/config.toml b/dotfiles/scooter/.config/scooter/config.toml new file mode 100644 index 0000000..1cad521 --- /dev/null +++ b/dotfiles/scooter/.config/scooter/config.toml @@ -0,0 +1,7 @@ +# ~/.config/scooter/config.toml + +[preview] +syntax_highlighting = true + +[style] +true_color = true diff --git a/dotfiles/yazi/.config/yazi/keymap.toml b/dotfiles/yazi/.config/yazi/keymap.toml new file mode 100644 index 0000000..3c4bbd0 --- /dev/null +++ b/dotfiles/yazi/.config/yazi/keymap.toml @@ -0,0 +1,3 @@ +[[mgr.prepend_keymap]] +on = "M" +run = "plugin mount" diff --git a/dotfiles/zsh/.zsh/editor.sh b/dotfiles/zsh/.zsh/editor.sh new file mode 100644 index 0000000..f538658 --- /dev/null +++ b/dotfiles/zsh/.zsh/editor.sh @@ -0,0 +1 @@ +export EDITOR="hx" diff --git a/dotfiles/zsh/.zsh/llvm.sh b/dotfiles/zsh/.zsh/llvm.sh new file mode 100644 index 0000000..c4dfa45 --- /dev/null +++ b/dotfiles/zsh/.zsh/llvm.sh @@ -0,0 +1,3 @@ +export PATH="/opt/homebrew/opt/llvm/bin:$PATH" +export LDFLAGS="-L/opt/homebrew/opt/llvm/lib" +export CPPFLAGS="-I/opt/homebrew/opt/llvm/include" diff --git a/dotfiles/zsh/.zsh/prompt.sh b/dotfiles/zsh/.zsh/prompt.sh new file mode 100644 index 0000000..2caa062 --- /dev/null +++ b/dotfiles/zsh/.zsh/prompt.sh @@ -0,0 +1,68 @@ +# ~/.zsh/prompt.sh + +autoload -Uz vcs_info +precmd_vcs_info() { vcs_info } +precmd_functions+=( precmd_vcs_info ) +setopt prompt_subst + +c_dir_bg="#CD96CD" +c_dir_fg="#000000" +c_branch_bg="#A3BE8C" +c_branch_fg="#000000" +c_ok="#D7FF00" +c_no="#FF4500" + +dir_empty_icon=" " +dir_filled_icon=" " +git_branch_icon="" + +dir_is_empty() +{ + local -a files + files=( *(N) .*(N) ) + (( ${#files} == 0 )) +} + +get_prompt_dir() +{ + local dir icon tail + + icon=" " + tail="%F{${c_dir_bg}}%f" + + if [[ -n ${vcs_info_msg_0_} ]]; then + tail="%F{${c_dir_bg}}%K{${c_branch_bg}}%k%f" + fi + + if [[ -z $(ls -A . 2>/dev/null) ]]; then + icon=" " + fi + + dir="%f%K{${c_dir_bg}}%F{${c_dir_fg}} ${icon} %~ %f%k${tail}" + print -r -- "$dir" +} + +get_prompt_branch() +{ + local branch + + if [[ -n ${vcs_info_msg_0_} ]]; then + branch="%F{${c_branch_fg}}%K{${c_branch_bg}}  ${vcs_info_msg_0_} %k%f%F{${c_branch_bg}}%f" + else + branch="" + fi + + print -r -- "$branch" +} + +result="%(?..%F{${c_no}}  %f)" + +if [[ "$TERM" == "linux" ]]; then + # Simple ASCII prompt for TTY + PROMPT='%n@%m %~ %# ' +else + PROMPT='$(get_prompt_dir)$(get_prompt_branch)${result} +%B%F{#D7FF00}%f%b ' +fi + +zstyle ':vcs_info:git:*' formats '%b' diff --git a/dotfiles/zsh/.zshenv b/dotfiles/zsh/.zshenv new file mode 100644 index 0000000..3aea204 --- /dev/null +++ b/dotfiles/zsh/.zshenv @@ -0,0 +1,2 @@ +export XDG_SESSION_TYPE=wayland +export XDG_RUNTIME_PATH=/run/user/$(id -u) diff --git a/dotfiles/zsh/.zshrc b/dotfiles/zsh/.zshrc new file mode 100644 index 0000000..3b199de --- /dev/null +++ b/dotfiles/zsh/.zshrc @@ -0,0 +1,12 @@ +autoload -Uz compinit && compinit + +try_source() +{ + [[ -f $1 ]] && source $1 +} + +try_source ~/.zsh/editor.sh +try_source ~/.zsh/prompt.sh +# try_source ~/.zsh/llvm.sh + +export PATH="$HOME/.local/bin:$PATH" diff --git a/groups/_seatd b/groups/_seatd new file mode 100644 index 0000000..e69de29 diff --git a/groups/audio b/groups/audio new file mode 100644 index 0000000..e69de29 diff --git a/groups/video b/groups/video new file mode 100644 index 0000000..e69de29 diff --git a/helpers.sh b/helpers.sh new file mode 100755 index 0000000..900e7e3 --- /dev/null +++ b/helpers.sh @@ -0,0 +1,81 @@ +#!/bin/sh + +install_package() +{ + if [ "$#" -eq 0 ]; then + gum style --foreground 9 "✗ no package provided!" + return 1 + fi + + local package="$1" + + if gum spin --title="Installing $package..." --show-error -- sudo xbps-install -Sy "$package"; then + gum style --foreground 10 "✓ $package" + else + gum style --foreground 9 "✗ $package" + fi +} + +install_service() +{ + if [ "$#" -eq 0 ]; then + echo echo "ERROR: No service provided!" + return 1 + fi + + local service="$1" + + if [ -e "/var/service/$service" ]; then + sudo rm -rf "/var/service/$service" + fi + + if sudo ln -s "/etc/sv/$service" "/var/service/"; then + gum style --foreground 10 "✓ $service" + else + gum style --foreground 9 "✗ $service" + fi +} + +remove_service() +{ + if [ "$#" -eq 0 ]; then + echo echo "ERROR: No service provided!" + return 1 + fi + + local service="$1" + + if sudo rm "/var/service/$service"; then + gum style --foreground 10 "✓ $service" + else + gum style --foreground 9 "✗ $service" + fi +} + +install_dotfiles() +{ + if [ $# -ne 3 ]; then + gum style --foreground 9 "✗ expected 3 arguments - target, dir, name" + return 1 + fi + + target="$1" + dir="$2" + name="$3" + + if [ ! -e "$target" ]; then + gum style --foreground 9 "✗ target path is invelid" + return 1 + fi + + if [ ! -e "$dir" ]; then + gum style --foreground 9 "✗ dir path is invelid" + return 1 + fi + + if sudo stow -R --target="$target" --dir="$dir" "$name"; then + gum style --foreground 10 "✓ $name" + else + gum style --foreground 9 "✗ $name" + fi +} diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..dbde52d --- /dev/null +++ b/install.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +DESOLATE_DIR="$HOME/.desolate" +PACKAGES_DIR="$DESOLATE_DIR/packages" +SERVICES_DIR="$DESOLATE_DIR/services" +DOTFILES_DIR="$DESOLATE_DIR/dotfiles" +GROUPS_DIR="$DESOLATE_DIR/groups" + +. "$HOME/.desolate/helpers.sh" + +. "$PACKAGES_DIR/install.sh" +. "$SERVICES_DIR/install.sh" +. "$DOTFILES_DIR/install.sh" +. "$DESOLATE_DIR/assign-groups.sh" + +gum style --foreground 15 " +Done! +" + +if gum confirm "Reboot system to apply changes?"; then + sudo reboot +fi diff --git a/packages/install-bash-completion.sh b/packages/install-bash-completion.sh new file mode 100755 index 0000000..fafa3ab --- /dev/null +++ b/packages/install-bash-completion.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +install_package "bash-completion" diff --git a/packages/install-bat.sh b/packages/install-bat.sh new file mode 100755 index 0000000..1ab71c2 --- /dev/null +++ b/packages/install-bat.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +install_package "bat" diff --git a/packages/install-btop.sh b/packages/install-btop.sh new file mode 100755 index 0000000..fadc562 --- /dev/null +++ b/packages/install-btop.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +install_package "btop" diff --git a/packages/install-dbus.sh b/packages/install-dbus.sh new file mode 100755 index 0000000..ae5ba1a --- /dev/null +++ b/packages/install-dbus.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +install_package "dbus" diff --git a/packages/install-emptty.sh b/packages/install-emptty.sh new file mode 100755 index 0000000..974e6c4 --- /dev/null +++ b/packages/install-emptty.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +install_package "emptty" diff --git a/packages/install-eza.sh b/packages/install-eza.sh new file mode 100755 index 0000000..0276b9e --- /dev/null +++ b/packages/install-eza.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +install_package "eza" diff --git a/packages/install-fuzzel.sh b/packages/install-fuzzel.sh new file mode 100755 index 0000000..382301e --- /dev/null +++ b/packages/install-fuzzel.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +install_package "fuzzel" diff --git a/packages/install-ghostty.sh b/packages/install-ghostty.sh new file mode 100755 index 0000000..a4de12f --- /dev/null +++ b/packages/install-ghostty.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +install_package "ghostty" diff --git a/packages/install-grim.sh b/packages/install-grim.sh new file mode 100755 index 0000000..e69de29 diff --git a/packages/install-helix.sh b/packages/install-helix.sh new file mode 100755 index 0000000..dc4f448 --- /dev/null +++ b/packages/install-helix.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +install_package "helix" diff --git a/packages/install-less.sh b/packages/install-less.sh new file mode 100755 index 0000000..976663b --- /dev/null +++ b/packages/install-less.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +install_package "less" diff --git a/packages/install-light.sh b/packages/install-light.sh new file mode 100755 index 0000000..dc71cf8 --- /dev/null +++ b/packages/install-light.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +if install_package "light"; then + sudo chmod g+w /sys/class/backlight/*/brightness + sudo chgrp video /sys/class/backlight/*/brightness +fi diff --git a/packages/install-noto-fonts.sh b/packages/install-noto-fonts.sh new file mode 100755 index 0000000..603441b --- /dev/null +++ b/packages/install-noto-fonts.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +install_package "noto-fonts-ttf" +install_package "noto-fonts-cjk" +install_package "noto-fonts-emoji" diff --git a/packages/install-pipewire.sh b/packages/install-pipewire.sh new file mode 100755 index 0000000..f38d057 --- /dev/null +++ b/packages/install-pipewire.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +install_package "pipewire" diff --git a/packages/install-ripgrep.sh b/packages/install-ripgrep.sh new file mode 100755 index 0000000..f5e6ba0 --- /dev/null +++ b/packages/install-ripgrep.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +install_package "ripgrep" diff --git a/packages/install-river.sh b/packages/install-river.sh new file mode 100755 index 0000000..6b19e9d --- /dev/null +++ b/packages/install-river.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +if install_package "river"; then + if [ ! -d "/run/user/$(id -u)" ]; then + sudo mkdir "/run/user/$(id -u)" + fi + sudo chmod 700 "/run/user/$(id -u)" +fi diff --git a/packages/install-seatd.sh b/packages/install-seatd.sh new file mode 100755 index 0000000..b83d79c --- /dev/null +++ b/packages/install-seatd.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +install_package "seatd" diff --git a/packages/install-slurp.sh b/packages/install-slurp.sh new file mode 100755 index 0000000..e69de29 diff --git a/packages/install-stow.sh b/packages/install-stow.sh new file mode 100755 index 0000000..fbe9f6b --- /dev/null +++ b/packages/install-stow.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +install_package "stow" diff --git a/packages/install-udisks2.sh b/packages/install-udisks2.sh new file mode 100755 index 0000000..5341312 --- /dev/null +++ b/packages/install-udisks2.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +install_package "udisks2" diff --git a/packages/install-usbutils.sh b/packages/install-usbutils.sh new file mode 100755 index 0000000..865b6ca --- /dev/null +++ b/packages/install-usbutils.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +install_package "usbutils" diff --git a/packages/install-waylock.sh b/packages/install-waylock.sh new file mode 100755 index 0000000..e89ad8f --- /dev/null +++ b/packages/install-waylock.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +install_package "waylock" diff --git a/packages/install-wiremix.sh b/packages/install-wiremix.sh new file mode 100755 index 0000000..348fb20 --- /dev/null +++ b/packages/install-wiremix.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +install_package "wiremix" diff --git a/packages/install-wl-clipboard.sh b/packages/install-wl-clipboard.sh new file mode 100755 index 0000000..d15ac24 --- /dev/null +++ b/packages/install-wl-clipboard.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +install_package "wl-clipboard" diff --git a/packages/install-yazi.sh b/packages/install-yazi.sh new file mode 100755 index 0000000..dec0c94 --- /dev/null +++ b/packages/install-yazi.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +install_package "yazi" + +plugin="mount" + +if [ -d "$HOME/.config/yazi/plugins/$plugin.yazi" ]; then + gum style --foreground 10 "✓ yazi:$plugin" + return 0 +fi + +if gum spin --title="Installing plugin: $plugin" --show-error -- ya pkg add "yazi-rs/plugins:$plugin"; then + gum style --foreground 10 "✓ yazi:$plugin" +else + gum style --foreground 0 "✗ yazi:$plugin" +fi diff --git a/packages/install-zsh.sh b/packages/install-zsh.sh new file mode 100755 index 0000000..03c32c1 --- /dev/null +++ b/packages/install-zsh.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +install_package "zsh" +install_package "zsh-completions" +install_package "zsh-autosuggestions" +install_package "zsh-syntax-highlighting" + + +if [ $(command -v zsh) >/dev/null 2>&1 ]; then + if [ $(basename $SHELL) != "zsh" ]; then + if ! error=$(sudo chsh -s /usr/bin/zsh $USER 2>&1); then + gum style --foreground 9 "✗ failed to change shell to zsh: $error" + else + gum style --foreground 15 "✓ changed shell to zsh" + fi + fi +fi diff --git a/packages/install.sh b/packages/install.sh new file mode 100755 index 0000000..d11cb17 --- /dev/null +++ b/packages/install.sh @@ -0,0 +1,34 @@ +#!/bin/sh + +sudo true + +gum style --foreground 4 " +INSTALLING PACKAGES: +" + +. "$PACKAGES_DIR/install-bash-completion.sh" +. "$PACKAGES_DIR/install-bat.sh" +. "$PACKAGES_DIR/install-btop.sh" +. "$PACKAGES_DIR/install-dbus.sh" +. "$PACKAGES_DIR/install-emptty.sh" +. "$PACKAGES_DIR/install-eza.sh" +. "$PACKAGES_DIR/install-fuzzel.sh" +. "$PACKAGES_DIR/install-ghostty.sh" +. "$PACKAGES_DIR/install-grim.sh" +. "$PACKAGES_DIR/install-helix.sh" +. "$PACKAGES_DIR/install-less.sh" +. "$PACKAGES_DIR/install-light.sh" +. "$PACKAGES_DIR/install-noto-fonts.sh" +. "$PACKAGES_DIR/install-pipewire.sh" +. "$PACKAGES_DIR/install-ripgrep.sh" +. "$PACKAGES_DIR/install-river.sh" +. "$PACKAGES_DIR/install-seatd.sh" +. "$PACKAGES_DIR/install-slurp.sh" +. "$PACKAGES_DIR/install-stow.sh" +. "$PACKAGES_DIR/install-udisks2.sh" +. "$PACKAGES_DIR/install-usbutils.sh" +. "$PACKAGES_DIR/install-waylock.sh" +. "$PACKAGES_DIR/install-wiremix.sh" +. "$PACKAGES_DIR/install-wl-clipboard.sh" +. "$PACKAGES_DIR/install-yazi.sh" +. "$PACKAGES_DIR/install-zsh.sh" diff --git a/services/install-dbus.sh b/services/install-dbus.sh new file mode 100755 index 0000000..2565c71 --- /dev/null +++ b/services/install-dbus.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +install_service "dbus" diff --git a/services/install-emptty.sh b/services/install-emptty.sh new file mode 100755 index 0000000..7abce17 --- /dev/null +++ b/services/install-emptty.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +install_service "emptty" diff --git a/services/install-river.sh b/services/install-river.sh new file mode 100755 index 0000000..2d1b5e9 --- /dev/null +++ b/services/install-river.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +install_service "river" diff --git a/services/install-seatd.sh b/services/install-seatd.sh new file mode 100755 index 0000000..84d66a5 --- /dev/null +++ b/services/install-seatd.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +install_service "seatd" diff --git a/services/install.sh b/services/install.sh new file mode 100755 index 0000000..b5fcc71 --- /dev/null +++ b/services/install.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +sudo true + +gum style --foreground 4 " +INSTALLING SERVICES: +" + +. "$SERVICES_DIR/install-dbus.sh" +. "$SERVICES_DIR/install-emptty.sh" +. "$SERVICES_DIR/install-seatd.sh"