Add 'shelp' script

Also add simple description comment to all script.
This commit is contained in:
samedami 2020-05-15 20:56:33 +02:00
parent 32cad7c15b
commit 9d56d3e272
No known key found for this signature in database
GPG Key ID: FCB4A9A20D00E894
32 changed files with 107 additions and 30 deletions

View File

@ -1,3 +1,5 @@
#!/bin/sh
# Menu with AUR packages.
yay -Slq | fzf -m --preview 'yay -Si {1}' | yay -S -

View File

@ -1,6 +1,6 @@
#!/usr/bin/env sh
#
# Blaze - record screen and audio
# Script to record screen and audio.
# Author - Cherrry9
deps() {

View File

@ -1,5 +1,7 @@
#!/bin/sh
# Menu with wallpapers to set.
if [ "$(cat /etc/hostname)" = "pc" ]; then
res="1920x1080"
elif [ "$(cat /etc/hostname)" = "laptop" ]; then

View File

@ -1,5 +1,7 @@
#!/bin/sh
# Run dwm bar with modules.
sym="|"
echo "$$" > "$HOME/.cache/dbar.pid"

View File

@ -1,3 +1,5 @@
#!/bin/sh
# Local IP.
ip a show enp4s0 | grep -Eo '(inet)?*([0-9]*\.){3}[0-9]*' | grep -v '**\.255'

View File

@ -1,5 +1,7 @@
#!/bin/sh
# Menu with FontAwesome chars.
xclip -h 2>/dev/null || exit
emoji=$(sed '0,/^__DATA__$/d' "$0" | rofi -dmenu -i -l 20 -p 'Font Awesome')

View File

@ -1,3 +1,5 @@
#!/bin/sh
# Menu with config files to edit in text editor.
find "$HOME"/.config/ -maxdepth 3 -type f | fzf --preview "cat {}" --height 25 --layout reverse | xargs -r "$EDITOR"

View File

@ -1,3 +1,5 @@
#!/bin/sh
# File manager.
"$TERMINAL" -e vifm

View File

@ -1,3 +1,5 @@
#!/bin/sh
# Menu with scripts to edit in editor.
find "$HOME"/.local/bin/scripts/ -type f | fzf --preview "cat {}" --height 25 --layout reverse | xargs -r "$EDITOR"

View File

@ -1,7 +1,6 @@
#!/bin/sh
# Autistic script for convert GitHub links into
# links to raw files and download it via wget.
# Autistic script for convert GitHub links to files and download it via wget.
echo "$1" | sed '
s/github.com/raw.githubusercontent.com/g;

View File

@ -1,7 +1,7 @@
#!/usr/bin/env sh
# Script to change links to sites into cursed links looks like this URL:
# 1337.verylegit.link/RkqaouwwADpPNkd653ip-stealer_.pdf.exe
# Script to change links to sites into cursed links.
# e.g: 1337.verylegit.link/RkqaouwwADpPNkd653ip-stealer_.pdf.exe
m() { rofi -dmenu -l 0 -width 50 "$@"; }

View File

@ -1,11 +1,6 @@
#!/bin/sh
# Author: Luke Smith
# Feed script a url or file location.
# If an image, it will view in sxiv,
# if a video or gif, it will view in mpv
# if a music file or pdf, it will download,
# otherwise it opens link in browser.
# Link handler.
# If no url given. Opens browser. For using script as $BROWSER.
[ -z "$1" ] && { "$BROWSER"; exit; }

View File

@ -1,5 +1,7 @@
#!/usr/bin/env sh
# Screen locker.
mkdir ~/.cache/lock/
f="$HOME/.cache/lock/lock.jpg"

View File

@ -1,3 +1,5 @@
#!/bin/sh
# Run email client.
st -e "neomutt"

View File

@ -1,5 +1,7 @@
#!/bin/sh
# Mount partition menu.
data() { lsblk -r | sed '/.*k $/d; /t \//d; 1d' | awk '{ print $1 " - " $4 }' ;}
[ ! "$(data)" ] && { rofi -e "Nothing to mount!"; exit 1 ;}
m() { rofi -dmenu -i "$@" ;}

View File

@ -1,5 +1,7 @@
#!/bin/sh
# Menu with official repository packages.
package="$(pacman -Slq | fzf -m --preview 'pacman -Si {1}')"
[ ! "$package" ] && exit

View File

@ -1,5 +1,7 @@
#!/usr/bin/env sh
# Power menu.
WHAT="$(printf " Shutdown\n Reboot\n Lock\n Suspend" | rofi -dmenu -i -p 'Powermenu' -l 4 -width 10px)"
if [ -z "$WHAT" ]; then exit; fi

View File

@ -1,5 +1,7 @@
#!/bin/sh
# Refresh dwm bar.
[ "$1" = "-r" ] && pkill dbar && { dbar & exit; }
[ ! "$(pgrep dbar)" ] && { dbar & exit; }

View File

@ -1,3 +1,5 @@
#!/bin/sh
# Run RSS Feeder.
st -e "newsboat"

View File

@ -1,5 +1,7 @@
#!/bin/sh
# Add RSS to collection.
! echo "$1" | grep "https*://\S\+\.[A-Za-z]\+\S*" >/dev/null &&
notify-send "That doesn't look like a full URL." && exit
RSSFILE="${XDG_CONFIG_HOME:-$HOME/.config}/newsboat/urls"

View File

@ -1,5 +1,7 @@
#!/usr/bin/env sh
# Screenshoter script.
m() { rofi -dmenu -width 200 -i -l "$@"; }
mkdir -p ~/pix/Screenshots

View File

@ -1,5 +1,7 @@
#!/bin/sh
# Set desktop background.
[ "$1" ] && { xwallpaper --maximize "$1" && exit 1; }
if [ "$(cat /etc/hostname)" = "pc" ]; then
@ -9,4 +11,3 @@ elif [ "$(cat /etc/hostname)" = "laptop" ]; then
fi
xwallpaper --maximize /home/samedamci/.config/wallpapers/"$res"/wall1.png &

27
.local/bin/scripts/shelp Executable file
View File

@ -0,0 +1,27 @@
#!/bin/sh
# Menu with all scripts and descriptions.
mess=\
" _ _ _ ___ _ __ _
_| || |_| | / / |__ (_)_ __ / /__| |__
|_ .. _| | / /| '_ \| | '_ \ / / __| '_ \ \r
|_ _|_|/ / | |_) | | | | |/ /\__ \ | | |
|_||_| (_)_/ |_.__/|_|_| |_/_/ |___/_| |_|
cat << EOF
\ /\ \r
) ( ')
( / )
\(__)|
EOF
"
head -n 3 $(find "$HOME"/.local/bin/scripts -maxdepth 1 -type f) |
sed 's/==> //g; s/<==//g; s/#!\/.*//g; /^$/d; s/# //g; s/.*\///g' |
awk '{printf (NR%2==0) ? "\t" $0 "\n" : $0}' | sort -r |
column -t -s $'\t' -o $'\t\t' |
fzf --preview "printf \"$mess\"" --preview-window=up:15 |
awk '{ print $1 }' | xargs -r "$EDITOR"

View File

@ -1,5 +1,7 @@
#!/bin/sh
# Toggle screenkey.
[ "$(pgrep screenkey)" ] && { killall screenkey && exit ;}
screenkey -s small --bg-color "$(awk '/.*selbg.*/ { print $2 }' ~/.config/Xresources)"

View File

@ -1,5 +1,7 @@
#!/bin/sh
# Add torrent to downloading queue.
pidof transmission-daemon >/dev/null || \
(transmission-daemon && notify-send "Starting transmission daemon...")

View File

@ -1,3 +1,5 @@
#!/bin/sh
# Script to run after torrent downloading ends.
notify-send " Transmission" "$TR_TORRENT_NAME downloaded successfully!"

View File

@ -1,3 +1,5 @@
#!/bin/sh
# Run torrent client.
"$TERMINAL" -e tremc

View File

@ -1,5 +1,7 @@
#!/bin/sh
# Umount partition menu.
data() { lsblk -r | awk '/t \// { print $1 " - " $7 }' ;}
m() { rofi -dmenu -i "$@" ;}

View File

@ -1,5 +1,7 @@
#!/bin/sh
# Packages update.
action="$(printf " Update\n Show packages" | \
rofi -dmenu -i -p 'Updater' -l 2 -width 200)"
[ ! "$action" ] && exit

View File

@ -1,5 +1,7 @@
#!/bin/sh
# Stream video in mpv.
url="$(rofi -dmenu -i -p "Video URL" -width 800 -l 0)"
mpv "$url"

View File

@ -1,3 +1,5 @@
#!/bin/sh
# Local IP.
ip a show wlp8s0 | grep -Eo '(inet)?*([0-9]*\.){3}[0-9]*' | grep -v '**\.255'

View File

@ -36,6 +36,11 @@ export PATH="$PATH:$HOME/.local/bin/:$HOME/.local/bin/scripts/:$NPM_PACKAGES:$GO
export LS_COLORS="no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=00;93:do=00;93:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=1;34:st=37;44:ex=01;32:*.tar=01;36:*.tgz=01;36:*.svgz=00;93:*.arj=01;36:*.taz=01;36:*.lzh=01;36:*.lzma=01;36:*.zip=01;36:*.z=01;36:*.Z=01;36:*.dz=01;36:*.gz=01;36:*.bz2=01;36:*.tbz2=01;36:*.bz=01;36:*.tz=01;36:*.deb=01;36:*.rpm=01;36:*.jar=01;36:*.rar=01;36:*.ace=01;36:*.zoo=01;36:*.cpio=01;36:*.7z=01;36:*.rz=01;36:*.jpg=00;93:*.jpeg=00;93:*.gif=00;93:*.bmp=00;93:*.pbm=00;93:*.pgm=00;93:*.ppm=00;93:*.tga=00;93:*.xbm=00;93:*.xpm=00;93:*.tif=00;93:*.tiff=00;93:*.png=00;93:*.mng=00;93:*.pcx=00;93:*.mov=00;93:*.mpg=00;93:*.mpeg=00;93:*.m2v=00;93:*.mkv=00;93:*.ogm=00;93:*.mp4=00;93:*.m4v=00;93:*.mp4v=00;93:*.vob=00;93:*.qt=00;93:*.nuv=00;93:*.wmv=00;93:*.asf=00;93:*.rm=00;93:*.rmvb=00;93:*.flc=00;93:*.avi=00;93:*.fli=00;93:*.gl=00;93:*.dl=00;93:*.xcf=00;93:*.xwd=00;93:*.yuv=00;93:*.svg=00;93:*.aac=00;36:*.au=00;36:*.flac=00;35:*.mid=00;35:*.midi=00;35:*.mka=00;35:*.mp3=00;35:*.mpc=00;35:*.ogg=00;35:*.ra=00;35:*.wav=00;35:*.opus=00;35:"
export FZF_DEFAULT_OPTS='
--color fg:242,bg:233,hl:65,fg+:15,bg+:234,hl+:108
--color info:108,prompt:109,spinner:108,pointer:168,marker:168
'
export _JAVA_AWT_WM_NONREPARENTING=1
export GPG_TTY=$(tty)