diff options
| author | NPScript <nathan@reinerweb.ch> | 2022-04-09 21:22:20 +0200 |
|---|---|---|
| committer | NPScript <nathan@reinerweb.ch> | 2022-04-09 21:22:20 +0200 |
| commit | 896c311feb10e947c727a888308dbc7eb71d1ec2 (patch) | |
| tree | b6713478d14eb8ea531107c3f399c437db7fd2fb /.local/bin/storeless | |
init commit
Diffstat (limited to '.local/bin/storeless')
| -rwxr-xr-x | .local/bin/storeless | 46 |
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 + + |