diff --git a/botfiles/.config/polybar/config.laptop b/botfiles/.config/polybar/config.laptop index 270a7e0..a6ca1d8 100644 --- a/botfiles/.config/polybar/config.laptop +++ b/botfiles/.config/polybar/config.laptop @@ -322,9 +322,9 @@ label-unmounted-foreground = #55 [module/updater] type = custom/script -exec = ~/.scripts/update-check.sh +exec = ~/.scripts/update-check label =  %output% -click-left = ~/.scripts/updater.sh & +click-left = ~/.scripts/updater & click-right = checkupdates | dmenu -l 30 interval = 60 @@ -335,7 +335,7 @@ interval = 60 type = custom/script format-foreground = ${colors.fg} exec = echo "" -click-left = ~/.scripts/powermenu.sh +click-left = ~/.scripts/powermenu ;~~~~~ ; "|" diff --git a/botfiles/.config/polybar/config.pc b/botfiles/.config/polybar/config.pc index 812f508..33ee057 100644 --- a/botfiles/.config/polybar/config.pc +++ b/botfiles/.config/polybar/config.pc @@ -324,9 +324,9 @@ label-unmounted-foreground = #55 [module/updater] type = custom/script -exec = ~/.scripts/update-check.sh +exec = ~/.scripts/update-check label =  %output% -click-left = ~/.scripts/updater.sh +click-left = ~/.scripts/updater & click-right = checkupdates | dmenu -l 30 interval = 60 @@ -337,7 +337,7 @@ interval = 60 type = custom/script format-foreground = ${colors.fg} exec = echo "" -click-left = ~/.scripts/powermenu.sh +click-left = ~/.scripts/powermenu ;~~~~~ ; "|" diff --git a/botfiles/.scripts/lockscreen.sh b/botfiles/.scripts/lockscreen similarity index 100% rename from botfiles/.scripts/lockscreen.sh rename to botfiles/.scripts/lockscreen diff --git a/botfiles/.scripts/powermenu.sh b/botfiles/.scripts/powermenu similarity index 100% rename from botfiles/.scripts/powermenu.sh rename to botfiles/.scripts/powermenu diff --git a/botfiles/.scripts/screenshot b/botfiles/.scripts/screenshot new file mode 100755 index 0000000..c3ce244 --- /dev/null +++ b/botfiles/.scripts/screenshot @@ -0,0 +1,32 @@ +#!/usr/bin/env sh + +# rofi prompts +TYPE="$(printf "Screen\nArea\n" | rofi -dmenu -l 2 -i -p 'What do you want to screenshot?')" +if [ -z "$TYPE" ]; then exit; fi +SAVE="$(printf "No\nYes" | rofi -dmenu -l 2 -i -p 'Do you want to copy to clipboard?')" +if [ -z "$SAVE" ]; then exit; fi +TIME="$(printf "0.7\n5\n10\n15" | rofi -dmenu -l 3 -i -p 'How many seconds you want to wait?')" +if [ -z "$TIME" ]; then exit; fi + +# Set flag if selected "Area" +case "$TYPE" in + Area) TYPE="-s -u";; + *) TYPE="" +esac + +# Prepere for screenshot +mkdir ~/Pictures/Screenshots +sleep "$TIME" +SCREEN_PATH=~/Pictures/Screenshots/$(date +%G-%m-%d_%s).png + +# Copy to clipboard (and save) or only save to file +case "$SAVE" in + Yes) + maim $TYPE $SCREEN_PATH + xclip -selection clipboard -t image/png $SCREEN_PATH;; + *) + maim $TYPE $SCREEN_PATH;; +esac + +# Send notify +notify-send -u low -t 1400 -i $SCREEN_PATH "Screenshot created!" diff --git a/botfiles/.scripts/screenshot.sh b/botfiles/.scripts/screenshot.sh deleted file mode 100755 index fb25b69..0000000 --- a/botfiles/.scripts/screenshot.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env sh - -# dmenu prompts -TYPE="$(printf "Screen\nArea\n" | dmenu -i -p 'What do you want to screenshot?')" -if [ -z "$TYPE" ]; then exit; fi -SAVE="$(printf "No\nYes" | dmenu -i -p 'Do you want to copy to clipboard?')" -if [ -z "$SAVE" ]; then exit; fi -TIME="$(printf "0.7\n5\n10\n15" | dmenu -i -p 'How many seconds you want to wait?')" -if [ -z "$TIME" ]; then exit; fi - -# Set flag if selected "Window" -case "$TYPE" in - Area) TYPE="-s -u";; - *) TYPE="" -esac - -# Prepere for screenshot -mkdir ~/Pictures/Screenshots -sleep "$TIME" - -# Copy to clipboard or save to file -case "$SAVE" in - Yes) maim $TYPE | xclip -selection clipboard -t image/png && maim $TYPE ~/Pictures/Screenshots/"$(date +%G-%m-%d_%s.png)";; - *) maim $TYPE ~/Pictures/Screenshots/"$(date +%G-%m-%d_%s.png)" -esac diff --git a/botfiles/.scripts/update-check.sh b/botfiles/.scripts/update-check similarity index 100% rename from botfiles/.scripts/update-check.sh rename to botfiles/.scripts/update-check diff --git a/botfiles/.scripts/updater.sh b/botfiles/.scripts/updater similarity index 100% rename from botfiles/.scripts/updater.sh rename to botfiles/.scripts/updater diff --git a/botfiles/.scripts/wificheck.sh b/botfiles/.scripts/wificheck.sh deleted file mode 100755 index e11220b..0000000 --- a/botfiles/.scripts/wificheck.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -sleep 10 -if ping -w 1 archlinux.org &> /dev/null -then - ~/.config/polybar/launch.sh - exit 0 -else - ~/.scripts/wificheck.sh - exit 0 -fi diff --git a/updot b/updot index bd909a3..44c5d9b 100755 --- a/updot +++ b/updot @@ -4,7 +4,7 @@ echo "Adding configs to dotfiles repo..." cd ~ cp .zshrc .Xresources .aliases .bashrc .zprofile .bash_profile .local/share/TelegramDesktop/tdata/shortcuts-custom.json ~/Dotfiles/botfiles/ &>/dev/null cd ~/.scripts/ -cp lockscreen.sh powermenu.sh screenshot.sh update-check.sh updater.sh wificheck.sh websearch ~/Dotfiles/botfiles/.scripts/ &>/dev/null +cp lockscreen powermenu screenshot update-check updater websearch ~/Dotfiles/botfiles/.scripts/ &>/dev/null cd ~/.config cp -r autostart bspwm dconf dunst GIMP gtk-3.0 gtk-2.0 homepage mpd ncmpcpp neofetch nvim picom polybar qutebrowser ranger rofi sxhkd vifm vis vlc wallpapers yay zsh ~/Dotfiles/botfiles/.config/ &>/dev/null cd ~/Dotfiles/botfiles/.config/