summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/47319
-rwxr-xr-xscripts/9t6
-rwxr-xr-xscripts/a6
-rwxr-xr-xscripts/add2rss34
-rwxr-xr-xscripts/b22
-rwxr-xr-xscripts/cs7
-rwxr-xr-xscripts/days2finals.py23
-rwxr-xr-xscripts/getUnicode12
-rwxr-xr-xscripts/internet10
-rwxr-xr-xscripts/jdm12
-rwxr-xr-xscripts/keys10
-rwxr-xr-xscripts/linkhandler26
-rwxr-xr-xscripts/mismatch11
-rwxr-xr-xscripts/money.py22
-rwxr-xr-xscripts/mr3
-rwxr-xr-xscripts/prompt3
-rwxr-xr-xscripts/rebootPrompt3
-rwxr-xr-xscripts/rotdir12
-rwxr-xr-xscripts/setWall6
-rwxr-xr-xscripts/shutdownPrompt3
-rwxr-xr-xscripts/testPort6
-rwxr-xr-xscripts/theme14
-rwxr-xr-xscripts/volume7
-rwxr-xr-xscripts/weather10
-rwxr-xr-xscripts/ytrss15
25 files changed, 0 insertions, 302 deletions
diff --git a/scripts/473 b/scripts/473
deleted file mode 100755
index 3025d01..0000000
--- a/scripts/473
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/sh
-
-NUMS="01\n02\n03\n04\n05\n06\n07\n08\n09\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n"
-
-NUM="$(echo $NUMS | fzf)"
-
-SERVER="e5-cse-135-$NUM.cse.psu.edu"
-
-USER=$1
-
-if [[ -z $NUM ]]; then
- echo "Select a server number"
- exit
-elif [[ -z $USER ]]; then
- echo "Provide a user name"
- exit
-fi
-
-ssh -Y $USER@$SERVER
diff --git a/scripts/9t b/scripts/9t
deleted file mode 100755
index 865b4a5..0000000
--- a/scripts/9t
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-SHELL=$PLAN9/bin/rc
-font=/mnt/font/Menlo-Regular/15a/font
-fontsrv &
-9 9term -f $font
diff --git a/scripts/a b/scripts/a
deleted file mode 100755
index df306a4..0000000
--- a/scripts/a
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-SHELL=$PLAN9/bin/rc
-font=/mnt/font/Menlo-Regular/15a/font
-9 fontsrv &
-9 acme -a -f $font $@ \ No newline at end of file
diff --git a/scripts/add2rss b/scripts/add2rss
deleted file mode 100755
index ab29362..0000000
--- a/scripts/add2rss
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/bin/sh
-
-RSSFILE=~/.config/newsboat/urls
-
-if test -n "$1";
-then
- URL=$1
-elif test ! -t 0;
-then
- URL=$(cat < /dev/stdin)
-else
- URL=$(xclip -o clipboard)
- if test -n "$URL";
- then
- notify-send "add2rss: copied $URL from clipboard"
- else
- notify-send "add2rss: no input"
- exit
- fi
-fi
-
-if test -n "$2";
-then
- URL="$URL \"$2\""
-fi
-
-if test -n "$(grep $URL $RSSFILE)";
-then
- notify-send "add2rss: You already added this feed"
-else
- echo "$URL" >> $RSSFILE
- notify-send "add2rss: Added"
-fi
-
diff --git a/scripts/b b/scripts/b
deleted file mode 100755
index 596b320..0000000
--- a/scripts/b
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/usr/bin/env bash
-
-# Select `b` (or before it, or after) and assign Acme `addr` to selection
-echo addr=dot | 9p write acme/$winid/ctl
-
-# Mark the current line and change `addr` to it
-echo -n '__MARKER__' | 9p write acme/$winid/data
-echo -n '/^.*__MARKER__/' | 9p write acme/$winid/addr
-
-# Process the line
-line=$(9p read acme/$winid/data | sed 1q)
-indentation=$(echo "$line" | sed -E 's/^( *).*$/\1/')
-before_marker=$(echo "$line" | sed -E 's/b?__MARKER__.*$/{/')
-after_marker=$(echo "$line" | awk -F'__MARKER__' '{print $2}')
-[ "$after_marker" == "b" ] && after_marker=""
-
-# Compose the final block
-block="$before_marker"$'\n'"$indentation "$'\n'"$indentation}$after_marker"
-
-# Change `addr` one more time and replace original line with my block
-echo -n '/^.*__MARKER__.*\n?/' | 9p write acme/$winid/addr
-echo "$block" | 9p write acme/$winid/data \ No newline at end of file
diff --git a/scripts/cs b/scripts/cs
deleted file mode 100755
index f3090ba..0000000
--- a/scripts/cs
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-[ -z "$(echo $@ | grep "\-l")" ] && str="a-z A-Z" || [ -z "$(echo $@ | grep "\-u")" ] && str="A-Z a-z" || (echo "cs: missing operand" && exit)
-[ -z "$(echo $@ | sed 's/\-l//g;s/\-u//g')" ] && words=$(< /dev/stdin) || words="$(echo $@ | sed 's/\-l//g;s/\-u//g')"
-
-echo $words | tr $str
-
diff --git a/scripts/days2finals.py b/scripts/days2finals.py
deleted file mode 100755
index 2111af6..0000000
--- a/scripts/days2finals.py
+++ /dev/null
@@ -1,23 +0,0 @@
-import datetime
-now = datetime.datetime.now()
-
-finalsDate = datetime.datetime(2023, 5, 1, 0, 0, 0, 0)
-breakDate = datetime.datetime(2023, 3, 3, 15, 0, 0, 0)
-def getDays(date, name):
- daysLeft = date - now
-
- weeks = daysLeft.days // 7
- days = daysLeft.days % 7
- minutes = daysLeft.seconds // 60
- hours = minutes // 60
- minutes %= 60
-
- if (weeks < 0):
- return f"{name.upper()} WEEK"
- return f"{weeks} weeks {days} days and {hours} hours until {name} week"
-
-output = f"{getDays(finalsDate, 'finals')}"
-#output += f"{getDays(breakDate, 'break')}"
-
-
-print(output)
diff --git a/scripts/getUnicode b/scripts/getUnicode
deleted file mode 100755
index 13d7971..0000000
--- a/scripts/getUnicode
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-
-char=$(cut -d ';' -f1 ~/.local/share/unicode | dmenu -i -l 30 | sed "s/ .*//")
-
-[ -z "$char" ] && exit
-
-if [ -n "$1" ]; then
- xdotool type "$char"
-else
- echo "$char" | tr -d '\n' | xclip -selection clipboard
- notify-send "'$char' copied to clipboard." &
-fi
diff --git a/scripts/internet b/scripts/internet
deleted file mode 100755
index 942eefe..0000000
--- a/scripts/internet
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-
-[ "$(connmanctl services | grep "Wired" | awk -F' ' '{print $2}')" = "Wired" ] && CONNECTION="Wired" || CONNECTION="$(connmanctl services | grep '*' | awk -F' ' '{print $2}')"
-
-[ "$CONNECTION" = "Wired" ] && IP="$(ip address | grep eth0 | grep 192.168.)" || IP="$(ip address | grep wlo | grep 192.168. )"
-
-IP="${IP%/*}"
-IP="${IP##* }"
-
-echo $CONNECTION $IP
diff --git a/scripts/jdm b/scripts/jdm
deleted file mode 100755
index d035b6e..0000000
--- a/scripts/jdm
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-declare -i count=1 # used as a reference throughout the script
-for desktop in $XDG_DATA_HOME/xsessions/*.desktop # looks at all the desktop files in /usr/share/xsessions
-do
- name[$count]=$(grep "Name" $desktop | sed "s/Name=/$count /g") # grabs the name and adds it to an array
- program[$count]=$(grep "Exec" $desktop | sed "s/Exec=//g") # grabs the path of the executable and adds it to an array
- count=$((count+1))
-done
-name[$count]="$count TTY" # adds an option for TTY
-select=$(dialog --title "Jacob's Display Manager" --menu "Select a WM:" 0 0 0 ${name[*]} 3>&1 1>&2 2>&3 3>&-) # creates the menu box
-[ "$select" != "$count" ] && [ "$select" != "0" ] && export wm=${program[$select]} && startx # startx if TTY is not selected
-clear && cat /etc/motd # clears the ncurses prompt after executing and cat the message of the day file
diff --git a/scripts/keys b/scripts/keys
deleted file mode 100755
index c525982..0000000
--- a/scripts/keys
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-# This script is called on startup to remap keys.
-# Decrease key repeat delay to 300ms and increase key repeat rate to 50 per second.
-xset r rate 300 50
-# Map the caps lock key to super, and map the menu key to right super.
-setxkbmap -option caps:super,altwin:menu_win
-# When caps lock is pressed only once, treat it as escape.
-killall xcape 2>/dev/null ; xcape -e 'Super_L=Escape'
-# Turn off caps lock if on since there is no longer a key for it.
-xset -q | grep -q "Caps Lock:\s*on" && xdotool key Caps_Lock
diff --git a/scripts/linkhandler b/scripts/linkhandler
deleted file mode 100755
index c13a462..0000000
--- a/scripts/linkhandler
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/sh
-
-# Feed script a url or file location.
-# If an image, it will view in sxiv,
-# if a video or gif, it will view in mpv
-# if a music file or pdf, it will download,
-# otherwise it opens link in browser.
-
-if [ -z "$1" ]; then
- url="$(xclip -o)"
-else
- url="$1"
-fi
-
-case "$url" in
- *mkv|*webm|*mp4|*youtube.com/watch*|*youtube.com/playlist*|*youtube.com/shorts*|*youtu.be*|*hooktube.com*|*bitchute.com*|*videos.lukesmith.xyz*|*odysee.com*)
- notify-send "linkhandler: launching $url in mpv" && setsid -f mpv -quiet "$url" >/dev/null 2>&1 ;;
- *png|*jpg|*jpe|*jpeg|*gif)
- curl -sL "$url" > "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" && sxiv -a "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 & ;;
- *pdf|*cbz|*cbr)
- curl -sL "$url" > "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" && zathura "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 & ;;
- *mp3|*flac|*opus|*mp3?source*)
- qndl "$url" 'curl -LO' >/dev/null 2>&1 ;;
- *)
- [ -f "$url" ] && setsid -f "$TERMINAL" -e "$EDITOR" "$url" >/dev/null 2>&1 || setsid -f "$BROWSER" "$url" >/dev/null 2>&1
-esac
diff --git a/scripts/mismatch b/scripts/mismatch
deleted file mode 100755
index 38776bc..0000000
--- a/scripts/mismatch
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-DICTFILE=/usr/share/dict/words
-
-[ -z $1 ] && words=$(< /dev/stdin) || words=$1
-
-for word in $words
-do
- [ -z "$(grep -i "\b$word\b" $DICTFILE)" ] && echo $word
-done
-
diff --git a/scripts/money.py b/scripts/money.py
deleted file mode 100755
index 4a36437..0000000
--- a/scripts/money.py
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/usr/local/bin/python3
-
-hours = int(input("Enter Hours Worked Per Week: "))
-wage = float(input("Enter Wage: "))
-tax = .13
-
-checking = (hours * 4) * wage
-checking -= checking * tax
-savings = checking / 2
-checking -= savings
-
-miles = 830
-mpg = float(input("Enter Gas Milage: "))
-gasPrice = float(input("Enter Gas Price: "))
-
-gas = (miles / mpg) * gasPrice
-
-expenses = gas + 10
-
-checking -= expenses
-
-print(f"${checking+savings:,.2f} left over total\n${checking:,.2f} left over for checking each month\n${savings:,.2f} left over for savings each month\nCost of gas: ${gas:,.2f}")
diff --git a/scripts/mr b/scripts/mr
deleted file mode 100755
index b3d7c48..0000000
--- a/scripts/mr
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-make run \ No newline at end of file
diff --git a/scripts/prompt b/scripts/prompt
deleted file mode 100755
index 5148d0a..0000000
--- a/scripts/prompt
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-[ "$(printf "No\nYes" | wofi -d -p "$1")" = "Yes" ] && $2
-
diff --git a/scripts/rebootPrompt b/scripts/rebootPrompt
deleted file mode 100755
index 4c3c361..0000000
--- a/scripts/rebootPrompt
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-prompt 'Reboot?' 'sudo reboot'
diff --git a/scripts/rotdir b/scripts/rotdir
deleted file mode 100755
index 86da6db..0000000
--- a/scripts/rotdir
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-
-# When I open an image from the file manager in sxiv (the image viewer), I want
-# to be able to press the next/previous keys to key through the rest of the
-# images in the same directory. This script "rotates" the content of a
-# directory based on the first chosen file, so that if I open the 15th image,
-# if I press next, it will go to the 16th etc. Autistic, I know, but this is
-# one of the reasons that sxiv is great for being able to read standard input.
-
-[ -z "$1" ] && echo "usage: rotdir regex 2>&1" && exit 1
-base="$(basename "$1")"
-ls "$PWD" | awk -v BASE="$base" 'BEGIN { lines = ""; m = 0; } { if ($0 == BASE) { m = 1; } } { if (!m) { if (lines) { lines = lines"\n"; } lines = lines""$0; } else { print $0; } } END { print lines; }'
diff --git a/scripts/setWall b/scripts/setWall
deleted file mode 100755
index 2e63a0a..0000000
--- a/scripts/setWall
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-[ -f "$1" ] && cp "$1" ~/.config/wall.png
-[ -d "$1" ] && cp "$(find "$1" -name "*.jpg" -o -name "*.png" -o -name "*.jpeg" -type f | shuf -n 1)" ~/.config/wall.png
-xwallpaper --zoom ~/.config/wall.png
-
diff --git a/scripts/shutdownPrompt b/scripts/shutdownPrompt
deleted file mode 100755
index 1be046d..0000000
--- a/scripts/shutdownPrompt
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-prompt 'Shutdown?' 'sudo shutdown -h now'
diff --git a/scripts/testPort b/scripts/testPort
deleted file mode 100755
index 92e76d4..0000000
--- a/scripts/testPort
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-nc -vz $1 25565 ;
- nc -vz $1 80 ;
- nc -vz $1 443 ;
-nc -vz $1 22
diff --git a/scripts/theme b/scripts/theme
deleted file mode 100755
index c6f0c2c..0000000
--- a/scripts/theme
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/zsh
-# Switch to Solarized Dark if we are currently in dark mode
-if [[ "$(uname -s)" == "Darwin" ]]; then
- val=$(defaults read -g AppleInterfaceStyle 2>/dev/null)
- if [[ $val == "Dark" ]]; then
- osascript -e 'tell application "Terminal"
- set current settings of tabs of windows to settings set "PaperColor-dark" # Theme name
- end tell'
- else
- osascript -e 'tell application "Terminal"
- set current settings of tabs of windows to settings set "PaperColor-light" # Theme name
- end tell'
- fi
-fi
diff --git a/scripts/volume b/scripts/volume
deleted file mode 100755
index ba26561..0000000
--- a/scripts/volume
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-vol="$(pamixer --get-volume-human)"
-
-[ "$vol" == "muted" ] && label="🔇" || label="🔊 $vol"
-
-echo "$label"
diff --git a/scripts/weather b/scripts/weather
deleted file mode 100755
index 664b0b1..0000000
--- a/scripts/weather
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-
-getforecast() { ping -q -c 1 1.1.1.1 >/dev/null || exit 1
-curl -sf "wttr.in/Ocean+City" > "$HOME/.cache/weatherreport" || exit 1 ;}
-
-showweather() { printf "%s" "$(sed '16q;d' "$HOME/.cache/weatherreport" | grep -wo "[0-9]*%" | sort -n | sed -e '$!d' | sed -e "s/^/☔ /g" | tr -d '\n')"
-sed '13q;d' "$HOME/.cache/weatherreport" | grep -o "m\\(-+\\)*[0-9]\\+" | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " ❄",$1 "°","🌞",$2 "°"}' ;}
-
-[ "$(stat -c %y "$HOME/.cache/weatherreport" 2>/dev/null | cut -d' ' -f1)" != "$(date '+%Y-%m-%d')" ] && getforecast
-showweather
diff --git a/scripts/ytrss b/scripts/ytrss
deleted file mode 100755
index 8539b18..0000000
--- a/scripts/ytrss
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh
-
-if test -n "$1";
-then
- id=$1
-elif test ! -t 0;
-then
- id=$(cat < /dev/stdin)
-else
- echo "ytrss: No Input"
- exit
-fi
-
-echo "https://www.youtube.com/feeds/videos.xml?channel_id="$id
-