Compare commits

...

5 Commits

Author SHA1 Message Date
yutent 449353ce84 修改代码目录 2024-01-29 18:24:33 +08:00
yutent fa38bcb985 fixed icon 2024-01-26 13:22:54 +08:00
yutent da94875407 修复一处语法错误 2023-09-11 14:55:19 +08:00
yutent 842793ff79 修复在新设备上死循环的bug 2023-09-11 14:30:27 +08:00
yutent 1760fbd212 设置应用的窗口名和标题 2023-09-07 13:37:32 +08:00
27 changed files with 11 additions and 3 deletions

View File

@ -4,7 +4,7 @@ if [ -d unpack ]; then
sudo rm -rf unpack sudo rm -rf unpack
fi fi
version="3.0.1" version="3.0.6"
mkdir -p unpack/DEBIAN mkdir -p unpack/DEBIAN
@ -26,6 +26,7 @@ sed -i "s/{{size}}/${_size}/" DEBIAN/control
sed -i "s/{{version}}/${version}/" DEBIAN/control sed -i "s/{{version}}/${version}/" DEBIAN/control
cd .. cd ..
sudo chown -R root:root unpack/
dpkg-deb -b unpack/ "hosts-switch-${version}.deb" dpkg-deb -b unpack/ "hosts-switch-${version}.deb"
sudo rm -rf unpack sudo rm -rf unpack

View File

@ -1,3 +1,3 @@
#!/bin/bash #!/bin/bash
/usr/lib/hosts-switch/hosts-switch.py /usr/share/hosts-switch/hosts-switch.py

View File

@ -11,6 +11,9 @@ class Window(Gtk.Window):
Gtk.Window.__init__(self, title = title) Gtk.Window.__init__(self, title = title)
self.set_default_size(width, height) self.set_default_size(width, height)
self.resize(width, height) self.resize(width, height)
self.set_wmclass('Hosts-Switch', 'Hosts-Switch')
self.set_title('Hosts-Switch')
self.set_icon_name('hosts-switch')
def toggle_visible(self, icon): def toggle_visible(self, icon):

View File

@ -13,8 +13,12 @@ APP_ID = 'fun.wkit.hosts-switch'
__dir__ = os.path.dirname(os.path.realpath(__file__)) __dir__ = os.path.dirname(os.path.realpath(__file__))
web_root = os.path.join(__dir__, './webapp') web_root = os.path.join(__dir__, './webapp')
home_dir = os.getenv('HOME')
config_dir = os.path.join(home_dir, '.config/hosts-switch')
if not os.path.isdir(config_dir):
os.mkdir(config_dir)
class Application(Gtk.Application): class Application(Gtk.Application):

View File

@ -101,7 +101,7 @@ class Sidebar extends Component {
toggleDomain(ev, name) { toggleDomain(ev, name) {
let { HOST_DATA, records } = this.$store let { HOST_DATA, records } = this.$store
name = name || ev.currentTarget.dataset.name name = name ?? ev.currentTarget.dataset.name
this.$store.activeDomain = name this.$store.activeDomain = name
this.$store.records = records = (HOST_DATA[name] || []).sort((a, b) => this.$store.records = records = (HOST_DATA[name] || []).sort((a, b) =>