Skip to content

Commit

Permalink
fixed a bug where gnome would not be recognized correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
oskarsh committed Apr 3, 2019
1 parent 5f8c19d commit dcef1e0
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,18 @@ def exists():
# returns True or False wether Config exists or note
return os.path.isfile(path+"/yin_yang/yin_yang.json")


def getDesktop():
word = str(subprocess.check_output(["w"]))
regexp = re.compile(r'gnome')
if regexp.search(word):
env = str(os.getenv("GDMSESSION"))
if env == "gnome":
return "gtk"
if env == "budgie-desktop":
return "gtk"
regexp = re.compile(r'kde')
if regexp.search(word):
if env == "plasma":
return "kde"
if env == "plasma-desktop":
return "kde"
return "unknown"



# generate path for yin-yang if there is none this will be skipped
Expand Down

3 comments on commit dcef1e0

@yochananmarqos
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just tried this on GNOME, this happens when clicking the Settings button:

$ env QT_AUTO_SCREEN_SCALE_FACTOR=1 sh /usr/bin/yin-yang -gui
qt5ct: using qt5ct plugin
0
Traceback (most recent call last):
  File "/opt/yin-yang/src/gui.py", line 223, in openSettings
    self.secwindow = SettingsWindow()
  File "/opt/yin-yang/src/gui.py", line 24, in __init__
    self.syncWithConfig()
  File "/opt/yin-yang/src/gui.py", line 76, in syncWithConfig
    self.getKdeThemes()
  File "/opt/yin-yang/src/gui.py", line 125, in getKdeThemes
    if (config.get("desktop") == "kde"):
  File "/opt/yin-yang/src/config.py", line 146, in get
    return config[key]
KeyError: 'desktop'
/usr/bin/yin-yang: line 2:  1656 Aborted                 (core dumped) python3 /opt/yin-yang/main.py $@

@oskarsh
Copy link
Owner Author

@oskarsh oskarsh commented on dcef1e0 Apr 3, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you run the install again? It seems like you are running a older config. I just pushed an update today fixing this issue. If this still exists please fill an issue.

@yochananmarqos
Copy link

@yochananmarqos yochananmarqos commented on dcef1e0 Apr 3, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done: #20

Please sign in to comment.