fix: fixed conflicts + moving to yadm
This commit is contained in:
52
.config/hypr/scripts/testing/BSC.py
Executable file
52
.config/hypr/scripts/testing/BSC.py
Executable file
@@ -0,0 +1,52 @@
|
||||
#!/usr/bin/env python3
|
||||
import os
|
||||
import time
|
||||
|
||||
from psutil import process_iter, sensors_battery
|
||||
from setproctitle import setproctitle
|
||||
|
||||
|
||||
APP_NAME = "BSC" # Battery status checker
|
||||
|
||||
|
||||
class config:
|
||||
low = 15
|
||||
critical = 5
|
||||
sleep = 2
|
||||
debug = False
|
||||
|
||||
|
||||
def debug(level):
|
||||
if config.debug:
|
||||
print(level)
|
||||
print("Charging: ", sensors_battery().power_plugged)
|
||||
print("Battery: ", sensors_battery().percent)
|
||||
|
||||
|
||||
def main():
|
||||
while True:
|
||||
battery = sensors_battery()
|
||||
if (
|
||||
not battery.power_plugged and
|
||||
config.critical < int(battery.percent) and
|
||||
int(battery.percent) <= config.low
|
||||
):
|
||||
os.system('notify-send -u critical -r "6896" "Battery" "Low battery level"')
|
||||
elif (
|
||||
not battery.power_plugged and
|
||||
int(battery.percent) <= config.critical
|
||||
):
|
||||
os.system('notify-send -u critical -r "6896" "Battery" "Critical battery level"')
|
||||
time.sleep(config.sleep)
|
||||
|
||||
|
||||
for proc in process_iter(["pid", "name"]):
|
||||
if proc.name() == APP_NAME and proc.pid != os.getpid():
|
||||
print(proc)
|
||||
os.kill(proc.pid, 9)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
setproctitle(APP_NAME)
|
||||
list_of_procs = []
|
||||
main()
|
||||
9
.config/hypr/scripts/testing/eDPower.sh
Executable file
9
.config/hypr/scripts/testing/eDPower.sh
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
check=$(hyprctl monitors | awk '/HDMI-A-1/{print $1}' | tr -d '\n')
|
||||
|
||||
if [ $check != '' ]; then
|
||||
hyprctl keyword monitor "eDP-1, disable"
|
||||
swww kill
|
||||
uwsm app -- swww-daemon
|
||||
fi
|
||||
19
.config/hypr/scripts/testing/player-status.sh
Executable file
19
.config/hypr/scripts/testing/player-status.sh
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
artist_offset=25
|
||||
title_offset=40
|
||||
|
||||
artist=$(playerctl metadata artist)
|
||||
title=$(playerctl metadata title)
|
||||
|
||||
if [ ${#title} != 0 ]; then
|
||||
if [ ${#artist} -gt $artist_offset ]; then
|
||||
artist=$(echo $artist | cut -c1-$artist_offset)
|
||||
artist=$(echo $artist'...')
|
||||
fi
|
||||
if [ ${#title} -gt $title_offset ]; then
|
||||
title=$(echo $title | cut -c1-$title_offset)
|
||||
title=$(echo $title'...')
|
||||
fi
|
||||
echo $artist - $title
|
||||
fi
|
||||
11
.config/hypr/scripts/testing/trackinfo.sh
Executable file
11
.config/hypr/scripts/testing/trackinfo.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
sleep 0.7
|
||||
|
||||
msgId="3378455"
|
||||
|
||||
artist=$(playerctl metadata artist)
|
||||
title=$(playerctl metadata title)
|
||||
image=$(playerctl metadata mpris:artUrl)
|
||||
|
||||
notify-send -u low -r "$msgId" "$artist" "$title" -i "$image"
|
||||
Reference in New Issue
Block a user