authorship and inspirations.

This commit is contained in:
#root_informatica 2024-02-26 01:30:45 -03:00
parent 51c1794ea7
commit 07bf62d7ed
35 changed files with 246 additions and 86 deletions

View File

@ -1,6 +1,7 @@
#!/bin/sh
# download adblock list
## download adblock list for luakit ##
# adblocklist.sh by @root_informatica.
# lists urls
RLISTS="https://easylist.to/easylist/easylist.txt \

View File

@ -1,5 +1,8 @@
#!/bin/sh
## open a minimal browser in different scenarios ##
# browser.sh by @root_informatica.
. $HOME/.config/wms/wms_var
FLAG=$1
@ -16,12 +19,15 @@ COLORS="
"
# discriminate depending on whether or not there is a graphical environment.
[ -t 0 ] && MENU="fzfmenu.sh"; \
WBROW="links -g $COLORS"; \
TWBROW="links -g $COLORS -socks-proxy 127.0.0.1:9050 -only-proxies 1" \
|| MENU="wms_menu.sh"; \
WBROW="links"; \
if [ -t 0 ]; then
MENU="fzy"
WBROW="links"
TWBROW="links -socks-proxy 127.0.0.1:9050 -only-proxies 1"
else
MENU="xmenu.sh"
WBROW="links -g $COLORS"
TWBROW="links -g $COLORS -socks-proxy 127.0.0.1:9050 -only-proxies 1"
fi
# torsock
TORSOCK="9050"

View File

@ -1,42 +1,52 @@
#!/bin/sh
## capture desktop content ##
# capturemedia.sh by @root_informatica.
# menu.
XMENU=wms_menu.sh
# music dir.
MDIR="$HOME/Música/"
XMENU=xmenu.sh
# timestamp.
DATE=`date +%m-%d-%Y_%H:%M:%S`
# webcam in a frame.
WEBCAM="ffplay -f video4linux2 -i /dev/video0 -video_size 420x340 -fflags nobuffer"
# mic and video lines.
RECORD_MIC="arecord capture-a_$DAT.mp3"
RECORD_VID="ffmpeg -f x11grab -s $(sed 's/,/x/' < /sys/class/graphics/fb0/virtual_size) -r 12 -i :1.0+0,0 -vcodec libx264 capture-v_$DATE.mp4"
RECORD_VID_MIC="ffmpeg -video_size $(sed 's/,/x/' < /sys/class/graphics/fb0/virtual_size) -framerate 25 -f x11grab -i :1 -f alsa -ac 2 -i hw:0 capture-av.$DATE.mp4"
# record mic.
MIC="arecord capture-a_$DAT.mp3"
# record desktop (smartphone compatibility).
DESKTOP="ffmpeg -f x11grab -s $(sed 's/,/x/' < /sys/class/graphics/fb0/virtual_size) -r 12 -i :1.0+0,0 -vcodec libx264 capture-v_$DATE.mp4"
# record desktop with audio from the michrophone.
DESKTOP_MIC="ffmpeg -video_size $(sed 's/,/x/' < /sys/class/graphics/fb0/virtual_size) -framerate 25 -f x11grab -i :1 -f alsa -ac 2 -i hw:0 capture-av.$DATE.mp4"
# add audio to an already recorded video.
add_audio() {
# music dir.
mdir="$HOME/Mùsica"
# video target.
video=$(find $HOME -maxdepth 1 -type f | grep ".mp4" | $XMENU)
# audio target
audio=$(find $MDIR -type f | $XMENU)
# mix command.
ffmpeg -i $video -stream_loop -1 -i $audio -c copy -shortest -map 0:v:0 -map 1:a:0 -vcodec libx264 -vf format=yuv420p -acodec aac -ab 128k -ac 2 -ar 44100 capture-av_$DATE.mp4
}
ITEMS=$(echo -e "addaudio\nmic\nvideo\nvideo-mic\nwebcam\nstop" | $XMENU)
case $ITEMS in
OPT=$(echo -e "addaudio\nmic\ndesktop\ndesktop-mic\nwebcam\nstop" | $XMENU)
case $OPT in
addaudio)
add_audio
;;
mic)
$RECORD_MIC & echo $! > /tmp/capturemedia.pid
$MIC & echo $! > /tmp/capturemedia.pid
;;
video)
$RECORD_VIDEO & echo $! > /tmp/capturemedia.pid
desktop)
$DESKTOP & echo $! > /tmp/capturemedia.pid
;;
video-mic)
$RECORD_VID_MIC & echo $! > /tmp/capturemedia.pid
desktop-mic)
$DESKTOP_MIC & echo $! > /tmp/capturemedia.pid
;;
webcam)
$WEBCAM
;;
stop)
# kill'em all.
kill $(cat /tmp/capturemedia.pid)
;;
esac

56
dzpanel.sh Executable file
View File

@ -0,0 +1,56 @@
#!/bin/sh
. $HOME/.config/wms/wms_var
## some info width dzen2 ##
# dzpanel.sh by @root_informatica.
FLAG=$1
clock() {
while true; do
date +%H:%M
sleep 60
done
}
# kill dzen
DZPID=$(pgrep dzen)
if [ -n "$DZPID" ]; then
pkill dzen
pkill wms_dz.sh
else
case $FLAG in
-c) # make a simple clock.
clock | dzen2 -fn Hack-80 \
-fg "#$BC" -bg "#$AC" \
-w 360 -h 120 -x 500 -y 300 \
&
;;
-f) # make a simple fetch.
sfetch.sh | dzen2 -fn Hack-14 \
-e 'onstart=uncollapse' -l 10 \
-fg "#$BC" -bg "#$AC" \
-w 820 -x 260 -y 240 -p \
&
;;
-h) # hello message.
cat .wms_hello | dzen2 -fn Hack-14 \
-e 'onstart=uncollapse' -l 24 \
-fg "#$AC" -bg "#$BC" \
-w 480 -x 440 -y 58 -p \
&
;;
-s) # make a simple status.
status.sh | dzen2 -fn Hack-14 \
-e 'onstart=uncollapse' -l 7 \
-fg "#$BC" -bg "#$AC" \
-w 500 -x 420 -y 280 -p \
&
;;
*)
exit 0
;;
esac
fi

View File

@ -1,5 +1,8 @@
#!/bin/sh
# some fun with ascii emojis ##
# emojis.sh by @root_informatica.
# emojis file path.
EMJ="$HOME/.emojis"
@ -11,10 +14,8 @@ if [ -t 0 ]; then
else
# pull up the file with fzfmenu.sh and store in a temporary file
MENU=wms_menu.sh
$MENU < $EMJ | cut -d ' ' -f 3- | xclip
# to paste somewhere else other than an X application.
xclip -o | xclip -sel c
MENU=xmenu.sh
$MENU < $EMJ | cut -d ' ' -f 3- | xclip -sel c
fi
## .emojis file example:

View File

@ -1,7 +1,7 @@
#!/bin/sh
## play music with ffplay and some visual arrangement ##
## rp_musicplayer by @root.sti ##
# ffplayer.sh by @root.informatica.
. $HOME/.config/wms/wms_var
@ -9,5 +9,5 @@
DIR=$1
# use fzfmenu.sh and do some magic.
for f in $(find $DIR -type f | grep -E ".flac|.mp3|.opus|.wav|.webm" | fzfmenu.sh); do
title=$(basename "$f"); ffplay -autoexit -f lavfi "amovie="$f",asplit [a][out1];[a]showwaves=size=600x200:mode=cline:colors=#$AC:r=50,drawtext=text="$title - %{pts\:hms}":box=1:boxborderw=5:x=(w-text_w)/2:y=h-(text_h*2):boxcolor=black@0.4:fontsize=18:font=Hack:fontcolor=#$IC[out0]"
title=$(basename "$f"); ffplay -autoexit lavfi "amovie="$f",asplit [a][out1];[a]showwaves=size=600x200:mode=cline:colors=#$AC:r=50,drawtext=text="$title - %{pts\:hms}":box=1:boxborderw=5:x=(w-text_w)/2:y=h-(text_h*2):boxcolor=black@0.4:fontsize=18:font=Hack:fontcolor=#$IC[out0]"
done

View File

@ -1,6 +1,7 @@
#!/bin/sh
## play urls width ffplay
## play urls width ffplay ##
# ffurlplayer.sh by @root_informatica.
# play with ytfzf
yt-dlp "$@" -o - | ffplay - -autoexit -loglevel quiet

8
fzfmenu.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/sh
## fzf menu for non-X sessions ##
# fzfmenu.sh by @root_informatica.
fzf --bind 'ctrl-e:print-query' --no-sort -m < /proc/$$/fd/0 > /proc/$$/fd/1

View File

@ -1,6 +1,7 @@
#!/bin/sh
## play music with mplayer ##
# fzfmp.sh by @root_informatica.
# music dir.
MDIR="$HOME/Música/"

View File

@ -1,5 +1,9 @@
#!/bin/sh
##utility for previewing content in fzf ##
## based on vi-nuke from @Visone_Selektah.
# fzfpreview.sh by @root_informatica.
TARGET=$1
# target name.
TNAME="${TARGET##*/}"

11
luckylove.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/sh
## try your luck in love ##
# luckylove.sh by @root_informatica.
VAL=$(shuf -i 0-1 -n 1 | tr -d '\n')
read -p "Enter the name of the person you are in love with:: " NAME
[ $VAL = 0 ] && echo "😍 $NAME loves You" \
|| echo "😠 $NAME hates you"

View File

@ -1,5 +1,7 @@
#!/bin/sh
# update mails with mbsync.
## update mails with mbsync ##
# mail_sync.sh by @root_informatica.
mbsync -c $HOME/.config/mbsync/mbsyncrc-1 cock
mbsync -c $HOME/.config/mbsync/mbsyncrc-2 disroot

View File

@ -1,6 +1,9 @@
#!/bin/sh
## play music with mplayer ##
# musicplayer.sh by @root_informatica.
. $HOME/.config/wms/wms_var
# music dir.
MDIR="$HOME/Música/"
@ -9,7 +12,7 @@ PLIST="/tmp/playlist"
# define the menu according to the environment.
[ -t 0 ] && MENU="fzy" \
|| MENU="wms_menu.sh"
|| MENU="xmenu.sh"
# add album to playlist.
for album in $(find $MDIR -type d | $MENU); do
@ -18,10 +21,14 @@ for album in $(find $MDIR -type d | $MENU); do
done
# play it
[ -t 0 ] && mpv --no-video \
[ -t 0 ] && mpv --config=no \
--quiet \
--vo=tct \
--lavfi-complex="[aid1]asplit[ao][a1];[a1]showwaves=mode=cline:colors=#$AC:rate=25[vo]" \
--playlist=$PLIST \
|| mpv --quiet \
--force-window=yes \
--lavfi-complex="[aid1]asplit[ao][a1];[a1]showwaves=mode=cline:colors=#$AC:rate=25,format=rgb0 [vo]" \
--playlist=$PLIST
# ffmpeg-filters showwaves

View File

@ -1,5 +1,8 @@
#!/bin/bash
## sync with nextcloud ##
# nextcloud_sync.sh by @root_informatica.
# nextcloud url, username, password and local dir.
. $HOME/.config/nextcloud/nextcloud_data

12
open.sh
View File

@ -1,12 +1,12 @@
#!/bin/sh
# crap with dmenu to browse/open files #
# depends on vi-nucke.sh #
## crappy script to browse and open files in different scenarios ##
## depends on vi-nucke.sh / vi-nuke from @Visone_Selektah ##
# open.sh by @root_informatica.
[ -t 0 ] && MENU="fzy" \
|| MENU="wms_menu.sh"
|| MENU="xmenu.sh"
# a loop ending with ":quit"
while true; do
# file/directory target.
TARGET=$(ls | $MENU)
@ -16,8 +16,8 @@ while true; do
cd "$TARGET"
else # if target is a file
# vi-nuke.sh will try to open it.
vi-nuke.sh $TARGET
# vi-nuke will try to open it.
vi-nuke.sh "$TARGET"
break
fi
done

View File

@ -1,10 +1,11 @@
#!/bin/sh
## play video with or without X server (Xorg) ##
# play.hs by @root_informatica.
TARGET=$1
# check display.
[ -n "$DISPLAY" ] && ffplay -autoexit "$TARGET" \
[ -n "$DISPLAY" ] && mpv "$TARGET" \
|| mpv --vo=drm "$TARGET"

View File

@ -1,11 +1,13 @@
#!/bin/sh
## podcast player ##
# podcastplayer.sh by @root_informatica.
# podcast dir.
PD="$HOME/Descargas/ytdl"
# last podcast played path. (in case of fire)
LP="/tmp/lastpodcast.ogg"
# select the target file.
TARGET=$(find $PD -type f | grep .ogg | fzfmenu.sh)

View File

@ -1,6 +1,8 @@
#!/bin/sh
## Monitor battery status and do a few things accordingly ##
## It's not a very generic script, let's say ##
# power.sh by @root_informatica.
# battery status and level.
read -r STATUS < /sys/class/power_supply/BAT0/status

View File

@ -1,6 +1,7 @@
#!/bin/sh
## read pdf's with or without X server (Xorg) ##
# read.sh by @root_informatica.
TARGET=$1

View File

@ -1,6 +1,6 @@
#!/bin/sh
# this fetch was born from the search for a simpler way to get system info. Several lines and ways of doing are the product of the exchange of ideas with other users who share my convictions.
## this fetch was born from the search for a simpler way to get system info. Several lines and ways of doing are the product of the exchange of ideas with other users who share my convictions ##
# rootfetch.sh by @root.informatica
# os name.

View File

@ -1,7 +1,10 @@
#!/bin/sh
## images and bragging with your pretty desktop ##
# screenshot.sh by @root_informatica.
# xmenu.
MENU=wms_menu.sh
MENU=xmenu.sh
# wmutils binary. (It can also be done with xdotool)
TARGET=$(pfw)
# date.
@ -12,7 +15,7 @@ SIGNATURE=$(cat $HOME/.signature)
DELAY="sleep 1"
# options
OPT=$(echo "desktop\nfancy\nwindow\nmultiwindow\nselection\nmultiselect\nedit\nshare" \
OPT=$(echo -e "desktop\nfancy\nwindow\nmultiwindow\nselection\nmultiselect\nedit\nshare" \
| $MENU)
# capture the desktop

View File

@ -1,51 +1,60 @@
#!/bin/sh
# this fetch was born from the search for a simpler way to get system info. Several lines and ways of doing are the product of the exchange of ideas with other users who share my convictions.
# simplefetch by @root.sti
## this fetch was born from the search for a simpler way to get system info. Several lines and ways of doing are the product of the exchange of ideas with other users who share my convictions ##
# sfetch.sh by @root.informatica.
# os name.
OS=$(awk -F '"' '/PRETTY_NAME/ {print $2}' /etc/os-release)
# kernel and arch.
read -r KERNEL < /proc/sys/kernel/osrelease
ARCH=$(getconf LONG_BIT)
# machine name.
read -r HOSTNAME < /etc/hostname
UPTIME=$(uptime -p)
INIT=$(if [ -f /sbin/runit ]; then echo runit; else echo openrc; fi)
CPU=$(awk -F ":" 'NR==5 {print $2}' /proc/cpuinfo)
GPU=$(lspci 2>/dev/null | awk -F ":" '/VGA/ {print $3}' | cut -c 1-62)
# init.
INIT=$(ps --no-headers -o comm 1)
# cpu and gpu procesors.
CPU=$(awk -F ":" 'NR==5 {print $2}' /proc/cpuinfo | tr -s ' ')
GPU=$(lspci 2>/dev/null | awk -F ":" '/VGA/ {print $3}' | cut -c 1-50)
# check display for screensize and working environment.
if [ -n "$DISPLAY" ]; then
SCREEN=$(sed 's/,/x/' < /sys/class/graphics/fb0/virtual_size)
WE=$(xprop -root WM_NAME | cut -d\" -f 2)
de=$(printf '%s' $DESKTOP_SESSION)
WE=$([ -d "$de" ] && $de \
|| xprop -root WM_NAME | cut -d '"' -f2)
else
SCREEN=$(stty size | awk '{print $1 " rows " $2 " columns"}')
tty=$(tty)
WE=tty${tty##*/}
fi
# memory.
MEM=$(awk '/MemTotal/ {total=$2} \
/MemFree/ {free=$2} \
/Buffers/ {buffers=$2} $1 ~ \
/^Cached/ {cached=$2} END \
{printf "%.0f\n",(total - (free + buffers + cached))/1000}' /proc/meminfo)
/MemFree/ {free=$2} \
/Buffers/ {buffers=$2} $1 ~ \
/^Cached/ {cached=$2} END \
{printf "%.0f\n",(total - (free + buffers + cached))/1024}' /proc/meminfo)
PKG=$(xbps-query -l | wc -l)
# packages.
PKG=$([ -f /usr/bin/xbps-install ] && xbps-query -l | wc -l \
|| dpkg --list | wc --lines)
# shell.
SHELL=$(printf '%s' "$(basename "$SHELL")")
TERMINAL=$(printf '%s' "$TERM")
FONT=$(awk -F ': ' '/faceName/ {print $2}' "$HOME"/.Xresources)
cat <<EOF
+ OS: ................ ${OS}
+ Linux Kernel: ...... ${KERNEL}-${ARCH}
+ Init: .............. ${INIT}
+ Hostname: .......... ${HOSTNAME}
+ Uptime: ............ ${UPTIME}
+ Processor (Cpu): .. ${CPU}
+ Graphics: ......... ${GPU}
+ Screen: ............ ${SCREEN}
+ Memory: ............ ${MEM}Mib
+ Packages: .......... ${PKG}
+ Work Environment:... ${WE}
+ Shell: ............. ${SHELL}
+ Terminal: .......... ${TERMINAL}
+ Fonts: ............. ${FONT}
# print formated information.
cat<<EOF
=========================================================================
OS: .................. ${OS}
Kernel: .............. ${KERNEL}-${ARCH}
Init ................. ${INIT}
Processor: .......... ${CPU}
Graphics: ........... ${GPU}
Ram: ................. ${MEM}Mib
Packages: ............ ${PKG}
Work Environment: .... ${WE}
Shell: ............... ${SHELL}
==============================================================
EOF

View File

@ -1,13 +1,14 @@
#!/bin/sh
## upload files and share with transfer.sh in non-X sessions ##
# share.sh by @root_informatica.
# menu variable depending on the environment
[ -t 0 ] && MENU="fzy" \
|| MENU="wms_menu.sh"
|| MENU="xmenu.sh"
# options
OPT=$(echo "documentos\nimágenes\nmúsica\nscripts\nvídeos" | $MENU)
OPT=$(echo -e "documentos\nimágenes\nmúsica\nscripts\nvídeos" | $MENU)
# define filters
case $OPT in

View File

@ -1,7 +1,7 @@
#!/bin/sh
# This script is useful only for terminals that adjust their size in relation to the size of the text
# and that define their geometry in columns and rows.
## This script is useful only for terminals that adjust their size in relation to the size of the text and that define their geometry in columns and rows ##
# termgeometry.sh by @root_informatica.
## usage ##
# 1- Open a terminal, adjust its size however you want.

View File

@ -1,7 +1,9 @@
#!/bin/sh
# It depends of: "libsixel / libsixel-util"
## a stupid gif as terminal saver ##
## It depends of: "libsixel / libsixel-util" ##
# terminalsaver.sh by @root_informatica.
GIF=$HOME/.gif
clear && tput cup 10 34 && img2sixel $GIF && tput reset
clear && chafa -C on $GIF && tput reset

7
vol.sh
View File

@ -1,6 +1,9 @@
#!/bin/sh
. /tmp/wms_var
## vol level, alxamixer, dzen2 notifications ##
# vol.sh by @root_informatica.
. $HOME/.config/wms/wms_var
FLAG=$1
@ -35,6 +38,6 @@ if [ -n "$DISPLAY" ]; then
vol=$(amixer sget Master | awk -F "[][]" '/Playback/ {print $2}' | tr -d '\n')
echo "volume: $vol" | dzen2 -fn Hack-40 \
-fg "#$BC" -bg "#$AC" \
-w 420 -h 80 -x 460 -y 320 -p 1 & \
-w 420 -h 80 -x 460 -y 320 -p 1
fi

View File

@ -1,8 +1,15 @@
#/bin/sh
#!/bin/sh
## wallpaper in .png or .xbm. External variable file dependent colors ##
# wallpaper.sh by @root_informatica.
. $HOME/.config/wms/wms_var
FLAG=$1
# wallpaper path.
WALL="$HOME/.wall.png"
# bitmap path.
BITMAP="$HOME/.bitmap.xbm"
# image target.
TARGET=$2
# screen resolution.

View File

@ -1,14 +1,15 @@
#!/bin/sh
## view images with or without X server (Xorg); ##
## outside or inside a terminal emulator (Xorg) ##
## inside or outside a terminal. (requires sixels graphics support) ##
# watch.sh by @root_informatica.
TARGET=$1
# check display.
if [ -n "$DISPLAY" ]; then
[ -t 0 ] && convert "$TARGET" -geometry 800x480 sixel:- \
|| nsxiv $TARGET
else
fbv $TARGET
fi
[ -n "$DISPLAY" ] && nsxiv "$TARGET" \
|| fbv "$TARGET"
# sixel graphics.
# convert $TARGET -geometry 800x480 sixel:-

View File

@ -1,6 +1,7 @@
#!/bin/sh
## blur the content of a window to hide it ##
# windowblur.sh by @root_informatica.
# date and time.
DATE=$(date +%m-%d-%Y_%H:%M:%S)

View File

@ -1,5 +1,8 @@
#!/bin/sh
## put some image witch nsxiv into the windows ##
# windowsaver.sh by @root_informatica.
. $HOME/.config/wms/wms_var
# window id. (wmutils)

View File

@ -1,5 +1,8 @@
#!/bin/sh
## very simple and sexiest graphic launcher made with your beloved plus fzy terminal ##
# xlauncher.sh by @root_informatica.
TERMINAL="xterm"
GEOMETRY="61x12+376+241"

View File

@ -1,5 +1,8 @@
#!/bin/sh
## overly sophisticated launcher for luakit ##
# xlbrowser.sh by @root_informatica.
FLAG=$1
case $FLAG in

View File

@ -1,5 +1,8 @@
#!/bin/sh
## very simple and sexiest graphic menu made with your beloved plus fzy terminal ##
# xmenu.sh by @root_informatica.
TERMINAL="xterm"
GEOMETRY="61x12+376+241"

View File

@ -1,6 +1,7 @@
#!/bin/sh
## open web browser with the content of x selection ##
# xselgo.sh by @root_informatica.
. $HOME/.config/wms/wms_var

View File

@ -1,5 +1,8 @@
#!/bin/sh
## Download new content from your favorite YouTube channels ##
# youtube_sync.sh by @root_informatica.
# download program path.
DL="/usr/bin/yt-dlp"
# downloads history file path.