dev: automated commit - 2025-07-16 19:26:06
This commit is contained in:
parent
fb87c567f6
commit
94487551fc
30 changed files with 173 additions and 157 deletions
126
local-bin/.local/bin/base16-rose-pine-scheme.sh
Executable file
126
local-bin/.local/bin/base16-rose-pine-scheme.sh
Executable file
|
|
@ -0,0 +1,126 @@
|
|||
#!/bin/sh
|
||||
# base16-shell (https://github.com/chriskempson/base16-shell)
|
||||
# Base16 Shell template by Chris Kempson (http://chriskempson.com)
|
||||
# Rosé Pine Dawn scheme by Emilia Dunfelt <sayhi@dunfelt.se>
|
||||
|
||||
color00="19/17/24" # Base 00 - Black
|
||||
color01="eb/6f/92" # Base 08 - Red
|
||||
color02="31/74/8f" # Base 0B - Green
|
||||
color03="eb/bc/ba" # Base 0A - Yellow
|
||||
color04="c4/a7/e7" # Base 0D - Blue
|
||||
color05="f6/c1/77" # Base 0E - Magenta
|
||||
color06="9c/cf/d8" # Base 0C - Cyan
|
||||
color07="e0/de/f4" # Base 05 - White
|
||||
color08="90/8c/aa" # Base 03 - Bright Black
|
||||
color09=$color01 # Base 08 - Bright Red
|
||||
color10=$color02 # Base 0B - Bright Green
|
||||
color11=$color03 # Base 0A - Bright Yellow
|
||||
color12=$color04 # Base 0D - Bright Blue
|
||||
color13=$color05 # Base 0E - Bright Magenta
|
||||
color14=$color06 # Base 0C - Bright Cyan
|
||||
color15="52/4f/67" # Base 07 - Bright White
|
||||
color16="f6/c1/77" # Base 09
|
||||
color17="eb/6f/92" # Base 0F
|
||||
color18="1f/1d/2e" # Base 01
|
||||
color19="26/23/3a" # Base 02
|
||||
color20="6e/6a/86" # Base 03
|
||||
color21="52/4f/67" # Base 04
|
||||
color_foreground="e0/de/f4" # Base 05
|
||||
color_background="19/17/24" # Base 00
|
||||
|
||||
if [ -n "$TMUX" ]; then
|
||||
# Tell tmux to pass the escape sequences through
|
||||
# (Source: http://permalink.gmane.org/gmane.comp.terminal-emulators.tmux.user/1324)
|
||||
put_template() { printf '\033Ptmux;\033\033]4;%d;rgb:%s\033\033\\\033\\' $@; }
|
||||
put_template_var() { printf '\033Ptmux;\033\033]%d;rgb:%s\033\033\\\033\\' $@; }
|
||||
put_template_custom() { printf '\033Ptmux;\033\033]%s%s\033\033\\\033\\' $@; }
|
||||
elif [ "${TERM%%[-.]*}" = "screen" ]; then
|
||||
# GNU screen (screen, screen-256color, screen-256color-bce)
|
||||
put_template() { printf '\033P\033]4;%d;rgb:%s\007\033\\' $@; }
|
||||
put_template_var() { printf '\033P\033]%d;rgb:%s\007\033\\' $@; }
|
||||
put_template_custom() { printf '\033P\033]%s%s\007\033\\' $@; }
|
||||
elif [ "${TERM%%-*}" = "linux" ]; then
|
||||
put_template() { [ $1 -lt 16 ] && printf "\e]P%x%s" $1 $(echo $2 | sed 's/\///g'); }
|
||||
put_template_var() { true; }
|
||||
put_template_custom() { true; }
|
||||
else
|
||||
put_template() { printf '\033]4;%d;rgb:%s\033\\' $@; }
|
||||
put_template_var() { printf '\033]%d;rgb:%s\033\\' $@; }
|
||||
put_template_custom() { printf '\033]%s%s\033\\' $@; }
|
||||
fi
|
||||
|
||||
# 16 color space
|
||||
put_template 0 $color00
|
||||
put_template 1 $color01
|
||||
put_template 2 $color02
|
||||
put_template 3 $color03
|
||||
put_template 4 $color04
|
||||
put_template 5 $color05
|
||||
put_template 6 $color06
|
||||
put_template 7 $color07
|
||||
put_template 8 $color08
|
||||
put_template 9 $color09
|
||||
put_template 10 $color10
|
||||
put_template 11 $color11
|
||||
put_template 12 $color12
|
||||
put_template 13 $color13
|
||||
put_template 14 $color14
|
||||
put_template 15 $color15
|
||||
|
||||
# 256 color space
|
||||
put_template 16 $color16
|
||||
put_template 17 $color17
|
||||
put_template 18 $color18
|
||||
put_template 19 $color19
|
||||
put_template 20 $color20
|
||||
put_template 21 $color21
|
||||
|
||||
# foreground / background / cursor color
|
||||
if [ -n "$ITERM_SESSION_ID" ]; then
|
||||
# iTerm2 proprietary escape codes
|
||||
put_template_custom Pg 575279 # foreground
|
||||
put_template_custom Ph faf4ed # background
|
||||
put_template_custom Pi 575279 # bold color
|
||||
put_template_custom Pj f2e9de # selection color
|
||||
put_template_custom Pk 575279 # selected text color
|
||||
put_template_custom Pl 575279 # cursor
|
||||
put_template_custom Pm faf4ed # cursor text
|
||||
else
|
||||
put_template_var 10 $color_foreground
|
||||
if [ "$BASE16_SHELL_SET_BACKGROUND" != false ]; then
|
||||
put_template_var 11 $color_background
|
||||
if [ "${TERM%%-*}" = "rxvt" ]; then
|
||||
put_template_var 708 $color_background # internal border (rxvt)
|
||||
fi
|
||||
fi
|
||||
put_template_custom 12 ";7" # cursor (reverse video)
|
||||
fi
|
||||
|
||||
# clean up
|
||||
unset -f put_template
|
||||
unset -f put_template_var
|
||||
unset -f put_template_custom
|
||||
unset color00
|
||||
unset color01
|
||||
unset color02
|
||||
unset color03
|
||||
unset color04
|
||||
unset color05
|
||||
unset color06
|
||||
unset color07
|
||||
unset color08
|
||||
unset color09
|
||||
unset color10
|
||||
unset color11
|
||||
unset color12
|
||||
unset color13
|
||||
unset color14
|
||||
unset color15
|
||||
unset color16
|
||||
unset color17
|
||||
unset color18
|
||||
unset color19
|
||||
unset color20
|
||||
unset color21
|
||||
unset color_foreground
|
||||
unset color_background
|
||||
16
local-bin/.local/bin/code.sh
Executable file
16
local-bin/.local/bin/code.sh
Executable file
|
|
@ -0,0 +1,16 @@
|
|||
#!/bin/bash
|
||||
MODULE_URL="mzunino.com.uy/go/code"
|
||||
BINARY_NAME="code"
|
||||
TARGET_DIR="$HOME/.local/bin"
|
||||
BINARY_PATH="$TARGET_DIR/$BINARY_NAME"
|
||||
|
||||
if [ ! -x "$BINARY_PATH" ]; then
|
||||
notify-send "📦 Installing $BINARY_NAME" "Installing from $MODULE_URL..."
|
||||
GO111MODULE=on GOBIN="$TARGET_DIR" go install "$MODULE_URL@latest" || {
|
||||
notify-send -u critical "Installation Failed" "Failed to install $BINARY_NAME from $MODULE_URL"
|
||||
exit 1
|
||||
}
|
||||
notify-send "Installation Complete" "$BINARY_NAME has been installed successfully"
|
||||
fi
|
||||
|
||||
exec "$BINARY_PATH" "$@"
|
||||
32
local-bin/.local/bin/fix-git.sh
Executable file
32
local-bin/.local/bin/fix-git.sh
Executable file
|
|
@ -0,0 +1,32 @@
|
|||
#!/bin/bash
|
||||
|
||||
OLD_URL=$(git remote get-url origin)
|
||||
if [[ $OLD_URL == "https://github.com"* ]]; then
|
||||
# Modified sed pattern to better handle GitHub URLs
|
||||
USER_REPO=$(echo $OLD_URL | sed -n 's|https://github.com/\([^/]*/[^/]*\)|\1|p')
|
||||
if [ -z "$USER_REPO" ]; then
|
||||
echo "Error: Could not extract user/repo from URL: $OLD_URL"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Remove any trailing .git if present and add it back consistently
|
||||
USER_REPO=$(echo $USER_REPO | sed 's/\.git$//')
|
||||
NEW_URL="git@github.com:${USER_REPO}.git"
|
||||
|
||||
echo "Old URL: $OLD_URL"
|
||||
echo "New URL: $NEW_URL"
|
||||
|
||||
# Update the remote URL to use SSH
|
||||
git remote set-url origin "$NEW_URL"
|
||||
|
||||
# Verify the change
|
||||
CURRENT_URL=$(git remote get-url origin)
|
||||
if [ "$CURRENT_URL" = "$NEW_URL" ]; then
|
||||
echo "Successfully updated remote URL to use SSH."
|
||||
else
|
||||
echo "Error: Failed to update remote URL."
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "Remote URL is already using SSH or a different protocol: $OLD_URL"
|
||||
fi
|
||||
53
local-bin/.local/bin/fuzzel.lua
Normal file
53
local-bin/.local/bin/fuzzel.lua
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
return {
|
||||
selector_cmd = function()
|
||||
return {
|
||||
command = "rofi",
|
||||
args = { "-dmenu", "-p", "Project: " },
|
||||
}
|
||||
end,
|
||||
editor_cmd = function(path, class)
|
||||
local dirName = path:match("([^/]+)$")
|
||||
-- Sanitize dirName for tmux session name (remove special chars)
|
||||
local tmuxSession = dirName:gsub("[^a-zA-Z0-9_]", "_")
|
||||
|
||||
local tmuxCmd = string.format(
|
||||
[[ tmux has-session -t %s 2>/dev/null && tmux attach -t %s || tmux new -c %s -s %s 'nvim %s' \; split-window -h -c %s ]],
|
||||
tmuxSession,
|
||||
tmuxSession,
|
||||
path,
|
||||
tmuxSession,
|
||||
path,
|
||||
path
|
||||
)
|
||||
return {
|
||||
command = "kitty",
|
||||
args = {
|
||||
"-d",
|
||||
path,
|
||||
"-T",
|
||||
class,
|
||||
"--class",
|
||||
class,
|
||||
"sh",
|
||||
"-c",
|
||||
tmuxCmd,
|
||||
},
|
||||
}
|
||||
end,
|
||||
format_project_title = function(path)
|
||||
-- Extract project name for better display
|
||||
-- local projectName = path:match("([^/]+)$") or path
|
||||
return "📘 " .. path
|
||||
end,
|
||||
|
||||
extract_path_from_title = function(title)
|
||||
-- Return back the path: 📘 work/project_1 -> work/project_1
|
||||
return title:gsub("^📘%s*", ""):gsub("\n$", "")
|
||||
end,
|
||||
|
||||
-- Add error handling function
|
||||
handle_error = function(err)
|
||||
io.stderr:write("Error: " .. tostring(err) .. "\n")
|
||||
return false
|
||||
end,
|
||||
}
|
||||
16
local-bin/.local/bin/goq.sh
Executable file
16
local-bin/.local/bin/goq.sh
Executable file
|
|
@ -0,0 +1,16 @@
|
|||
#!/bin/bash
|
||||
MODULE_URL="github.com/marianozunino/goq"
|
||||
BINARY_NAME="goq"
|
||||
TARGET_DIR="$HOME/.local/bin"
|
||||
BINARY_PATH="$TARGET_DIR/$BINARY_NAME"
|
||||
|
||||
if [ ! -x "$BINARY_PATH" ]; then
|
||||
notify-send "📦 Installing $BINARY_NAME" "Installing from $MODULE_URL..."
|
||||
GO111MODULE=on GOBIN="$TARGET_DIR" go install "$MODULE_URL@latest" || {
|
||||
notify-send -u critical "Installation Failed" "Failed to install $BINARY_NAME from $MODULE_URL"
|
||||
exit 1
|
||||
}
|
||||
notify-send "Installation Complete" "$BINARY_NAME has been installed successfully"
|
||||
fi
|
||||
|
||||
exec "$BINARY_PATH" "$@"
|
||||
27
local-bin/.local/bin/leapp.sh
Executable file
27
local-bin/.local/bin/leapp.sh
Executable file
|
|
@ -0,0 +1,27 @@
|
|||
#!/bin/bash
|
||||
REPO="noovolari/leapp"
|
||||
BINARY_NAME="leapp"
|
||||
TARGET_DIR="$HOME/.local/bin"
|
||||
BINARY_PATH="$TARGET_DIR/$BINARY_NAME"
|
||||
DOWNLOAD_URL="https://asset.noovolari.com/latest/Leapp-appImage.zip"
|
||||
|
||||
if [ ! -x "$BINARY_PATH" ]; then
|
||||
notify-send "📦 Installing $BINARY_NAME" "Downloading from $REPO..."
|
||||
|
||||
mkdir -p "$TARGET_DIR"
|
||||
|
||||
wget -q -O /tmp/leapp.zip "$DOWNLOAD_URL" || {
|
||||
notify-send -u critical "Installation Failed" "Failed to download $BINARY_NAME from $REPO"
|
||||
exit 1
|
||||
}
|
||||
|
||||
unzip -q /tmp/leapp.zip -d /tmp/leapp_extract
|
||||
find /tmp/leapp_extract -name "Leapp*" -type f | head -1 | xargs -I {} mv {} "$BINARY_PATH"
|
||||
chmod +x "$BINARY_PATH"
|
||||
|
||||
rm -rf /tmp/leapp.zip /tmp/leapp_extract
|
||||
|
||||
notify-send "Installation Complete" "$BINARY_NAME has been installed successfully"
|
||||
fi
|
||||
|
||||
exec "$BINARY_PATH" "$@"
|
||||
25
local-bin/.local/bin/lock.sh
Executable file
25
local-bin/.local/bin/lock.sh
Executable file
|
|
@ -0,0 +1,25 @@
|
|||
#!/bin/bash
|
||||
swaylock -f \
|
||||
--screenshots \
|
||||
--clock \
|
||||
--indicator \
|
||||
--indicator-radius 150 \
|
||||
--indicator-thickness 7 \
|
||||
--font-size 24 \
|
||||
--effect-blur 7x5 \
|
||||
--effect-vignette 0.5:0.5 \
|
||||
--ring-color 9ccfd8 \
|
||||
--ring-ver-color f6c177 \
|
||||
--ring-wrong-color eb6f92 \
|
||||
--key-hl-color eb6f92 \
|
||||
--line-color 00000000 \
|
||||
--inside-color 191724aa \
|
||||
--inside-ver-color 191724aa \
|
||||
--inside-wrong-color 191724aa \
|
||||
--separator-color 00000000 \
|
||||
--text-color e0def4 \
|
||||
--text-ver-color e0def4 \
|
||||
--text-wrong-color e0def4 \
|
||||
--text-caps-lock-color f6c177 \
|
||||
--grace 2 \
|
||||
--fade-in 0.2
|
||||
22
local-bin/.local/bin/nosql.sh
Executable file
22
local-bin/.local/bin/nosql.sh
Executable file
|
|
@ -0,0 +1,22 @@
|
|||
#!/bin/bash
|
||||
BINARY_NAME="nosql"
|
||||
TARGET_DIR="$HOME/.local/bin"
|
||||
BINARY_PATH="$TARGET_DIR/$BINARY_NAME"
|
||||
DOWNLOAD_URL="https://s3.nosqlbooster.com/download/releasesv7/nosqlbooster4mongo-7.1.17.AppImage"
|
||||
|
||||
if [ ! -x "$BINARY_PATH" ]; then
|
||||
notify-send "📦 Installing $BINARY_NAME" "Downloading NoSQL Booster..."
|
||||
|
||||
mkdir -p "$TARGET_DIR"
|
||||
|
||||
wget -q -O "$BINARY_PATH" "$DOWNLOAD_URL" || {
|
||||
notify-send -u critical "Installation Failed" "Failed to download $BINARY_NAME"
|
||||
exit 1
|
||||
}
|
||||
|
||||
chmod +x "$BINARY_PATH"
|
||||
|
||||
notify-send "Installation Complete" "$BINARY_NAME has been installed successfully"
|
||||
fi
|
||||
|
||||
exec "$BINARY_PATH" "$@"
|
||||
6
local-bin/.local/bin/obsidian-launcher
Executable file
6
local-bin/.local/bin/obsidian-launcher
Executable file
|
|
@ -0,0 +1,6 @@
|
|||
#!/usr/bin/env sh
|
||||
swaymsg '[class="obsidian"]' focus && exit
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
obsidian && swaymsg '[class="obsidian"]' focus >/dev/null 2>&1
|
||||
fi
|
||||
26
local-bin/.local/bin/openlens.sh
Executable file
26
local-bin/.local/bin/openlens.sh
Executable file
|
|
@ -0,0 +1,26 @@
|
|||
#!/bin/bash
|
||||
REPO="MuhammedKalkan/OpenLens"
|
||||
BINARY_NAME="openlens"
|
||||
TARGET_DIR="$HOME/.local/bin"
|
||||
BINARY_PATH="$TARGET_DIR/$BINARY_NAME"
|
||||
|
||||
if [ ! -x "$BINARY_PATH" ]; then
|
||||
notify-send "📦 Installing $BINARY_NAME" "Downloading from GitHub repository $REPO..."
|
||||
|
||||
mkdir -p "$TARGET_DIR"
|
||||
|
||||
arch=$(uname -m)
|
||||
filename=$(curl -s "https://api.github.com/repos/$REPO/releases/latest" | jq -r '.assets[].name' | grep "${arch}.AppImage$")
|
||||
fileurl=$(curl -s "https://api.github.com/repos/$REPO/releases/latest" | jq -r --arg filename "$filename" '.assets[] | select(.name == $filename) | .browser_download_url')
|
||||
|
||||
wget -q -O "$BINARY_PATH" "$fileurl" || {
|
||||
notify-send -u critical "Installation Failed" "Failed to download $BINARY_NAME from $REPO"
|
||||
exit 1
|
||||
}
|
||||
|
||||
chmod +x "$BINARY_PATH"
|
||||
|
||||
notify-send "Installation Complete" "$BINARY_NAME has been installed successfully"
|
||||
fi
|
||||
|
||||
exec "$BINARY_PATH" "$@"
|
||||
39
local-bin/.local/bin/randwall
Executable file
39
local-bin/.local/bin/randwall
Executable file
|
|
@ -0,0 +1,39 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Kill any existing swaybg or feh instances
|
||||
pkill swaybg
|
||||
pkill feh
|
||||
|
||||
# Function to set wallpaper using swaybg on Sway
|
||||
set_wallpaper_sway() {
|
||||
if [ "$(hostname)" == "main" ]; then
|
||||
swaymsg -t get_outputs -r | jq -r ".[].name" | parallel 'swaybg -o {} -i $(find ~/Pictures/* -type f | shuf -n 1) &'
|
||||
elif [ "$(hostname)" == "fw" ]; then
|
||||
swaybg -m fill -i "/home/forbi/Pictures/nord-balloons.png"
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to set wallpaper using swaybg on Hyprland
|
||||
set_wallpaper_hyprland() {
|
||||
hyprctl monitors -j | jq -r ".[].name" | parallel 'swaybg -o {} -i $(find ~/Pictures/* -type f | shuf -n 1) &'
|
||||
}
|
||||
|
||||
# Function to set wallpaper using feh on i3
|
||||
set_wallpaper_i3() {
|
||||
# Count number of connected monitors
|
||||
monitor_count=$(xrandr --query | grep " connected" | wc -l)
|
||||
|
||||
# Get random wallpapers equal to monitor count
|
||||
readarray -t wallpapers < <(find ~/Pictures/* -type f | shuf -n "$monitor_count")
|
||||
|
||||
# Construct the feh command with multiple --bg-fill arguments
|
||||
cmd="feh"
|
||||
for wallpaper in "${wallpapers[@]}"; do
|
||||
cmd+=" --bg-fill '$wallpaper'"
|
||||
done
|
||||
|
||||
# Execute the command
|
||||
eval "$cmd"
|
||||
}
|
||||
|
||||
set_wallpaper_sway
|
||||
26
local-bin/.local/bin/redis.sh
Executable file
26
local-bin/.local/bin/redis.sh
Executable file
|
|
@ -0,0 +1,26 @@
|
|||
#!/bin/bash
|
||||
REPO="qishibo/AnotherRedisDesktopManager"
|
||||
BINARY_NAME="redis"
|
||||
TARGET_DIR="$HOME/.local/bin"
|
||||
BINARY_PATH="$TARGET_DIR/$BINARY_NAME"
|
||||
|
||||
if [ ! -x "$BINARY_PATH" ]; then
|
||||
notify-send "📦 Installing $BINARY_NAME" "Downloading from GitHub repository $REPO..."
|
||||
|
||||
mkdir -p "$TARGET_DIR"
|
||||
|
||||
arch=$(uname -m)
|
||||
filename=$(curl -s "https://api.github.com/repos/$REPO/releases/latest" | jq -r '.assets[].name' | grep "AppImage" | grep "$arch")
|
||||
fileurl=$(curl -s "https://api.github.com/repos/$REPO/releases/latest" | jq -r --arg filename "$filename" '.assets[] | select(.name == $filename) | .browser_download_url')
|
||||
|
||||
wget -q -O "$BINARY_PATH" "$fileurl" || {
|
||||
notify-send -u critical "Installation Failed" "Failed to download $BINARY_NAME from $REPO"
|
||||
exit 1
|
||||
}
|
||||
|
||||
chmod +x "$BINARY_PATH"
|
||||
|
||||
notify-send "Installation Complete" "$BINARY_NAME has been installed successfully"
|
||||
fi
|
||||
|
||||
exec "$BINARY_PATH" "$@"
|
||||
16
local-bin/.local/bin/rop.sh
Executable file
16
local-bin/.local/bin/rop.sh
Executable file
|
|
@ -0,0 +1,16 @@
|
|||
#!/bin/bash
|
||||
MODULE_URL="github.com/marianozunino/rop"
|
||||
BINARY_NAME="rop"
|
||||
TARGET_DIR="$HOME/.local/bin"
|
||||
BINARY_PATH="$TARGET_DIR/$BINARY_NAME"
|
||||
|
||||
if [ ! -x "$BINARY_PATH" ]; then
|
||||
notify-send "📦 Installing $BINARY_NAME" "Installing from $MODULE_URL..."
|
||||
GO111MODULE=on GOBIN="$TARGET_DIR" go install "$MODULE_URL@latest" || {
|
||||
notify-send -u critical "Installation Failed" "Failed to install $BINARY_NAME from $MODULE_URL"
|
||||
exit 1
|
||||
}
|
||||
notify-send "Installation Complete" "$BINARY_NAME has been installed successfully"
|
||||
fi
|
||||
|
||||
exec "$BINARY_PATH" "$@"
|
||||
7
local-bin/.local/bin/screenshot-upload
Executable file
7
local-bin/.local/bin/screenshot-upload
Executable file
|
|
@ -0,0 +1,7 @@
|
|||
#!/bin/bash
|
||||
file=/tmp/$(date "+%Y%m%d-%H%M%S")_screenshot.png
|
||||
|
||||
grim -g "$(slurp)" "$file" &&
|
||||
satty --filename "$file" --fullscreen &&
|
||||
yad --title="Upload?" --text="Upload image?" --image="dialog-question" --default-cancel &&
|
||||
curl -F "file=@$file" https://drop.mz.uy | xargs xdg-open
|
||||
16
local-bin/.local/bin/sdm-ui.sh
Executable file
16
local-bin/.local/bin/sdm-ui.sh
Executable file
|
|
@ -0,0 +1,16 @@
|
|||
#!/bin/bash
|
||||
MODULE_URL="github.com/marianozunino/sdm-ui"
|
||||
BINARY_NAME="sdm-ui"
|
||||
TARGET_DIR="$HOME/.local/bin"
|
||||
BINARY_PATH="$TARGET_DIR/$BINARY_NAME"
|
||||
|
||||
if [ ! -x "$BINARY_PATH" ]; then
|
||||
notify-send "📦 Installing $BINARY_NAME" "Installing from $MODULE_URL..."
|
||||
GO111MODULE=on GOBIN="$TARGET_DIR" go install "$MODULE_URL@latest" || {
|
||||
notify-send -u critical "Installation Failed" "Failed to install $BINARY_NAME from $MODULE_URL"
|
||||
exit 1
|
||||
}
|
||||
notify-send "Installation Complete" "$BINARY_NAME has been installed successfully"
|
||||
fi
|
||||
|
||||
exec "$BINARY_PATH" "$@"
|
||||
34
local-bin/.local/bin/sm.sh
Executable file
34
local-bin/.local/bin/sm.sh
Executable file
|
|
@ -0,0 +1,34 @@
|
|||
#!/bin/bash
|
||||
BINARY_NAME="sm"
|
||||
TARGET_DIR="$HOME/.local/bin"
|
||||
BINARY_PATH="$TARGET_DIR/$BINARY_NAME"
|
||||
SUBLIME_DIR="$TARGET_DIR/sublime_merge"
|
||||
|
||||
if [ ! -x "$BINARY_PATH" ]; then
|
||||
notify-send "📦 Installing $BINARY_NAME" "Downloading Sublime Merge..."
|
||||
|
||||
mkdir -p "$TARGET_DIR"
|
||||
|
||||
URL=$(curl -s "https://www.sublimemerge.com/download_thanks?target=x64-tar" | grep -oP 'https://download.sublimetext.com/sublime_merge_build_\d+_x64.tar.xz' | head -n 1)
|
||||
VERSION=$(echo "$URL" | grep -oP '\d+' | head -n 1)
|
||||
FILENAME="sublime_merge_build_${VERSION}_x64.tar.xz"
|
||||
|
||||
cd "$TARGET_DIR"
|
||||
|
||||
if [ ! -f "$FILENAME" ]; then
|
||||
wget -q "$URL" || {
|
||||
notify-send -u critical "Installation Failed" "Failed to download $BINARY_NAME"
|
||||
exit 1
|
||||
}
|
||||
|
||||
tar -xf "$FILENAME"
|
||||
fi
|
||||
|
||||
if [ ! -f "$BINARY_PATH" ]; then
|
||||
ln -s "$SUBLIME_DIR/sublime_merge" "$BINARY_PATH"
|
||||
fi
|
||||
|
||||
notify-send "Installation Complete" "$BINARY_NAME has been installed successfully"
|
||||
fi
|
||||
|
||||
exec "$BINARY_PATH" "$@"
|
||||
62
local-bin/.local/bin/vmrss
Executable file
62
local-bin/.local/bin/vmrss
Executable file
|
|
@ -0,0 +1,62 @@
|
|||
#!/usr/bin/env bash
|
||||
if [ $# -eq 0 ]; then
|
||||
echo "Usage: $0 <pid>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
function print_vmrss() {
|
||||
declare -a arr
|
||||
arr=("$1" 0)
|
||||
total=0
|
||||
|
||||
while [ ${#arr[@]} -gt 0 ]; do
|
||||
|
||||
# remove last element
|
||||
space=${arr[${#arr[@]}-1]}
|
||||
unset arr[${#arr[@]}-1]
|
||||
pid=${arr[${#arr[@]}-1]}
|
||||
unset arr[${#arr[@]}-1]
|
||||
|
||||
[ -d "/proc/$pid" ] || continue
|
||||
|
||||
GREP_OPTS=${GREP_OPTS:-"
|
||||
--color=auto
|
||||
--exclude-dir={.bzr,CVS,.git,.hg,.svn,.idea,.tox}
|
||||
"}
|
||||
mem=$(grep $GREP_OPTS VmRSS /proc/$pid/status \
|
||||
| grep $GREP_OPTS -o '[0-9]\+' \
|
||||
| awk '{print $1/1024}')
|
||||
#Add decimals to total
|
||||
total=$(echo $mem+$total | bc)
|
||||
|
||||
# name of process
|
||||
name=$(ps -p $pid -o comm=)
|
||||
|
||||
printf "%${space}s%s($pid): $mem MB\n" '' "$name"
|
||||
|
||||
# get children
|
||||
children=$(pgrep -P $pid)
|
||||
|
||||
# add children to array
|
||||
for child in $children; do
|
||||
arr+=("$child" $((space+2)))
|
||||
done
|
||||
done
|
||||
printf "Total: $total MB\n"
|
||||
}
|
||||
|
||||
# check VMRSS_MONITOR = 1
|
||||
if [ ! -z "$VMRSS_MONITOR" ]; then
|
||||
while true; do
|
||||
if ps -p $1 > /dev/null
|
||||
then
|
||||
print_vmrss $1
|
||||
sleep 0.5
|
||||
else
|
||||
break
|
||||
fi
|
||||
done
|
||||
print_vmrss $1
|
||||
else
|
||||
print_vmrss $1
|
||||
fi
|
||||
11
local-bin/.local/bin/waybar.sh
Executable file
11
local-bin/.local/bin/waybar.sh
Executable file
|
|
@ -0,0 +1,11 @@
|
|||
#!/bin/bash
|
||||
|
||||
CONFIG_FILES="$HOME/.config/waybar/config.jsonc $HOME/.config/waybar/style.css"
|
||||
|
||||
trap "killall waybar" EXIT
|
||||
|
||||
while true; do
|
||||
waybar &
|
||||
inotifywait -e create,modify $CONFIG_FILES
|
||||
killall waybar
|
||||
done
|
||||
BIN
local-bin/.local/bin/wlrecord.sh
Executable file
BIN
local-bin/.local/bin/wlrecord.sh
Executable file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue