Users browsing this thread: 3 Guest(s)
prx*
Members
okay, here you go, but there's not much to see. :)

## dwall

Code:
#!/bin/sh
# change wallpaper

WALLDIR=$HOME/docs/img/wallpapers

test -s $HOME/.dmenurc && . $HOME/.dmenurc

prompt="wallpaper"
WALL=$(ls $WALLDIR | dmenu -sb ${sb} -sf ${sf} -nb ${nb} -nf ${nf} -fn ${fn} -i -p "$PWD $prompt:")
if [ -n "$WALL" ]; then
    #feh --bg-scale "$WALLDIR/$WALL"        
    #qiv -z "$WALLDIR/$WALL"
    setwall "$WALLDIR/$WALL"
    
fi
exit 0

## setwall
The previous script use setwall.
Code:
#!/bin/sh
bgcol="$(/usr/X11R6/bin/xrdb -query |grep background | cut -d':' -f2 |  tr -d [:space:])"
test $? -ne 0 && bgcol="black"
/usr/X11R6/bin/xsetroot -solid "$bgcol"

whereis xwallpaper > /dev/null
if [ $? -eq 0 ]; then
    /usr/local/bin/xwallpaper --zoom "${1}"
else
# gm has issues with xcompmgr
    /usr/local/bin/gm display -foreground "$bgcol" -window root -backdrop "${1}"
fi

exit 0

## dshot
Take a screenshot:
* Whole screen
* after 5 sec
* selection
* selection and copy in clipboard to paste image
* selection and upload using 'pixup' (curl to 0x0 or other providers if it fails)
Code:
#!/bin/sh -e

test -s $HOME/.dmenurc && . $HOME/.dmenurc

P="screenshot:"
OPTION="-l ${l} -sb ${sb} -sf ${sf} -nb ${nb} -nf ${nf} -fn ${fn} -p "${P}" "
img=/tmp/scrot-$(date +%Y%m%d%H%S).png

case $LANG in
    fr* )
        txtfull="tout l'écran"
        txtfullwait5="tout l'écran après 5 secondes"
        txtsel="sélection"
        txtselncopy="sélection et copie dans presse papier"
        txtselnup="sélection et upload"
        ;;
    * )
        txtfull="whole screen"
        txtfullwait5="whole screen after 5s"
        txtsel="select"
        txtselncopy="select and copy"
        txtselnup="select and upload"
        ;;
esac

action=$(echo "$txtfull
$txtsel
$txtselncopy
$txtselnup"| dmenu $OPTION)

case "$action" in
    "${txtfull}" )
        scrot "${img}"
    ;;
    "${txtfullwait5}" )
        scrot -d5 "${img}"
    ;;
    "${txtsel}" )
        scrot -s "${img}"
    ;;
    "${txtselncopy}" )
        scrot -s "${img}"
        xclip -selection clipboard -t "image/png" < "$img"
    ;;
    "${txtselnup}" )
        scrot -s "${img}"
        $BROWSER "$(pixup ${img})"
    ;;
esac

exit


Messages In This Thread
Dmenu Scripts - by pfr - 09-06-2021, 03:38 AM
RE: Dmenu Scripts - by seninha - 09-06-2021, 09:35 AM
RE: Dmenu Scripts - by prx* - 09-06-2021, 09:42 AM
RE: Dmenu Scripts - by pfr - 09-06-2021, 10:48 AM
RE: Dmenu Scripts - by prx* - 10-06-2021, 04:28 AM
RE: Dmenu Scripts - by Gorm - 11-06-2021, 09:17 PM
RE: Dmenu Scripts - by pfr - 07-10-2024, 11:04 PM