Skip to content

Commit 681eb75

Browse files
添加Linux系统自动使用GTK后端支持
1 parent ae3b81f commit 681eb75

3 files changed

Lines changed: 7 additions & 0 deletions

File tree

.DS_Store

0 Bytes
Binary file not shown.

icons/icons/settings/widgets.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="m18.5 2.33 3.17 3.18c.88.88.88 2.3 0 3.18l-2.58 2.59A2.25 2.25 0 0 1 21 13.5v5.25C21 20 20 21 18.75 21H5.25C4.01 21 3 20 3 18.75V5.25C3 4.01 4 3 5.25 3h5.25c1.13 0 2.06.83 2.23 1.92l2.58-2.59c.88-.88 2.3-.88 3.18 0Zm-14 16.42c0 .41.34.75.75.75h6v-6.75H4.5v6Zm8.25.75h6c.41 0 .75-.34.75-.75V13.5a.75.75 0 0 0-.75-.75h-6v6.75Zm-2.25-15H5.25a.75.75 0 0 0-.75.75v6h6.75v-6a.75.75 0 0 0-.75-.75Zm2.25 4.81v1.94h1.94l-1.94-1.94Zm3.62-5.92L13.2 6.57c-.3.3-.3.77 0 1.06l3.18 3.18c.3.3.77.3 1.06 0l3.18-3.18c.3-.3.3-.77 0-1.06l-3.18-3.18a.75.75 0 0 0-1.06 0Z"/></svg>

main.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414
from PIL import Image, ImageDraw
1515
import pystray
1616

17+
# 根据操作系统设置默认的GUI后端
18+
system = platform.system()
19+
if system == 'Linux':
20+
# Linux系统默认使用GTK后端
21+
os.environ['WEBVIEW_GUI'] = 'gtk'
22+
1723
# 修改默认端口
1824
http.DEFAULT_HTTP_PORT = 2001
1925

0 commit comments

Comments
 (0)