From 2dd4ec52b92185ab3428a7a758da75e401d76db8 Mon Sep 17 00:00:00 2001 From: Marko Korhonen Date: Thu, 13 Feb 2025 12:18:30 -0600 Subject: [PATCH] Remove unused scripts --- scripts/autorotate.sh | 22 ---------------------- scripts/checkupdates.sh | 12 ------------ scripts/mail/notify-new-mail.sh | 23 ----------------------- scripts/media/imageviewer | 29 ----------------------------- scripts/media/imgurviewer | 11 ----------- scripts/media/mpvqueue | 30 ------------------------------ 6 files changed, 127 deletions(-) delete mode 100755 scripts/autorotate.sh delete mode 100755 scripts/checkupdates.sh delete mode 100755 scripts/mail/notify-new-mail.sh delete mode 100755 scripts/media/imageviewer delete mode 100755 scripts/media/imgurviewer delete mode 100755 scripts/media/mpvqueue diff --git a/scripts/autorotate.sh b/scripts/autorotate.sh deleted file mode 100755 index c4f6f674..00000000 --- a/scripts/autorotate.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -function rotate_ms { - case $1 in - "normal") - swaymsg output eDP-1 transform 0 - ;; - "right-up") - swaymsg output eDP-1 transform 90 - ;; - "bottom-up") - swaymsg output eDP-1 transform 180 - ;; - "left-up") - swaymsg output eDP-1 transform 270 - ;; - esac -} - -while IFS='$\n' read -r line; do - rotation="$(echo $line | sed -En "s/^.*orientation changed: (.*)/\1/p")" - [[ ! -z $rotation ]] && rotate_ms $rotation -done < <(stdbuf -oL monitor-sensor) diff --git a/scripts/checkupdates.sh b/scripts/checkupdates.sh deleted file mode 100755 index 27bd1464..00000000 --- a/scripts/checkupdates.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -checkupdates -d - -CODE=$? - -if [ $CODE -eq 2 ]; then - echo "No updates available" - exit 0 -fi - -exit $CODE diff --git a/scripts/mail/notify-new-mail.sh b/scripts/mail/notify-new-mail.sh deleted file mode 100755 index a4d2f302..00000000 --- a/scripts/mail/notify-new-mail.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -NEWMAILDIR=~/.mail/$1/INBOX/new -COUNT=$(ls $NEWMAILDIR | wc -l) -ICON=/usr/share/icons/Papirus-Dark/64x64/apps/email.svg -SOUND=/usr/share/sounds/Oxygen-Im-Message-In.ogg - -if [ $COUNT -ne 0 ]; then - mpv $SOUND & -fi - -if [ $COUNT -gt 1 ]; then - fromaddress=$(cat $NEWMAILDIR/$(ls $NEWMAILDIR | sort -R | tail -1) | formail -x From | tail -1) - notify-send.sh -i $ICON "$COUNT new messages in $1" "From $fromaddress and others" - -elif [ $COUNT -eq 1 ]; then - mailsubject=$(cat $NEWMAILDIR/* | formail -x Subject) - fromaddress=$(cat $NEWMAILDIR/* | formail -x From | tail -1) - - notify-send.sh -i $ICON "New message in $1" "$fromaddress $mailsubject" -else - echo "No new mail" -fi diff --git a/scripts/media/imageviewer b/scripts/media/imageviewer deleted file mode 100755 index bd14f550..00000000 --- a/scripts/media/imageviewer +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -if [ $# -eq 1 ]; then - DIR=/tmp/images - IMGNAME=$(basename $1) - - if [ ! -d $DIR ]; then - mkdir $DIR - fi - - if [ ! -f $DIR/$IMGNAME ]; then - wget $1 -O $DIR/$IMGNAME - fi - - mimeo $DIR/$IMGNAME - -else - DIR=/tmp/images/$(basename $1) - - if [ ! -d $]; then - mkdir -p $DIR - fi - - if [ ! -f $DIR/$IMGNAME ]; then - wget -P $DIR $@ - fi - - mimeo $DIR/* -fi diff --git a/scripts/media/imgurviewer b/scripts/media/imgurviewer deleted file mode 100755 index a5a02053..00000000 --- a/scripts/media/imgurviewer +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -ALBUMNAME=$(basename $1) -ALBUMDIR=/tmp/imgur/$ALBUMNAME - -if [ ! -d $ALBUMDIR ]; then - mkdir -p $ALBUMDIR - imgur-album-downloader $1 $ALBUMDIR -fi - -mimeo $ALBUMDIR diff --git a/scripts/media/mpvqueue b/scripts/media/mpvqueue deleted file mode 100755 index 5a84bc64..00000000 --- a/scripts/media/mpvqueue +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env bash - -notify="notify-send -i mpv -a mpv" -url="$1" - -# NOTE: You need to configure mpv to -# enable ipc server on this path (see my mpv config for an example) -MPVSOCKET="/tmp/mpvsocket" - -# See if MPV is already running -if [ -z "$(pidof mpv)" ]; then - # mpv is not running - - # pause other players - playerctl pause - - # start mpv - /usr/bin/mpv --no-terminal "$url" & disown - - # Wait for mpv to be up before adding anything else to playlist - while [ -z "$(pidof mpv)" ]; do - sleep 1 - done - $notify "Playing $url" - -else - # mpv is running, so add stuff to playlist - $notify "Adding $url" - echo "{\"command\": [\"loadfile\", \"$url\", \"append\"]}" | socat - /tmp/mpvsocket -fi