Code change.
This commit is contained in:
parent
1cda74c8f0
commit
682a603575
|
@ -10,7 +10,7 @@ RECORD_VIDEO="ffmpeg -f x11grab -s $(sed 's/,/x/' < /sys/class/graphics/fb0/virt
|
|||
|
||||
add_audio() {
|
||||
video=$(find $HOME -maxdepth 1 -type f | grep ".mp4" | $XMENU)
|
||||
audio=$(find $MDIR -type f | $XMENU_XL)
|
||||
audio=$(find $MDIR -type f | $XMENU)
|
||||
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
|
||||
}
|
||||
|
||||
|
|
46
fzfshare.sh
46
fzfshare.sh
|
@ -1,46 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
## upload files and share with transfer.sh in non-X sessions ##
|
||||
|
||||
# a simple menu
|
||||
MENU=fzfmenu.sh
|
||||
TYPE=$(echo "documentos\nimágenes\nmúsica\nscripts\nvídeos" | $MENU)
|
||||
|
||||
# define filters
|
||||
case $TYPE in
|
||||
documentos)
|
||||
filter=".pdf|.txt"
|
||||
;;
|
||||
imágenes)
|
||||
filter=".png|.jpg|.jpeg"
|
||||
;;
|
||||
música)
|
||||
filter=".mp3|.flac|.wav|.ogg|.webm"
|
||||
;;
|
||||
scripts)
|
||||
filter=".pl|.py|.sh|.bash"
|
||||
;;
|
||||
vídeos)
|
||||
filter=".mp4|.avi|.mkv"
|
||||
;;
|
||||
esac
|
||||
|
||||
# do the thing
|
||||
if [ -n "$filter" ]; then
|
||||
|
||||
filepath=$(find $HOME -type f | grep -E "$filter" | $MENU) # path to file
|
||||
if [ -n "$filepath" ]; then # if filepath
|
||||
if [ -n "$DISPLAY" ]; then # if we are under X
|
||||
|
||||
# upload the file and save it to the clipboard
|
||||
curl -F "file=@$filepath" -F "secret=" https://0x0.st | xclip
|
||||
|
||||
# make it available to other programs
|
||||
xclip -o | xclip -sel c
|
||||
|
||||
else
|
||||
# upload the file and save the link in /tmp
|
||||
curl -F "file=@$filepath" -F "secret=" https://0x0.st > /tmp
|
||||
fi
|
||||
fi
|
||||
fi
|
70
sfetch.sh
70
sfetch.sh
|
@ -3,47 +3,47 @@
|
|||
# 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
|
||||
|
||||
os=$(awk -F '"' '/PRETTY_NAME/ {print $2}' /etc/os-release)
|
||||
read -r kernel < /proc/sys/kernel/osrelease
|
||||
arch=$(getconf LONG_BIT)
|
||||
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)
|
||||
OS=$(awk -F '"' '/PRETTY_NAME/ {print $2}' /etc/os-release)
|
||||
read -r KERNEL < /proc/sys/kernel/osrelease
|
||||
ARCH=$(getconf LONG_BIT)
|
||||
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)
|
||||
|
||||
if [ -n "$DISPLAY" ]; then
|
||||
screen=$(sed 's/,/x/' < /sys/class/graphics/fb0/virtual_size)
|
||||
we=$(xprop -root WM_NAME | cut -d\" -f 2)
|
||||
SCREEN=$(sed 's/,/x/' < /sys/class/graphics/fb0/virtual_size)
|
||||
WE=$(xprop -root WM_NAME | cut -d\" -f 2)
|
||||
else
|
||||
screen=$(stty size | awk '{print $1 " rows " $2 " columns"}')
|
||||
SCREEN=$(stty size | awk '{print $1 " rows " $2 " columns"}')
|
||||
tty=$(tty)
|
||||
we=tty${tty##*/}
|
||||
WE=tty${tty##*/}
|
||||
fi
|
||||
|
||||
mem=$(free -h | grep Mem: | awk '{print $3}')
|
||||
memtotal=$(awk '/MemTotal/ {print $2/1024}' /proc/meminfo)
|
||||
swaptotal=$(awk '/SwapTotal/ {print $2/1024}' /proc/meminfo)
|
||||
swapfree=$(awk '/SwapFree/ {print $2/1024}' /proc/meminfo)
|
||||
pkg=$(xbps-query -l | wc -l)
|
||||
shell=$(printf '%s' "$(basename "$SHELL")")
|
||||
terminal=$(printf '%s' "$TERM")
|
||||
font=$(awk -F ': ' '/faceName/ {print $2}' "$HOME"/.Xresources)
|
||||
MEM=$(free -h | grep Mem: | awk '{print $3}')
|
||||
MEMTOTAL=$(awk '/MemTotal/ {print $2/1024}' /proc/meminfo)
|
||||
SWAPTOTAL=$(awk '/SwapTotal/ {print $2/1024}' /proc/meminfo)
|
||||
SWAPFREE=$(awk '/SwapFree/ {print $2/1024}' /proc/meminfo)
|
||||
PKG=$(xbps-query -l | wc -l)
|
||||
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}
|
||||
+ Ram: ............... ${mem} / ${memtotal}Mib
|
||||
+ Swap: .............. $(echo ${swaptotal}-${swapfree} | bc)Mib / ${swaptotal}Mib
|
||||
+ Packages: .......... ${pkg}
|
||||
+ Window Manager: .... ${wm}
|
||||
+ Shell: ............. ${shell}
|
||||
+ Terminal: .......... ${terminal}
|
||||
+ Fonts: ............. ${font}
|
||||
+ OS: ................ ${OS}
|
||||
+ Linux Kernel: ...... ${KERNEL}-${ARCH}
|
||||
+ Init: .............. ${INIT}
|
||||
+ Hostname: .......... ${HOSTNAME}
|
||||
+ Uptime: ............ ${UPTIME}
|
||||
+ Processor (Cpu): .. ${CPU}
|
||||
+ Graphics: ......... ${GPU}
|
||||
+ Screen: ............ ${SCREEN}
|
||||
+ Ram: ............... ${MEM}b / ${MEMTOTAL}Mib
|
||||
+ Swap: .............. $(echo ${SWAPTOTAL}-${SWAPFREE} | bc)Mib / ${SWAPTOTAL}Mib
|
||||
+ Packages: .......... ${PKG}
|
||||
+ Work Environment:... ${WE}
|
||||
+ Shell: ............. ${SHELL}
|
||||
+ Terminal: .......... ${TERMINAL}
|
||||
+ Fonts: ............. ${FONT}
|
||||
EOF
|
||||
|
|
|
@ -3,11 +3,18 @@
|
|||
## upload files and share with transfer.sh in non-X sessions ##
|
||||
|
||||
# a simple menu
|
||||
MENU=dmenu.sh
|
||||
TYPE=$(echo "documentos\nimágenes\nmúsica\nscripts\nvídeos" | $MENU)
|
||||
if [ -n "$DISPLAY" ]; then
|
||||
MENU=dmenu.sh
|
||||
|
||||
else
|
||||
MENU=fzfmenu.sh
|
||||
|
||||
fi
|
||||
|
||||
OPT=$(echo "documentos\nimágenes\nmúsica\nscripts\nvídeos" | $MENU)
|
||||
|
||||
# define filters
|
||||
case $TYPE in
|
||||
case $OPT in
|
||||
documentos)
|
||||
filter=".pdf|.txt"
|
||||
;;
|
||||
|
@ -30,17 +37,16 @@ if [ -n "$filter" ]; then
|
|||
|
||||
filepath=$(find $HOME -type f | grep -E "$filter" | $MENU) # path to file
|
||||
if [ -n "$filepath" ]; then # if filepath
|
||||
if [ -n "$DISPLAY" ]; then # if we are under X
|
||||
|
||||
if [ -n "$DISPLAY" ]; then
|
||||
# upload the file and save it to the clipboard
|
||||
curl -F "file=@$filepath" -F "secret=" https://0x0.st | xclip
|
||||
|
||||
# make it available to other programs
|
||||
xclip -o | xclip -sel c
|
||||
|
||||
|
||||
else
|
||||
# upload the file and save the link in /tmp
|
||||
curl -F "file=@$filepath" -F "secret=" https://0x0.st > /tmp
|
||||
curl -F "file=@$filepath" -F "secret=" https://0x0.st > /tmp/share.txt
|
||||
|
||||
fi
|
||||
fi
|
||||
fi
|
|
@ -3,46 +3,46 @@
|
|||
# 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
|
||||
|
||||
os=$(awk -F '"' '/PRETTY_NAME/ {print $2}' /etc/os-release)
|
||||
read -r kernel < /proc/sys/kernel/osrelease
|
||||
arch=$(getconf LONG_BIT)
|
||||
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)
|
||||
OS=$(awk -F '"' '/PRETTY_NAME/ {print $2}' /etc/os-release)
|
||||
read -r KERNEL < /proc/sys/kernel/osrelease
|
||||
ARCH=$(getconf LONG_BIT)
|
||||
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)
|
||||
if [ -n "$DISPLAY" ]; then
|
||||
screen=$(sed 's/,/x/' < /sys/class/graphics/fb0/virtual_size)
|
||||
we=$(xprop -root WM_NAME | cut -d\" -f 2)
|
||||
SCREEN=$(sed 's/,/x/' < /sys/class/graphics/fb0/virtual_size)
|
||||
WE=$(xprop -root WM_NAME | cut -d\" -f 2)
|
||||
else
|
||||
screen=$(stty size | awk '{print $1 " rows " $2 " columns"}')
|
||||
SCREEN=$(stty size | awk '{print $1 " rows " $2 " columns"}')
|
||||
tty=$(tty)
|
||||
we=tty${tty##*/}
|
||||
WE=tty${tty##*/}
|
||||
fi
|
||||
mem=$(free -h | grep Mem: | awk '{print $3}')
|
||||
memtotal=$(awk '/MemTotal/ {print $2/1024}' /proc/meminfo)
|
||||
swaptotal=$(awk '/SwapTotal/ {print $2/1024}' /proc/meminfo)
|
||||
swapfree=$(awk '/SwapFree/ {print $2/1024}' /proc/meminfo)
|
||||
pkg=$(xbps-query -l | wc -l)
|
||||
shell=$(printf '%s' "$(basename "$SHELL")")
|
||||
terminal=$(printf '%s' "$TERM")
|
||||
font=$(awk -F ': ' '/faceName/ {print $2}' "$HOME"/.Xresources)
|
||||
MEM=$(free -h | grep Mem: | awk '{print $3}')
|
||||
MEMTOTAL=$(awk '/MemTotal/ {print $2/1024}' /proc/meminfo)
|
||||
SWAPTOTAL=$(awk '/SwapTotal/ {print $2/1024}' /proc/meminfo)
|
||||
SWAPFREE=$(awk '/SwapFree/ {print $2/1024}' /proc/meminfo)
|
||||
PKG=$(xbps-query -l | wc -l)
|
||||
SHELL=$(printf '%s' "$(basename "$SHELL")")
|
||||
TERMINAL=$(printf '%s' "$TERM")
|
||||
FONT=$(awk -F ': ' '/faceName/ {print $2}' "$HOME"/.Xresources)
|
||||
|
||||
|
||||
printf "
|
||||
\033[36m OS: \033[0m ..........................\033[37m ${os} \033[0m
|
||||
\033[36m Linux Kernel: \033[0m ................\033[37m ${kernel}-${arch} \033[0m
|
||||
\033[36m Init: \033[0m ........................\033[37m ${init} \033[0m
|
||||
\033[36m Hostname: \033[0m ....................\033[37m ${hostname} \033[0m
|
||||
\033[36m Uptime: \033[0m ......................\033[37m ${uptime} \033[0m
|
||||
\033[36m Processor (Cpu): \033[0m .............\033[37m ${cpu} \033[0m
|
||||
\033[36m Graphics Processor (GPU):\033[0m .....\033[37m ${gpu} \033[0m
|
||||
\033[36m Screen: \033[0m ......................\033[37m ${screen} \033[0m
|
||||
\033[36m Ram: \033[0m .........................\033[37m ${mem} - ${memtotal}Mi \033[0m
|
||||
\033[36m Swap: \033[0m ........................\033[37m ${swapfree} x- ${swaptotal}Mi \033[0m
|
||||
\033[36m Packages: \033[0m ....................\033[37m ${pkg} \033[0m
|
||||
\033[36m Work Environment: \033[0m ............\033[37m ${we} \033[0m
|
||||
\033[36m Shell: \033[0m .......................\033[37m ${shell} \033[0m
|
||||
\033[36m Terminal: \033[0m ....................\033[37m ${terminal} \033[0m
|
||||
\033[36m Fonts: \033[0m .......................\033[37m ${font} \033[0m
|
||||
\033[36m OS: \033[0m ..........................\033[37m ${OS} \033[0m
|
||||
\033[36m Linux Kernel: \033[0m ................\033[37m ${KERNEL}-${ARCH} \033[0m
|
||||
\033[36m Init: \033[0m ........................\033[37m ${INIT} \033[0m
|
||||
\033[36m Hostname: \033[0m ....................\033[37m ${HOSTNAME} \033[0m
|
||||
\033[36m Uptime: \033[0m ......................\033[37m ${UPTIME} \033[0m
|
||||
\033[36m Processor (Cpu): \033[0m .............\033[37m ${CPU} \033[0m
|
||||
\033[36m Graphics Processor (GPU):\033[0m .....\033[37m ${GPU} \033[0m
|
||||
\033[36m Screen: \033[0m ......................\033[37m ${SCREEN} \033[0m
|
||||
\033[36m Ram: \033[0m .........................\033[37m ${MEM} / ${MEMTOTAL}Mib \033[0m
|
||||
\033[36m Swap: \033[0m ........................\033[37m $(echo ${SWAPTOTAL}-${SWAPFREE} | bc)Mib / ${SWAPTOTAL}Mib \033[0m
|
||||
\033[36m Packages: \033[0m ....................\033[37m ${PKG} \033[0m
|
||||
\033[36m Work Environment: \033[0m ............\033[37m ${WE} \033[0m
|
||||
\033[36m Shell: \033[0m .......................\033[37m ${SHELL} \033[0m
|
||||
\033[36m Terminal: \033[0m ....................\033[37m ${TERMINAL} \033[0m
|
||||
\033[36m Fonts: \033[0m .......................\033[37m ${FONT} \033[0m
|
||||
"
|
||||
|
|
Loading…
Reference in New Issue