Made scrot more robust; removed wind from weather; fixed link.sh, adding starsector

This commit is contained in:
Siina Mashek 2022-01-08 18:52:51 +02:00
parent 419ba98995
commit 99d2ce32c9
4 changed files with 24 additions and 8 deletions

4
bitbreaker/starsector Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
cd /data/storage/linuxgames/starsector
./starsector.sh

View File

@ -4,6 +4,7 @@
# #
# Requires: # Requires:
# - maim: takes the screenshot # - maim: takes the screenshot
# - imagemagick: for custom resolution sizes
# - mpv: plays audio file upon completion # - mpv: plays audio file upon completion
# - boop.sh: uploads screenshot to boop.icu # - boop.sh: uploads screenshot to boop.icu
# #
@ -12,28 +13,39 @@
# TYPE CMD KEYBIND # TYPE CMD KEYBIND
# #
# Fullscreen scrot.sh Print # Fullscreen scrot.sh Print
# Main monitor scrot.sh --main Meta+Ctrl+Print # Main monitor scrot.sh -m Meta+Ctrl+Print
# Active window/Selct scrot.sh -s Meta+Print # Active window/Selct scrot.sh -s Meta+Print
# #
# TODO: Autodetect mpv and boop.sh to make them optional # TODO: Autodetect mpv and boop.sh to make them optional
# TODO: Figure out how to capture a specific monitor, not just main # TODO: Figure out how to capture a specific monitor, not just main
screendir="$HOME/Screenshots/" screendir="$HOME/Screenshots"
sound="$HOME/Projects/local-bin/sounds/shutter.ogg" sound="$HOME/Projects/local-bin/sounds/shutter.ogg"
filename="$(date +'%Y%m%d_%H%M%S').png" filename="$(date +'%Y%m%d_%H%M%S').png"
resolution="1920x1080" resolution="1920x1080"
# For desktop multi-monitor
if [[ ${2} == "-d" ]]; then
resolution="1920x1590"
fi
args="-m 9 -u" args="-m 9 -u"
cd $screendir cd $screendir
if [[ ${1} == "--main" ]]; then if [[ ${1} == "-m" ]]; then
args="${args} -g 1920x1080+0+0" args="${args} -g ${resolution}+0+0" # for standard 1080p single monitor
else else
args="${args} ${1}" args="${args} ${1}"
fi fi
maim -B $args $filename > /dev/null 2>&1 || echo "please install maim" maim -B $args $filename > /dev/null 2>&1
# cleanup for my dual-monitor setup
if [[ ${2} == "-d" ]]; then
magick convert $filename -trim +repage $screendir/$filename
fi
mpv $sound mpv $sound
$HOME/.local/bin/boop.sh "$screendir$filename" $HOME/.local/bin/boop.sh "$screendir/$filename"

View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
FORMAT="%C,+%t+(feels+like+%f)+Wind:+%w&M" FORMAT="%C,+%t+(feels+like+%f)"
WEATHER=$(curl -s wttr.in/?format=$FORMAT) WEATHER=$(curl -s wttr.in/?format=$FORMAT)
printf "$WEATHER\n" printf "$WEATHER\n"

View File

@ -9,7 +9,7 @@ if [ ! -d "$dest" ]; then
mkdir -p "$dest" mkdir -p "$dest"
fi fi
if [ -f "$node" ]; then if [ -d "$node" ]; then
node_files=($(ls $PWD/$node)) node_files=($(ls $PWD/$node))
for file in "${node_files[@]}"; do for file in "${node_files[@]}"; do
ln -sf "$PWD/$node/$file" "$dest" ln -sf "$PWD/$node/$file" "$dest"