Dotfiles config update (2023-05-14)

This commit is contained in:
q3aql 2023-05-14 19:12:23 +02:00
parent 962458488b
commit bbd072576b
10 changed files with 345 additions and 3 deletions

View File

@ -11,7 +11,7 @@ title=foot
locked-title=no
# Font configuration
font=mono:size=10
font=mono:size=10.5
# font=monospace:size=8
# font-bold=<bold variant of regular font>
# font-italic=<italic variant of regular font>

91
.config/i3/caffeine.py Executable file
View File

@ -0,0 +1,91 @@
#!/usr/bin/env python3
import tkinter as tk
import os
import psutil
def check_process_running(process_name):
for proc in psutil.process_iter(['name']):
if proc.info['name'] == process_name:
return True
return False
class MainWindow:
def __init__(self, master):
self.master = master
master.title("Caffeine.py")
# Set theme and window size
master.configure(bg='#262321')
master.geometry('250x215')
self.boton1 = tk.Button(master, text="Enable Caffeine Mode", command=self.exec_command1, bg='#703207', fg="white")
self.boton1.pack(side=tk.TOP, pady=10)
self.boton2 = tk.Button(master, text="Disable Caffeine Mode", command=self.exec_command2, bg='#703207', fg="white")
self.boton2.pack(side=tk.TOP, pady=10)
self.boton3 = tk.Button(master, text="Check Status", command=self.exec_command3, bg='#703207', fg="white")
self.boton3.pack(side=tk.TOP, pady=10)
self.boton4 = tk.Button(master, text="Exit", command=self.exec_command4, bg='#703207', fg="white")
self.boton4.pack(side=tk.TOP, pady=10)
# Set center buttons
self.boton1.pack(side=tk.TOP, padx=10, pady=10, fill=tk.BOTH)
self.boton2.pack(side=tk.TOP, padx=10, pady=10, fill=tk.BOTH)
self.boton3.pack(side=tk.TOP, padx=10, pady=10, fill=tk.BOTH)
self.boton4.pack(side=tk.TOP, padx=10, pady=10, fill=tk.BOTH)
def exec_command1(self):
print('# Enabled Caffeine Mode')
command = "killall startscreensaver.sh 2> /dev/null"
os.system(command)
command = "killall xscreensaver 2> /dev/null"
os.system(command)
command = "killall xautolock 2> /dev/null"
os.system(command)
def exec_command2(self):
command = "killall startscreensaver.sh 2> /dev/null"
os.system(command)
command = "killall xscreensaver 2> /dev/null"
os.system(command)
command = "killall xautolock 2> /dev/null"
os.system(command)
command = "~/.config/i3/startscreensaver.sh &"
os.system(command)
print('# Disabled Caffeine Mode')
def exec_command3(self):
message = tk.Tk()
message.title("Caffeine.py")
# Set theme and window size
message.configure(bg='#262321')
message.geometry('190x105')
# Verificar si el proceso swayidle está en ejecución
if check_process_running("xscreensaver"):
label = tk.Label(message, text="Caffeine Mode is Disabled.", bg='#703207', fg="white")
else:
if check_process_running("xautolock"):
label = tk.Label(message, text="Caffeine Mode is Disabled.", bg='#703207', fg="white")
else:
label = tk.Label(message, text="Caffeine Mode is Enabled.", bg='#703207', fg="white")
# Show window message
label.pack(side=tk.TOP, pady=10)
# Add close button
button = tk.Button(message, text="Close", command=message.destroy, bg='#703207', fg="white")
button.pack(side=tk.TOP, padx=10, pady=10, fill=tk.BOTH)
# Init events bucle
message.mainloop()
def exec_command4(self):
command = "exit"
os.system(command)
exit()
root = tk.Tk()
window = MainWindow(root)
root.mainloop()

View File

@ -103,6 +103,8 @@ bindsym $mod+z exec --no-startup-id nitrogen
bindsym $mod+u exec --no-startup-id xterm
bindsym $mod+t exec --no-startup-id rofi-theme-selector
bindsym $mod+i exec --no-startup-id lxappearance
bindsym $mod+Shift+c exec --no-startup-id ~/.config/i3/caffeine.py
bindsym $mod+Shift+x exec --no-startup-id ~/.config/i3/display-tools.py
# change focus
bindsym $mod+j focus left
@ -253,7 +255,7 @@ for_window [class="Mozilla VPN" instance="mozillavpn"] floating enable
for_window [class="Lxappearance" instance="lxappearance"] floating enable
# reload the configuration file
bindsym $mod+Shift+c reload
#bindsym $mod+Shift+c reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+r restart
# exit i3 (logs you out of your X session)

View File

@ -103,6 +103,8 @@ bindsym $mod+z exec --no-startup-id nitrogen
bindsym $mod+u exec --no-startup-id xterm
bindsym $mod+t exec --no-startup-id rofi-theme-selector
bindsym $mod+i exec --no-startup-id lxappearance
bindsym $mod+Shift+c exec --no-startup-id ~/.config/i3/caffeine.py
bindsym $mod+Shift+x exec --no-startup-id ~/.config/i3/display-tools.py
# change focus
bindsym $mod+j focus left
@ -253,7 +255,7 @@ for_window [class="Mozilla VPN" instance="mozillavpn"] floating enable
for_window [class="Lxappearance" instance="lxappearance"] floating enable
# reload the configuration file
bindsym $mod+Shift+c reload
#bindsym $mod+Shift+c reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+r restart
# exit i3 (logs you out of your X session)

75
.config/i3/display-tools.py Executable file
View File

@ -0,0 +1,75 @@
#!/usr/bin/env python3
import tkinter as tk
import os
import psutil
def check_process_running(process_name):
for proc in psutil.process_iter(['name']):
if proc.info['name'] == process_name:
return True
return False
class MainWindow:
def __init__(self, master):
self.master = master
master.title("Display-Tools.py")
# Set theme and window size
master.configure(bg='#23283f')
master.geometry('350x265')
self.boton1 = tk.Button(master, text="Run ARandR", command=self.exec_command1, bg='#205d2c', fg="white")
self.boton1.pack(side=tk.TOP, pady=10)
self.boton2 = tk.Button(master, text="Run ~/.config/i3/startxrandr.sh", command=self.exec_command2, bg='#205d2c', fg="white")
self.boton2.pack(side=tk.TOP, pady=10)
self.boton3 = tk.Button(master, text="Run xfce4-screenshooter", command=self.exec_command3, bg='#205d2c', fg="white")
self.boton3.pack(side=tk.TOP, pady=10)
self.boton4 = tk.Button(master, text="Start/Restart Conky i3", command=self.exec_command4, bg='#205d2c', fg="white")
self.boton4.pack(side=tk.TOP, pady=10)
self.boton5 = tk.Button(master, text="Exit", command=self.exec_command5, bg='#205d2c', fg="white")
self.boton5.pack(side=tk.TOP, pady=10)
# Set center buttons
self.boton1.pack(side=tk.TOP, padx=10, pady=10, fill=tk.BOTH)
self.boton2.pack(side=tk.TOP, padx=10, pady=10, fill=tk.BOTH)
self.boton3.pack(side=tk.TOP, padx=10, pady=10, fill=tk.BOTH)
self.boton4.pack(side=tk.TOP, padx=10, pady=10, fill=tk.BOTH)
self.boton5.pack(side=tk.TOP, padx=10, pady=10, fill=tk.BOTH)
def exec_command1(self):
print('# Run ARandR')
command = "arandr"
os.system(command)
def exec_command2(self):
print('# Run ~/.config/i3/startxrandr.sh')
command = "killall startwlrrandr.sh"
os.system(command)
command = "~/.config/sway/startwlrrandr.sh &"
os.system(command)
def exec_command3(self):
print('# Run xfce4-screenshooter"')
command = "xfce4-screenshooter"
os.system(command)
def exec_command4(self):
print('# Start/Restart nwg-wrapper (conky sway)')
command = "killall conky && sleep 1"
os.system(command)
command = "conky -c ~/.config/conky/conkyrc_i3 &"
os.system(command)
def exec_command5(self):
command = "exit"
os.system(command)
exit()
root = tk.Tk()
window = MainWindow(root)
root.mainloop()

View File

@ -0,0 +1,91 @@
#!/usr/bin/env python3
import tkinter as tk
import os
import psutil
def check_process_running(process_name):
for proc in psutil.process_iter(['name']):
if proc.info['name'] == process_name:
return True
return False
class MainWindow:
def __init__(self, master):
self.master = master
master.title("Caffeine.py")
# Set theme and window size
master.configure(bg='#262321')
master.geometry('250x215')
self.boton1 = tk.Button(master, text="Enable Caffeine Mode", command=self.exec_command1, bg='#703207', fg="white")
self.boton1.pack(side=tk.TOP, pady=10)
self.boton2 = tk.Button(master, text="Disable Caffeine Mode", command=self.exec_command2, bg='#703207', fg="white")
self.boton2.pack(side=tk.TOP, pady=10)
self.boton3 = tk.Button(master, text="Check Status", command=self.exec_command3, bg='#703207', fg="white")
self.boton3.pack(side=tk.TOP, pady=10)
self.boton4 = tk.Button(master, text="Exit", command=self.exec_command4, bg='#703207', fg="white")
self.boton4.pack(side=tk.TOP, pady=10)
# Set center buttons
self.boton1.pack(side=tk.TOP, padx=10, pady=10, fill=tk.BOTH)
self.boton2.pack(side=tk.TOP, padx=10, pady=10, fill=tk.BOTH)
self.boton3.pack(side=tk.TOP, padx=10, pady=10, fill=tk.BOTH)
self.boton4.pack(side=tk.TOP, padx=10, pady=10, fill=tk.BOTH)
def exec_command1(self):
print('# Enabled Caffeine Mode')
command = "killall startscreensaver.sh 2> /dev/null"
os.system(command)
command = "killall xscreensaver 2> /dev/null"
os.system(command)
command = "killall xautolock 2> /dev/null"
os.system(command)
def exec_command2(self):
command = "killall startscreensaver.sh 2> /dev/null"
os.system(command)
command = "killall xscreensaver 2> /dev/null"
os.system(command)
command = "killall xautolock 2> /dev/null"
os.system(command)
command = "~/.config/qtile/startscreensaver.sh &"
os.system(command)
print('# Disabled Caffeine Mode')
def exec_command3(self):
message = tk.Tk()
message.title("Caffeine.py")
# Set theme and window size
message.configure(bg='#262321')
message.geometry('190x105')
# Verificar si el proceso swayidle está en ejecución
if check_process_running("xscreensaver"):
label = tk.Label(message, text="Caffeine Mode is Disabled.", bg='#703207', fg="white")
else:
if check_process_running("xautolock"):
label = tk.Label(message, text="Caffeine Mode is Disabled.", bg='#703207', fg="white")
else:
label = tk.Label(message, text="Caffeine Mode is Enabled.", bg='#703207', fg="white")
# Show window message
label.pack(side=tk.TOP, pady=10)
# Add close button
button = tk.Button(message, text="Close", command=message.destroy, bg='#703207', fg="white")
button.pack(side=tk.TOP, padx=10, pady=10, fill=tk.BOTH)
# Init events bucle
message.mainloop()
def exec_command4(self):
command = "exit"
os.system(command)
exit()
root = tk.Tk()
window = MainWindow(root)
root.mainloop()

View File

@ -0,0 +1,75 @@
#!/usr/bin/env python3
import tkinter as tk
import os
import psutil
def check_process_running(process_name):
for proc in psutil.process_iter(['name']):
if proc.info['name'] == process_name:
return True
return False
class MainWindow:
def __init__(self, master):
self.master = master
master.title("Display-Tools.py")
# Set theme and window size
master.configure(bg='#23283f')
master.geometry('350x265')
self.boton1 = tk.Button(master, text="Run ARandR", command=self.exec_command1, bg='#205d2c', fg="white")
self.boton1.pack(side=tk.TOP, pady=10)
self.boton2 = tk.Button(master, text="Run ~/.config/qtile/startxrandr.sh", command=self.exec_command2, bg='#205d2c', fg="white")
self.boton2.pack(side=tk.TOP, pady=10)
self.boton3 = tk.Button(master, text="Run xfce4-screenshooter", command=self.exec_command3, bg='#205d2c', fg="white")
self.boton3.pack(side=tk.TOP, pady=10)
self.boton4 = tk.Button(master, text="Start/Restart Conky Qtile", command=self.exec_command4, bg='#205d2c', fg="white")
self.boton4.pack(side=tk.TOP, pady=10)
self.boton5 = tk.Button(master, text="Exit", command=self.exec_command5, bg='#205d2c', fg="white")
self.boton5.pack(side=tk.TOP, pady=10)
# Set center buttons
self.boton1.pack(side=tk.TOP, padx=10, pady=10, fill=tk.BOTH)
self.boton2.pack(side=tk.TOP, padx=10, pady=10, fill=tk.BOTH)
self.boton3.pack(side=tk.TOP, padx=10, pady=10, fill=tk.BOTH)
self.boton4.pack(side=tk.TOP, padx=10, pady=10, fill=tk.BOTH)
self.boton5.pack(side=tk.TOP, padx=10, pady=10, fill=tk.BOTH)
def exec_command1(self):
print('# Run ARandR')
command = "arandr"
os.system(command)
def exec_command2(self):
print('# Run ~/.config/qtile/startxrandr.sh')
command = "killall startwlrrandr.sh"
os.system(command)
command = "~/.config/qtile/startxrandr.sh &"
os.system(command)
def exec_command3(self):
print('# Run xfce4-screenshooter"')
command = "xfce4-screenshooter"
os.system(command)
def exec_command4(self):
print('# Start/Restart Conky Qtile')
command = "killall conky && sleep 1"
os.system(command)
command = "conky -c ~/.config/conky/conkyrc_qtile &"
os.system(command)
def exec_command5(self):
command = "exit"
os.system(command)
exit()
root = tk.Tk()
window = MainWindow(root)
root.mainloop()

View File

@ -66,6 +66,8 @@ keys = [Key(key[0], key[1], *key[2:]) for key in [
([mod], "x", lazy.spawn("lxrandr")),
([mod], "i", lazy.spawn("lxappearance")),
([mod], "v", lazy.spawn("pavucontrol")),
([mod, "shift"], "c", lazy.spawn("~/.config/qtile/settings/caffeine.py")),
([mod, "shift"], "x", lazy.spawn("~/.config/qtile/settings/display-tools.py")),
# Terminal
([mod], "Return", lazy.spawn("kitty")),

View File

@ -99,6 +99,8 @@ My list of extra combinations:
- Super + u = Open Xterm
- Super + i = Open LXAppearance
- Super + c = Open NetWorkManager
- Super + Shift + c = Caffeine Mode
- Super + Shift + x = Display Tools
- Volume-Up = Volume +5
- Volume-Down = Volume -5
- VolumeMute = Mute Volume

View File

@ -93,6 +93,8 @@ My list of extra combinations:
- Super + i = Open LXAppearance
- Super + v = Open Pavucontrol
- Super + s = Open Screenshooter
- Super + Shift + c = Caffeine Mode
- Super + Shift + x = Display Tools
- Volume-Up = Volume +5
- Volume-Down = Volume -5
- VolumeMute = Mute Volume