master
gotbletu 5 months ago
parent fbf05289d8
commit 5324dca5f0

@ -6,9 +6,7 @@
|___/
- https://www.youtube.com/user/gotbletu
- https://lbry.tv/@gotbletu
- https://odysee.com/@gotbletu
- https://twitter.com/gotbletu
- https://github.com/gotbletu
- gotbletu@gmail.com
@ -31,7 +29,7 @@ If you find my videos feature on other site let me know also, I always need an E
- [curseofwar](https://github.com/a-nikolaev/curseofwar/wiki) - fast action terminal RTS game with vim hotkeys
- [fzf](https://github.com/junegunn/fzf/wiki) - fuzzy finder for your shell
- [greenclip](https://github.com/erebe/greenclip) - simple clipboard manager to be integrated with rofi
- [inxi](https://code.google.com/p/inxi/) - a full featured system information script
- [inxi](https://code.google.com/p/inxi/) [movedsite](https://smxi.org/docs/inxi-about.htm) - a full featured system information script
- [package converter](https://code.google.com/p/foxoman/wiki/PackageConverter) - frontend to Alien
- [pacmixer](https://github.com/KenjiTakahashi/pacmixer) - an alsamixer alike for pulseaudio
- [pipe-viewer](https://github.com/trizen/pipe-viewer) - a command-line interface to YouTube (fork of straw-viewer)
@ -47,8 +45,6 @@ If you find my videos feature on other site let me know also, I always need an E
#### Blogs/Wikis/SocialMedia:
- Archwiki: xbacklight / xcalib - backlight utilities [Link](https://wiki.archlinux.org/index.php/backlight)
- FZF Fuzzy Finder - A command-line fuzzy finder written in Go [Link](http://junegunn.kr/2015/02/fzf-in-go/)
- Hackaday: linux-fu running commands [Link](https://hackaday.com/2017/07/07/linux-fu-running-commands/)
- Linuxaria: poor mans sportify [Link](http://linuxaria.com/pills/linux-terminal-poor-mans-spotify?lang=en)
- Linuxaria: Reptyr attach a running process to a new terminal [Link](https://linuxaria.com/pills/linux-terminal-reptyr-attach-a-running-process-to-a-new-terminal)

@ -1,42 +1,29 @@
#!/usr/bin/env bash
### _ _ _ _
### __ _ ___ | |_| |__ | | ___| |_ _ _
### / _` |/ _ \| __| '_ \| |/ _ \ __| | | |
###| (_| | (_) | |_| |_) | | __/ |_| |_| |
### \__, |\___/ \__|_.__/|_|\___|\__|\__,_|
### |___/
### https://www.youtube.com/user/gotbletu
### https://twitter.com/gotbletu
### https://github.com/gotbletu
### gotbletu@gmail.com
###
### Author : gotbletu
### Name : dl_wallhaven_wallpapers.sh
### Version : 0.2
### Date : 20190811
### Description : A script to download random wallpaper and delete old wallpaper at the sametime (wallhaven.cc)
### Depends On : bash coreutils grep findutils lynx wget
### Video Demo : https://www.youtube.com/watch?v=cDtVEXjiKTw
### Release Notes : 20190811 -- v0.2 minor fixes to get it working again
### 20170121 -- v0.1 it has begun
# author: gotbletu (@youtube|github|odysee)
# https://www.youtube.com/user/gotbletu
# desc: a script to download random wallpaper and delete old wallpaper at the sametime (wallhaven.cc)
# demo: https://www.youtube.com/watch?v=cDtVEXjiKTw
# depend: curl grep sed findutils coreutils wget
# Variable (you can change any of these to your liking)
real_wall_dir=~/Pictures/Wallpapers
temp_wall_dir=/tmp/wallpaper_wallhaven
expire_wall_date=30
savedir=~/Pictures/Wallpapers
tempdir=/tmp/wallpaper_wallhaven
expire_date=30
# create folders
mkdir -p $real_wall_dir
mkdir -p $temp_wall_dir
mkdir -p $savedir
mkdir -p $tempdir
cd $tempdir || exit
# change the url if you need different resolutions
curl -f -L 'https://wallhaven.cc/search?categories=111&purity=100&resolutions=1920x1080&sorting=random&order=desc&ai_art_filter=1' | grep -Eo "https?://\S+?\"" | grep small | cut -d '"' -f1 | sed -e 's@//th@//w@g' -e 's/small/full/g' -e 's@/@/wallhaven-@5' | while read -r link ; do wget --timestamping "$link" || wget --timestamping "${link//.jpg/.png}" ; done
cd $temp_wall_dir
# get links of images and download it
get_random_url=$(lynx -listonly -nonumbers -dump "https://wallhaven.cc/random" | grep '/w/')
get_images_url=$(echo "$get_random_url" | while read line; do lynx -source "$line" | grep -Po '<img id="wallpaper" src="\K[^"]+' ; done )
dl_images=$(echo "$get_images_url" | while read line; do wget -N "$line" ; done)
# # get links of images and download it
# get_random_url=$(lynx -listonly -nonumbers -dump "https://wallhaven.cc/random" | grep '/w/')
# get_images_url=$(echo "$get_random_url" | while read -r line; do lynx -source "$line" | grep -Po '<img id="wallpaper" src="\K[^"]+' ; done )
# echo "$get_images_url" | while read -r line; do wget -N "$line" ; done
# delete any file under 200k in size (to avoid shitty thumnbails or crap quality)
find . -type f -iname "*.jp*g" -size -200k -exec rm {} \;
@ -49,10 +36,10 @@ find . -type f -iname "*.png" -exec touch -m {} \;
# now that everything is cleaned and filter
# send the downloaded images to the wallpaper folder
find . -type f -iname "*.jp*g" -exec mv {} $real_wall_dir \;
find . -type f -iname "*.png" -exec mv {} $real_wall_dir \;
find . -type f -iname "*.jp*g" -exec mv {} $savedir \;
find . -type f -iname "*.png" -exec mv {} $savedir \;
# delete wallpaper image older then X days and remove temp folder
rm -rf $temp_wall_dir
find $real_wall_dir -mtime +$expire_wall_date -exec rm {} \;
rm -rf $tempdir
find $savedir -mtime +$expire_date -exec rm {} \;

@ -18,6 +18,7 @@ add read aloud features to w3m terminal web browser, with hotkeys to pause, stop
########################### Text to speech TTS (SVOX Pico) {{{
# https://aur.archlinux.org/packages/svox-pico-bin/
# https://web.archive.org/web/20230729001652/https://aur.archlinux.org/packages/svox-pico-bin
keymap \\\s COMMAND "READ_SHELL 'echo $W3M_CURRENT_WORD | pico2wave -w /tmp/pico2wave.wav' ; BACK ; READ_SHELL 'mpv --no-video /tmp/pico2wave.wav >/dev/null 2>&1 &' ; BACK" ## Text to Speech - Svox Pico - Read aloud word on cursor
keymap \\\a COMMAND "READ_SHELL 'rm /tmp/pico2wave.txt' ; BACK ; PRINT /tmp/pico2wave.txt ; READ_SHELL 'pico2wave -w /tmp/pico2wave.wav < /tmp/pico2wave.txt' ; BACK ; READ_SHELL 'mpv --no-video /tmp/pico2wave.wav >/dev/null 2>&1 &'; BACK" ## Text to Speech - Svox Pico - Read aloud page
keymap \\\t COMMAND "READ_SHELL 'rdrview -H $W3M_CURRENT_LINK 2>/dev/null' ; VIEW ; DELETE_PREVBUF ; READ_SHELL 'rm /tmp/pico2wave.txt' ; BACK ; PRINT /tmp/pico2wave.txt ; READ_SHELL 'pico2wave -w /tmp/pico2wave.wav < /tmp/pico2wave.txt' ; BACK ; READ_SHELL 'mpv --no-video /tmp/pico2wave.wav >/dev/null 2>&1 &'; BACK" ## Text to Speech - Svox Pico - Clean page with rdrview then read aloud page (cursor link)

Loading…
Cancel
Save