clean files
This commit is contained in:
parent
dd8482a6fb
commit
30542228ee
82 changed files with 11285 additions and 0 deletions
37
scripts/battWarning.sh
Executable file
37
scripts/battWarning.sh
Executable file
|
@ -0,0 +1,37 @@
|
|||
#!/bin/bash
|
||||
|
||||
while true; do
|
||||
|
||||
batteryStatus=$(cat /sys/class/power_supply/BAT0/status)
|
||||
batteryLevel=$(cat /sys/class/power_supply/BAT0/capacity)
|
||||
currentPowerSetting=$(powerprofilesctl get)
|
||||
|
||||
if [ "$batteryLevel" -le "25" ] && [ "$batteryStatus" == "Discharging" ]; then
|
||||
notify-send -u critical -i ~/dotfiles/scripts/battery-alert.svg "Low Battery" "25% battery remaining"
|
||||
fi
|
||||
|
||||
|
||||
if [ "$batteryLevel" -le "40" ]; then
|
||||
if [ "$currentPowerSetting" != "power-saver" ]; then
|
||||
powerprofilesctl set power-saver
|
||||
notify-send -t 3000 "Battery Saver Turned On"
|
||||
fi
|
||||
elif [ "$batteryLevel" -ge "40" ] && [ "$batteryLevel" -le "75" ]; then
|
||||
if [ "$currentPowerSetting" != "balanced" ]; then
|
||||
powerprofilesctl set balanced
|
||||
notify-send -t 3000 "Battery Saver Turned Off"
|
||||
fi
|
||||
elif [ "$batteryLevel" -ge "75" ] && [ "$batteryStatus" == "Charging" ] || [ "$batteryStatus" == "Full" ]; then
|
||||
if [ "$currentPowerSetting" != "performance" ]; then
|
||||
powerprofilesctl set performance
|
||||
notify-send -t 3000 "Performance Mode Turned On"
|
||||
fi
|
||||
elif [ "$batteryLevel" -ge "75" ]; then
|
||||
if [ "$currentPowerSetting" != "balanced" ]; then
|
||||
powerprofilesctl set balanced
|
||||
notify-send -t 3000 "Performance Mode Turned Off"
|
||||
fi
|
||||
fi
|
||||
|
||||
sleep 60
|
||||
done
|
1
scripts/battery-alert.svg
Normal file
1
scripts/battery-alert.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 14H11V8H13M13 18H11V16H13M16.7 4H15V2H9V4H7.3C6.6 4 6 4.6 6 5.3V20.6C6 21.4 6.6 22 7.3 22H16.6C17.3 22 17.9 21.4 17.9 20.7V5.3C18 4.6 17.4 4 16.7 4Z" /></svg>
|
After Width: | Height: | Size: 231 B |
22
scripts/brightnessWidget.sh
Executable file
22
scripts/brightnessWidget.sh
Executable file
|
@ -0,0 +1,22 @@
|
|||
#!/bin/bash
|
||||
|
||||
while true; do
|
||||
while "$(cat /home/rafayahmad/dotfiles/.config/eww/brightnessShow)"; do
|
||||
|
||||
activeWindows=$(/home/rafayahmad/eww/target/release/eww active-windows)
|
||||
if [[ "$activeWindows" != *"brightnessWin"* ]] ; then
|
||||
echo "opening"
|
||||
/home/rafayahmad/eww/target/release/eww open brightnessWin
|
||||
fi
|
||||
|
||||
echo false > /home/rafayahmad/.config/eww/brightnessShow
|
||||
sleep 1
|
||||
done
|
||||
|
||||
activeWindows=$(/home/rafayahmad/eww/target/release/eww active-windows)
|
||||
if [[ "$activeWindows" == *"brightnessWin"* ]] ; then
|
||||
echo "closing"
|
||||
/home/rafayahmad/eww/target/release/eww close brightnessWin
|
||||
fi
|
||||
|
||||
done
|
28
scripts/changeWallpaper.sh
Executable file
28
scripts/changeWallpaper.sh
Executable file
|
@ -0,0 +1,28 @@
|
|||
#!/bin/bash
|
||||
|
||||
monitor="eDP-1"
|
||||
|
||||
currentWallpaper=$(hyprctl hyprpaper listactive)
|
||||
currentWallpaper=${currentWallpaper:8}
|
||||
|
||||
echo "$currentWallpaper"
|
||||
|
||||
wallpapers=$(hyprctl hyprpaper listloaded)
|
||||
|
||||
set=false
|
||||
for wallpaper in $wallpapers; do
|
||||
echo "$wallpaper"
|
||||
if $set; then
|
||||
hyprctl hyprpaper wallpaper "${monitor},${wallpaper}"
|
||||
set=false
|
||||
fi
|
||||
if [ "$wallpaper" = "$currentWallpaper" ]; then
|
||||
set=true
|
||||
echo yes
|
||||
fi
|
||||
done
|
||||
|
||||
if $set; then
|
||||
hyprctl hyprpaper wallpaper "${monitor},/home/rafayahmad/dotfiles/bgs/1.png"
|
||||
fi
|
||||
|
8
scripts/currentWallpaperHyprlock.sh
Executable file
8
scripts/currentWallpaperHyprlock.sh
Executable file
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash
|
||||
currentWallpaper=$(hyprctl hyprpaper listactive)
|
||||
currentWallpaper=${currentWallpaper:8}
|
||||
configFile=${currentWallpaper: -5:1}
|
||||
configFile="/home/rafayahmad/.config/hypr/hyprlock/${configFile}.conf"
|
||||
export currentWallpaper
|
||||
echo "$configFile"
|
||||
hyprlock -c "$configFile"
|
3
scripts/reloadwaybar
Executable file
3
scripts/reloadwaybar
Executable file
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/bash
|
||||
killall waybar
|
||||
waybar
|
8
scripts/startWin11.sh
Executable file
8
scripts/startWin11.sh
Executable file
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash
|
||||
|
||||
systemctl start libvirtd || exit 1
|
||||
virsh -c qemu:///system start win11
|
||||
|
||||
sleep 1
|
||||
|
||||
virt-viewer -c qemu:///system -f win11
|
67
scripts/youtubeBlocker.py
Executable file
67
scripts/youtubeBlocker.py
Executable file
|
@ -0,0 +1,67 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
from datetime import date
|
||||
from datetime import datetime
|
||||
import socket
|
||||
import os
|
||||
import time
|
||||
from threading import Thread
|
||||
import subprocess
|
||||
|
||||
date_format = "%Y-%m-%d"
|
||||
youtube_focused = False
|
||||
|
||||
time_remaining = int(0)
|
||||
|
||||
def update_file():
|
||||
with open('/home/rafayahmad/dotfiles/scripts/youtubeData', 'w') as file:
|
||||
file.write(date.today().strftime(date_format))
|
||||
file.write('\n')
|
||||
file.write(time_remaining.__str__())
|
||||
|
||||
def read_file():
|
||||
global time_remaining
|
||||
with open('/home/rafayahmad/dotfiles/scripts/youtubeData') as file:
|
||||
date_t = file.readline().strip()
|
||||
date_t = datetime.strptime(date_t, date_format).date()
|
||||
time_remaining = int(file.readline())
|
||||
|
||||
if date_t != date.today():
|
||||
print('differnt date, resetting')
|
||||
time_remaining = 60
|
||||
update_file()
|
||||
|
||||
|
||||
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
|
||||
path = os.path.expandvars('$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock')
|
||||
sock.connect(path)
|
||||
|
||||
def time_counter():
|
||||
while True:
|
||||
global time_remaining
|
||||
if youtube_focused:
|
||||
read_file()
|
||||
if time_remaining == 0:
|
||||
subprocess.run(['hyprctl', 'dispatch', 'killactive'])
|
||||
subprocess.run(['notify-send', 'time\'s up buddy'])
|
||||
time.sleep(1)
|
||||
continue
|
||||
time.sleep(60)
|
||||
time_remaining -= 1
|
||||
update_file()
|
||||
print('Remainng Youtube Time is: ', time_remaining)
|
||||
|
||||
Thread(target=time_counter).start()
|
||||
|
||||
while True:
|
||||
data = sock.recv(1024)
|
||||
lines = data.decode().split('\n')
|
||||
for line in lines:
|
||||
if line.startswith('activewindow>>'):
|
||||
print(line)
|
||||
if line.__contains__('YouTube'):
|
||||
youtube_focused = True
|
||||
print('youtube focused')
|
||||
else:
|
||||
youtube_focused = False
|
||||
print('youtube unfocused')
|
2
scripts/youtubeData
Normal file
2
scripts/youtubeData
Normal file
|
@ -0,0 +1,2 @@
|
|||
2025-07-26
|
||||
0
|
Loading…
Add table
Add a link
Reference in a new issue