Init
This commit is contained in:
36
.config/hypr/scripts/app_launcher.sh
Executable file
36
.config/hypr/scripts/app_launcher.sh
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/bin/bash
|
||||
rofi_conf="~/.config/rofi/main.rasi"
|
||||
|
||||
# Rofi action
|
||||
case $1 in
|
||||
d) mode="drun" ;;
|
||||
w) mode="window" ;;
|
||||
f) mode="filebrowser" ;;
|
||||
e) mode="emoji"
|
||||
action=(-a copy)
|
||||
;;
|
||||
c) mode="calc"
|
||||
action=(-calc-command "wl-copy {result}")
|
||||
children="\"message\", "
|
||||
;;
|
||||
h) echo -e "$0 [action]"
|
||||
echo "d : drun mode"
|
||||
echo "w : window mode"
|
||||
echo "f : filebrowser mode"
|
||||
exit 0 ;;
|
||||
*) mode="drun" ;;
|
||||
esac
|
||||
|
||||
# Get font
|
||||
font=`gsettings get org.gnome.desktop.interface font-name`
|
||||
fnt_override="configuration {font: \"${font//\'}\";}"
|
||||
|
||||
# Get icon theme
|
||||
icon_override=`gsettings get org.gnome.desktop.interface icon-theme | sed "s/'//g"`
|
||||
icon_override="configuration {icon-theme: \"${icon_override}\";}"
|
||||
|
||||
# Children
|
||||
children_ovr="mainbox {children: [\"inputbar\", $children \"listbox\"];}"
|
||||
|
||||
# Launch rofi
|
||||
rofi -show $mode ${action[0]} "${action[1]}" -theme-str "$children_ovr" -theme-str "$fnt_override" -theme-str "$icon_override" -config "$rofi_conf"
|
||||
53
.config/hypr/scripts/background.sh
Executable file
53
.config/hypr/scripts/background.sh
Executable file
@@ -0,0 +1,53 @@
|
||||
#!/bin/bash
|
||||
#set -e # Exit immediately if a command exits with a non-zero status. (deprecated) -> [CMD] || exit 1
|
||||
|
||||
if [[ $# -lt 1 ]] || [[ ! -d $1 ]]; then
|
||||
echo "Usage:
|
||||
$0 <dir containing images> [interval(seconds)]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
## Check running
|
||||
running=$(ps -ef | grep "$0" | grep -v grep | wc -l)
|
||||
if [ ${running} -gt 2 ]; then
|
||||
echo "Script already running! Killing others (TODO)..."
|
||||
exit 1
|
||||
# CRASHES EVERYTHING \/ !!!!!!!!!!
|
||||
script_pids=$(ps aux | grep -E "$script_name" | grep -v "grep" | awk -v pid="$current_pid" '$2 != pid {print $2}')
|
||||
|
||||
# Loop through the PIDs and kill the processes
|
||||
for pid in $script_pids; do
|
||||
echo "Killing process $pid"
|
||||
kill "$pid"
|
||||
done
|
||||
fi
|
||||
|
||||
## Start swww
|
||||
swww init &> /dev/null
|
||||
|
||||
## Settings for swww
|
||||
export SWWW_TRANSITION_FPS=60
|
||||
export SWWW_TRANSITION_STEP=2
|
||||
INTERVAL=300
|
||||
if [ ! -z $2 ]; then
|
||||
INTERVAL=$2
|
||||
fi
|
||||
|
||||
## Main loop
|
||||
while true; do
|
||||
find "$1" \
|
||||
| while read -r img; do
|
||||
echo "$((RANDOM % 1000)):$img"
|
||||
done \
|
||||
| sort -n | cut -d':' -f2- \
|
||||
| while read -r img; do
|
||||
img=${img/\~/$HOME}
|
||||
if [ -d $img ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
swww img "$img" --transition-type wipe --resize=fit
|
||||
ln -sf "$img" ~/.config/hypr/theme/current_background.jpg
|
||||
sleep $INTERVAL
|
||||
done
|
||||
done
|
||||
17
.config/hypr/scripts/bar.sh
Executable file
17
.config/hypr/scripts/bar.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
eww open bar1
|
||||
eww open bar2
|
||||
eww open bar3
|
||||
|
||||
indicator-mic-cam & disown
|
||||
|
||||
## Waybar auto update (requires inotifytools)
|
||||
# CONFIG_FILES="$HOME/.config/waybar/config $HOME/.config/waybar/style.css"
|
||||
#
|
||||
# trap "killall waybar" EXIT
|
||||
#
|
||||
# while true; do
|
||||
# waybar &
|
||||
# inotifywait -e create,modify $CONFIG_FILES
|
||||
# killall waybar
|
||||
# done
|
||||
19
.config/hypr/scripts/battery_check.sh
Executable file
19
.config/hypr/scripts/battery_check.sh
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
bat=$(upower -e | grep BAT)
|
||||
|
||||
if [ -z $bat ]; then
|
||||
echo "No battery available!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
while true; do
|
||||
per=$(upower -i $bat | grep percentage | awk '{print $2}')
|
||||
per="${per%\%}"
|
||||
|
||||
if "$per" -lt 15 #&& ! is_charging
|
||||
eww open battery_warning
|
||||
fi
|
||||
|
||||
sleep 120
|
||||
done
|
||||
24
.config/hypr/scripts/clipboard.sh
Executable file
24
.config/hypr/scripts/clipboard.sh
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
roconf="~/.config/rofi/clipboard.rasi"
|
||||
|
||||
# Read font
|
||||
font=`gsettings get org.gnome.desktop.interface font-name`
|
||||
fnt_override="configuration {font: \"${font//\'}\";}"
|
||||
|
||||
# Clipboard action
|
||||
case $1 in
|
||||
c) cliphist list | rofi -dmenu -theme-str "entry { placeholder: \"Copy...\";}" -theme-str "$fnt_override" -config $roconf | cliphist decode | wl-copy
|
||||
;;
|
||||
d) cliphist list | rofi -dmenu -theme-str "entry { placeholder: \"Delete...\";}" -theme-str "$fnt_override" -config $roconf | cliphist delete
|
||||
;;
|
||||
w) if [ `echo -e "Yes\nNo" | rofi -dmenu -theme-str "entry { placeholder: \"Clear Clipboard History?\";}" -theme-str "$fnt_override" -config $roconf` == "Yes" ] ; then
|
||||
cliphist wipe
|
||||
fi
|
||||
;;
|
||||
*) echo -e "$0 [action]"
|
||||
echo "c : cliphist list and copy selected"
|
||||
echo "d : cliphist list and delete selected"
|
||||
echo "w : cliphist wipe database"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
3
.config/hypr/scripts/game_mode.sh
Executable file
3
.config/hypr/scripts/game_mode.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
eww close bar1 || eww open bar1 & disown
|
||||
21
.config/hypr/scripts/idle.sh
Executable file
21
.config/hypr/scripts/idle.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
isplayingvideo(){
|
||||
if pactl list | grep -q RUNNING; then
|
||||
exit 1
|
||||
else
|
||||
exit 0
|
||||
fi
|
||||
}
|
||||
|
||||
if ! [ -z $1 ]; then
|
||||
isplayingvideo
|
||||
fi
|
||||
|
||||
timeout_lock=900
|
||||
timeout_DPMS=1080
|
||||
|
||||
swayidle -w \
|
||||
timeout ${timeout_lock} "$0 isplayinfvideo || ~/.config/hypr/scripts/lock.sh" \
|
||||
#timeout ${timeout_DPMS} 'hyprctl dispatch dpms off'
|
||||
#resume 'hyprctl dispatch dpms on' # Crashes all apps -> Hyprland config set misc/mouse_move_enables_dpms=true
|
||||
10
.config/hypr/scripts/lock.sh
Executable file
10
.config/hypr/scripts/lock.sh
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
dnd=$(swaync-client -D)
|
||||
|
||||
swaync-client -dn
|
||||
swaylock -C ~/.config/swaylock/swaylock.conf
|
||||
|
||||
if [ "$dnd" == "false" ]; then
|
||||
swaync-client -df
|
||||
fi
|
||||
Reference in New Issue
Block a user