File tree Expand file tree Collapse file tree 4 files changed +12
-5
lines changed Expand file tree Collapse file tree 4 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -141,8 +141,8 @@ force_transparency = False
141141calculated_color_factor = 0
142142
143143# Console theme
144- # This is the theme to be used when a PyRasio is executed either in a linux
145- # virtual console , or on a terminal that does not support color change.
144+ # This is the theme to be used when a PyRadio is executed either in a Linux
145+ # Virtual Console , or on a terminal that does not support color change.
146146# Possible values: dark / light
147147#
148148# Default value: dark
Original file line number Diff line number Diff line change 3333from .server import IPsWithNumbers
3434from .xdg import XdgDirs , XdgMigrate , CheckDir
3535from .install import get_a_linux_resource_opener
36+ from .html_help import is_graphical_environment_running
3637HAS_REQUESTS = True
3738
3839try :
@@ -1494,7 +1495,9 @@ def enable_mouse(self, val):
14941495
14951496 @property
14961497 def enable_notifications (self ):
1497- return self .opts ['enable_notifications' ][1 ]
1498+ if is_graphical_environment_running ():
1499+ return self .opts ['enable_notifications' ][1 ]
1500+ return False
14981501
14991502 @enable_notifications .setter
15001503 def enable_notifications (self , val ):
Original file line number Diff line number Diff line change 22import subprocess
33import logging
44from sys import platform
5- from os import path , environ , listdir
5+ from os import path , environ , listdir , getenv
66from shutil import which
77from .install import get_a_linux_resource_opener
88try :
@@ -29,6 +29,9 @@ def convert_to_md(a_file):
2929
3030def is_graphical_environment_running ():
3131 global HAS_GRAPHICAL_ENV
32+ if getenv ('TERM' ) == 'linux' :
33+ HAS_GRAPHICAL_ENV = 2
34+ return False
3235 if HAS_GRAPHICAL_ENV == 1 :
3336 return True
3437 elif HAS_GRAPHICAL_ENV == 2 :
Original file line number Diff line number Diff line change @@ -466,7 +466,8 @@ def _show_notification(self, msg):
466466 self ._repeat_notification .reset_timer ()
467467
468468 else :
469- if self ._cnf ._notification_command :
469+ if self ._cnf ._notification_command and \
470+ self ._cnf .enable_notifications :
470471 d_title , d_msg = self ._get_desktop_notification_data (msg )
471472 if d_msg :
472473 if self ._cnf ._current_notification_message != d_msg :
You can’t perform that action at this time.
0 commit comments