summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorjustsaumit <justsaumit@draconyan.xyz>2022-03-01 19:54:04 +0530
committerjustsaumit <justsaumit@draconyan.xyz>2022-03-01 19:54:04 +0530
commit98bbe7bd7fcec209e2408ff0b086858715ca89e0 (patch)
treed7597d75bbcc7d2b9621693c89058b77c8d504b2 /scripts
parent588af889ea41d9dfeb7f2c47c1a7af4de65b4406 (diff)
updated
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/dprompt (renamed from scripts/prompt)0
-rwxr-xr-xscripts/pidkill9
-rw-r--r--scripts/promptquit9
l---------scripts/st-copyout1
l---------scripts/st-urlhandler1
-rwxr-xr-xscripts/trashy5
-rwxr-xr-xscripts/urbandictserch15
-rwxr-xr-xscripts/wifi-menu-custom22
-rwxr-xr-xscripts/ytd2
-rwxr-xr-xscripts/ytm3
10 files changed, 58 insertions, 9 deletions
diff --git a/scripts/prompt b/scripts/dprompt
index 9549658..9549658 100755
--- a/scripts/prompt
+++ b/scripts/dprompt
diff --git a/scripts/pidkill b/scripts/pidkill
new file mode 100755
index 0000000..e1b69e8
--- /dev/null
+++ b/scripts/pidkill
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+prok=$(ps -u $USER -o pid,%mem,%cpu,comm | sort -b -k2 -r | sed -n '1!p' | dmenu -i -l 15 )
+pid=$(echo $prok | awk '{print $1}')
+pname=$(echo $prok | awk '{print $4}')
+
+kill -15 $pid 2>/dev/null
+dunstify "Terminated process Successfully" "$pname was killed"
+
diff --git a/scripts/promptquit b/scripts/promptquit
deleted file mode 100644
index cb06659..0000000
--- a/scripts/promptquit
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-# A dmenu binary prompt script
-# Gives dmenu prompt labeled with $1 to perform command $2
-# For example:
-# './promptquit "Do you really want to quit?" "shutdown -h now"'
-
-[ $(echo -e "No\nYes" | dmenu -i -p "$1") \
- == "Yes"] && $2
-
diff --git a/scripts/st-copyout b/scripts/st-copyout
new file mode 120000
index 0000000..e822e4a
--- /dev/null
+++ b/scripts/st-copyout
@@ -0,0 +1 @@
+/home/saumit/.local/src/st/external-pipe_scripts/st-copyout \ No newline at end of file
diff --git a/scripts/st-urlhandler b/scripts/st-urlhandler
new file mode 120000
index 0000000..0d8625f
--- /dev/null
+++ b/scripts/st-urlhandler
@@ -0,0 +1 @@
+/home/saumit/.local/src/st/external-pipe_scripts/st-urlhandler \ No newline at end of file
diff --git a/scripts/trashy b/scripts/trashy
new file mode 100755
index 0000000..3318e41
--- /dev/null
+++ b/scripts/trashy
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+trashfiledir=$(find $HOME -type f -o -type d | dmenu -i -p "File to be deleted:" -l 15| awk '{printf('\"%s\"\n', $0);}')
+
+trash-put $trashfiledir
diff --git a/scripts/urbandictserch b/scripts/urbandictserch
new file mode 100755
index 0000000..c007d60
--- /dev/null
+++ b/scripts/urbandictserch
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+search=$(echo "" | dmenu -p 'Urban Dictionary:'|sed 's/ /%20/g')
+
+curl -s "https://api.urbandictionary.com/v0/define?term={$search}" | jq '.' | grep --color=always definition | awk 'BEGIN {RS="definition"; ORS=""} {print $0""++i}' > /tmp/urban-dic
+
+n=$(wc -l < /tmp/urban-dic)
+touch /tmp/urban-dic.txt && > /tmp/urban-dic.txt
+
+for i in $(eval echo {1..$n}p)
+do
+ sed -n $i /tmp/urban-dic|sed -r "s/\x1B\[[0-9;]*[a-zA-Z]//g" >> /tmp/urban-dic.txt
+done
+cat /tmp/urban-dic.txt | dmenu -l $n -p "$1"i
+
diff --git a/scripts/wifi-menu-custom b/scripts/wifi-menu-custom
new file mode 100755
index 0000000..db2fced
--- /dev/null
+++ b/scripts/wifi-menu-custom
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+choice=$(echo -e "up\ndown\nconnect" | dmenu -p "Do you wish to connect to a wi-fi or disconnect?:")
+
+case $choice in
+ "connect")
+ bssid=$(nmcli device wifi list | sed -n '1!p' | cut -b 9- | dmenu -p "Select Wifi  " -l 20 | cut -d' ' -f1)
+ pass=$(echo "" | dmenu -p "Enter Pswd  ")
+ nmcli device wifi $choice $bssid password $pass;;
+ "up" | "down")
+ ssid=$(nmcli device wifi list | sed -n '1!p' | cut -b 9- | dmenu -p "Select Wifi  " -l 20 | cut -d' ' -f3)
+ nmcli c $choice $ssid;;
+esac
+wifistatus=$(nmcli d | grep wlan0 | cut -d ' ' -f10)
+case $wifistatus in
+ "connected")
+ nmcli con down eth0 "Wired connection 1";;
+ "disconnected")
+ nmcli con up eth0 "Wired connection 1";;
+esac
+ethstatus=$(nmcli d | grep eth0 | cut -d ' ' -f7)
+notify-send "Ethernet connection is $ethstatus"
diff --git a/scripts/ytd b/scripts/ytd
new file mode 100755
index 0000000..a61e490
--- /dev/null
+++ b/scripts/ytd
@@ -0,0 +1,2 @@
+#!/bin/sh
+ytfzf -D
diff --git a/scripts/ytm b/scripts/ytm
new file mode 100755
index 0000000..ea9a8b0
--- /dev/null
+++ b/scripts/ytm
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+ytfzf -mlD