Maxim Likhachev 5 years ago
parent
commit
04c5489b10
  1. 4
      README.md
  2. 4
      dates
  3. 4
      git-aliases
  4. 11
      hidecursor
  5. 101
      retag
  6. 4
      spread
  7. 6
      sync-date
  8. 10
      use
  9. 4
      writeup
  10. 25
      www
  11. 2
      xstab

4
README.md

@ -35,6 +35,7 @@ will create the symbolic link for each script in the \<path> directory. @@ -35,6 +35,7 @@ will create the symbolic link for each script in the \<path> directory.
- [a2mp3](a2mp3) converts wav audio files to mp3 format.
- [axaudio](axaudio) gets an information and audio stream from Axia Livewire network.
- [retag](retag) writes id3 tags based on file path.
- [radio](radio) plays the internet radio stations from a list stored in the file.
- [vls](vls) runs vlc-ncurses with increased speed.
@ -72,6 +73,8 @@ will create the symbolic link for each script in the \<path> directory. @@ -72,6 +73,8 @@ will create the symbolic link for each script in the \<path> directory.
- [defgroups](defgroups) adds a user to default system groups.
- [passgen](passgen) creates the strong passwords.
- [sync-date](sync-date) sets system time according to Google.
- [use](use) shows Gentoo USE flag's description.
## Development tools
@ -97,6 +100,7 @@ will create the symbolic link for each script in the \<path> directory. @@ -97,6 +100,7 @@ will create the symbolic link for each script in the \<path> directory.
- [calculator](calculator) computes mathematical expressions with variables and intermediate values.
- [fix-eselect](fix-eselect) adjusts 'type' command in gentoo's eselect scripts.
- [hidecursor](hidecursor) moves cursor to upper right screen angle.
- [musca_status](musca_status) shows a list of all musca's workspaces.
- [poweroff-dialog](poweroff-dialog) and [asroot](asroot) provide a menu with 'shutdown', 'reboot' and 'suspend' commands.
- [windows](windows) shows a list of the all opened windows.

4
dates

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
#!/bin/bash
#Создан: Чт 06 Май 2010 02:44:00
#Изменён: Ср 28 авг 2013 19:58:49
#Изменён: Вс 23 фев 2020 13:27:43
# Скрипт напоминания о датах
#
@ -26,7 +26,7 @@ TODAY=$(\date +%s --date=$(\date '+%m/%d')) @@ -26,7 +26,7 @@ TODAY=$(\date +%s --date=$(\date '+%m/%d'))
FOUND=0
dates() {
echo "$greenБлижайшие даты:$rstc"
echo -e "${green}Ближайшие даты:${rstc}"
#Поиск дат в базе данных
for i in $(seq 0 $DAYS); do

4
git-aliases

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
#!/bin/bash
#Создан: чт 14 ноя 2019 14:03:43
#Изменён: чт 14 ноя 2019 17:34:38
#Изменён: Сб 29 фев 2020 02:48:48
# Список псевдонимов git
@ -23,7 +23,7 @@ rstc="\033[00m" @@ -23,7 +23,7 @@ rstc="\033[00m"
GITCONFIG=~/.gitconfig
GIT_ALIASES=$(git config --get-regexp 'alias.*' | sed 's/alias.//' | sed 's/ .*//')
GIT_ALIASES=$(git config --get-regexp 'alias.*' | sed 's/alias.//' | sed 's/ .*//' | sort)
while read -r alias; do
line=$(\grep -n -E "^\s*${alias}\s+" "$GITCONFIG")

11
hidecursor

@ -0,0 +1,11 @@ @@ -0,0 +1,11 @@
#!/bin/bash
#Создан: Чт 27 фев 2020 00:49:54
#Изменён: Чт 27 фев 2020 00:52:22
# Скрипт помещает курсор в правый верхний угол экрана
CURSOR_POSITION=$(xdpyinfo | awk '/dimensions:/ { gsub("x.*", " 0", $2); print $2 }')
eval xdotool mousemove "$CURSOR_POSITION"

101
retag

@ -0,0 +1,101 @@ @@ -0,0 +1,101 @@
#!/bin/bash
#Создан: Ср 19 фев 2020 21:59:29
#Изменён: Чт 20 фев 2020 00:45:38
# Requirements:
# - mid3v2 from media-libs/mutagen
rstc="\033[00m"
green="\033[1;32m"
yellow="\033[1;33m"
blue="\033[1;34m"
REGEXP=".*/(.*)/(.*) \[(.*)\]/(.*)/(.*?) - (.*)/(.*?) - (.*)\.([[:alnum:]]{3})$"
usage() {
echo "$(basename "$0") - simple mp3 tagger."
echo
echo "USAGE: $(basename "$0") [file] [options]"
echo
echo "The filenames should be in the format \"[...]/GENRE/ARTIST [COUNTRY]/TYPE/YEAR - ALBUM/TRACK - TITLE.FORMAT\""
echo
echo "Command line arguments:"
echo " -h --help - show this help"
echo " -v --verbose - show updating tags"
echo " -d --dry - run without tags saving"
}
tag_file() {
file="$1"
[[ $file =~ $REGEXP ]]
printf "${blue}%s[%02d/%02d] ${yellow}Tagging the file «%s»${rstc}\n" "$INDENT" "$((++CURRENT_TRACK))" "$TRACKS" "$file"
GENRE="${BASH_REMATCH[1]}"
ARTIST="${BASH_REMATCH[2]}"
YEAR="${BASH_REMATCH[5]}"
ALBUM="${BASH_REMATCH[6]}"
TRACK="${BASH_REMATCH[7]}"
TITLE="${BASH_REMATCH[8]}"
if [ -n "$VERBOSE" ]; then
printf "%s\t Genre: %s | Artist: %s |" "$INDENT" "$GENRE" "$ARTIST"
printf "Year: %s | Album: %s |" "$YEAR" "$ALBUM"
printf "Track: %s | Title: %s\n" "$TRACK" "$TITLE"
fi
if [ -z "$DRY_RUN" ]; then
mid3v2 --genre="$GENRE" --artist="$ARTIST" --year="$YEAR" \
--album="$ALBUM" --track="$TRACK" --song="$TITLE" \
"$file"
fi
}
tag_directory() {
TRACKS=$(find "$1" -name '*.mp3' -print | wc -l)
printf "${green}> %s/${rstc}\n" "$1"
INDENT=" "
find "$1" -name '*.mp3' | while read -r file; do tag_file "$file"; done
}
tag() {
if [[ -d "$1" ]]; then
tag_directory "$1"
elif [[ "$1" =~ \.mp3 ]]; then
tag_file "$1"
fi
}
if (( $# == 0 )); then
usage
exit 1
fi
QUEUE=()
while [[ $# -gt 0 ]]; do
key="$1"
case $key in
-h|--help) usage; exit 0; shift;;
-v|--verbose) VERBOSE=1; shift;;
-d|--dry) DRY_RUN=1; VERBOSE=1; shift;;
*) QUEUE+=("$1"); shift;;
esac
done
set -- "${QUEUE[@]}"
INDENT=
TRACKS="$#"
CURRENT_TRACK=0
for item in "${QUEUE[@]}"; do
tag "$(realpath "$item")"
done

4
spread

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
#!/bin/bash
#Создан: Пт 24 июн 2016 14:34:58
#Изменён: Пт 24 июн 2016 15:06:26
#Изменён: Пт 21 фев 2020 11:49:12
if [ ! -z $1 ]; then
DATA=$(cat "$@")
@ -12,5 +12,5 @@ fi @@ -12,5 +12,5 @@ fi
\rm -rf /tmp/*.speedreading
echo "$DATA" > /tmp/$$.speedreading
urxvtc -e bash -c "fsz 37 && tput clear && tput cup 7 && echo && speedread /tmp/$$.speedreading 2>/dev/null && read"
st -e bash -c "fsz 37 && tput clear && tput cup 7 && echo && speedread /tmp/$$.speedreading 2>/dev/null && read"

6
sync-date

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
#!/bin/bash
# (c) https://unix.stackexchange.com/a/251575
date -s "$(curl -s --head http://google.com | grep ^Date: | sed 's/Date: //')"

10
use

@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
#!/bin/bash
#Создан: Вт 25 фев 2020 18:24:10
#Изменён: Вт 25 фев 2020 18:30:29
# Show Gentoo USE flag description
curl -sq "https://packages.gentoo.org/useflags/${1?USAGE: $(basename "$0") [use flag]}" \
| awk '/class="lead"/{getline; gsub(/^[ \t]+/, "", $0); print}'

4
writeup

@ -3,14 +3,14 @@ @@ -3,14 +3,14 @@
write() {
# urxvtc -fn 'xft:TrixiePro:pixelsize=20' \
# -e bash -c "vim '+colorscheme $1' '+Goyo 60%' $2"
st -f 'TrixiePro:pixelsize=24' \
st -f 'TrixiePro:pixelsize=30' \
-e bash -c "nvim '+colorscheme $1' '+Goyo 60%' $2"
}
WRITE_DIR="$HOME/FILES/Docs/WRITE/"
WRITE_FILE=$(cd "$WRITE_DIR" && \ls -d */* | grep -v nohup.out | rofi -dmenu)
if [ -z "$WRITE_FILE"]; then
if [ -z "$WRITE_FILE" ]; then
WRITE_FILE="WIKI/$(\date +%Y-%m-%d).wiki"
fi

25
www

@ -1,38 +1,39 @@ @@ -1,38 +1,39 @@
#!/bin/bash
#Создан: Чт 23 июн 2016 13:14:17
#Изменён: Ср 04 апр 2018 19:38:58
#Изменён: Пн 17 фев 2020 17:54:01
# BROWSER=surf,vimprobable2,vimb,jumanji,chromium
BROWSER=min
BROWSER=firefox-bin
SEARCH="https://duckduckgo.com/?q="
#title:url
#?XXX? title:url
URLS="$SHELLRC/var/www/urls"
LINES=5
LINES=7
# URL="$(rofi -dmenu -hide-scrollbar -columns 8 -location 1 -width 100 -lines 10 -input $URLS)"
TITLES="$(awk '/\[/{print NR-1}' $URLS | paste -s -d ',')"
TITLES="$(awk '/\[/{print NR-1}' "$URLS" | paste -s -d ',')"
BADURLS="$(awk '/XXX/{print NR-1}' $URLS | paste -s -d ',')"
BADURLS="$(awk '/XXX/{print NR-1}' "$URLS" | paste -s -d ',')"
WEBSITE=$(cat $URLS \
WEBSITE=$(cat "$URLS" \
| cut -d ':' -f 1 \
| sed 's/XXX //' \
| rofi -dmenu -hide-scrollbar -i -columns 4 -location 1 -width 100 -lines $LINES -a $TITLES -u $BADURLS -p "web:")
| rofi -dmenu -hide-scrollbar -i -columns 3 -location 1 -width 100 -lines $LINES -a "$TITLES" -u "$BADURLS" -p "web:")
if [ ! -z "$WEBSITE" ]; then
URL="$(grep "${WEBSITE}:" $URLS | cut -d ':' -f 2-)"
if [ -n "$WEBSITE" ]; then
URL="$(grep "${WEBSITE}:" "$URLS" | cut -d ':' -f 2-)"
if [ ! -z "$URL" ]; then
if [ -n "$URL" ]; then
$BROWSER "$URL"
else
case $WEBSITE in
/*) $BROWSER "${WEBSITE/\/}" ;;
*) $BROWSER "$(echo $SEARCH$WEBSITE | tr ' ' '+')";;
/*) "$BROWSER" "${WEBSITE/\/}" ;;
*) "$BROWSER" "$(tr ' ' '+' <<<"${SEARCH}${WEBSITE}")";;
esac
fi
fi

2
xstab

@ -2,5 +2,5 @@ @@ -2,5 +2,5 @@
TERMINAL=st
nohup tabbed -r 2 -c -t '#bcbcbc' -T black -u '#999999' -U black "$TERMINAL" -w '' &
nohup tabbed -r 2 -c -t '#bcbcbc' -T black -u '#999999' -U black "$TERMINAL" -w '' </dev/null >/dev/null 2>&1 &

Loading…
Cancel
Save