Add scripts: pub, qr, {dp1_{mirror,only,right},edp1_only,hdmi1_{mirror,only,right}}

This commit is contained in:
tosu 2024-06-17 03:04:10 +02:00
parent 630c20c21a
commit 50d97d819a
9 changed files with 46 additions and 0 deletions

2
.local/bin/dp1_mirror Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
xrandr --output eDP-1 --auto --output DP-1 --same-as eDP-1 --auto

2
.local/bin/dp1_only Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
xrandr --output DP-1 --auto --output eDP-1 --off

2
.local/bin/dp1_right Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
xrandr --output eDP-1 --auto --output DP-1 --right-of eDP-1 --auto

2
.local/bin/edp1_only Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
xrandr --output eDP-1 --auto --output HDMI-1 --off --output DP-1 --off

2
.local/bin/hdmi1_mirror Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
xrandr --output eDP-1 --auto --output HDMI-1 --same-as eDP-1 --auto

2
.local/bin/hdmi1_only Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
xrandr --output HDMI-1 --auto --output eDP-1 --off

2
.local/bin/hdmi1_right Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
xrandr --output eDP-1 --auto --output HDMI-1 --right-of eDP-1 --auto

27
.local/bin/pub Executable file
View File

@ -0,0 +1,27 @@
#!/bin/sh
err () {
printf '\033[31m%s\033[m\n' "$*"
}
# mia's 0x0.st -- fast!
curl -sfSL -F"file=@${1:--}" 0x0.st && exit 0
err "Mia's (0x0.st) pastebin failed!"
# pb1n.de -- fast!
curl -sfSL -F"f=@${1:--}" pb1n.de && exit 0
err "pb1n.de pastebin failed!"
# chris titus' hastebin -- not that fast
response="$(curl -sfSL --data-binary @"${1:--}" bin.christitus.com/documents)" &&
{ hasteKey="$(printf %s "$response" | jq -r '.key')" && [ -n "${hasteKey}" ] &&
echo "http://bin.christitus.com/raw/$hasteKey" && exit 0 || err "Couldn't extract hasteKey. Sorry!"; }
err "Chris' pastebin failed!"
# paste.rs -- damn slow
curl -sfSL --data-binary @"${1:--}" paste.rs && exit 0
err "paste.rs pastebin failed!"
# ix.io, broken
curl -sfSL -F"f=@${1:--}" pb1n.de && exit 0
err "ix.io pastebin failed!"

5
.local/bin/qr Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
[ -t 1 ] &&
qrencode -m2 -t ANSI256UTF8 "$@" ||
qrencode -m2 -t UTF8 "$@"