Edit scripts

- delete '.sh' from name
- edit screenshot script
  * use rofi instead of dmenu
  * add notification
  * fix area mode
- few changes in polybar config and updot
This commit is contained in:
samedamci 2020-03-13 12:45:30 +01:00
parent 23cc5cb051
commit f4aa5d265c
10 changed files with 39 additions and 43 deletions

View File

@ -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
;~~~~~
; "|"

View File

@ -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
;~~~~~
; "|"

32
botfiles/.scripts/screenshot Executable file
View File

@ -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!"

View File

@ -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

View File

@ -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

2
updot
View File

@ -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/