add stuff
This commit is contained in:
30
.local/share/darkman/gtk-theme.py
Executable file
30
.local/share/darkman/gtk-theme.py
Executable file
@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import subprocess
|
||||
from argparse import ArgumentParser
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = ArgumentParser(description="GTK theme switcher")
|
||||
parser.add_argument(
|
||||
"mode",
|
||||
help="The mode to switch the GTK theme to (e.g., 'dark' or 'light')",
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.mode not in ["dark", "light"]:
|
||||
print("Invalid mode. Please choose 'dark' or 'light'.")
|
||||
exit(1)
|
||||
|
||||
gtk_theme = "Adwaita-dark" if args.mode == "dark" else "Adwaita"
|
||||
color_scheme = "prefer-dark" if args.mode == "dark" else "prefer-light"
|
||||
|
||||
# Set the GTK theme using gsettings
|
||||
subprocess.run(
|
||||
["gsettings", "set", "org.gnome.desktop.interface", "gtk-theme", gtk_theme],
|
||||
check=True,
|
||||
)
|
||||
subprocess.run(
|
||||
["gsettings", "set", "org.gnome.desktop.interface", "color-scheme", color_scheme],
|
||||
check=True,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user