aboutsummaryrefslogtreecommitdiff
path: root/.local/bin/storeless
diff options
context:
space:
mode:
Diffstat (limited to '.local/bin/storeless')
-rwxr-xr-x.local/bin/storeless46
1 files changed, 46 insertions, 0 deletions
diff --git a/.local/bin/storeless b/.local/bin/storeless
new file mode 100755
index 0000000..a7114d5
--- /dev/null
+++ b/.local/bin/storeless
@@ -0,0 +1,46 @@
+#!/bin/sh
+
+store() {
+ selection=$(yay -Ss | sed -z 's/\n\s\+/ - /g' | sed -E 's/^[^\/]*\///g' | sed -e 's/([0-9.]* .iB /(/g' | sed -e 's/\[base-devel\]//g' | sed -e 's/ \+/ /g' | dmenu)
+
+ name=$(echo $selection | awk '{ print $1 }')
+
+ if [ -z "$name" ]; then
+ exit
+ fi
+
+ if [ -z "$(yay -Qs $name)" ]; then
+ selection=$(printf 'Install\nInfo\nBack' | dmenu -p "Package: $name ")
+ else
+ selection=$(printf 'Remove\nInfo\nBack' | dmenu -p "Package: $name ")
+ fi
+
+ echo $name
+
+ case "$selection" in
+ Install)window "yay -S $name" && notify-send "Storeless" "$name Successfully Installed";;
+ Remove)window "yay -Rns $name" && notify-send "Storeless" "$name Successfully Removed ";;
+ Info)notify-send -t 0 "$name" "$(yay -Si $name)";;
+ Back)store;;
+ esac
+}
+
+primaryscreenwidth() {
+ xrandr | grep primary | awk '{ print $4 }' | grep -o '^[0-9]*'
+}
+
+window() {
+ st -g 108x24+10+40 -c floating $1
+}
+
+update() {
+ window yay
+ notify-send "Storeless" "System Up To Date"
+}
+
+case "$(printf "Store\nUpdate" | dmenu)" in
+ Store)store;;
+ Update)update;;
+esac
+
+