Skip to content

Commit

Permalink
Basic fallback method for konsole profile switch
Browse files Browse the repository at this point in the history
  • Loading branch information
heddxh committed Jan 15, 2024
1 parent 70e85d8 commit ebb016b
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions yin_yang/plugins/konsole.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,16 @@ def set_profile(service: str, profile: str):
try:
sessions = subprocess.check_output(f'qdbus {service} | grep "Sessions/"', shell=True)
except subprocess.CalledProcessError:
# happens when dolphins konsole is not opened
logger.debug(f'No Konsole sessions available in service {service}, skipping')
return
try:
sessions = subprocess.check_output(
f'qdbus org.kde.konsole | grep "Sessions/"', shell=True
)
logger.debug(f'Found org.kde.konsole, use that instead')
service = "org.kde.konsole"
except subprocess.CalledProcessError:
# happens when dolphins konsole is not opened
logger.debug(f'No Konsole sessions available in service {service}, skipping')
return
sessions = sessions.decode('utf-8').removesuffix('\n').split('\n')

# loop: process sessions
Expand Down

0 comments on commit ebb016b

Please sign in to comment.