Update: Added cava and fonts, updated configs, delted useless rofi configs.

This commit is contained in:
Keyitdev
2022-06-22 19:25:59 +02:00
parent b7c3fa05d1
commit 9ffd98738b
40 changed files with 253 additions and 118 deletions
+6 -6
View File
@@ -6,13 +6,13 @@ for pid in $(pidof -x battery); do
fi
done
DIR="/usr/local/bin/icons"
DIR_ICONS="/usr/local/bin/icons"
# Notify when below this percentage
warning_level=15
WARNING_LEVEL=15
# How often to check battery status, in minutes
check_interval=1
CHECK_INTERVAL=1
while true; do
battery_level=$(acpi -b \
@@ -21,15 +21,15 @@ while true; do
charging=$(acpi -b | grep -c "Charging")
# When battery is low, and not already charging
if [ $battery_level -lt $warning_level ] &&
if [ $battery_level -lt $WARNING_LEVEL ] &&
[ $charging -eq 0 ]
then
dunstify -a "Battery" \
"Low battery: ${battery_level}%" \
"Battery is running low" \
-r 100 \
-i $DIR/battery.svg
-i $DIR_ICONS/battery.svg
fi
sleep ${check_interval}m
sleep ${CHECK_INTERVAL}m
done
+1 -1
View File
@@ -4,7 +4,7 @@ DIR="/usr/local/bin/icons"
CUR_VOL=$(pactl list sinks | grep '^[[:space:]]Volume:' | \
head -n $(( $SINK + 1 )) | tail -n 1 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,')
MUTE=$(pactl list sinks | grep Mute | sed 's/.*Mute: //g')
MUTE=$(pactl list sinks | grep Mute | sed 's/.*Mute: //g' | sed 1q)
affirmative="yes"
negative="no"
+3 -3
View File
@@ -22,15 +22,15 @@ get_options() {
main() {
# Get choice from rofi
choice=$( (get_options) | rofi -dmenu -i -fuzzy -p "" -theme "$THEME")
CHOICE=$( (get_options) | rofi -dmenu -i -fuzzy -p "" -theme "$THEME")
# If user has not picked anything, exit
if [[ -z "${choice// /}" ]]; then
if [[ -z "${CHOICE// /}" ]]; then
exit 1
fi
# run the selected command
case $choice in
case $CHOICE in
' Capture Region (without saving)')
screenshot -crtc
;;
+36 -36
View File
@@ -1,9 +1,9 @@
#!/usr/bin/env bash
# Screenshot directory
screenshot_directory="$HOME/Pictures/screenshots/rofi"
videos_directory="$HOME/Videos/rofi"
audio_directory="$HOME/Music/rofi"
SCREENSHOT_DIRECTORY="$HOME/Pictures/screenshots"
VIDEOS_DIRECTORY="$HOME/Videos"
AUDIO_DIRECTORY="$HOME/Music"
# set ffmpeg defaults
ffmpeg() {
@@ -36,10 +36,10 @@ crtc() {
# capture region to file and clipboard
crtf() {
notify-send "Screenshot" "Select a region to capture"
dt=$(date '+%d-%m-%Y %H:%M:%S')
ffcast -q $(slop -n -f '-g %g ') png "$screenshot_directory/$dt.png"
xclip -selection clipboard -t image/png "$screenshot_directory/$dt.png"
notify-send "Screenshot" "Region saved to $screenshot_directory"
DT=$(date '+%d-%m-%Y %H:%M:%S')
ffcast -q $(slop -n -f '-g %g ') png "$SCREENSHOT_DIRECTORY/$DT.png"
xclip -selection clipboard -t image/png "$SCREENSHOT_DIRECTORY/$DT.png"
notify-send "Screenshot" "Region saved to $SCREENSHOT_DIRECTORY"
}
# capture screenshot to clipboard
@@ -52,92 +52,92 @@ cstc() {
# capture screenshot to file and clipboard
cstf() {
dt=$(date '+%d-%m-%Y %H:%M:%S')
ffcast -q png "$screenshot_directory/$dt.png"
xclip -selection clipboard -t image/png "$screenshot_directory/$dt.png"
notify-send "Screenshot" "Screenshot saved to $screenshot_directory"
DT=$(date '+%d-%m-%Y %H:%M:%S')
ffcast -q png "$SCREENSHOT_DIRECTORY/$DT.png"
xclip -selection clipboard -t image/png "$SCREENSHOT_DIRECTORY/$DT.png"
notify-send "Screenshot" "Screenshot saved to $SCREENSHOT_DIRECTORY"
}
# record region (GIF)
rrg() {
notify-send "Screenshot" "Select a region to record"
dt=$(date '+%d-%m-%Y %H:%M:%S')
DT=$(date '+%d-%m-%Y %H:%M:%S')
ffcast -q $(slop -n -f '-g %g ' && countdown) rec /tmp/screenshot_gif.mp4
notify-send "Screenshot" "Converting to gif... (this can take a while)"
video_to_gif /tmp/screenshot_gif.mp4 "$screenshot_directory/$dt.gif"
video_to_gif /tmp/screenshot_gif.mp4 "$SCREENSHOT_DIRECTORY/$DT.gif"
rm /tmp/screenshot_gif.mp4
notify-send "Screenshot" "Recording saved to $screenshot_directory"
notify-send "Screenshot" "Recording saved to $SCREENSHOT_DIRECTORY"
}
# record screen (GIF)
rsg() {
countdown
dt=$(date '+%d-%m-%Y %H:%M:%S')
DT=$(date '+%d-%m-%Y %H:%M:%S')
ffcast -q rec /tmp/screenshot_gif.mp4
notify-send "Screenshot" "Converting to gif... (this can take a while)"
video_to_gif /tmp/screenshot_gif.mp4 "$screenshot_directory/$dt.gif"
video_to_gif /tmp/screenshot_gif.mp4 "$SCREENSHOT_DIRECTORY/$DT.gif"
rm /tmp/screenshot_gif.mp4
notify-send "Screenshot" "Recording saved to $screenshot_directory"
notify-send "Screenshot" "Recording saved to $SCREENSHOT_DIRECTORY"
}
# record region (mp4)
rrv() {
notify-send "Screenshot" "Select a region to record"
dt=$(date '+%d-%m-%Y %H:%M:%S')
ffcast -q $(slop -n -f '-g %g ' && countdown) rec "$videos_directory/$dt.mp4"
notify-send "Screenshot" "Recording saved to $videos_directory"
DT=$(date '+%d-%m-%Y %H:%M:%S')
ffcast -q $(slop -n -f '-g %g ' && countdown) rec "$VIDEOS_DIRECTORY/$DT.mp4"
notify-send "Screenshot" "Recording saved to $VIDEOS_DIRECTORY"
}
# record screen (mp4)
rsv() {
countdown
dt=$(date '+%d-%m-%Y %H:%M:%S')
ffcast -q rec "$videos_directory/$dt.mp4"
notify-send "Screenshot" "Recording saved to $videos_directory"
DT=$(date '+%d-%m-%Y %H:%M:%S')
ffcast -q rec "$VIDEOS_DIRECTORY/$DT.mp4"
notify-send "Screenshot" "Recording saved to $VIDEOS_DIRECTORY"
}
# record screen (mp4) with audio virt
rrav() {
notify-send "Screenshot" "Select a region to record"
dt=$(date '+%d-%m-%Y %H:%M:%S')
DT=$(date '+%d-%m-%Y %H:%M:%S')
ffcast -q $(slop -n -f '-g %g ' && countdown) ffmpeg \
-hide_banner \
-loglevel error \
-f x11grab -show_region 1 -framerate 30 -video_size %wx%h -i :0.0+%x,%y \
-f pulse -i alsa_output.pci-0000_00_1f.3.analog-stereo.monitor -ac 1 "$videos_directory/$dt.mp4"
notify-send "Screenshot" "Recording saved to $videos_directory"
-f pulse -i alsa_output.pci-0000_00_1f.3.analog-stereo.monitor -ac 1 "$VIDEOS_DIRECTORY/$DT.mp4"
notify-send "Screenshot" "Recording saved to $VIDEOS_DIRECTORY"
}
# record screen (mp4) with mic audio
rrmv() {
notify-send "Screenshot" "Select a region to record"
dt=$(date '+%d-%m-%Y %H:%M:%S')
DT=$(date '+%d-%m-%Y %H:%M:%S')
ffcast -q $(slop -n -f '-g %g ' && countdown) ffmpeg \
-hide_banner \
-loglevel error \
-f x11grab -show_region 1 -framerate 30 -video_size %wx%h -i :0.0+%x,%y \
-f pulse -i alsa_input.pci-0000_00_1f.3.analog-stereo -ac 1 "$videos_directory/$dt.mp4"
notify-send "Screenshot" "Recording saved to $videos_directory"
-f pulse -i alsa_input.pci-0000_00_1f.3.analog-stereo -ac 1 "$VIDEOS_DIRECTORY/$DT.mp4"
notify-send "Screenshot" "Recording saved to $VIDEOS_DIRECTORY"
}
# record audio virt
rav() {
notify-send "Screenshot" "Starting audio recording." -i sound-recorder
dt=$(date '+%d-%m-%Y %H:%M:%S')
DT=$(date '+%d-%m-%Y %H:%M:%S')
'ffmpeg' \
-loglevel error \
-f pulse -i alsa_output.pci-0000_00_1f.3.analog-stereo.monitor -ac 1 "$audio_directory/$dt.mp3"
notify-send "Screenshot" "Audio saved to $audio_directory" -i sound-recorder
-f pulse -i alsa_output.pci-0000_00_1f.3.analog-stereo.monitor -ac 1 "$AUDIO_DIRECTORY/$DT.mp3"
notify-send "Screenshot" "Audio saved to $AUDIO_DIRECTORY" -i sound-recorder
}
# record audio mic
ram() {
notify-send "Screenshot" "Starting audio recording." -i sound-recorder
dt=$(date '+%d-%m-%Y %H:%M:%S')
DT=$(date '+%d-%m-%Y %H:%M:%S')
'ffmpeg' \
-loglevel error \
-f pulse -i alsa_input.pci-0000_00_1f.3.analog-stereo -ac 1 "$audio_directory/$dt.mp3"
notify-send "Screenshot" "Audio saved to $audio_directory" -i sound-recorder
-f pulse -i alsa_input.pci-0000_00_1f.3.analog-stereo -ac 1 "$AUDIO_DIRECTORY/$DT.mp3"
notify-send "Screenshot" "Audio saved to $AUDIO_DIRECTORY" -i sound-recorder
}
check_deps() {
@@ -156,7 +156,7 @@ usage() {
echo -crtc
echo " Capture region to clipboard."
echo -crtf
echo " Capture screen to file and clipboard"
echo " Capture region to file and clipboard"
echo -cstc
echo " Capture screen to clipboard."
echo -cstf
+1 -20
View File
@@ -5,11 +5,6 @@ DIR_THEME="$HOME/.config/rofi/compact_without_icons.rasi"
DIR="/usr/local/bin/themes"
get_options_theme() {
echo "blue"
echo "dark"
}
get_options_theme_polybar() {
echo "polybar-square"
echo "polybar-rounded"
@@ -17,21 +12,7 @@ get_options_theme_polybar() {
main() {
# Get THEME from rofi
THEME=$( (get_options_theme) | rofi -dmenu -i -fuzzy -p "" -theme "$DIR_THEME")
# If user has not picked anything, exit
if [[ -z "${THEME// /}" ]]; then
exit 1
fi
cp -f $DIR/$THEME/kitty/kitty.conf ~/.config/kitty/
cp -f $DIR/$THEME/rofi/* ~/.config/rofi/
cp -f $DIR/$THEME/vsc/* ~/.config/Code\ -\ OSS/User
cp -f $DIR/$THEME/vsc/* ~/.config/Code/User
cp -f $DIR/$THEME/polybar/* ~/.config/polybar
cp -f $DIR/$THEME/i3/* ~/.config/i3
cp -f $DIR/$THEME/dunst/* ~/.config/dunst
# Get THEME_POLYBAR from rofi
THEME_POLYBAR=$( (get_options_theme_polybar) | rofi -dmenu -i -fuzzy -p "" -theme "$DIR_THEME")
# If user has not picked anything, exit
+4 -4
View File
@@ -1,6 +1,6 @@
#!/bin/bash
DIR="/usr/local/bin/icons"
DIR_ICONS="/usr/local/bin/icons"
CUR_VOL=$(pactl list sinks | grep '^[[:space:]]Volume:' | \
head -n $(( $SINK + 1 )) | tail -n 1 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,')
@@ -13,19 +13,19 @@ if [ $CUR_VOL -le $VOL_QUIET ]; then
"Volume" \
"Current volume is $CUR_VOL%" \
-r 100 \
-i $DIR/volume.svg
-i $DIR_ICONS/volume.svg
fi
if [ $CUR_VOL -gt $VOL_QUIET ] && [ $CUR_VOL -le $VOL_LOUD ]; then
dunstify -a "Volume" \
"Volume" \
"Current volume is $CUR_VOL%" \
-r 100 \
-i $DIR/volume-1.svg
-i $DIR_ICONS/volume-1.svg
fi
if [ $CUR_VOL -gt $VOL_LOUD ]; then
dunstify -a "Volume" \
"Volume" \
"Current volume is $CUR_VOL%" \
-r 100 \
-i $DIR/volume-2.svg
-i $DIR_ICONS/volume-2.svg
fi