This commit is contained in:
cheesus_crust 2023-02-14 21:22:28 +03:00
commit 9581bcc174
10 changed files with 191 additions and 0 deletions

1
README.md Normal file
View File

@ -0,0 +1 @@
0/

13
fedilives/owncast.sh Executable file
View File

@ -0,0 +1,13 @@
#!/usr/bin/env bash
: "${1?How to use: $0 OWNCAST_LINK }"
url="$1"
link=$(echo "$url" | sed 's#https://##' | sed 's#/##' )
echo
xdg-open https://"$link"/embed/chat/readwrite &
mpv https://"$link" &
exit 0

59
fedilives/peertube.sh Normal file
View File

@ -0,0 +1,59 @@
#!/usr/bin/env bash
: "${1?How to use: $0 PT_VIDEO_LINK}"
link="$1"
### Get HTML
wget "$link" -O /tmp/videohtml
### Variables
videolink=$( grep "meta property" /tmp/videohtml | grep "og:video:url" \
| sed 's/.*href="//' | sed 's#" />##')
chatver=$( grep 'peertube-plugin-livechat' /tmp/videohtml | grep 'version'\
| sed 's#.*npmName..:..peertube-plugin-livechat.....name..:..livechat.....version..:..##' \
| sed 's#.....description.....PeerTube plugin livechat: offers a way.*##' )
instance=$(echo "$videolink" | sed 's#https://##' | sed 's#/videos/watch/.*##')
videoid=$(echo $videolink | sed 's#.*videos/watch/##')
### Delete html
rm /tmp/videohtml
### Functions
function live()
{
xdg-open https://"$instance"/plugins/livechat/"$chatver"/router/webchat/room/"$videoid" &
mpv https://"$instance"/static/streaming-playlists/hls/"$videoid"/0.m3u8 &
exit 0
}
function nolive()
{
mpv --ytdl-format=best "$videolink"
exit 0
}
### Choose
echo
echo "Is it live? (Y/n)"
read -r is_live
echo
case "$is_live" in
"" | "y")
live
;;
"n")
nolive
;;
* )
echo "Ты, блять, дурак что ли? Белым по чёрному написано y или n"
;;
esac
exit 0

14
for_bigg/rtcdate.sh Executable file
View File

@ -0,0 +1,14 @@
#!/usr/bin/env bash
midnight=$(TZ=Europe/Moscow date +"%p")
# echo $midnight
if [[ $midnight = "PM" ]]
then
# echo "PM"
rtcdate=$(TZ='Europe/Moscow' date --date='08:15 tomorrow' +"%Y%m%d%H%M%S")
else
# echo "AM"
rtcdate=$(TZ='Europe/Moscow' date --date='08:15' +"%Y%m%d%H%M%S")
fi
echo "$rtcdate"

31
for_bigg/ytmpdplay.sh Executable file
View File

@ -0,0 +1,31 @@
#!/usr/bin/env bash
: "${1?How to use: $0 YT_VIDEO_LINK}"
yt_link="$1"
play_link=$(yt-dlp -g "$yt_link" | sed '1d')
echo "Clear playlist? (N/y)"
read -r clearplay
case "$clearplay" in
"y")
mpc clear 1>/dev/null
echo "Playlist cleared"
mpc add "$play_link" 1>/dev/null
mpc play 1>/dev/null
echo "Playing"
exit 0
;;
"n")
echo "Adding"
;;
"")
echo "Adding"
;;
esac
mpc add "$play_link" 1>/dev/null
exit 0

23
for_smol/bat.sh Executable file
View File

@ -0,0 +1,23 @@
#!/bin/bash
state=$(acpi -a)
# echo "$state"
if [[ "$state" = "Adapter 0: on-line" ]]
then
echo "Charging"
exit 0
fi
bat=$(acpi -b | cut -b 25-27 | sed 's/%//')
echo "$bat %"
if [[ "$bat" = 100 ]]
then
echo "Full"
exit 0
fi
if [[ "$bat" -lt 20 ]]
then
echo "Suspending"
systemctl suspend
exit 0
fi

14
for_smol/bt.sh Normal file
View File

@ -0,0 +1,14 @@
#!/bin/bash
power=$(bluetoothctl show | grep Powered)
echo "$power"
if [[ "$power" = " Powered: no" ]]
then
bluetoothctl power on
sleep 1
bluetoothctl connect 68:D6:ED:28:EB:D9
exit
else
bluetoothctl power off
exit
fi

14
for_smol/musicctrl.sh Normal file
View File

@ -0,0 +1,14 @@
#!/bin/bash
playerstatus=$(playerctl status)
echo "$playerstatus"
if [[ "$playerstatus" = "Playing" ]]
then
playerctl -a stop
exit 0
fi
if [[ "$playerstatus" = "Stopped" ]]
then
playerctl play
exit 0
fi

13
for_smol/ytmpdplay.sh Executable file
View File

@ -0,0 +1,13 @@
#!/usr/bin/env bash
: "${1?How to use: $0 YT_VIDEO_LINK}"
yt_link="$1"
play_link=$(yt-dlp -g "$yt_link" | sed '1d')
mpc clear 1>/dev/null
mpc add "$play_link" 1>/dev/null
mpc play 1>/dev/null
exit 0

9
for_smollest/sender.sh Normal file
View File

@ -0,0 +1,9 @@
# #!/data/data/com.termux/files/usr/bin/env bash
host="$(grep 'Host ' .ssh/config | sed 's/Host //g' )"
echo "Sends message to $host "
echo
echo "Type message: "
read -r message
ssh "$host" notify-send -u critical "MESSAGE" " '$message' "