summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstkhan <personal@slickd.xyz>2024-01-02 18:32:28 +0000
committerstkhan <personal@slickd.xyz>2024-01-02 18:32:28 +0000
commit822460668136332b9ba8d00c74904fb8f93d1699 (patch)
treefa590d4ebecc83776fd2eebb385e7f4c12bc33db
parentcc4412e7144b32cca0ab7384b3ef3cbc6ee8c25c (diff)
Updated scripts
-rw-r--r--Makefile7
-rwxr-xr-xpower8
-rw-r--r--server_download9
-rwxr-xr-xsxiv-launch4
-rwxr-xr-xweb_search13
5 files changed, 37 insertions, 4 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..00337cd
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,7 @@
+all: install
+
+install:
+ mkdir -p ~/.local/bin/
+ cp * ~/.local/bin
+
+
diff --git a/power b/power
index 6d39e3b..294e91e 100755
--- a/power
+++ b/power
@@ -9,6 +9,11 @@ tearing() {
fi
}
+kill_program() {
+ target=$(ps ax | awk '{print $5}' | cut -d "[" -f1 | sed 's/COMMAND//g' | grep . | dmenu -p "Enter program to kill: ")
+ sudo killall $target
+}
+
jellyfin() {
status=$(pidof jellyfin)
if [[ -z $status ]]; then
@@ -102,13 +107,14 @@ status() {
notify-send Status "Redshift: $redstats\nTearFree: $tearing\nMonero: $moneropid\nCompositor: $compstats"
}
-case "$(printf "compositor\ntearfree\nredshift\nJellyfin\nmonero\nVPN\nstatus\nreboot\nshutdown\n" | dmenu -i -p 'Power: ')" in
+case "$(printf "compositor\ntearfree\nredshift\nJellyfin\nmonero\nVPN\nkill\nstatus\nreboot\nshutdown\n" | dmenu -i -p 'Power: ')" in
'tearfree') tearing;;
'redshift') redshift;;
'Jellyfin') jellyfin;;
'compositor') compositor;;
'monero') monero;;
'VPN') vpn;;
+ 'kill') kill_program;;
'status') status;;
'reboot') sudo reboot;;
'shutdown') sudo shutdown now;;
diff --git a/server_download b/server_download
new file mode 100644
index 0000000..d901c4d
--- /dev/null
+++ b/server_download
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+SERVER=$(cat ~/.config/server_download.conf | dmenu -i "Servers: ")
+LOC=/
+
+lookup() {
+ file=$(ssh $SERVER ls $LOC | dmenu -p "Files: ")
+
+
diff --git a/sxiv-launch b/sxiv-launch
new file mode 100755
index 0000000..928b6c7
--- /dev/null
+++ b/sxiv-launch
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+folder=$(find ~ -type d | dmenu -p "Choose a folder: " -l 25)
+sxiv $folder/
diff --git a/web_search b/web_search
index 60a1f2a..a0d7c28 100755
--- a/web_search
+++ b/web_search
@@ -2,12 +2,13 @@
BROWSER="firefox"
QUERY=$(tac ~/.config/sarc/search.txt | sort -u | dmenu -l 20 -p "Search or enter URL: ")
-SEARCH=$(echo $QUERY | sed 's/ /+/g; s/-e//')
+SEARCH=$(echo $QUERY | sed 's/ /+/g; s/-e//; s/\:g//g')
open_search() {
- URL="duckduckgo.com/?q=$SEARCH"
+ if [[ $URL == "null" ]]; then
+ URL="duckduckgo.com/?q=$SEARCH"
+ fi
CMD="$BROWSER $URL"
-
$CMD
}
@@ -23,6 +24,12 @@ save_query() {
}
case $SEARCH in
+
+ *:g)
+ save_query
+ URL="https://google.com/search?q="
+ open_url
+ ;;
*.com)
save_query
open_url