This commit is contained in:
coast 2025-07-21 12:57:44 +03:30
parent 3b424f823a
commit 0669800f5e
17 changed files with 341 additions and 67 deletions

View file

@ -57,37 +57,37 @@ vim.opt.writebackup = false
vim.opt.lazyredraw = true
vim.opt.smoothscroll = true
vim.api.nvim_set_hl(0, "Normal", { fg = "#d77189", bg = "NONE", ctermfg = 168, ctermbg = "NONE" })
vim.api.nvim_set_hl(0, "NormalNC", { fg = "#c7607a", bg = "NONE", ctermfg = 168, ctermbg = "NONE" })
vim.api.nvim_set_hl(0, "LineNr", { fg = "#914659", bg = "NONE", ctermfg = 131, ctermbg = "NONE" })
vim.api.nvim_set_hl(0, "CursorLine", { bg = "#1a0a0e", fg = "NONE", ctermbg = 233, ctermfg = "NONE" })
vim.api.nvim_set_hl(0, "VertSplit", { fg = "#351f26", bg = "NONE", ctermfg = 59, ctermbg = "NONE" })
vim.api.nvim_set_hl(0, "Normal", { fg = "#5B469A", bg = "NONE", ctermfg = 61, ctermbg = "NONE" })
vim.api.nvim_set_hl(0, "NormalNC", { fg = "#6c55b4", bg = "NONE", ctermfg = 63, ctermbg = "NONE" })
vim.api.nvim_set_hl(0, "LineNr", { fg = "#3f2b75", bg = "NONE", ctermfg = 60, ctermbg = "NONE" })
vim.api.nvim_set_hl(0, "CursorLine", { bg = "#2a1f4d", fg = "NONE", blend = 30 })
vim.api.nvim_set_hl(0, "VertSplit", { fg = "#2a1f4d", bg = "NONE", ctermfg = 238, ctermbg = "NONE" })
vim.api.nvim_set_hl(0, "StatusLine", {
fg = "#d77189",
bg = "#2a151b",
ctermfg = 168,
ctermbg = 235,
fg = "#5B469A",
bg = "#1f1832",
ctermfg = 61,
ctermbg = 234,
})
vim.api.nvim_set_hl(0, "StatusLineMode", {
fg = "#ffd1dc",
bg = "#5c2f3d",
fg = "#e0d4f7",
bg = "#3b2a6d",
bold = true,
ctermfg = 217,
ctermbg = 131,
ctermfg = 189,
ctermbg = 60,
})
vim.api.nvim_set_hl(0, "Visual", { bg = "#4c2934", fg = "NONE", ctermbg = 95, ctermfg = "NONE" })
vim.api.nvim_set_hl(0, "VisualNOS", { bg = "#4c2934", fg = "NONE", ctermbg = 95, ctermbg = "NONE" })
vim.api.nvim_set_hl(0, "VisualSB", { bg = "#4c2934", fg = "NONE", ctermbg = 95, ctermfg = "NONE" })
vim.api.nvim_set_hl(0, "Search", { fg = "#d77189", bg = "#1a0a0e", ctermfg = 168, ctermbg = 233 })
vim.api.nvim_set_hl(0, "IncSearch", { fg = "#ff9fb2", bg = "#1a0a0e", ctermfg = 217, ctermbg = 233 })
vim.api.nvim_set_hl(0, "Pmenu", { fg = "#d77189", bg = "NONE", ctermfg = 168, ctermbg = "NONE" })
vim.api.nvim_set_hl(0, "PmenuSel", { fg = "#000000", bg = "#d77189", ctermfg = 0, ctermbg = 168 })
vim.api.nvim_set_hl(0, "WildMenu", { fg = "#d77189", bg = "NONE", ctermfg = 168, ctermbg = "NONE" })
vim.api.nvim_set_hl(0, "Folded", { fg = "#a45b6d", bg = "NONE", ctermfg = 131, ctermbg = "NONE" })
vim.api.nvim_set_hl(0, "SignColumn", { fg = "#ff8ca3", bg = "NONE", ctermfg = 210, ctermbg = "NONE" })
vim.api.nvim_set_hl(0, "Visual", { bg = "#342562", fg = "NONE", ctermbg = 60, ctermfg = "NONE" })
vim.api.nvim_set_hl(0, "VisualNOS", { bg = "#342562", fg = "NONE", ctermbg = 60, ctermbg = "NONE" })
vim.api.nvim_set_hl(0, "VisualSB", { bg = "#342562", fg = "NONE", ctermbg = 60, ctermfg = "NONE" })
vim.api.nvim_set_hl(0, "Search", { fg = "#5B469A", bg = "#1c1533", ctermfg = 61, ctermbg = 234 })
vim.api.nvim_set_hl(0, "IncSearch", { fg = "#b6a3f5", bg = "#1c1533", ctermfg = 183, ctermbg = 234 })
vim.api.nvim_set_hl(0, "Pmenu", { fg = "#5B469A", bg = "NONE", ctermfg = 61, ctermbg = "NONE" })
vim.api.nvim_set_hl(0, "PmenuSel", { fg = "#000000", bg = "#5B469A", ctermfg = 0, ctermbg = 61 })
vim.api.nvim_set_hl(0, "WildMenu", { fg = "#5B469A", bg = "NONE", ctermfg = 61, ctermbg = "NONE" })
vim.api.nvim_set_hl(0, "Folded", { fg = "#7a66b1", bg = "NONE", ctermfg = 103, ctermbg = "NONE" })
vim.api.nvim_set_hl(0, "SignColumn", { fg = "#bca4f4", bg = "NONE", ctermfg = 183, ctermbg = "NONE" })
local mode_names = {
n = "NRM",
@ -128,6 +128,8 @@ map("n", "<leader>v", ":Ex<CR>")
map("", "j", "gj")
map("", "k", "gk")
vim.keymap.set({ "n", "v" }, "<leader>cd", vim.cmd.Ex)
vim.keymap.set({ "n", "v" }, "<leader>d", '"_d', { desc = "Delete without yanking" })
vim.keymap.set("n", "<leader>bn", ":bnext<CR>", { desc = "Next buffer" })
vim.keymap.set("n", "<leader>bp", ":bprevious<CR>", { desc = "Previous buffer" })
@ -163,3 +165,4 @@ require('colorizer').setup {
css = { names = true },
html = { names = true },
}

3
local/bin/abr-kill Executable file
View file

@ -0,0 +1,3 @@
#!/bin/sh
cat "$HOME/.abrpid" | xargs kill
rm "$HOME/.abrpid"

21
local/bin/abr-listen Executable file
View file

@ -0,0 +1,21 @@
#!/bin/sh
SCRIPT="$HOME/.local/share/notify-send.lua"
PID="$HOME/.abrpid"
#pick your audio quality (uncomment one to use it)
# 128kbps Opus
URL=https://radio.animebits.moe/stream/stream128.ogg
# 256kbps Opus
#URL=https://radio.animebits.moe/stream/stream256.ogg
# ~148kbps VBR AAC
#URL=https://radio.animebits.moe/stream/stream128.aac
# ~192kbps VBR MP3
#URL=https://radio.animebits.moe/stream/stream192.mp3
# Lossless FLAC
#URL=https://radio.animebits.moe/stream/stream.flac
[ -f "$PID" ] && { notify-send 'Already running'; exit 1; }
[ "$URL" = "" ] && notify-send "Please edit the script to choose the quality of audio you would like."
echo $$ > "$PID"
exec mpv --script="$SCRIPT" --no-terminal "$URL" 2>/dev/null

View file

@ -2,8 +2,8 @@
#inspired by 'firemenu' by <swindlesmccoop> on github
# BRWMENU:
set -e
DMENU_OPTS="-i -fn monospace:size=12 -nb #151515 -nf #bbbbbb -sb #663300 -sf #eeeeee"
BROWSER="brave-bin"
DMENU_OPTS="-i -fn DepartureMono:size=10 -nb #151515 -nf #bbbbbb -sb #884757 -sf #eeeeee"
BROWSER="mullvad-browser-bin"
SWALLOW=""
NOTIFIER="notify-send"
for cmd in dmenu "$BROWSER"; do
@ -12,15 +12,15 @@ for cmd in dmenu "$BROWSER"; do
exit 1
fi
done
CHOICES="YouTube\nGithub\nCodeberg\nIPLeak\nQwant\nDuckDuckGo\nURL"
CHOICES="Startpage\nURL\nIncognito URL\nYouTube\nGithub\nCodeberg\ncoasteen.github.io\nIPLeak\nSafebooru\nWikipedia"
PROMPT="Where to?"
open_url() {
if [ -z "$1" ]; then
$NOTIFIER "Error" "No URL specified" 2>/dev/null || echo "Error: No URL specified" >&2
exit 1
fi
if ! $SWALLOW "$BROWSER" "$1" >/dev/null 2>&1; then
if ! $SWALLOW $BROWSER "$1" >/dev/null 2>&1; then
$NOTIFIER "Error" "Failed to open browser with URL: $1" 2>/dev/null || \
echo "Error: Failed to open browser with URL: $1" >&2
exit 1
@ -30,17 +30,16 @@ get_input() {
prompt="$1"
prefix="$2"
input=$(printf '' | dmenu $DMENU_OPTS -p "$prompt" 2>/dev/null)
if [ -z "$input" ]; then
$NOTIFIER "Error" "No input provided" 2>/dev/null || echo "Error: No input provided" >&2
exit 1
fi
input=$(printf "%s" "$input" | sed 's/ /%20/g')
echo "${prefix}${input}"
}
CHOICE=$(printf "$CHOICES" | dmenu $DMENU_OPTS -p "$PROMPT" 2>/dev/null)
case "$CHOICE" in
Github)
url=$(get_input "Username & repo:" "https://github.com/")
@ -53,27 +52,45 @@ case "$CHOICE" in
IPLeak)
open_url "https://ipleak.net"
;;
Qwant)
query=$(get_input "Search Qwant:" "")
open_url "https://qwant.com/search?q=$query"
Startpage)
query=$(get_input "Search Startpage:" "")
open_url "https://www.startpage.com/do/search?q="
;;
DuckDuckGo)
query=$(get_input "Search DuckDuckGo:" "")
open_url "https://duckduckgo.com/?q=$query"
Wikipedia)
query=$(get_input "Search Wikipedia:" "")
open_url "https://en.wikipedia.org/wiki/Special:Search?search=$query"
;;
URL)
url=$(get_input "Enter URL:" "")
# add https:// if missing
case "$url" in
http://*|https://*) ;;
*) url="https://$url" ;;
esac
open_url "$url"
;;
Incognito\ URL)
url=$(get_input "Enter incognito URL:" "")
case "$url" in
http://*|https://*) ;;
*) url="https://$url" ;;
esac
if ! $SWALLOW brave-bin --incognito "$url" >/dev/null 2>&1; then
$NOTIFIER "Error" "Failed to open incognito window" 2>/dev/null || \
echo "Error: Failed to open incognito window" >&2
exit 1
fi
;;
YouTube)
query=$(get_input "Search YouTube:" "")
open_url "https://youtube.com/results?search_query=$query"
;;
Safebooru)
query=$(get_input "Search Safebooru:" "")
open_url "https://safebooru.org/index.php?page=post&s=list&tags=$query"
;;
coasteen.github.io)
open_url "https://coasteen.github.io/www/"
;;
*)
$NOTIFIER "Error" "Invalid selection: $CHOICE" 2>/dev/null || \
echo "Error: Invalid selection: $CHOICE" >&2

Binary file not shown.

8
local/bin/httpx Executable file
View file

@ -0,0 +1,8 @@
#!/home/coast/.local/share/pipx/venvs/httpx/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from httpx import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())

33
local/bin/mpdscrobble Executable file
View file

@ -0,0 +1,33 @@
#!/usr/lib/python-exec/python3.13/python
# EASY-INSTALL-ENTRY-SCRIPT: 'mpdscrobble==0.3.3','console_scripts','mpdscrobble'
import re
import sys
# for compatibility with easy_install; see #2198
__requires__ = 'mpdscrobble==0.3.3'
try:
from importlib.metadata import distribution
except ImportError:
try:
from importlib_metadata import distribution
except ImportError:
from pkg_resources import load_entry_point
def importlib_load_entry_point(spec, group, name):
dist_name, _, _ = spec.partition('==')
matches = (
entry_point
for entry_point in distribution(dist_name).entry_points
if entry_point.group == group and entry_point.name == name
)
return next(matches).load()
globals().setdefault('load_entry_point', importlib_load_entry_point)
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(load_entry_point('mpdscrobble==0.3.3', 'console_scripts', 'mpdscrobble')())

8
local/bin/pip Executable file
View file

@ -0,0 +1,8 @@
#!/Users/coast/.local/share/pipx/venvs/pip/bin/python3.13
# -*- coding: utf-8 -*-
import re
import sys
from pip._internal.cli.main import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())

8
local/bin/pip3 Executable file
View file

@ -0,0 +1,8 @@
#!/Users/coast/.local/share/pipx/venvs/pip/bin/python3.13
# -*- coding: utf-8 -*-
import re
import sys
from pip._internal.cli.main import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())

8
local/bin/pip3.13 Executable file
View file

@ -0,0 +1,8 @@
#!/Users/coast/.local/share/pipx/venvs/pip/bin/python3.13
# -*- coding: utf-8 -*-
import re
import sys
from pip._internal.cli.main import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())

30
local/bin/radio Executable file
View file

@ -0,0 +1,30 @@
#!/usr/bin/env python3
import subprocess
import time
# 128kbps Opus
URL="https://radio.animebits.moe/stream/stream128.ogg"
# 256kbps Opus
#URL="https://radio.animebits.moe/stream/stream256.ogg"
# ~148kbps VBR AAC
#URL="https://radio.animebits.moe/stream/stream128.aac"
# ~192kbps VBR MP3
#URL="https://radio.animebits.moe/stream/stream192.mp3"
# Lossless FLAC
#URL="https://radio.animebits.moe/stream/stream.flac"
#volume
VOL=20
while True:
try:
print("Playing now...")
subprocess.run(["notify-send", "Playing now..."])
subprocess.run(["mpv", "--no-video", f"--volume={VOL}", URL])
except KeyboardInterrupt:
subprocess.run(["notify-send", "Stopping now..."])
print("\nStopping now...")
break
except Exception as e:
print(f"Something broke... trying again... Error: {e}")
time.sleep(2)

View file

@ -1,2 +1,2 @@
#!/bin/sh
doas systemctl restart emacsd.service
systemctl restart --user emacs.service

View file

@ -1,25 +1,21 @@
#!/bin/sh
#Prints battery percentage
#!/usr/bin/env python3
import os
import sys
import glob
batteries = glob.glob('/sys/class/power_supply/BAT*')
if not any(os.path.isdir(b) for b in batteries):
print("None")
sys.exit(1)
first = True
for battery in glob.glob('/sys/class/power_supply/BAT?*'):
try:
with open(os.path.join(battery, "capacity")) as f:
capacity = int(f.read().strip())
except Exception:
capacity = 0
if not first:
print(" ", end="")
print(f"{capacity}%", end="")
first = False
_bsd() {
PERCENT="$(apm | grep -o '[0-9].*%' | head -n 1)"
[ "$PERCENT" = "" ] && printf "None" && exit
echo "$PERCENT"
}
_linux() {
if ! [ -d /sys/class/power_supply/BAT* ]; then
printf "None\n"
exit 1
fi
for battery in /sys/class/power_supply/BAT?*; do
[ -n "${capacity+x}" ] && printf " "
capacity="$(cat "$battery/capacity" 2>&1)"
printf "%s%s%d%%" "$status" "$warn" "$capacity"; unset warn
done && printf "\\n"
}
case $(uname) in
Linux) _linux ;;
*BSD) _bsd ;;
esac
print()

View file

@ -16,10 +16,8 @@ _freebsd() {
}
_linux() {
TOTAL="$(free -h | awk '/^Mem:/ {print $2}')"
MUSED="$(free -h | awk '/^Mem:/ {print $3}')"
printf "$MUSED" | grep "[0-9]{4}" > /dev/null && FUSED="$(printf "$MUSED" | cut -c -2 | sed 's/./.&/2')G" || FUSED=$MUSED
printf "$FUSED/$TOTAL\n" | sed 's/Gi/GB/g' | sed 's/Mi/MB/g'
MUSED="$(free -m | awk '/^Mem:/ {print $3}')"
echo "$MUSED"
}
case $(uname) in

72
local/bin/screenie Executable file
View file

@ -0,0 +1,72 @@
#!/usr/bin/env bash
set -euo pipefail
export DISPLAY="${DISPLAY:-:0}"
# Dependencies check
for cmd in xclip import notify-send; do command -v "$cmd" &>/dev/null || { echo "Missing: $cmd" >&2; exit 1; }; done
OUTDIR="${2:-$HOME/files/pics/screenies}"; mkdir -p "$OUTDIR"
FILE="$OUTDIR/$(date +%Y%m%d_%H%M%S).png"
TMP=$(mktemp --suffix=.png); trap 'rm -f "$TMP"' EXIT
show_help(){
cat <<EOF
Usage: $0 [color|full|window] [output_dir]
Environment options:
WATERMARK=1
WATERMARK_TEXT='text'
WATERMARK_POS=position
WATERMARK_SIZE=px
WATERMARK_BG='#rrggbbaa'
EOF
}
post(){
[[ "${WATERMARK:-}" == "1" ]] && {
command -v magick &>/dev/null || { echo "Missing: magick" >&2; exit 1; }
# Watermark subsystem (env overrides supported)
magick "$FILE" \
-gravity "${WATERMARK_POS:-southeast}" \
-pointsize "${WATERMARK_SIZE:-28}" \
-fill white -undercolor "${WATERMARK_BG:-#00000080}" \
-annotate +20+20 "${WATERMARK_TEXT:-$(date '+%Y-%m-%d %H:%M')}" \
"$FILE"
}
xclip -selection clipboard -t image/png -i "$FILE" && notify-send -i "$FILE" "Screenshot: $(basename "$FILE")"
}
colorpicker(){
command -v magick &>/dev/null || { notify-send "Missing: magick"; exit 1; }
if command -v slop &>/dev/null; then
import -window root -crop "$(slop --tolerance=0 || exit 1)" "$TMP"
else
import "$TMP"
fi
hex=$(magick "$TMP" -scale 1x1\! -format "#%[hex:p{0,0}]" info: 2>/dev/null || echo "#??????")
echo "$hex" | xclip -selection clipboard -i && notify-send -i "$TMP" "Color: $hex"
}
capture_full(){
import -window root "$FILE" && post
}
capture_window(){
command -v xdotool &>/dev/null || { echo "Missing: xdotool" >&2; exit 1; }
import -window "$(xdotool getwindowfocus -f)" "$FILE" && post
}
capture_selection(){
import "$FILE" && post
}
main(){
case "${1:-}" in
-h|--help) show_help ;;
color*) colorpicker ;;
full) capture_full ;;
window) capture_window ;;
*) capture_selection ;;
esac
}
main "$@"

38
local/bin/shishi.sh Executable file
View file

@ -0,0 +1,38 @@
#!/bin/bash
hyprctl monitors > /dev/null || { echo "Hyprland IPC not available"; exit 1; }
focused_win_id=$(hyprctl activewindow -j | jq -r '.id')
new_win_id=$1
if [ -z "$focused_win_id" ] || [ -z "$new_win_id" ]; then
echo "Missing window IDs"
exit 1
fi
# Get all windows on current workspace
workspace_id=$(hyprctl activewindow -j | jq -r '.workspace.id')
windows=($(hyprctl clients -j | jq -r --arg ws "$workspace_id" '.[] | select(.workspace.id==$ws) | .id'))
# Find focused window index
idx=-1
for i in "${!windows[@]}"; do
if [[ "${windows[$i]}" == "$focused_win_id" ]]; then
idx=$i
break
fi
done
# If focused window not found, just bail
if [[ $idx -eq -1 ]]; then
exit 0
fi
# Move new window right after focused window in stack order
# Hyprland doesnt support direct stack manipulation via IPC yet,
# but you can focus new window and then focus focused_win again
# to simulate the "attach aside" effect in focus order.
hyprctl dispatch focuswindow "$new_win_id"
hyprctl dispatch focuswindow "$focused_win_id"

31
local/bin/stfu Executable file
View file

@ -0,0 +1,31 @@
#!/bin/sh
RED=$(printf "\033[1;31m")
NORMAL=$(printf "\033[0m")
colors1() {
for i in 0 1 2 3 4 5 6 7; do
printf "\033[4${i}m \033[0m"
done
}
colors2() {
for i in 0 1 2 3 4 5 6 7; do
printf "\033[10${i}m \033[0m"
done
}
cat <<EOF
${RED} _____ _______ shutthe@fuckup
${RED} / ____|__ __| ${NORMAL}--------------
${RED}| (___ | | I dont care:${NORMAL} about your fetch stuff
${RED} \___ \ | | In fact,:${NORMAL} I'm getting tired of all of this BS
${RED} ____) | | | ramfetch, a fetch that displays memory i-:${NORMAL} SHUT UP
${RED}|_____/ |_| yfetch - a minimal command-li-:${NORMAL} FUCK OFF
${RED} ______ _ _ cpufetch - Simplistic yet fa-:${NORMAL} NO ITS NOT FANCY ITS OVERDONE
${RED}| ____| | | | cottonfetch - another fetch BS-:${NORMAL} WHY MORE FETCH CRAP
${RED}| |__ | | | | blablablafetc-:${NORMAL} GET THE FUCK OUT OF MY REDDIT FRONTPAGE
${RED}| __| | | | | If I saw one Nawre fetch BS:${NORMAL} I'll fucking destroy my computer
${RED}| | | |__| | and never use:${NORMAL} Reddit ever again
${RED}|_| \____/ ${NORMAL}$(colors1)
$(colors2)
EOF