parent
ac77586a15
commit
1faeefffd7
@ -0,0 +1,9 @@
|
||||
[submodule "zsh-autosuggestions"]
|
||||
path = config/zsh/zsh-autosuggestions
|
||||
url = https://github.com/zsh-users/zsh-autosuggestions
|
||||
[submodule "zsh-history-substring-search"]
|
||||
path = config/zsh/zsh-history-substring-search
|
||||
url = https://github.com/zsh-users/zsh-history-substring-search
|
||||
[submodule "zsh-syntax-highlighting"]
|
||||
path = config/zsh/zsh-syntax-highlighting
|
||||
url = https://github.com/zsh-users/zsh-syntax-highlighting
|
@ -1,3 +1,7 @@
|
||||
# SelimovDE
|
||||
|
||||
"Desktop Environment" repo which provides basic scripts for building out my linux system
|
||||
|
||||
## Installation
|
||||
|
||||
|
||||
|
@ -0,0 +1,46 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Requires ffmpeg (audio splitting) and my `tag` wrapper script.
|
||||
|
||||
[ ! -f "$2" ] && printf "The first file should be the audio, the second should be the timecodes.\\n" && exit
|
||||
|
||||
echo "Enter the album/book title:"; read -r booktitle
|
||||
|
||||
echo "Enter the artist/author:"; read -r author
|
||||
|
||||
echo "Enter the publication year:"; read -r year
|
||||
|
||||
inputaudio="$1"
|
||||
|
||||
# Get a safe file name from the book.
|
||||
escbook="$(echo "$booktitle" | iconv -cf UTF-8 -t ASCII//TRANSLIT | tr -d '[:punct:]' | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | sed "s/-\+/-/g;s/\(^-\|-\$\)//g")"
|
||||
|
||||
! mkdir -p "$escbook" && echo "Do you have write access in this directory?" && exit 1
|
||||
|
||||
# As long as the extension is in the tag script, it'll work.
|
||||
ext="${1##*.}"
|
||||
#ext="${1#*.}"
|
||||
|
||||
# Get the total number of tracks from the number of lines.
|
||||
total="$(wc -l < "$2")"
|
||||
|
||||
while read -r x;
|
||||
do
|
||||
end="$(echo "$x" | cut -d' ' -f1)"
|
||||
|
||||
[ -n "$start" ] &&
|
||||
echo "From $start to $end; $track $title"
|
||||
file="$escbook/$(printf "%.2d" "$track")-$esctitle.$ext"
|
||||
[ -n "$start" ] && echo "Splitting \"$title\"..." &&
|
||||
ffmpeg -nostdin -y -loglevel -8 -i "$inputaudio" -ss "$start" -to "$end" -vn -c copy "$file" &&
|
||||
echo "Tagging \"$title\"..." && tag -a "$author" -A "$booktitle" -t "$title" -n "$track" -N "$total" -d "$year" "$file"
|
||||
title="$(echo "$x" | cut -d' ' -f 2-)"
|
||||
esctitle="$(echo "$title" | iconv -cf UTF-8 -t ASCII//TRANSLIT | tr -d '[:punct:]' | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | sed "s/-\+/-/g;s/\(^-\|-\$\)//g")"
|
||||
track="$((track+1))"
|
||||
start="$end"
|
||||
done < "$2"
|
||||
# The last track must be done outside the loop.
|
||||
echo "From $start to the end: $title"
|
||||
file="$escbook/$(printf "%.2d" "$track")-$esctitle.$ext"
|
||||
echo "Splitting \"$title\"..." && ffmpeg -nostdin -y -loglevel -8 -i "$inputaudio" -ss "$start" -vn -c copy "$file" &&
|
||||
echo "Tagging \"$title\"..." && tag -a "$author" -A "$booktitle" -t "$title" -n "$track" -N "$total" -d "$year" "$file"
|
@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
loads=($(mpstat -P ALL 1 1 | awk '/Average:/ && $2 ~ /[0-9]/ {print $3}'))
|
||||
|
||||
warn=''
|
||||
if [ ${loads[0]} -gt 80 ]; then
|
||||
warn=$(echo "1 "$warn)
|
||||
fi
|
||||
if [ ${loads[1]} -gt 80 ]; then
|
||||
warn=$(echo "2 "$warn)
|
||||
fi
|
||||
if [ ${loads[2]} -gt 80 ]; then
|
||||
warn=$(echo "3 "$warn)
|
||||
fi
|
||||
if [ ${loads[3]} -gt 80 ]; then
|
||||
warn=$(echo "4 "$warn)
|
||||
fi
|
||||
avg=$(echo "(${loads[0]}+${loads[1]}+${loads[2]}+${loads[3]})/4" | bc)
|
||||
echo $warn $avg%
|
@ -0,0 +1 @@
|
||||
echo " $(date '+%b %d (%a) %I:%M%p') "
|
@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Define the input file
|
||||
input_file="$HOME/docs/kjv.txt"
|
||||
|
||||
# Generate a unique identifier based on the current date
|
||||
date=$( date +%Y%m%d )
|
||||
|
||||
# Generate random data with a seed
|
||||
get_seeded_random()
|
||||
{
|
||||
seed="$1"
|
||||
openssl enc -aes-256-ctr -pass pass:"$seed" -nosalt \
|
||||
</dev/zero 2>/dev/null
|
||||
}
|
||||
|
||||
random_line=$(shuf -n 1 --random-source=<(get_seeded_random "$date") $input_file)
|
||||
|
||||
# Print the randomly selected line
|
||||
echo "$random_line"
|
@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
# notify when mpd music changed
|
||||
while "true"; do
|
||||
status="`mpc status`"
|
||||
if [[ ${status} == *"[playing]"* ]]; then
|
||||
dunstify -a Music --replace=27072 -t 2000 -i "$HOME/media/pics/music.png" "Now Playing:" "Artist: $(mpc --format '%artist%' current)\nSong: $(mpc --format '%title%' current)"
|
||||
fi
|
||||
mpc current --wait > /dev/null
|
||||
done
|
||||
|
@ -0,0 +1,326 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# notify-send.sh - drop-in replacement for notify-send with more features
|
||||
# Copyright (C) 2015-2021 notify-send.sh authors (see AUTHORS file)
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Desktop Notifications Specification
|
||||
# https://developer.gnome.org/notification-spec/
|
||||
|
||||
VERSION=1.2
|
||||
NOTIFY_ARGS=(--session
|
||||
--dest org.freedesktop.Notifications
|
||||
--object-path /org/freedesktop/Notifications)
|
||||
EXPIRE_TIME=-1
|
||||
APP_NAME="${0##*/}"
|
||||
REPLACE_ID=0
|
||||
URGENCY=1
|
||||
HINTS=()
|
||||
SUMMARY_SET=n
|
||||
|
||||
help() {
|
||||
cat <<EOF
|
||||
Usage:
|
||||
notify-send.sh [OPTION...] <SUMMARY> [BODY] - create a notification
|
||||
|
||||
Help Options:
|
||||
-?|--help Show help options
|
||||
|
||||
Application Options:
|
||||
-u, --urgency=LEVEL Specifies the urgency level (low, normal, critical).
|
||||
-t, --expire-time=TIME Specifies the timeout in milliseconds at which to expire the notification.
|
||||
-f, --force-expire Forcefully closes the notification when the notification has expired.
|
||||
-a, --app-name=APP_NAME Specifies the app name for the icon.
|
||||
-i, --icon=ICON[,ICON...] Specifies an icon filename or stock icon to display.
|
||||
-c, --category=TYPE[,TYPE...] Specifies the notification category.
|
||||
-h, --hint=TYPE:NAME:VALUE Specifies basic extra data to pass. Valid types are int, double, string and byte.
|
||||
-o, --action=LABEL:COMMAND Specifies an action. Can be passed multiple times. LABEL is usually a button's label. COMMAND is a shell command executed when action is invoked.
|
||||
-d, --default-action=COMMAND Specifies the default action which is usually invoked by clicking the notification.
|
||||
-l, --close-action=COMMAND Specifies the action invoked when notification is closed.
|
||||
-p, --print-id Print the notification ID to the standard output.
|
||||
-r, --replace=ID Replace existing notification.
|
||||
-R, --replace-file=FILE Store and load notification replace ID to/from this file.
|
||||
-s, --close=ID Close notification.
|
||||
-v, --version Version of the package.
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
convert_type() {
|
||||
case "$1" in
|
||||
int) echo int32 ;;
|
||||
double|string|byte) echo "$1" ;;
|
||||
*) echo error; return 1 ;;
|
||||
esac
|
||||
}
|
||||
|
||||
make_action_key() {
|
||||
echo "$(tr -dc _A-Z-a-z-0-9 <<< \"$1\")${RANDOM}"
|
||||
}
|
||||
|
||||
make_action() {
|
||||
local action_key="$1"
|
||||
printf -v text "%q" "$2"
|
||||
echo "\"$action_key\", \"$text\""
|
||||
}
|
||||
|
||||
make_hint() {
|
||||
type=$(convert_type "$1")
|
||||
[[ ! $? = 0 ]] && return 1
|
||||
name="$2"
|
||||
[[ "$type" = string ]] && command="\"$3\"" || command="$3"
|
||||
echo "\"$name\": <$type $command>"
|
||||
}
|
||||
|
||||
concat_actions() {
|
||||
local result="$1"
|
||||
shift
|
||||
for s in "$@"; do
|
||||
result="$result, $s"
|
||||
done
|
||||
echo "[$result]"
|
||||
}
|
||||
|
||||
concat_hints() {
|
||||
local result="$1"
|
||||
shift
|
||||
for s in "$@"; do
|
||||
result="$result, $s"
|
||||
done
|
||||
echo "{$result}"
|
||||
}
|
||||
|
||||
parse_notification_id(){
|
||||
sed 's/(uint32 \([0-9]\+\),)/\1/g'
|
||||
}
|
||||
|
||||
notify() {
|
||||
local actions="$(concat_actions "${ACTIONS[@]}")"
|
||||
local hints="$(concat_hints "${HINTS[@]}")"
|
||||
|
||||
NOTIFICATION_ID=$(gdbus call "${NOTIFY_ARGS[@]}" \
|
||||
--method org.freedesktop.Notifications.Notify \
|
||||
-- \
|
||||
"$APP_NAME" "$REPLACE_ID" "$ICON" "$SUMMARY" "$BODY" \
|
||||
"${actions}" "${hints}" "int32 $EXPIRE_TIME" \
|
||||
| parse_notification_id)
|
||||
|
||||
if [[ -n "$STORE_ID" ]] ; then
|
||||
echo "$NOTIFICATION_ID" > "$STORE_ID"
|
||||
fi
|
||||
if [[ -n "$PRINT_ID" ]] ; then
|
||||
echo "$NOTIFICATION_ID"
|
||||
fi
|
||||
|
||||
if [[ -n "$FORCE_EXPIRE" ]] ; then
|
||||
SLEEP_TIME="$( LC_NUMERIC=C printf %f "${EXPIRE_TIME}e-3" )"
|
||||
( sleep "$SLEEP_TIME" ; notify_close "$NOTIFICATION_ID" ) &
|
||||
fi
|
||||
|
||||
maybe_run_action_handler
|
||||
}
|
||||
|
||||
notify_close () {
|
||||
gdbus call "${NOTIFY_ARGS[@]}" --method org.freedesktop.Notifications.CloseNotification "$1" >/dev/null
|
||||
}
|
||||
|
||||
process_urgency() {
|
||||
case "$1" in
|
||||
low) URGENCY=0 ;;
|
||||
normal) URGENCY=1 ;;
|
||||
critical) URGENCY=2 ;;
|
||||
*) echo "Unknown urgency $URGENCY specified. Known urgency levels: low, normal, critical."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
process_category() {
|
||||
IFS=, read -a categories <<< "$1"
|
||||
for category in "${categories[@]}"; do
|
||||
hint="$(make_hint string category "$category")"
|
||||
HINTS=("${HINTS[@]}" "$hint")
|
||||
done
|
||||
}
|
||||
|
||||
process_hint() {
|
||||
IFS=: read type name command <<< "$1"
|
||||
if [[ -z "$name" ]] || [[ -z "$command" ]] ; then
|
||||
echo "Invalid hint syntax specified. Use TYPE:NAME:VALUE."
|
||||
exit 1
|
||||
fi
|
||||
hint="$(make_hint "$type" "$name" "$command")"
|
||||
if [[ ! $? = 0 ]] ; then
|
||||
echo "Invalid hint type \"$type\". Valid types are int, double, string and byte."
|
||||
exit 1
|
||||
fi
|
||||
HINTS=("${HINTS[@]}" "$hint")
|
||||
}
|
||||
|
||||
maybe_run_action_handler() {
|
||||
if [[ -n "$NOTIFICATION_ID" ]] && [[ -n "$ACTION_COMMANDS" ]]; then
|
||||
local notify_action="$(dirname ${BASH_SOURCE[0]})/notify-action.sh"
|
||||
if [[ -x "$notify_action" ]] ; then
|
||||
"$notify_action" "$NOTIFICATION_ID" "${ACTION_COMMANDS[@]}" &
|
||||
exit 0
|
||||
else
|
||||
echo "executable file not found: $notify_action"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
process_action() {
|
||||
IFS=: read name command <<<"$1"
|
||||
if [[ -z "$name" ]] || [[ -z "$command" ]]; then
|
||||
echo "Invalid action syntax specified. Use NAME:COMMAND."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
local action_key="$(make_action_key "$name")"
|
||||
ACTION_COMMANDS=("${ACTION_COMMANDS[@]}" "$action_key" "$command")
|
||||
|
||||
local action="$(make_action "$action_key" "$name")"
|
||||
ACTIONS=("${ACTIONS[@]}" "$action")
|
||||
}
|
||||
|
||||
process_special_action() {
|
||||
action_key="$1"
|
||||
command="$2"
|
||||
|
||||
if [[ -z "$action_key" ]] || [[ -z "$command" ]]; then
|
||||
echo "Command must not be empty"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ACTION_COMMANDS=("${ACTION_COMMANDS[@]}" "$action_key" "$command")
|
||||
|
||||
if [[ "$action_key" != close ]]; then
|
||||
local action="$(make_action "$action_key" "$name")"
|
||||
ACTIONS=("${ACTIONS[@]}" "$action")
|
||||
fi
|
||||
}
|
||||
|
||||
process_posargs() {
|
||||
if [[ "$1" = -* ]] && ! [[ "$positional" = yes ]] ; then
|
||||
echo "Unknown option $1"
|
||||
exit 1
|
||||
else
|
||||
if [[ "$SUMMARY_SET" = n ]]; then
|
||||
SUMMARY="$1"
|
||||
SUMMARY_SET=y
|
||||
else
|
||||
BODY="$1"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
while (( $# > 0 )) ; do
|
||||
case "$1" in
|
||||
-\?|--help)
|
||||
help
|
||||
exit 0
|
||||
;;
|
||||
-v|--version)
|
||||
echo "${0##*/} $VERSION"
|
||||
exit 0
|
||||
;;
|
||||
-u|--urgency|--urgency=*)
|
||||
[[ "$1" = --urgency=* ]] && urgency="${1#*=}" || { shift; urgency="$1"; }
|
||||
process_urgency "$urgency"
|
||||
;;
|
||||
-t|--expire-time|--expire-time=*)
|
||||
[[ "$1" = --expire-time=* ]] && EXPIRE_TIME="${1#*=}" || { shift; EXPIRE_TIME="$1"; }
|
||||
if ! [[ "$EXPIRE_TIME" =~ ^-?[0-9]+$ ]]; then
|
||||
echo "Invalid expire time: ${EXPIRE_TIME}"
|
||||
exit 1;
|
||||
fi
|
||||
;;
|
||||
-f|--force-expire)
|
||||
FORCE_EXPIRE=yes
|
||||
;;
|
||||
-a|--app-name|--app-name=*)
|
||||
[[ "$1" = --app-name=* ]] && APP_NAME="${1#*=}" || { shift; APP_NAME="$1"; }
|
||||
;;
|
||||
-i|--icon|--icon=*)
|
||||
[[ "$1" = --icon=* ]] && ICON="${1#*=}" || { shift; ICON="$1"; }
|
||||
;;
|
||||
-c|--category|--category=*)
|
||||
[[ "$1" = --category=* ]] && category="${1#*=}" || { shift; category="$1"; }
|
||||
process_category "$category"
|
||||
;;
|
||||
-h|--hint|--hint=*)
|
||||
[[ "$1" = --hint=* ]] && hint="${1#*=}" || { shift; hint="$1"; }
|
||||
process_hint "$hint"
|
||||
;;
|
||||
-o | --action | --action=*)
|
||||
[[ "$1" == --action=* ]] && action="${1#*=}" || { shift; action="$1"; }
|
||||
process_action "$action"
|
||||
;;
|
||||
-d | --default-action | --default-action=*)
|
||||
[[ "$1" == --default-action=* ]] && default_action="${1#*=}" || { shift; default_action="$1"; }
|
||||
process_special_action default "$default_action"
|
||||
;;
|
||||
-l | --close-action | --close-action=*)
|
||||
[[ "$1" == --close-action=* ]] && close_action="${1#*=}" || { shift; close_action="$1"; }
|
||||
process_special_action close "$close_action"
|
||||
;;
|
||||
-p|--print-id)
|
||||
PRINT_ID=yes
|
||||
;;
|
||||
-r|--replace|--replace=*)
|
||||
[[ "$1" = --replace=* ]] && REPLACE_ID="${1#*=}" || { shift; REPLACE_ID="$1"; }
|
||||
;;
|
||||
-R|--replace-file|--replace-file=*)
|
||||
[[ "$1" = --replace-file=* ]] && filename="${1#*=}" || { shift; filename="$1"; }
|
||||
if [[ -s "$filename" ]]; then
|
||||
REPLACE_ID="$(< "$filename")"
|
||||
fi
|
||||
STORE_ID="$filename"
|
||||
;;
|
||||
-s|--close|--close=*)
|
||||
[[ "$1" = --close=* ]] && close_id="${1#*=}" || { shift; close_id="$1"; }
|
||||
# always check that --close provides a numeric value
|
||||
if [[ -z "$close_id" || ! "$close_id" =~ ^[0-9]+$ ]]; then
|
||||
echo "Invalid close id: '$close_id'"
|
||||
exit 1
|
||||
fi
|
||||
notify_close "$close_id"
|
||||
exit $?
|
||||
;;
|
||||
--)
|
||||
positional=yes
|
||||
;;
|
||||
*)
|
||||
process_posargs "$1"
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
# always force --replace and --replace-file to provide a numeric value; 0 means no id provided
|
||||
if [[ -z "$REPLACE_ID" || ! "$REPLACE_ID" =~ ^[0-9]+$ ]]; then
|
||||
REPLACE_ID=0
|
||||
fi
|
||||
|
||||
# urgency is always set
|
||||
HINTS=("$(make_hint byte urgency "$URGENCY")" "${HINTS[@]}")
|
||||
|
||||
if [[ "$SUMMARY_SET" = n ]] ; then
|
||||
help
|
||||
exit 1
|
||||
else
|
||||
notify
|
||||
fi
|
@ -0,0 +1 @@
|
||||
/home/aselimov/projects/utility/scripts/pubs-rofi.sh
|
@ -0,0 +1,46 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Feed script a url.
|
||||
# If an image, it will view in feh,
|
||||
# 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.
|
||||
|
||||
# List of sites that will be opened in mpv.
|
||||
vidsites="youtube.com
|
||||
\|youtu.be
|
||||
\|hooktube.com
|
||||
\|bitchute.com
|
||||
\|lukesmith.xyz
|
||||
\|odysee.com
|
||||
\|rumble.com
|
||||
"
|
||||
if [ -p /dev/stdin ]; then
|
||||
read url
|
||||
else
|
||||
url=$1
|
||||
fi
|
||||
echo $url
|
||||
ext="${url##*.}"
|
||||
mpvFiles="ogg mkv mp4 gif mp3 mp3?source=feed"
|
||||
sxivFiles="png jpg jpeg jpe"
|
||||
mpvAdd="mp3?updated=*"
|
||||
wgetFiles="mp3 flac opus mp3?source=feed pdf"
|
||||
|
||||
if echo $sxivFiles | grep -w $ext > /dev/null; then
|
||||
view_url_image "$url" >/dev/null &
|
||||
elif echo $mpvFiles | grep -w $ext > /dev/null; then
|
||||
mpv --audio-display=no --loop "$url"
|
||||
elif echo $wgetFiles | grep -w $ext > /dev/null; then
|
||||
wget "$url" >/dev/null &
|
||||
elif echo "$url" | grep "$vidsites">/dev/null; then
|
||||
mpv "$url" > /dev/null &
|
||||
elif echo "$url" | grep "$mpvAdd" > /dev/null; then
|
||||
mpv --audio-display=no --loop "$url"
|
||||
elif echo "$url" | grep "doi.org" > /dev/null; then
|
||||
view_doc $url
|
||||
elif echo "$url" | grep "mp3" > /dev/null; then
|
||||
mpv --audio-display=no --loop "$url"
|
||||
else
|
||||
$BROWSER "$url" 2>/dev/null & disown
|
||||
fi
|
@ -0,0 +1,70 @@
|
||||
#!/bin/bash
|
||||
|
||||
# You can call this script like this:
|
||||
# $./volume.sh up
|
||||
# $./volume.sh down
|
||||
# $./volume.sh mute
|
||||
|
||||
function get_volume {
|
||||
pamixer --get-volume
|
||||
}
|
||||
|
||||
function is_mute {
|
||||
[ $(pamixer --get-mute) = 'true']
|
||||
}
|
||||
|
||||
function send_notification {
|
||||
DIR=$(dirname "$0")
|
||||
volume=$(get_volume)
|
||||
# Make the bar with the special character ─ (it's not dash -)
|
||||
# https://en.wikipedia.org/wiki/Box-drawing_character
|
||||
#bar=$(seq -s "─" $(($volume/5)) | sed 's/[0-9]//g')
|
||||
if [ "$volume" = "0" ]; then
|
||||
icon_name="/usr/share/icons/Papirus/48x48/status/notification-audio-volume-muted.svg"
|
||||
$DIR/notify-send.sh "$volume"" " -i "$icon_name" -t 2000 -h string:synchronous:"─" --replace=555
|
||||
else
|
||||
if [ "$volume" -lt "10" ]; then
|
||||
icon_name="/usr/share/icons/Papirus/48x48/status/notification-audio-volume-low.svg"
|
||||
$DIR/notify-send.sh "$volume"" " -i "$icon_name" --replace=555 -t 2000
|
||||
else
|
||||
if [ "$volume" -lt "30" ]; then
|
||||
icon_name="/usr/share/icons/Papirus/48x48/status/notification-audio-volume-low.svg"
|
||||
else
|
||||
if [ "$volume" -lt "70" ]; then
|
||||
icon_name="/usr/share/icons/Papirus/48x48/status/notification-audio-volume-medium.svg"
|
||||
else
|
||||
icon_name="/usr/share/icons/Papirus/48x48/status/notification-audio-volume-high.svg"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
bar=$(seq -s "─" $(($volume / 5)) | sed 's/[0-9]//g')
|
||||
# Send the notification
|
||||
$DIR/notify-send.sh "$volume%"" ""$bar" -i "$icon_name" -t 2000 -h string:synchronous:"$bar" --replace=555
|
||||
|
||||
}
|
||||
|
||||
case $1 in
|
||||
up)
|
||||
# Set the volume on (if it was muted)
|
||||
#amixer -D pulse set Master on > /dev/null
|
||||
# Up the volume (+ 5%)
|
||||
pactl set-sink-volume @DEFAULT_SINK@ +5%
|
||||
send_notification
|
||||
;;
|
||||
down)
|
||||
#amixer -D pulse set Master on > /dev/null
|
||||
pactl set-sink-volume @DEFAULT_SINK@ -5%
|
||||
send_notification
|
||||
;;
|
||||
mute)
|
||||
# Toggle mute
|
||||
#amixer -D pulse set Master 1+ toggle > /dev/null
|
||||
if is_mute; then
|
||||
DIR=$(dirname "$0")
|
||||
$DIR/notify-send.sh -i "/usr/share/icons/Papirus/48x48/status/notification-audio-volume-muted.svg" --replace=555 -u normal "Mute" -t 2000
|
||||
else
|
||||
send_notification
|
||||
fi
|
||||
;;
|
||||
esac
|
@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
|
||||
papesdir=$HOME/media/wallpapers/current_rotation
|
||||
|
||||
# Kill existing execution if it exists
|
||||
pgrep -fl wallpaper_randomizer.sh | while read -r line; do
|
||||
pid=$(echo $line | cut -d " " -f1)
|
||||
process=$(echo $line | cut -d " " -f2)
|
||||
if [[ "$pid" != "$$" ]] && [[ "$process" == "wallpaper_rando" ]]; then
|
||||
kill $pid
|
||||
fi
|
||||
done
|
||||
|
||||
last_index=""
|
||||
index=""
|
||||
while :; do
|
||||
files=($papesdir/*)
|
||||
count=$(find -L $papesdir -type f | wc -l)
|
||||
|
||||
# Get a new wallpaper
|
||||
while [ "$index" == "$last_index" ]; do
|
||||
index=$((($RANDOM % $count)))
|
||||
done
|
||||
|
||||
feh --bg-fill ${files[$index]}
|
||||
last_index=$index
|
||||
sleep 15m
|
||||
done
|
@ -0,0 +1,305 @@
|
||||
[global]
|
||||
frame_width = 1
|
||||
frame_color = "#888694"
|
||||
|
||||
font = FiraCode Nerd Font 11
|
||||
|
||||
# Allow a small subset of html markup:
|
||||
# <b>bold</b>
|
||||
# <i>italic</i>
|
||||
# <s>strikethrough</s>
|
||||
# <u>underline</u>
|
||||
#
|
||||
# For a complete reference see
|
||||
# <http://developer.gnome.org/pango/stable/PangoMarkupFormat.html>.
|
||||
# If markup is not allowed, those tags will be stripped out of the
|
||||
# message.
|
||||
markup = yes
|
||||
|
||||
# The format of the message. Possible variables are:
|
||||
# %a appname
|
||||
# %s summary
|
||||
# %b body
|
||||
# %i iconname (including its path)
|
||||
# %I iconname (without its path)
|
||||
# %p progress value if set ([ 0%] to [100%]) or nothing
|
||||
# Markup is allowed
|
||||
format = "%s %p\n%b"
|
||||
|
||||
# Sort messages by urgency.
|
||||
sort = yes
|
||||
|
||||
# Show how many messages are currently hidden (because of geometry).
|
||||
indicate_hidden = yes
|
||||
|
||||
# Alignment of message text.
|
||||
# Possible values are "left", "center" and "right".
|
||||
alignment = left
|
||||
|
||||
# The frequency with wich text that is longer than the notification
|
||||
# window allows bounces back and forth.
|
||||
# This option conflicts with "word_wrap".
|
||||
# Set to 0 to disable.
|
||||
bounce_freq = 5
|
||||
|
||||
|
||||
# Show age of message if message is older than show_age_threshold
|
||||
# seconds.
|
||||
# Set to -1 to disable.
|
||||
show_age_threshold = 60
|
||||
|
||||
# Split notifications into multiple lines if they don't fit into
|
||||
# geometry.
|
||||
word_wrap = yes
|
||||
|
||||
# Ignore newlines '\n' in notifications.
|
||||
ignore_newline = no
|
||||
|
||||
|
||||
# The geometry of the window:
|
||||
# [{width}]x{height}[+/-{x}+/-{y}]
|
||||
# The geometry of the message window.
|
||||
# The height is measured in number of notifications everything else
|
||||
# in pixels. If the width is omitted but the height is given
|
||||
# ("-geometry x2"), the message window expands over the whole screen
|
||||
# (dmenu-like). If width is 0, the window expands to the longest
|
||||
# message displayed. A positive x is measured from the left, a
|
||||
# negative from the right side of the screen. Y is measured from
|
||||
# the top and down respectevly.
|
||||
# The width can be negative. In this case the actual width is the
|
||||
# screen width minus the width defined in within the geometry option.
|
||||
origin="top-right"
|
||||
offset= 25x25
|
||||
width=350
|
||||
height=200
|
||||
|
||||
# Shrink window if it's smaller than the width. Will be ignored if
|
||||
# width is 0.
|
||||
shrink = yes
|
||||
|
||||
# The transparency of the window. Range: [0; 100].
|
||||
# This option will only work if a compositing windowmanager is
|
||||
# present (e.g. xcompmgr, compiz, etc.).
|
||||
transparency =25
|
||||
|
||||
# Don't remove messages, if the user is idle (no mouse or keyboard input)
|
||||
# for longer than idle_threshold seconds.
|
||||
# Set to 0 to disable.
|
||||
# default 120
|
||||
idle_threshold = 120
|
||||
|
||||
# Which monitor should the notifications be displayed on.
|
||||
monitor = 0
|
||||
|
||||
# Display notification on focused monitor. Possible modes are:
|
||||
# mouse: follow mouse pointer
|
||||
# keyboard: follow window with keyboard focus
|
||||
# none: don't follow anything
|
||||
#
|
||||
# "keyboard" needs a windowmanager that exports the
|
||||
# _NET_ACTIVE_WINDOW property.
|
||||
# This should be the case for almost all modern windowmanagers.
|
||||
#
|
||||
# If this option is set to mouse or keyboard, the monitor option
|
||||
# will be ignored.
|
||||
follow = mouse
|
||||
|
||||
# Should a notification popped up from history be sticky or timeout
|
||||
# as if it would normally do.
|
||||
sticky_history = no
|
||||
|
||||
# Maximum amount of notifications kept in history
|
||||
history_length = 5
|
||||
|
||||
# Display indicators for URLs (U) and actions (A).
|
||||
show_indicators = no
|
||||
|
||||
# The height of a single line. If the height is smaller than the
|
||||
# font height, it will get raised to the font height.
|
||||
# This adds empty space above and under the text.
|
||||
line_height = 0
|
||||
|
||||
# Draw a line of "separator_height" pixel height between two
|
||||
# notifications.
|
||||
# Set to 0 to disable.
|
||||
separator_height = 1
|
||||
|
||||
# Padding between text and separator.
|
||||
# padding = 8
|
||||
padding = 8
|
||||
|
||||
# Horizontal padding.
|
||||
horizontal_padding = 10
|
||||
|
||||
# Define a color for the separator.
|
||||
# possible values are:
|
||||
# * auto: dunst tries to find a color fitting to the background;
|
||||
# * foreground: use the same color as the foreground;
|
||||
# * frame: use the same color as the frame;
|
||||
# * anything else will be interpreted as a X color.
|
||||
separator_color = foreground
|
||||
|
||||
# Print a notification on startup.
|
||||
# This is mainly for error detection, since dbus (re-)starts dunst
|
||||
# automatically after a crash.
|
||||
startup_notification = false
|
||||
|
||||
# dmenu path.
|
||||
dmenu = /usr/bin/dmenu -p dunst:
|
||||
|
||||
# Browser for opening urls in context menu.
|
||||
browser = qutebrowser
|
||||
|
||||
# Align icons left/right/off
|
||||
icon_position = left
|
||||
|
||||
# Paths to default icons.
|
||||
icon_path = /usr/share/icons/Adwaita/16x16/status/:/usr/share/icons/Adwaita/16x16/devices/
|
||||
|
||||
# Limit icons size.
|
||||
max_icon_size=128
|
||||
|
||||
[shortcuts]
|
||||
|
||||
# Shortcuts are specified as [modifier+][modifier+]...key
|
||||
# Available modifiers are "ctrl", "mod1" (the alt-key), "mod2",
|
||||
# "mod3" and "mod4" (windows-key).
|
||||
# Xev might be helpful to find names for keys.
|
||||
|
||||
# Close notification.
|
||||
close = mod1+space
|
||||
|
||||
# Close all notifications.
|
||||
# close_all = ctrl+shift+space
|
||||
close_all = ctrl+mod1+space
|
||||
|
||||
# Redisplay last message(s).
|
||||
# On the US keyboard layout "grave" is normally above TAB and left
|
||||
# of "1".
|
||||
history = ctrl+mod4+h
|
||||
|
||||
# Context menu.
|
||||
context = ctrl+mod1+c
|
||||
|
||||
[urgency_low]
|
||||
# IMPORTANT: colors have to be defined in quotation marks.
|
||||
# Otherwise the "#" and following would be interpreted as a comment.
|
||||
background = "#191919"
|
||||
foreground = "#8e8e8e"
|
||||
timeout = 5
|
||||
|
||||
[urgency_normal]
|
||||
background = "#191919"
|
||||
foreground = "#BBBBBB"
|
||||
timeout = 5
|
||||
|
||||
[urgency_critical]
|
||||
background = "#de6e7c"
|
||||
foreground = "#BBBBBB"
|
||||
timeout = 0
|
||||
|
||||
|
||||
# Every section that isn't one of the above is interpreted as a rules to
|
||||
# override settings for certain messages.
|
||||
# Messages can be matched by "appname", "summary", "body", "icon", "category",
|
||||
# "msg_urgency" and you can override the "timeout", "urgency", "foreground",
|
||||
# "background", "new_icon" and "format".
|
||||
# Shell-like globbing will get expanded.
|
||||
#
|
||||
# SCRIPTING
|
||||
# You can specify a script that gets run when the rule matches by
|
||||
# setting the "script" option.
|
||||
# The script will be called as follows:
|
||||
# script appname summary body icon urgency
|
||||
# where urgency can be "LOW", "NORMAL" or "CRITICAL".
|
||||
#
|
||||
# NOTE: if you don't want a notification to be displayed, set the format
|
||||
# to "".
|
||||
# NOTE: It might be helpful to run dunst -print in a terminal in order
|
||||
# to find fitting options for rules.
|
||||
|
||||
#[espeak]
|
||||
# summary = "*"
|
||||
# script = dunst_espeak.sh
|
||||
|
||||
#[script-test]
|
||||
# summary = "*script*"
|
||||
# script = dunst_test.sh
|
||||
|
||||
#[ignore]
|
||||
# # This notification will not be displayed
|
||||
# summary = "foobar"
|
||||
# format = ""
|
||||
|
||||
#[signed_on]
|
||||
# appname = Pidgin
|
||||
# summary = "*signed on*"
|
||||
# urgency = low
|
||||
#
|
||||
#[signed_off]
|
||||
# appname = Pidgin
|
||||
# summary = *signed off*
|
||||
# urgency = low
|
||||
#
|
||||
#[says]
|
||||
# appname = Pidgin
|
||||
# summary = *says*
|
||||
# urgency = critical
|
||||
#
|
||||
#[twitter]
|
||||
# appname = Pidgin
|
||||
# summary = *twitter.com*
|
||||
# urgency = normal
|
||||
#
|
||||
#[Claws Mail]
|
||||
# appname = claws-mail
|
||||
# category = email.arrived
|
||||
# urgency = normal
|
||||
# background = "#2F899E"
|
||||
# foreground = "#FFA247"
|
||||
#
|
||||
#[mute.sh]
|
||||
# appname = mute
|
||||
# category = mute.sound
|
||||
# script = mute.sh
|
||||
#
|
||||
#[JDownloader]
|
||||
# appname = JDownloader
|
||||
# category = JD
|
||||
# background = "#FFA247"
|
||||
# foreground = "#FFFFFF"
|
||||
#
|
||||
#[newsbeuter]
|
||||
# summary = *Feeds*
|
||||
# background = "#A8EB41"
|
||||
# foreground = "#FFFFFF"
|
||||
#
|
||||
#[irc]
|
||||
# appname = weechat
|
||||
# timeout = 0
|
||||
# background = "#0033bb"
|
||||
# foreground = "#dddddd"
|
||||
##
|
||||
#[weechat hl]
|
||||
# appname = weechat
|
||||
# category = weechat.HL
|
||||
# background = "#FF5C47"
|
||||
# foreground = "#FFFFFF"
|
||||
##
|
||||
#[weechat pn]
|
||||
# appname = weechat
|
||||
# category = weechat.PM
|
||||
# background = "#D53B84"
|
||||
# foreground = "#FFFFFF"
|
||||
#
|
||||
#[CMUS]
|
||||
# appname = CMUS
|
||||
# category = cmus
|
||||
# background = "#6C4AB7"
|
||||
# foreground = "#FFE756"
|
||||
#
|
||||
#
|
||||
# background = "#30AB70"
|
||||
# foreground = "#F67245"
|
||||
#
|
||||
# vim: ft=cfg
|
@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
case "$1" in
|
||||
"C-w") while read file; do feh --bg-scale "$file"; done;;
|
||||
"C-d") while read file; do rm "$file"; done;;
|
||||
"C-c") while read file; do cp "$file" $HOME/pics/signal.png; done;;
|
||||
"w") while read file; do cp "$file" $HOME/dotfiles/wallpapers/; done;;
|
||||
esac
|
@ -0,0 +1,49 @@
|
||||
XF86Audio{Prev,Next}
|
||||
mpc {cdprev,next}; kill -45 $(cat ~/.cache/pidofbar)
|
||||
|
||||
XF86AudioPlay
|
||||
mpc toggle
|
||||
|
||||
XF86Audio{Raise,Lower}Volume
|
||||
volume.sh {up,down}; kill -44 $(pidof dwmblocks)
|
||||
|
||||
XF86AudioMute
|
||||
volume.sh mute; kill -44 $(pidof dwmblocks)
|
||||
|
||||
XF86MonBrightness{Up,Down}
|
||||
xbacklight -{inc,dec} 10
|
||||
|
||||
super+ctrl+p
|
||||
pubs-rofi.sh open
|
||||
|
||||
super+ctrl+i
|
||||
pubs-rofi.sh tag
|
||||
|
||||
super+ctrl+d
|
||||
pubs-rofi.sh url
|
||||
|
||||
super+ctrl+t
|
||||
textbooks.sh
|
||||
|
||||
super+ctrl+l
|
||||
passmenu --type
|
||||
|
||||
ctrl+shift+v
|
||||
paste_from_primary.sh
|
||||
|
||||
super+shift+s
|
||||
maim -s --hidecursor | xclip -selection clipboard -t image/png
|
||||
|
||||
super+o
|
||||
find_open
|
||||
super+y
|
||||
xclip -o | viewurl
|
||||
|
||||
ctrl+shift+s
|
||||
swap_monitor.sh
|
||||
|
||||
ctrl+shift+d
|
||||
dock.sh
|
||||
|
||||
shift+super+i
|
||||
rofi-connman
|
@ -0,0 +1,15 @@
|
||||
# This file is written by xdg-user-dirs-update
|
||||
# If you want to change or add directories, just edit the line you're
|
||||
# interested in. All local changes will be retained on the next run.
|
||||
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
|
||||
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
|
||||
# absolute path. No other format is supported.
|
||||
#
|
||||
XDG_DOWNLOAD_DIR="$HOME/down"
|
||||
XDG_DOCUMENTS_DIR="$HOME/docs"
|
||||
XDG_MUSIC_DIR="$HOME/media/music"
|
||||
XDG_PICTURES_DIR="$HOME/media/pics"
|
||||
XDG_VIDEOS_DIR="$HOME/media/vids"
|
||||
XDG_DESKTOP_DIR="$HOME/down"
|
||||
XDG_TEMPLATES_DIR="$HOME/down"
|
||||
XDG_PUBLICSHARE_DIR="$HOME/down"
|
@ -0,0 +1 @@
|
||||
en_US
|
@ -0,0 +1,15 @@
|
||||
set statusbar-h-padding 0
|
||||
set statusbar-v-padding 0
|
||||
map u scroll half-up
|
||||
map d scroll half-down
|
||||
map D toggle_page_mode
|
||||
map r reload
|
||||
map R rotate
|
||||
map K zoom in
|
||||
map J zoom out
|
||||
map i recolor
|
||||
map p print
|
||||
set default-bg "#191919"
|
||||
set recolor true
|
||||
set recolor-darkcolor "#BBBBBB"
|
||||
set recolor-lightcolor "#191919"
|
@ -0,0 +1 @@
|
||||
Subproject commit ae315ded4dba10685dbbafbfa2ff3c1aefeb490d
|
@ -0,0 +1 @@
|
||||
Subproject commit 0f80b8eb3368b46e5e573c1d91ae69eb095db3fb
|
@ -0,0 +1 @@
|
||||
Subproject commit ebef4e55691f62e630318d56468e5798367aa81c
|
@ -0,0 +1,55 @@
|
||||
# Lines configured by zsh-newuser-install
|
||||
HISTFILE=~/.histfile
|
||||
HISTSIZE=1000
|
||||
SAVEHIST=1000
|
||||
setopt extendedglob notify
|
||||
unsetopt autocd beep
|
||||
bindkey -v
|
||||
# End of lines configured by zsh-newuser-install
|
||||
# The following lines were added by compinstall
|
||||
zstyle :compinstall filename '/home/aselimov/.zshrc'
|
||||
|
||||
~/bin/daily_scripture.sh
|
||||
autoload -Uz compinit
|
||||
compinit
|
||||
# End of lines added by compinstall
|
||||
#
|
||||
export OMPI_MCA_rmaps_base_oversubscribe=1
|
||||
export CLICOLOR=1
|
||||
export LSCOLORS=ExGxBxDxCxEgEdxbxgxcxd
|
||||
alias vi="nvim"
|
||||
alias vim="nvim"
|
||||
alias mergepdf="gs -dBATCH -dNOPAUSE -dQUIET -sDEVICE=pdfwrite -sOutputFile=output.pdf"
|
||||
alias ddg="w3m ddg.gg"
|
||||
alias cal="khal calendar"
|
||||
#alias sxiv="sxiv-rifle"
|
||||
function addbin(){
|
||||
ln -s $PWD/$1 /home/aselimov/bin
|
||||
}
|
||||
eval "$(starship init zsh)"
|
||||
zstyle -e ':completion:*:hosts' hosts 'reply=(
|
||||
${=${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2)(N) 2>/dev/null)"}%%[#| ]*}//,/ }
|
||||
${=${${${${(@M)${(f)"$(cat ~/.ssh/config 2>/dev/null)"}:#Host *}#Host }:#*\**}:#*\?*}}
|
||||
)'
|
||||
|
||||
source "/home/aselimov/.config/zsh/zsh-autosuggestions/zsh-autosuggestions.zsh"
|
||||
source "/home/aselimov/.config/zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
|
||||
source "/home/aselimov/.config/zsh/zsh-history-substring-search/zsh-history-substring-search.zsh"
|
||||
|
||||
bindkey '^[[A' history-substring-search-up
|
||||
bindkey '^[[B' history-substring-search-down
|
||||
export XKB_DEFAULT_OPTIONS="caps:escape"
|
||||
|
||||
|
||||
|
||||
function panbeamer (){
|
||||
pandoc --pdf-engine=xelatex -o "${1/md/pdf}" -t beamer "$1"
|
||||
}
|
||||
|
||||
export panbeamer
|
||||
|
||||
export NVM_DIR="$HOME/.nvm"
|
||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
|
||||
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
|
||||
|
||||
[ -f "/home/aselimov/.ghcup/env" ] && . "/home/aselimov/.ghcup/env" # ghcup-env
|
@ -0,0 +1,2 @@
|
||||
./linux/void-linux-minimal.png
|
||||
./minimalist/zen-maze.png
|
After Width: | Height: | Size: 41 KiB |
After Width: | Height: | Size: 3.2 MiB |
Loading…
Reference in new issue