First commit
このコミットが含まれているのは:
コミット
b3744af0ae
|
@ -0,0 +1 @@
|
||||||
|
test/
|
|
@ -0,0 +1,10 @@
|
||||||
|
SCRIPTS = $(shell file * | grep "shell script" | cut -d ":" -f1)
|
||||||
|
DIR = $(HOME)/.local/bin
|
||||||
|
|
||||||
|
.PHONY: install
|
||||||
|
install:
|
||||||
|
cp $(SCRIPTS) $(DIR)
|
||||||
|
|
||||||
|
.PHONY: uninstall
|
||||||
|
uninstall:
|
||||||
|
$(foreach s, $(SCRIPTS),rm $(DIR)/$(s);)
|
|
@ -0,0 +1 @@
|
||||||
|
Because I want something specific or just for the good kek
|
|
@ -0,0 +1,6 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Screenshot a selection of screen
|
||||||
|
|
||||||
|
import png:- | xclip -selection clipboard -t image/png &&
|
||||||
|
notify-send "Screenshot copied to clipboard"
|
|
@ -0,0 +1,9 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
FILENAME="screen_$(date +%Y%m%d_%H%m%S).png"
|
||||||
|
DIR="$HOME/pictures/screenshots"
|
||||||
|
|
||||||
|
[ -z "$DIR" ] && mkdir -p "$DIR"
|
||||||
|
|
||||||
|
import -window root "$DIR/$FILENAME" | xclip -selection clipboard -t image/png &&
|
||||||
|
notify-send --icon="$DIR/$FILENAME" "Screenshot taken"
|
|
@ -0,0 +1,42 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Return a stream URL from a Subsonic server
|
||||||
|
|
||||||
|
#SUBSONIC_SERVER="https://example.com"
|
||||||
|
#SUBSONIC_USER="user"
|
||||||
|
#SUBSONIC_PASSWORD="password"
|
||||||
|
|
||||||
|
tmp=$(mktemp -p /tmp/)
|
||||||
|
|
||||||
|
printf "Enter your query\n-> "
|
||||||
|
read -r query
|
||||||
|
|
||||||
|
curl -sG --data-urlencode "query=$query" \
|
||||||
|
"$SUBSONIC_SERVER/rest/search3?u=$SUBSONIC_USER&p=$SUBSONIC_PASSWORD&v=1.16.1&c=bash&f=json" |
|
||||||
|
jq -s '[.[] | ."subsonic-response".searchResult3.song[] | {id:.id, title:.title, artist:.artist}] | [limit(5;.[])]' > "$tmp"
|
||||||
|
|
||||||
|
[ -z "$(cat "$tmp")" ] && printf "\n\e[1;31m[!] \e[107;mNo result\n\n" && rm "$tmp" && exit 1
|
||||||
|
|
||||||
|
length=$(( "$(jq '. | length' "$tmp")" - 1))
|
||||||
|
i=0
|
||||||
|
printf "\n"
|
||||||
|
while [ "$i" -le "$length" ]; do
|
||||||
|
title=$(jq -s '.[] | .['"$i"'].title' "$tmp" | sed 's/\"//g')
|
||||||
|
artist=$(jq -s '.[] | .['"$i"'].artist' "$tmp" | sed 's/\"//g')
|
||||||
|
printf "\e[1;32m[%s] \e[107;m%s by %s\n" $(("$i"+1)) "$title" "$artist"
|
||||||
|
i=$((i + 1))
|
||||||
|
done
|
||||||
|
|
||||||
|
printf "\nSelect track number\n-> " && read -r number
|
||||||
|
number=$(( "$number" - 1 ))
|
||||||
|
|
||||||
|
title=$(jq -r '.['"$number"'].title' "$tmp")
|
||||||
|
artist=$(jq -r '.['"$number"'].artist' "$tmp")
|
||||||
|
id=$(jq -r '.['$number'].id' "$tmp")
|
||||||
|
|
||||||
|
url="$SUBSONIC_SERVER/rest/download?u=$SUBSONIC_USER&p=$SUBSONIC_PASSWORD&v=1.16.1&c=curl&f=json&id=$id"
|
||||||
|
|
||||||
|
printf "%s" "$url" | xclip -sel c
|
||||||
|
printf "Copying the URL for \e[1;32m%s \e[107;mby %s to clipboard.\n" "$title" "$artist"
|
||||||
|
|
||||||
|
rm "$tmp"
|
|
@ -0,0 +1,42 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Return a stream URL from a Subsonic server
|
||||||
|
|
||||||
|
#SUBSONIC_SERVER="https://example.lol"
|
||||||
|
#SUBSONIC_USER="user"
|
||||||
|
#SUBSONIC_PASSWORD="password"
|
||||||
|
|
||||||
|
tmp=$(mktemp -p /tmp/)
|
||||||
|
|
||||||
|
printf "Enter your query\n-> "
|
||||||
|
read -r query
|
||||||
|
|
||||||
|
curl -sG --data-urlencode "query=$query" \
|
||||||
|
"$SUBSONIC_SERVER/rest/search3?u=$SUBSONIC_USER&p=$SUBSONIC_PASSWORD&v=1.16.1&c=bash&f=json" |
|
||||||
|
jq -s '[.[] | ."subsonic-response".searchResult3.song[] | {id:.id, title:.title, artist:.artist}] | [limit(5;.[])]' > "$tmp"
|
||||||
|
|
||||||
|
[ -z "$(cat "$tmp")" ] && printf "\n\e[1;31m[!] \e[107;mNo result\n\n" && rm "$tmp" && exit 1
|
||||||
|
|
||||||
|
length=$(( "$(jq '. | length' "$tmp")" - 1))
|
||||||
|
i=0
|
||||||
|
printf "\n"
|
||||||
|
while [ "$i" -le "$length" ]; do
|
||||||
|
title=$(jq -s '.[] | .['"$i"'].title' "$tmp" | sed 's/\"//g')
|
||||||
|
artist=$(jq -s '.[] | .['"$i"'].artist' "$tmp" | sed 's/\"//g')
|
||||||
|
printf "\e[1;32m[%s] \e[107;m%s by %s\n" $(("$i"+1)) "$title" "$artist"
|
||||||
|
i=$((i + 1))
|
||||||
|
done
|
||||||
|
|
||||||
|
printf "\nSelect track number\n-> " && read -r number
|
||||||
|
number=$(( "$number" - 1 ))
|
||||||
|
|
||||||
|
title=$(jq -r '.['"$number"'].title' "$tmp")
|
||||||
|
artist=$(jq -r '.['"$number"'].artist' "$tmp")
|
||||||
|
id=$(jq -r '.['$number'].id' "$tmp")
|
||||||
|
|
||||||
|
url="$SUBSONIC_SERVER/rest/stream?u=$SUBSONIC_USER&p=$SUBSONIC_PASSWORD&v=1.16.1&c=curl&f=json&id=$id"
|
||||||
|
|
||||||
|
printf "%s" "$url" | xclip -sel c
|
||||||
|
printf "Copying the URL for \e[1;32m%s \e[107;mby %s to clipboard.\n" "$title" "$artist"
|
||||||
|
|
||||||
|
rm "$tmp"
|
|
@ -0,0 +1,11 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
BOOKMARK_FILE_URL="https://example.com/bookmarks"
|
||||||
|
|
||||||
|
[ ! -f "$XDG_DATA_HOME/bookmarks" ] && curl "$BOOKMARK_FILE_URL" > "$XDG_DATA_HOME"/bookmarks
|
||||||
|
|
||||||
|
url="$(dmenu -l 5 -nb "#d2d971" -nf "#570580" -sb "#36121f" -sf "#bab6b8" < "$XDG_DATA_HOME"/bookmarks | grep -o "[a-z].*")"
|
||||||
|
|
||||||
|
[ -z "$url" ] && exit
|
||||||
|
|
||||||
|
surf "$url"
|
読み込み中…
新しいイシューから参照