Updated scripts
This commit is contained in:
parent
87432bb576
commit
e7a3068ce4
39
black.py
Normal file
39
black.py
Normal file
@ -0,0 +1,39 @@
|
||||
import tkinter as tk
|
||||
import socket
|
||||
import sys
|
||||
|
||||
PORT = 65432
|
||||
|
||||
|
||||
def check_if_already_running():
|
||||
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
try:
|
||||
sock.bind(("127.0.0.1", PORT))
|
||||
except OSError:
|
||||
print("Already running.")
|
||||
sys.exit(0)
|
||||
return sock
|
||||
|
||||
|
||||
def exit_app(event=None):
|
||||
root.destroy()
|
||||
|
||||
|
||||
def bind_input_events():
|
||||
root.bind("<Motion>", exit_app)
|
||||
root.bind("<Key>", exit_app)
|
||||
root.bind("<Button>", exit_app)
|
||||
|
||||
|
||||
lock_socket = check_if_already_running()
|
||||
|
||||
root = tk.Tk()
|
||||
root.title("BlackScreenApp") # Needed for wmctrl or hyprctl targeting
|
||||
root.configure(background="black")
|
||||
root.attributes("-fullscreen", True) # Try fullscreen directly
|
||||
root.config(cursor="none")
|
||||
|
||||
root.after(500, bind_input_events)
|
||||
root.mainloop()
|
||||
|
||||
lock_socket.close()
|
||||
@ -4,11 +4,10 @@ general {
|
||||
after_sleep_cmd = hyprctl dispatch dpms on # to avoid having to press a key twice to turn on the display.
|
||||
}
|
||||
|
||||
# listener {
|
||||
# timeout = 300 # 5min
|
||||
# on-timeout = hyprctl dispatch dpms off # screen off when timeout has passed
|
||||
# on-resume = hyprctl dispatch dpms on # screen on when activity is detected after timeout has fired.
|
||||
# }
|
||||
listener {
|
||||
timeout = 60
|
||||
on-timeout = python ~/linuxbox/black.py
|
||||
}
|
||||
|
||||
listener {
|
||||
timeout = 6000 # 60min
|
||||
|
||||
@ -252,11 +252,6 @@ windowrulev2 = float, initialTitle:^(Picture in picture)$
|
||||
windowrulev2 = move 100%-w-20 60, initialTitle:^(Picture in picture)$
|
||||
windowrulev2 = workspace e+0, initialTitle:^(Picture in picture)$
|
||||
|
||||
# # FzfMenu
|
||||
# windowrulev2 = float, onworkspace:special:fzfmenu
|
||||
# windowrulev2 = size 30% 40%, onworkspace:special:fzfmenu
|
||||
# workspace = special:fzfmenu, on-created-empty:$terminal -e fzfmenu
|
||||
|
||||
# Btop
|
||||
windowrulev2 = float, onworkspace:special:btop
|
||||
windowrulev2 = size 80% 80%, onworkspace:special:btop
|
||||
@ -322,6 +317,9 @@ workspace = special:mixer, on-created-empty:pavucontrol
|
||||
# # FreeCad
|
||||
# windowrulev2 = workspace emptyn, initialTitle:^(FreeCAD.*)$
|
||||
|
||||
# screensaver workaround
|
||||
windowrulev2 = fullscreen, title:^(BlackScreenApp)$
|
||||
|
||||
# Ignore maximize requests from apps. You'll probably like this.
|
||||
windowrulev2 = suppressevent maximize, class:.*
|
||||
|
||||
|
||||
@ -177,7 +177,7 @@ sudo localectl set-locale LANG=en_US.UTF-8
|
||||
# Install hyprland
|
||||
if [ "${ROLES[HYPERLAND]}" == "yes" ]; then
|
||||
printf -- '\033[33m Installing hyprland\n\033[37m'
|
||||
sudo pacman --noconfirm --needed -S nm-connection-editor usbutils plymouth dracut dunst hyprpaper hypridle hyprland hyprlock xdg-desktop-portal-hyprland polkit-gnome xorg-xhost gnome-keyring qt5ct qt6ct gnome-themes-extra qt5-wayland qt6-wayland lxappearance qt5-tools adwaita-fonts gnome-disk-utility
|
||||
sudo pacman --noconfirm --needed -S nm-connection-editor usbutils plymouth dracut dunst hyprpaper hypridle hyprland hyprlock xdg-desktop-portal-hyprland polkit-gnome xorg-xhost gnome-keyring qt6ct qt6ct gnome-themes-extra qt5-wayland qt6-wayland lxappearance qt5-tools adwaita-fonts gnome-disk-utility hyprpaper tk
|
||||
|
||||
yay --noconfirm -S --needed --aur adwaita-qt5-git
|
||||
yay --noconfirm -S --needed --aur adwaita-qt6-git
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user