diff --git a/.local/bin/scripts/aur b/.local/bin/scripts/aur index ebeef7b..08cca0a 100755 --- a/.local/bin/scripts/aur +++ b/.local/bin/scripts/aur @@ -1,3 +1,5 @@ #!/bin/sh +# Menu with AUR packages. + yay -Slq | fzf -m --preview 'yay -Si {1}' | yay -S - diff --git a/.local/bin/scripts/blaze b/.local/bin/scripts/blaze index 1cdb338..2417e0c 100755 --- a/.local/bin/scripts/blaze +++ b/.local/bin/scripts/blaze @@ -1,6 +1,6 @@ #!/usr/bin/env sh -# -# Blaze - record screen and audio + +# Script to record screen and audio. # Author - Cherrry9 deps() { @@ -150,7 +150,7 @@ done shift $((OPTIND -1)) # exit if blaze is running -[ -f /tmp/blaze-pid ] && { +[ -f /tmp/blaze-pid ] && { echo "Blaze is already running, exiting." notify-send "Blaze is already running, exiting." exit diff --git a/.local/bin/scripts/choosewall b/.local/bin/scripts/choosewall index 7c5a168..eae7091 100755 --- a/.local/bin/scripts/choosewall +++ b/.local/bin/scripts/choosewall @@ -1,9 +1,11 @@ #!/bin/sh +# Menu with wallpapers to set. + if [ "$(cat /etc/hostname)" = "pc" ]; then res="1920x1080" elif [ "$(cat /etc/hostname)" = "laptop" ]; then res="1366x768" fi -find ~/.config/wallpapers/"$res"/* | shuf | sxiv - -tb +find ~/.config/wallpapers/"$res"/* | shuf | sxiv - -tb diff --git a/.local/bin/scripts/dbar b/.local/bin/scripts/dbar index 3bc22c3..fd4701f 100755 --- a/.local/bin/scripts/dbar +++ b/.local/bin/scripts/dbar @@ -1,5 +1,7 @@ #!/bin/sh +# Run dwm bar with modules. + sym="|" echo "$$" > "$HOME/.cache/dbar.pid" @@ -22,7 +24,7 @@ EOF } while :; do - [ "$(transmission-remote -l 2>/dev/null | grep %)" ] && + [ "$(transmission-remote -l 2>/dev/null | grep %)" ] && delay="10s" || delay="1m" xsetroot -name " $(status | tr '\n' ' ')" diff --git a/.local/bin/scripts/eth-ip b/.local/bin/scripts/eth-ip index 4d97642..8817762 100755 --- a/.local/bin/scripts/eth-ip +++ b/.local/bin/scripts/eth-ip @@ -1,3 +1,5 @@ #!/bin/sh +# Local IP. + ip a show enp4s0 | grep -Eo '(inet)?*([0-9]*\.){3}[0-9]*' | grep -v '**\.255' diff --git a/.local/bin/scripts/fawesome b/.local/bin/scripts/fawesome index 5d4da95..332ad1c 100755 --- a/.local/bin/scripts/fawesome +++ b/.local/bin/scripts/fawesome @@ -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') diff --git a/.local/bin/scripts/fcfg b/.local/bin/scripts/fcfg index fbb8f32..9a78ac5 100755 --- a/.local/bin/scripts/fcfg +++ b/.local/bin/scripts/fcfg @@ -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" diff --git a/.local/bin/scripts/fm b/.local/bin/scripts/fm index 113b96d..1bc097a 100755 --- a/.local/bin/scripts/fm +++ b/.local/bin/scripts/fm @@ -1,3 +1,5 @@ #!/bin/sh +# File manager. + "$TERMINAL" -e vifm diff --git a/.local/bin/scripts/fscr b/.local/bin/scripts/fscr index b0d9f94..ab7b2f6 100755 --- a/.local/bin/scripts/fscr +++ b/.local/bin/scripts/fscr @@ -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" diff --git a/.local/bin/scripts/gethub b/.local/bin/scripts/gethub index b47ce32..374d6e4 100755 --- a/.local/bin/scripts/gethub +++ b/.local/bin/scripts/gethub @@ -1,10 +1,9 @@ #!/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; + s/github.com/raw.githubusercontent.com/g; s/blob//g ' | xargs -r wget diff --git a/.local/bin/scripts/legitlink b/.local/bin/scripts/legitlink index 8e1f83d..e9e5e08 100755 --- a/.local/bin/scripts/legitlink +++ b/.local/bin/scripts/legitlink @@ -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 "$@"; } @@ -10,7 +10,7 @@ url="$(m -p "Paste URL")" cursed_url="$(curl -s verylegit.link/sketchify -d long_url="$url")" -[ "$cursed_url" ] && { - echo "$cursed_url" | xclip -sel clip +[ "$cursed_url" ] && { + echo "$cursed_url" | xclip -sel clip notify-send "Cursed URL copied to clipboard." } || notify-send "Error! URL has not been copied to clipboard correctly!" diff --git a/.local/bin/scripts/linkhandler b/.local/bin/scripts/linkhandler index 4715939..d4a9f99 100755 --- a/.local/bin/scripts/linkhandler +++ b/.local/bin/scripts/linkhandler @@ -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; } diff --git a/.local/bin/scripts/lockscreen b/.local/bin/scripts/lockscreen index 9464619..9ea8ef2 100755 --- a/.local/bin/scripts/lockscreen +++ b/.local/bin/scripts/lockscreen @@ -1,5 +1,7 @@ #!/usr/bin/env sh +# Screen locker. + mkdir ~/.cache/lock/ f="$HOME/.cache/lock/lock.jpg" @@ -8,4 +10,4 @@ convert "$f" -blur 0x6 "$f" i3lock -i "$f" --composite --insidecolor=55443311 --ringcolor=99443300 --insidevercolor=55443311 --keyhlcolor=99999999 --indicator --veriftext= --wrongtext=! --radius 180 -b --separatorcolor=00000000 -rm "$f" +rm "$f" diff --git a/.local/bin/scripts/mails b/.local/bin/scripts/mails index 9f1f7f6..26745d2 100755 --- a/.local/bin/scripts/mails +++ b/.local/bin/scripts/mails @@ -1,3 +1,5 @@ #!/bin/sh +# Run email client. + st -e "neomutt" diff --git a/.local/bin/scripts/mounter b/.local/bin/scripts/mounter index f38d1cf..b7614f6 100755 --- a/.local/bin/scripts/mounter +++ b/.local/bin/scripts/mounter @@ -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 "$@" ;} diff --git a/.local/bin/scripts/pac b/.local/bin/scripts/pac index 0fd23f9..8c73822 100755 --- a/.local/bin/scripts/pac +++ b/.local/bin/scripts/pac @@ -1,5 +1,7 @@ #!/bin/sh +# Menu with official repository packages. + package="$(pacman -Slq | fzf -m --preview 'pacman -Si {1}')" [ ! "$package" ] && exit diff --git a/.local/bin/scripts/powermenu b/.local/bin/scripts/powermenu index f1231d3..5dede94 100755 --- a/.local/bin/scripts/powermenu +++ b/.local/bin/scripts/powermenu @@ -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 diff --git a/.local/bin/scripts/refbar b/.local/bin/scripts/refbar index b213274..0246aca 100755 --- a/.local/bin/scripts/refbar +++ b/.local/bin/scripts/refbar @@ -1,5 +1,7 @@ #!/bin/sh +# Refresh dwm bar. + [ "$1" = "-r" ] && pkill dbar && { dbar & exit; } [ ! "$(pgrep dbar)" ] && { dbar & exit; } diff --git a/.local/bin/scripts/rss b/.local/bin/scripts/rss index b2ca02d..d25b31b 100755 --- a/.local/bin/scripts/rss +++ b/.local/bin/scripts/rss @@ -1,3 +1,5 @@ #!/bin/sh +# Run RSS Feeder. + st -e "newsboat" diff --git a/.local/bin/scripts/rssadd b/.local/bin/scripts/rssadd index 2ce421b..28180c4 100755 --- a/.local/bin/scripts/rssadd +++ b/.local/bin/scripts/rssadd @@ -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" diff --git a/.local/bin/scripts/screenshot b/.local/bin/scripts/screenshot index 5d3a4b5..611b362 100755 --- a/.local/bin/scripts/screenshot +++ b/.local/bin/scripts/screenshot @@ -1,12 +1,14 @@ #!/usr/bin/env sh +# Screenshoter script. + m() { rofi -dmenu -width 200 -i -l "$@"; } mkdir -p ~/pix/Screenshots screen_path=~/pix/Screenshots/$(date +%G-%m-%d_%s).png screenshot() { - maim $type "$screen_path" && + maim $type "$screen_path" && notify-send -u low -t 1400 -i "$screen_path" "Screenshot created!" } @@ -24,6 +26,6 @@ time="$(printf "0.7\n5\n10\n15" | m 3 -p 'Delay')" sleep "$time" screenshot -[ "$save" = " Yes" ] && - xclip -sel clip /dev/null; sleep 0.5 +[ "$save" = " Yes" ] && + xclip -sel clip /dev/null; sleep 0.5 xclip -selection clipboard -t image/png "$screen_path" || exit diff --git a/.local/bin/scripts/setwall b/.local/bin/scripts/setwall index be13d6e..4c50be7 100755 --- a/.local/bin/scripts/setwall +++ b/.local/bin/scripts/setwall @@ -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 & - diff --git a/.local/bin/scripts/shelp b/.local/bin/scripts/shelp new file mode 100755 index 0000000..c0b5e1d --- /dev/null +++ b/.local/bin/scripts/shelp @@ -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" diff --git a/.local/bin/scripts/tgscreenkey b/.local/bin/scripts/tgscreenkey index 5a23e5e..02feca6 100755 --- a/.local/bin/scripts/tgscreenkey +++ b/.local/bin/scripts/tgscreenkey @@ -1,5 +1,7 @@ #!/bin/sh +# Toggle screenkey. + [ "$(pgrep screenkey)" ] && { killall screenkey && exit ;} screenkey -s small --bg-color "$(awk '/.*selbg.*/ { print $2 }' ~/.config/Xresources)" diff --git a/.local/bin/scripts/torradd b/.local/bin/scripts/torradd index 1badc7d..7174b3a 100755 --- a/.local/bin/scripts/torradd +++ b/.local/bin/scripts/torradd @@ -1,5 +1,7 @@ #!/bin/sh +# Add torrent to downloading queue. + pidof transmission-daemon >/dev/null || \ (transmission-daemon && notify-send "Starting transmission daemon...") diff --git a/.local/bin/scripts/torrdone b/.local/bin/scripts/torrdone index 4868c8e..2baa03b 100755 --- a/.local/bin/scripts/torrdone +++ b/.local/bin/scripts/torrdone @@ -1,3 +1,5 @@ #!/bin/sh +# Script to run after torrent downloading ends. + notify-send " Transmission" "$TR_TORRENT_NAME downloaded successfully!" diff --git a/.local/bin/scripts/tuirent b/.local/bin/scripts/tuirent index 89179db..05ea7b3 100755 --- a/.local/bin/scripts/tuirent +++ b/.local/bin/scripts/tuirent @@ -1,3 +1,5 @@ #!/bin/sh +# Run torrent client. + "$TERMINAL" -e tremc diff --git a/.local/bin/scripts/umounter b/.local/bin/scripts/umounter index 26f0641..e29100f 100755 --- a/.local/bin/scripts/umounter +++ b/.local/bin/scripts/umounter @@ -1,5 +1,7 @@ #!/bin/sh +# Umount partition menu. + data() { lsblk -r | awk '/t \// { print $1 " - " $7 }' ;} m() { rofi -dmenu -i "$@" ;} diff --git a/.local/bin/scripts/update b/.local/bin/scripts/update index 0df7e05..c362a80 100755 --- a/.local/bin/scripts/update +++ b/.local/bin/scripts/update @@ -1,11 +1,13 @@ #!/bin/sh +# Packages update. + action="$(printf " Update\n Show packages" | \ rofi -dmenu -i -p 'Updater' -l 2 -width 200)" [ ! "$action" ] && exit case "$action" in - " Update") + " Update") export PASS="$(printf | dmenu -P -p "Enter password: " -h 24)" [ ! "$PASS" ] && exit st -e sh -c "echo $PASS | sudo -S -v && clear; sudo pacman -Su --noconfirm" diff --git a/.local/bin/scripts/watchvid b/.local/bin/scripts/watchvid index 0ff4b18..5c90f0c 100755 --- a/.local/bin/scripts/watchvid +++ b/.local/bin/scripts/watchvid @@ -1,5 +1,7 @@ #!/bin/sh +# Stream video in mpv. + url="$(rofi -dmenu -i -p "Video URL" -width 800 -l 0)" mpv "$url" diff --git a/.local/bin/scripts/wifi-ip b/.local/bin/scripts/wifi-ip index 7f82461..0eec67b 100755 --- a/.local/bin/scripts/wifi-ip +++ b/.local/bin/scripts/wifi-ip @@ -1,3 +1,5 @@ #!/bin/sh +# Local IP. + ip a show wlp8s0 | grep -Eo '(inet)?*([0-9]*\.){3}[0-9]*' | grep -v '**\.255' diff --git a/.profile b/.profile index 9c1bbf6..7c83fce 100644 --- a/.profile +++ b/.profile @@ -1,13 +1,13 @@ #!/usr/bin/env bash -# -# ████ ██ ██ -# ██████ ░██░ ░░ ░██ -# ░██░░░██ ██████ ██████ ██████ ██ ░██ █████ +# +# ████ ██ ██ +# ██████ ░██░ ░░ ░██ +# ░██░░░██ ██████ ██████ ██████ ██ ░██ █████ # ░██ ░██░░██░░█ ██░░░░██░░░██░ ░██ ░██ ██░░░██ # ░██████ ░██ ░ ░██ ░██ ░██ ░██ ░██░███████ -# ░██░░░ ░██ ░██ ░██ ░██ ░██ ░██░██░░░░ +# ░██░░░ ░██ ░██ ░██ ░██ ░██ ░██░██░░░░ # ░██ ░███ ░░██████ ░██ ░██ ███░░██████ -# ░░ ░░░ ░░░░░░ ░░ ░░ ░░░ ░░░░░░ +# ░░ ░░░ ░░░░░░ ░░ ░░ ░░░ ░░░░░░ #~~~~~~~~~~~~~~ # Default Apps @@ -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)