Merge remote-tracking branch 'origin/main' into dotman-dev
This commit is contained in:
commit
c7728f91ac
1
fetch.theme
Symbolic link
1
fetch.theme
Symbolic link
@ -0,0 +1 @@
|
||||
/home/ferit/scripts/fetchdark.theme
|
4
fetchdark.theme
Normal file
4
fetchdark.theme
Normal file
@ -0,0 +1,4 @@
|
||||
#75FDFF
|
||||
#FFE252
|
||||
#D66565
|
||||
#FFAB3D
|
4
fetchlight.theme
Normal file
4
fetchlight.theme
Normal file
@ -0,0 +1,4 @@
|
||||
#00348A
|
||||
#FFAE00
|
||||
#E04B00
|
||||
#E05955
|
81
modeset.py
Executable file
81
modeset.py
Executable file
@ -0,0 +1,81 @@
|
||||
#!/usr/bin/env python3
|
||||
#
|
||||
# Ferit Yiğit BALABAN, <fyb@duck.com>
|
||||
#
|
||||
# modeset.py is a handy theme switcher for multiple applications.
|
||||
from datetime import datetime
|
||||
import os
|
||||
import sys
|
||||
from subprocess import run
|
||||
|
||||
|
||||
HOME_FOLDR = '/home/ferit'
|
||||
PATH_LOGFL = f'{HOME_FOLDR}/navi.log'
|
||||
DARK_THEME = f'{HOME_FOLDR}/repos/kitty-themes/themes/hardcore.conf'
|
||||
LGHT_THEME = f'{HOME_FOLDR}/repos/kitty-themes/themes/Novel.conf'
|
||||
DARK_WLLPR = f'{HOME_FOLDR}/sources/wallpapers/6kkzj7.png'
|
||||
LGHT_WLLPR = f'{HOME_FOLDR}/sources/wallpapers/5dd9v9.png'
|
||||
DARK_FETCH = f'{HOME_FOLDR}/scripts/fetchdark.theme'
|
||||
LGHT_FETCH = f'{HOME_FOLDR}/scripts/fetchlight.theme'
|
||||
PATH_KITTY = f'{HOME_FOLDR}/.config/kitty/theme.conf'
|
||||
PATH_FETCH = f'{HOME_FOLDR}/scripts/fetch.theme'
|
||||
KBD_NAME = 'asus::kbd_backlight'
|
||||
|
||||
|
||||
def write(status: str):
|
||||
log = f'[{datetime.now().strftime("%d/%m/%y-%H.%M.%S")}]'
|
||||
log += 'navi is going dark.' if status == 'dark' else 'navi is enlightened.'
|
||||
with open(PATH_LOGFL, 'a') as f:
|
||||
f.write(log)
|
||||
f.close()
|
||||
|
||||
|
||||
def set_kbdlight(intensity: int):
|
||||
run(['brightnessctl', 'set', '--device', KBD_NAME, str(intensity)])
|
||||
|
||||
|
||||
def set_wallpaper(wallpaper: str):
|
||||
run(['nitrogen', '--set-centered', wallpaper])
|
||||
|
||||
|
||||
def set_fetchpy(theme: str):
|
||||
try:
|
||||
os.remove(PATH_FETCH)
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
os.symlink(theme, PATH_FETCH)
|
||||
|
||||
|
||||
def set_kitty(theme: str):
|
||||
try:
|
||||
os.remove(PATH_KITTY)
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
os.symlink(theme, PATH_KITTY)
|
||||
|
||||
|
||||
def main():
|
||||
sys.argv.reverse()
|
||||
sys.argv.pop()
|
||||
if len(sys.argv) != 0:
|
||||
mode = sys.argv.pop()
|
||||
if mode == 'd' or mode == 'dark':
|
||||
set_kitty(DARK_THEME)
|
||||
set_wallpaper(DARK_WLLPR)
|
||||
set_fetchpy(DARK_FETCH)
|
||||
set_kbdlight(1)
|
||||
write('dark')
|
||||
elif mode == 'l' or mode == 'light':
|
||||
set_kitty(LGHT_THEME)
|
||||
set_wallpaper(LGHT_WLLPR)
|
||||
set_fetchpy(LGHT_FETCH)
|
||||
set_kbdlight(0)
|
||||
write('light')
|
||||
else:
|
||||
print("Error: expected d, dark, l or light as argument.")
|
||||
exit(1)
|
||||
exit(0)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
6
reboot.sh
Normal file
6
reboot.sh
Normal file
@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
dt=$(date +'%d/%m/%y-%H.%M.%S')
|
||||
echo "[$dt] navi restarting..." >> $HOME/navi.log
|
||||
brightnessctl --device amdgpu_bl1 set 128
|
||||
brightnessctl --device asus::kbd_backlight 1
|
||||
reboot
|
6
shutdown.sh
Executable file
6
shutdown.sh
Executable file
@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
dt=$(date +'%d/%m/%y-%H.%M.%S')
|
||||
echo "[$dt] navi shutting down..." >> navi.log
|
||||
brightnessctl set 128
|
||||
brightnessctl --device asus::kbd_backlight 1
|
||||
shutdown -h now
|
Loading…
x
Reference in New Issue
Block a user