File tree Expand file tree Collapse file tree 4 files changed +3
-37
lines changed Expand file tree Collapse file tree 4 files changed +3
-37
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,6 @@ All valid options for the widgets are listed on the widgets page.
15
15
| ` watch_stylesheet ` | boolean | ` true ` | Reload bar when style is changed. |
16
16
| ` watch_config ` | boolean | ` true ` | Reload bar when config is changed. |
17
17
| ` debug ` | boolean | ` false ` | Enable debug mode to see more logs |
18
- | ` hide_taskbar ` | boolean | ` false ` | Hide Windows taskbar from all screens. Note: for better performance set taskbar auto-hide. |
19
18
| ` env_file ` | string | ` None ` | Load environment variables from file. |
20
19
21
20
Original file line number Diff line number Diff line change 1
1
import ctypes .wintypes
2
2
from core .event_enums import Event
3
- import logging
4
3
5
4
user32 = ctypes .windll .user32
6
5
user32 .SetWinEventHook .restype = ctypes .wintypes .HANDLE
19
18
ctypes .wintypes .DWORD
20
19
)
21
20
22
-
23
21
class WinEvent (Event ):
24
22
"""
25
23
Win32user Event Constants
@@ -101,22 +99,4 @@ class WinEvent(Event):
101
99
EventUIAEventIdStart = 0x4E00
102
100
EventUIAEventIdEnd = 0x4EFF
103
101
EventUIAPropIdStart = 0x7500
104
- EventUIAPropIdEnd = 0x75FF
105
-
106
-
107
- class WindowsTaskbar :
108
- @staticmethod
109
- def hide (state , debug ):
110
- SW_SHOWNORMAL = 1
111
- SW_HIDE = 0
112
- user32 = ctypes .WinDLL ('user32' , use_last_error = True )
113
- try :
114
- for class_name in ["Shell_TrayWnd" , "Shell_SecondaryTrayWnd" ]:
115
- taskbar = user32 .FindWindowW (class_name , None )
116
- if taskbar :
117
- user32 .ShowWindow (taskbar , SW_HIDE if state else SW_SHOWNORMAL )
118
- if debug :
119
- logging .info (f"Taskbar { taskbar } found and { 'hide' if state else 'restore' } ." )
120
- except Exception as e :
121
- if debug :
122
- logging .error (f"Failed to hide taskbar: { e } " )
102
+ EventUIAPropIdEnd = 0x75FF
Original file line number Diff line number Diff line change 20
20
'required' : False ,
21
21
'default' : None ,
22
22
},
23
- 'hide_taskbar' : {
24
- 'type' : 'boolean' ,
25
- 'default' : False ,
26
- 'required' : False ,
27
- },
28
23
'komorebi' : {
29
24
'type' : 'dict' ,
30
25
'schema' : {
Original file line number Diff line number Diff line change 13
13
import settings
14
14
import ctypes
15
15
import ctypes .wintypes
16
- from core .utils .win32 .windows import WindowsTaskbar
17
16
from dotenv import load_dotenv
18
17
19
18
logging .getLogger ('asyncio' ).setLevel (logging .WARNING )
20
19
21
20
def main ():
22
21
config , stylesheet = get_config_and_stylesheet ()
23
- global hide_taskbar
24
- hide_taskbar = config ['hide_taskbar' ]
25
-
22
+
26
23
if config ['debug' ]:
27
24
settings .DEBUG = True
28
25
logging .info ("Debug mode enabled." )
@@ -61,22 +58,17 @@ def stop_observer():
61
58
if observer :
62
59
observer .stop ()
63
60
observer .join ()
64
- if hide_taskbar :
65
- WindowsTaskbar .hide (False , settings .DEBUG )
61
+
66
62
app .aboutToQuit .connect (stop_observer )
67
63
68
64
with loop :
69
- if hide_taskbar :
70
- WindowsTaskbar .hide (True , settings .DEBUG )
71
65
loop .run_forever ()
72
66
73
67
74
68
if __name__ == "__main__" :
75
69
init_logger ()
76
70
base_excepthook = sys .excepthook
77
71
def exception_hook (exctype , value , traceback ):
78
- if hide_taskbar :
79
- WindowsTaskbar .hide (False , settings .DEBUG )
80
72
EventService ().clear ()
81
73
logging .error ("Unhandled exception" , exc_info = value )
82
74
sys .exit (1 )
You can’t perform that action at this time.
0 commit comments