all repos — dotfiles @ d3d55ff8a039cadd3f6422fc8f02df50880e7c21

linux dotfiles

update and add scripts
Prithu Goswami prithugoswami524@gmail.com
Fri, 09 Aug 2019 15:31:06 +0530
commit

d3d55ff8a039cadd3f6422fc8f02df50880e7c21

parent

4cb58154e8c232c1b180ca666cb0b77adf55ee62

M bin/cron/newsboat-cronbin/cron/newsboat-cron

@@ -10,7 +10,7 @@ if [ $count -gt 0 ]

then echo $count > $HOME/.config/newsboat/unread pkill -SIGRTMIN+10 i3blocks - notify-send "$count unread RSS feeds" + notify-send -i feedreader "$count unread RSS feeds" elif [ $count -eq 0 ] then echo $count > $HOME/.config/newsboat/unread
A bin/cron/pacupdate-cron

@@ -0,0 +1,10 @@

+#!/usr/bin/bash + + ping -q -c 1 google.com >/dev/null || exit +[ "$1" = "-u" ] && sudo pacman -Sy +count=$(pacman -Qu | wc -l) + +[ $count -gt 0 ] && notify-send \ + "$count package updates available" + +pkill -SIGRTMIN+8 i3blocks
A bin/scripts/i3scripts/i3-scrot

@@ -0,0 +1,78 @@

+#!/bin/sh +# /usr/bin/i3-scrot +# +# simple screenshot-script using scrot for manjaro-i3 by oberon@manjaro.org + +_conf=$HOME/.config/i3-scrot.conf + +if ! [ -f $_conf ]; then + echo "scrot_dir=$(xdg-user-dir PICTURES)" > $_conf +fi + +source $_conf + +if ! [ -d $scrot_dir ]; then + mkdir -p $scrot_dir +fi + +if ! [[ -z "$2" ]]; then + cmd="scrot -d $2" +else + cmd='scrot' +fi + +case "$1" in + --desk|-d|$NULL) + cd $scrot_dir + $cmd && + notify-send "Screenshot saved" + ;; + --window|-w) + cd $scrot_dir + $cmd -u && + notify-send "Screenshot saved" + ;; + --select|-s) + cd $scrot_dir + notify-send 'Select an area for the screenshot' & + scrot -s && + notify-send "Screenshot saved" + ;; + --help|-h) + echo " +available options: +-d | --desk full screen +-w | --window active window +-s | --select selection +-h | --help display this information + +The -d or -w options can be used with a delay +by adding the number of seconds, like for example: +'i3-scrot -w 5' + +Default option is 'full screen'. + +The file destination can be set in ${_conf}. +Default is $scrot_dir +" + ;; + *) + echo " +== ! i3-scrot: missing or wrong argument ! == + +available options: +-d | --desk full screen +-w | --window active window +-s | --select selection +-h | --help display this information + +Default option is 'full screen'. + +The file destination can be set in ${_conf}. +Default is $scrot_dir +" + + exit 2 +esac + +exit 0
M bin/scripts/linkhandlerbin/scripts/linkhandler

@@ -18,9 +18,21 @@ case "$1" in

*mkv|*webm|*mp4|*gif) setsid mpv -quiet "$1" >/dev/null 2>&1 & ;; *youtube.com*|*youtu.be*) - notify-send "Playing youtube video" + cq="" + q=$(echo -en "1080p\n720p\n480p\n360p\n240p" | dmenu $DMENU_ARGS\ + -p 'Quality ') + case $q in + "1080p") cq="-1" ;; + "720p") cq="-7" ;; + "480p") cq="-4" ;; + "360p") cq="-3" ;; + "240p") cq="-2" ;; + "") q="default";; + esac + + notify-send -i youtube "Playing youtube video in $q quality" # setsid mpv --ytdl-format=$ytdlfmt --quiet "$1" >/dev/null 2>&1 & ;; - setsid youtube-viewer "$1" >/dev/null 2>&1 & ;; + setsid youtube-viewer $cq "$1" >/dev/null 2>&1 & ;; *png|*jpg|*jpe|*jpeg) setsid feh "$1" >/dev/null 2>&1 & ;; *mp3|*flac|*opus|*mp3?source)
M bin/scripts/newsboat_bin/scripts/newsboat_

@@ -3,4 +3,4 @@ # To be used with the i3blocks setup

# I made this so that I can call open newsboat in a new terminal window and # also signaling i3block at the same time. Use this with the dmenu launcher # I use with i3 with mod+d -st -e zsh -c newsboat && pkill -SIGRTMIN+10 i3blocks +st -e bash -c newsboat && pkill -SIGRTMIN+10 i3blocks
M bin/scripts/notebin/scripts/note

@@ -1,7 +1,9 @@

#!/bin/sh remind_path=$HOME/.config/note -dmenu_cmd="dmenu -l 20 -h 23" +dmenu_cmd="dmenu $DMENU_ARGS -l 20 -h 20" +#dmenu_cmd="dmenu $DMENU_ARGS -l 20" +[ -e $remind_path ] || touch $remind_path if [ $# -eq 0 ]; then output=$(cat $remind_path | $dmenu_cmd)

@@ -9,9 +11,8 @@ [ $? -ne 0 ] && exit;

fi case $output in - +) echo -n "" | dmenu -nb "#000" -sb "#FFF"\ - -sf "#000" -h 23 -p note >> $remind_path;; - *) ans=$(echo -e "no\nyes" | dmenu -h 23 -p "Delete?") + +) echo -n "" | $dmenu_cmd -p note >> $remind_path;; + *) ans=$(echo -e "no\nyes" | $dmenu_cmd -p "Delete?") if [ $ans = "yes" ]; then sed -i "/$output/d" $remind_path else
M bin/scripts/notes_scrotbin/scripts/notes_scrot

@@ -2,12 +2,12 @@ #!/usr/bin/bash

# Wrote this to be able to take a selective-area screenshot for my note-taking # workflow # Screenshots are saved in the respective img/ directory of each -# subject/course/book directory under ~/Documents/notes/ +# subject/course/book directory under ~/docs/notes/ # This is so that I can use those images in markdown while writing notes # and compile them using pandoc. Useful to take screenshots of diagrams # from book that I am reading. -#nip - Notes images paths for notes in ~/Documents/notes +#nip - Notes images paths for notes in ~/docs/notes [[ -e $HOME/.config/nip ]] || exit 0 n_path=$(cat $HOME/.config/nip | dmenu -l 15) [[ -z $n_path ]] && exit 0
M bin/scripts/pdbin/scripts/pd

@@ -70,7 +70,7 @@ # Change these accordingly

env_home = os.environ['HOME'] tmp_pd_path = '/tmp/pd' key_path = env_home + '/.pdkey' -pd_dir = env_home + '/Dropbox/pd' +pd_dir = env_home + '/dropbox/pd' pd_path = pd_dir + '/pd' rclone_dir = 'drop:/pd'