Skip to content

Commit

Permalink
Minor PEP8 improvements
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Castleman <contact@draugeros.org>
  • Loading branch information
Batcastle committed Mar 23, 2024
1 parent 0c7f235 commit 49146d6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions usr/lib/python3/dist-packages/de_control/_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@
"""Common internal functions for de_control"""
import os


def get_de():
return os.getenv("XDG_CURRENT_DESKTOP").upper()
5 changes: 3 additions & 2 deletions usr/lib/python3/dist-packages/de_control/modify.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,18 @@ def for_desktop(username):
__eprint__("DESKTOP DETECTED. EDITING PANEL ACCORDINGLY.")
de = com.get_de()
if de == "XFCE":
config = f"/home/{ username }/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml"
try:
os.remove("/home/" + username + "/.config/xfce4/panel/battery-12.rc")
except FileNotFoundError:
pass
with open("/home/" + username + "/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml", "r") as file:
with open(config, "r") as file:
xml = file.read().split("\n")
for each in range(len(xml) - 1, -1, -1):
if "battery" in xml[each]:
del xml[each]
xml = "\n".join(xml)
with open("/home/" + username + "/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml", "w") as file:
with open(config, "w") as file:
file.write(xml)
elif de == "KDE":
__eprint__("WARNING: KDE detected. KDE support not yet implemented.")
Expand Down

0 comments on commit 49146d6

Please sign in to comment.