Skip to content

Commit

Permalink
WIP: Maybe try to not rename svgs
Browse files Browse the repository at this point in the history
  • Loading branch information
A6GibKm committed Nov 23, 2022
1 parent 2ea8ff9 commit 4185710
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 69 deletions.
130 changes: 65 additions & 65 deletions data/svgs/svg-lookup.ini
Original file line number Diff line number Diff line change
@@ -1,259 +1,259 @@
[ASUS ROG Gladius II Origin]
DeviceMatch=usb:0b05:1877
Svg=asus-rog-gladius2-origin
Svg=asus-rog-gladius2-origin.svg

[ASUS ROG Gladius II Origin PNK LTD]
DeviceMatch=usb:0b05:18cd
Svg=asus-rog-gladius2-origin-pink
Svg=asus-rog-gladius2-origin-pink.svg

[ASUS ROG Keris Wireless]
DeviceMatch=usb:0b05:195e;usb:0b05:1960
Svg=asus-rog-keris-wireless
Svg=asus-rog-keris-wireless.svg

[ASUS ROG Strix Carry]
DeviceMatch=usb:0b05:18b4
Svg=asus-rog-strix-carry
Svg=asus-rog-strix-carry.svg

[ASUS ROG Strix Impact II Wireless]
DeviceMatch=usb:0b05:1949;usb:0b05:1947
Svg=asus-rog-strix-impact2-wireless
Svg=asus-rog-strix-impact2-wireless.svg

[Etekcity Scroll Alpha]
DeviceMatch=usb:1ea7:4011
Svg=fallback
Svg=fallback.svg

[Logitech G102/G103]
DeviceMatch=usb:046d:c084;usb:046d:c092
Svg=logitech-g102-g203
Svg=logitech-g102-g203.svg

[Logitech G300]
DeviceMatch=usb:046d:c246
Svg=logitech-g300
Svg=logitech-g300.svg

[Logitech G302]
DeviceMatch=usb:046d:c07f
Svg=logitech-g303
Svg=logitech-g303.svg

[Logitech G303]
DeviceMatch=usb:046d:c080
Svg=logitech-g303
Svg=logitech-g303.svg

[Logitech G305]
DeviceMatch=usb:046d:4074
Svg=logitech-g-pro
Svg=logitech-g-pro.svg

[Logitech G402]
DeviceMatch=usb:046d:c07e
Svg=logitech-g402
Svg=logitech-g402.svg

[Logitech G403]
DeviceMatch=usb:046d:c083
Svg=logitech-g403
Svg=logitech-g403.svg

[Logitech G403 Hero]
DeviceMatch=usb:046d:c08f
Svg=logitech-g403
Svg=logitech-g403.svg

[Logitech G403 Wireless]
DeviceMatch=usb:046d:c082;usb:046d:405d
Svg=logitech-g403
Svg=logitech-g403.svg

[Logitech G500]
DeviceMatch=usb:046d:c068
Svg=logitech-g500
Svg=logitech-g500.svg

[Logitech G500s]
DeviceMatch=usb:046d:c24e
Svg=logitech-g500s
Svg=logitech-g500s.svg

[Logitech G502 X Wireless]
DeviceMatch=usb:046d:c098
Svg=logitech-g502-x
Svg=logitech-g502-x.svg

[Logitech G502 X]
DeviceMatch=usb:046d:c099
Svg=logitech-g502-x
Svg=logitech-g502-x.svg

[Logitech G502 Hero Wireless]
DeviceMatch=usb:046d:407f;usb:046d:c08d
Svg=logitech-g502
Svg=logitech-g502.svg

[Logitech G502 Hero]
DeviceMatch=usb:046d:c08b
Svg=logitech-g502
Svg=logitech-g502.svg

[Logitech G502 Proteus Core]
DeviceMatch=usb:046d:c07d
Svg=logitech-g502
Svg=logitech-g502.svg

[Logitech G502 Proteus Spectrum]
DeviceMatch=usb:046d:c332
Svg=logitech-g502
Svg=logitech-g502.svg

[Logitech G513 Carbon]
DeviceMatch=usb:046d:c33c
Svg=logitech-g513
Svg=logitech-g513.svg

[Logitech G600]
DeviceMatch=usb:046d:c24a
Svg=logitech-g600
Svg=logitech-g600.svg

[Logitech G602]
DeviceMatch=usb:046d:402c
Svg=logitech-g602
Svg=logitech-g602.svg

[Logitech G603]
DeviceMatch=bluetooth:046d:b01c;usb:046d:406c
Svg=logitech-g603
Svg=logitech-g603.svg

[Logitech G604]
DeviceMatch=usb:046d:4085;bluetooth:046d:b024
Svg=logitech-g604
Svg=logitech-g604.svg

[Logitech G700]
DeviceMatch=usb:046d:c06b;usb:046d:c07c
Svg=logitech-g700
Svg=logitech-g700.svg

[Logitech G700s]
DeviceMatch=usb:046d:c531
Svg=logitech-g700
Svg=logitech-g700.svg

[Logitech G703]
DeviceMatch=usb:046d:c087;usb:046d:4070
Svg=logitech-g703
Svg=logitech-g703.svg

[Logitech G703 Hero]
DeviceMatch=usb:046d:c090;usb:046d:4086
Svg=logitech-g703
Svg=logitech-g703.svg

[Logitech G815]
DeviceMatch=usb:046d:c33f
Svg=logitech-g815
Svg=logitech-g815.svg

[Logitech G915]
DeviceMatch=usb:046d:c33e;usb:046d:c541
Svg=logitech-g815
Svg=logitech-g815.svg

[Logitech G900]
DeviceMatch=usb:046d:c081;usb:046d:4053
Svg=logitech-g900
Svg=logitech-g900.svg

[Logitech G903]
DeviceMatch=usb:046d:c086;usb:046d:4067
Svg=logitech-g900
Svg=logitech-g900.svg

[Logitech G903 Hero]
DeviceMatch=usb:046d:c091;usb:046d:4087
Svg=logitech-g900
Svg=logitech-g900.svg

[Logitech G9]
DeviceMatch=usb:046d:c048
Svg=logitech-g9
Svg=logitech-g9.svg

[Logitech G9x]
DeviceMatch=usb:046d:c066;usb:046d:c249
Svg=logitech-g9
Svg=logitech-g9.svg

[Logitech G Pro]
DeviceMatch=usb:046d:c085;usb:046d:c08c
Svg=logitech-g-pro
Svg=logitech-g-pro.svg

[Logitech G Pro Wireless]
DeviceMatch=usb:046d:c088;usb:046d:4079
Svg=logitech-g-pro-wireless
Svg=logitech-g-pro-wireless.svg

[Logitech G Pro X Wireless Superlight]
DeviceMatch=usb:046d:4093;usb:046d:c094
Svg=logitech-g-pro-x-wireless-superlight
Svg=logitech-g-pro-x-wireless-superlight.svg

[Logitech M500s]
DeviceMatch=usb:046d:c093
Svg=logitech-m500s
Svg=logitech-m500s.svg

[Logitech M720]
DeviceMatch=usb:046d:405e;bluetooth:046d:b015
Svg=logitech-m720
Svg=logitech-m720.svg

[Logitech MX518]
DeviceMatch=usb:046d:c08e
Svg=logitech-mx518
Svg=logitech-mx518.svg

[Logitech MX Anywhere 3]
DeviceMatch=usb:046d:c52b;bluetooth:046d:b025
Svg=logitech-mx-anywhere3
Svg=logitech-mx-anywhere3.svg

[Logitech MX Anywhere 2]
DeviceMatch=usb:046d:404a;usb:046d:4072;usb:046d:4063;bluetooth:046d:b013;bluetooth:046d:b018;bluetooth:046d:b01f
Svg=logitech-mx-anywhere2
Svg=logitech-mx-anywhere2.svg

[Logitech MX Anywhere 2S]
DeviceMatch=bluetooth:046d:b01a;usb:046d:406a
Svg=logitech-mx-anywhere2
Svg=logitech-mx-anywhere2.svg

[Logitech MX Ergo]
DeviceMatch=bluetooth:046d:b01d;usb:046d:406f
Svg=logitech-mx-ergo
Svg=logitech-mx-ergo.svg

[Logitech MX Master 3]
DeviceMatch=bluetooth:046d:b023;usb:046d:4082
Svg=logitech-mx-master-3
Svg=logitech-mx-master-3.svg

[Logitech MX Master 2S]
DeviceMatch=bluetooth:046d:b019;usb:046d:4069
Svg=logitech-mx-master-2s
Svg=logitech-mx-master-2s.svg

[Logitech MX Master]
DeviceMatch=usb:046d:4041;bluetooth:046d:b012;usb:046d:4060;bluetooth:046d:b017;usb:046d:4071
Svg=logitech-mx-master
Svg=logitech-mx-master.svg

[Logitech MX Vertical]
DeviceMatch=bluetooth:046d:b020;usb:046d:407b;usb:046d:c08a
Svg=logitech-mx-vertical
Svg=logitech-mx-vertical.svg

[Mars Gaming MM4]
DeviceMatch=usb:04d9:fa58
Svg=marsgaming-mm4
Svg=marsgaming-mm4.svg

[Roccat Kone Pure]
DeviceMatch=usb:1e7d:2dc2;usb:1e7d:2dbe
Svg=roccat-kone-pure
Svg=roccat-kone-pure.svg

[Roccat Kone XTD]
DeviceMatch=usb:1e7d:2e22
Svg=roccat-kone-xtd
Svg=roccat-kone-xtd.svg

[SteelSeries Kinzu V2]
DeviceMatch=usb:1038:1378
Svg=steelseries-kinzu-v2
Svg=steelseries-kinzu-v2.svg

[SteelSeries Kinzu V3]
DeviceMatch=usb:1038:1388
Svg=steelseries-kinzu-v3
Svg=steelseries-kinzu-v3.svg

[SteelSeries Rival 310]
DeviceMatch=usb:1038:1720
Svg=steelseries-rival310
Svg=steelseries-rival310.svg

[SteelSeries Rival 600]
DeviceMatch=usb:1038:1724
Svg=steelseries-rival600
Svg=steelseries-rival600.svg

[SteelSeries Rival]
DeviceMatch=usb:1038:1384
Svg=steelseries-rival
Svg=steelseries-rival.svg

[SteelSeries Sensei 310]
DeviceMatch=usb:1038:1722
Svg=steelseries-sensei310
Svg=steelseries-sensei310.svg

[SteelSeries Sensei Raw]
DeviceMatch=usb:1038:1369
Svg=steelseries-senseiraw
Svg=steelseries-senseiraw.svg

[SteelSeries Sensei Ten]
DeviceMatch=usb:1038:1832
Svg=steelseries-senseiten
Svg=steelseries-senseiten.svg

[SN Tech T3]
DeviceMatch=usb:258a:0012
Svg=sn-tech-t3
Svg=sn-tech-t3.svg
4 changes: 2 additions & 2 deletions piper/svg.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ def get_svg(model):

if manager := Handy.StyleManager.get_default():
if manager.get_dark():
filename += '-dark'
filename = filename.replace('.svg', '-dark.svg')

resource = Gio.resources_lookup_data('/org/freedesktop/Piper/svgs/{}.svg'.format(filename),
resource = Gio.resources_lookup_data('/org/freedesktop/Piper/svgs/{}'.format(filename),
Gio.ResourceLookupFlags.NONE)

return resource.get_data()
3 changes: 1 addition & 2 deletions tests/svg-lookup-ini-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ def test_required(self):

def test_svg_filename(self):
svgs = [config[s]['Svg'] for s in config.sections()]
for filename in svgs:
svg = f'{filename}.svg'
for svg in svgs:
self.assertTrue(Path(svgdir, svg).exists(), msg=svg)

def test_uniq_match(self):
Expand Down

0 comments on commit 4185710

Please sign in to comment.