diff options
| author | bh <qn+git@epicurus.dev> | 2026-03-23 00:16:51 +0800 |
|---|---|---|
| committer | bh <qn+git@epicurus.dev> | 2026-03-23 00:16:51 +0800 |
| commit | 5b63cb778a6ad0902bf40293c02c7a12de3e3c7d (patch) | |
| tree | 659bef30189e6e5c28dc4148212059aba80eb063 /scripts/Scripts | |
| parent | a16a2e3d85830082e3c33e318a4399859e4516b1 (diff) | |
Change Scripts to scripts
Diffstat (limited to 'scripts/Scripts')
| -rwxr-xr-x | scripts/Scripts/clipboard | 29 | ||||
| -rwxr-xr-x | scripts/Scripts/mute | 14 | ||||
| -rwxr-xr-x | scripts/Scripts/screenshot | 15 | ||||
| -rwxr-xr-x | scripts/Scripts/tt | 20 | ||||
| -rwxr-xr-x | scripts/Scripts/tt.elf | bin | 0 -> 4136592 bytes |
5 files changed, 78 insertions, 0 deletions
diff --git a/scripts/Scripts/clipboard b/scripts/Scripts/clipboard new file mode 100755 index 0000000..93789a0 --- /dev/null +++ b/scripts/Scripts/clipboard @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +clipboard_mode() { + if [ "$ROFI_RETV" = "0" ]; then + cliphist list | while IFS= read -r line; do + id="${line%% *}" + content="${line#* }" + + if [[ "$content" == *"[[ binary data"* ]]; then + printf ' IMAGE: %s\0info\x1f%s\n' "$id" "$id" + else + printf '%s\0info\x1f%s\n' "$content" "$id" + fi + done + else + cliphist decode "$ROFI_INFO" | wl-copy + exit 0 + fi +} + +export -f clipboard_mode + +if [ -z "$ROFI_RETV" ]; then + rofi -modi "clipboard:$0" \ + -show clipboard \ + -theme ~/.config/rofi/clipboard.rasi +else + clipboard_mode "$@" +fi diff --git a/scripts/Scripts/mute b/scripts/Scripts/mute new file mode 100755 index 0000000..ad61d7d --- /dev/null +++ b/scripts/Scripts/mute @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +# Toggle mute +pactl set-sink-mute @DEFAULT_SINK@ toggle + +# Get mute status +MUTE=$(pactl get-sink-mute @DEFAULT_SINK@ | awk '{print $2}') + +if [ "$MUTE" = "yes" ]; then + dunstify " Volume: Muted" -r 2593 -t 1000 +else + VOLUME=$(pactl get-sink-volume @DEFAULT_SINK@ | grep -Po "\d+%" | head -1) + dunstify " Volume: $VOLUME" -h int:value:${VOLUME%\%} -r 2593 -t 1000 +fi diff --git a/scripts/Scripts/screenshot b/scripts/Scripts/screenshot new file mode 100755 index 0000000..5ed5b7d --- /dev/null +++ b/scripts/Scripts/screenshot @@ -0,0 +1,15 @@ +#!/bin/bash + +mkdir -p ~/Pictures/Screenshots + +FILE=~/Pictures/Screenshots/$(date '+%Y-%m-%d_%H-%M-%S').png + +if [[ "$1" == "snip" ]]; then + grim -g "$(slurp)" "$FILE" || exit 1 +else + grim "$FILE" || exit 1 +fi + +wl-copy --type image/png < "$FILE" + +notify-send "Screenshot Taken" "Saved to $FILE" -i "$FILE" diff --git a/scripts/Scripts/tt b/scripts/Scripts/tt new file mode 100755 index 0000000..48824a3 --- /dev/null +++ b/scripts/Scripts/tt @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +# How much to zoom in +ZOOM="+12" + +# Store current font size +# ORIG_SIZE=$(kitty @ get-font-size) + +# Zoom in +kitty @ set-font-size "$ZOOM" + +# Restore on exit +restore_font() { + # kitty @ set-font-size "$ORIG_SIZE" + kitty @ set-font-size 10.5 +} +trap restore_font EXIT + +# Run tt +~/Zsh/tt.elf -notheme diff --git a/scripts/Scripts/tt.elf b/scripts/Scripts/tt.elf Binary files differnew file mode 100755 index 0000000..8c85e9a --- /dev/null +++ b/scripts/Scripts/tt.elf |
