Browse Source

Removed qutebrowser dependency on xresources

master
Micah Halter 1 month ago
parent
commit
60d7638d91
2 changed files with 71 additions and 77 deletions
  1. 1
    1
      i3/.config/i3/config
  2. 70
    76
      qutebrowser/.config/qutebrowser/config.py

+ 1
- 1
i3/.config/i3/config View File

@@ -24,7 +24,7 @@ for_window [class="^.*"] border pixel 5
24 24
 gaps inner $defaultgaps
25 25
 
26 26
 # colors
27
-set_from_resource $bg-color 	         i3wm.color7 #676E7D
27
+set_from_resource $bg-color            i3wm.color7 #676E7D
28 28
 set_from_resource $inactive-bg-color   i3wm.color0 #2f343f
29 29
 set_from_resource $text-color          i3wm.color7 #f3f4f5
30 30
 set_from_resource $inactive-text-color i3wm.color8 #676E7D

+ 70
- 76
qutebrowser/.config/qutebrowser/config.py View File

@@ -3,128 +3,122 @@
3 3
 ##   qute://help/configuring.html
4 4
 ##   qute://help/settings.html
5 5
 
6
-import subprocess
6
+import os
7 7
 
8
-def read_xresources(prefix):
9
-    props = {}
10
-    x = subprocess.run(['xrdb', '-query'], stdout=subprocess.PIPE)
11
-    lines = x.stdout.decode().split('\n')
12
-    for line in filter(lambda l : l.startswith(prefix), lines):
13
-        prop, _, value = line.partition(':\t')
14
-        props[prop] = value
15
-    return props
8
+colors = []
16 9
 
17
-xresources = read_xresources('*')
10
+with open(os.getenv('XDG_CONFIG_HOME', '~/.config')+'/wpg/formats/colors') as f:
11
+    colors = f.read().splitlines()
18 12
 
19 13
 config.load_autoconfig()
20 14
 
21
-c.colors.completion.category.bg = xresources['*color6']
22
-c.colors.completion.category.fg = xresources['*color0']
15
+c.colors.completion.category.bg = colors[6]
16
+c.colors.completion.category.fg = colors[0]
23 17
 
24
-c.colors.completion.category.border.bottom = xresources['*color0']
25
-c.colors.completion.category.border.top = xresources['*color6']
18
+c.colors.completion.category.border.bottom = colors[0]
19
+c.colors.completion.category.border.top = colors[6]
26 20
 
27
-c.colors.completion.even.bg = xresources['*color0']
21
+c.colors.completion.even.bg = colors[0]
28 22
 
29
-c.colors.completion.odd.bg = xresources['*color0']
23
+c.colors.completion.odd.bg = colors[0]
30 24
 
31
-c.colors.completion.item.selected.bg = xresources['*color4']
32
-c.colors.completion.item.selected.fg = xresources['*color7']
25
+c.colors.completion.item.selected.bg = colors[4]
26
+c.colors.completion.item.selected.fg = colors[7]
33 27
 
34
-c.colors.completion.item.selected.border.bottom = xresources['*color4']
28
+c.colors.completion.item.selected.border.bottom = colors[4]
35 29
 
36
-c.colors.completion.match.fg = xresources['*color2']
30
+c.colors.completion.match.fg = colors[2]
37 31
 
38
-c.colors.completion.scrollbar.bg = xresources['*color7']
39
-c.colors.completion.scrollbar.fg = xresources['*color0']
32
+c.colors.completion.scrollbar.bg = colors[7]
33
+c.colors.completion.scrollbar.fg = colors[0]
40 34
 
41
-c.colors.downloads.bar.bg = xresources['*color0']
35
+c.colors.downloads.bar.bg = colors[0]
42 36
 
43
-c.colors.downloads.error.bg = xresources['*color1']
44
-c.colors.downloads.error.fg = xresources['*color8']
37
+c.colors.downloads.error.bg = colors[1]
38
+c.colors.downloads.error.fg = colors[8]
45 39
 
46
-c.colors.downloads.start.bg = xresources['*color5']
47
-c.colors.downloads.start.fg = xresources['*color7']
40
+c.colors.downloads.start.bg = colors[5]
41
+c.colors.downloads.start.fg = colors[7]
48 42
 
49
-c.colors.downloads.stop.bg = xresources['*color2']
50
-c.colors.downloads.stop.fg = xresources['*color8']
43
+c.colors.downloads.stop.bg = colors[2]
44
+c.colors.downloads.stop.fg = colors[8]
51 45
 
52
-c.colors.hints.bg = xresources['*color0']
53
-c.colors.hints.fg = xresources['*color7']
46
+c.colors.hints.bg = colors[0]
47
+c.colors.hints.fg = colors[7]
54 48
 
55
-c.colors.hints.match.fg = xresources['*color3']
49
+c.colors.hints.match.fg = colors[3]
56 50
 
57
-c.colors.keyhint.bg = xresources['*color0']
58
-c.colors.keyhint.fg = xresources['*color7']
51
+c.colors.keyhint.bg = colors[0]
52
+c.colors.keyhint.fg = colors[7]
59 53
 
60
-c.colors.keyhint.suffix.fg = xresources['*color3']
54
+c.colors.keyhint.suffix.fg = colors[3]
61 55
 
62
-c.colors.messages.error.bg = xresources['*color1']
63
-c.colors.messages.error.border = xresources['*color1']
64
-c.colors.messages.error.fg = xresources['*color8']
56
+c.colors.messages.error.bg = colors[1]
57
+c.colors.messages.error.border = colors[1]
58
+c.colors.messages.error.fg = colors[8]
65 59
 
66
-c.colors.messages.info.bg = xresources['*color2']
67
-c.colors.messages.info.border = xresources['*color2']
68
-c.colors.messages.info.fg = xresources['*color8']
60
+c.colors.messages.info.bg = colors[2]
61
+c.colors.messages.info.border = colors[2]
62
+c.colors.messages.info.fg = colors[8]
69 63
 
70
-c.colors.messages.warning.bg = xresources['*color3']
71
-c.colors.messages.warning.border = xresources['*color3']
72
-c.colors.messages.warning.fg = xresources['*color7']
64
+c.colors.messages.warning.bg = colors[3]
65
+c.colors.messages.warning.border = colors[3]
66
+c.colors.messages.warning.fg = colors[7]
73 67
 
74
-c.colors.prompts.bg = xresources['*color0']
75
-c.colors.prompts.border = xresources['*color0']
76
-c.colors.prompts.fg = xresources['*color7']
68
+c.colors.prompts.bg = colors[0]
69
+c.colors.prompts.border = colors[0]
70
+c.colors.prompts.fg = colors[7]
77 71
 
78
-c.colors.prompts.selected.bg = xresources['*color3']
72
+c.colors.prompts.selected.bg = colors[3]
79 73
 
80
-c.colors.statusbar.caret.bg = xresources['*color5']
81
-c.colors.statusbar.caret.fg = xresources['*color7']
74
+c.colors.statusbar.caret.bg = colors[5]
75
+c.colors.statusbar.caret.fg = colors[7]
82 76
 
83
-c.colors.statusbar.command.bg = xresources['*color6']
84
-c.colors.statusbar.command.fg = xresources['*color0']
77
+c.colors.statusbar.command.bg = colors[6]
78
+c.colors.statusbar.command.fg = colors[0]
85 79
 
86 80
 c.colors.statusbar.command.private.bg = 'black'
87 81
 
88
-c.colors.statusbar.insert.bg = xresources['*color2']
89
-c.colors.statusbar.insert.fg = xresources['*color8']
82
+c.colors.statusbar.insert.bg = colors[2]
83
+c.colors.statusbar.insert.fg = colors[8]
90 84
 
91
-c.colors.statusbar.normal.bg = xresources['*color0']
92
-c.colors.statusbar.normal.fg = xresources['*color7']
85
+c.colors.statusbar.normal.bg = colors[0]
86
+c.colors.statusbar.normal.fg = colors[7]
93 87
 
94
-c.colors.statusbar.private.bg = xresources['*color0']
95
-c.colors.statusbar.private.fg = xresources['*color7']
88
+c.colors.statusbar.private.bg = colors[0]
89
+c.colors.statusbar.private.fg = colors[7]
96 90
 
97
-c.colors.statusbar.progress.bg = xresources['*color7']
91
+c.colors.statusbar.progress.bg = colors[7]
98 92
 
99
-c.colors.statusbar.url.error.fg = xresources['*color1']
93
+c.colors.statusbar.url.error.fg = colors[1]
100 94
 
101
-c.colors.statusbar.url.fg = xresources['*color7']
95
+c.colors.statusbar.url.fg = colors[7]
102 96
 
103
-c.colors.statusbar.url.hover.fg = xresources['*color4']
97
+c.colors.statusbar.url.hover.fg = colors[4]
104 98
 
105
-c.colors.statusbar.url.success.http.fg = xresources['*color7']
99
+c.colors.statusbar.url.success.http.fg = colors[7]
106 100
 
107
-c.colors.statusbar.url.success.https.fg = xresources['*color2']
101
+c.colors.statusbar.url.success.https.fg = colors[2]
108 102
 
109
-c.colors.statusbar.url.warn.fg = xresources['*color3']
103
+c.colors.statusbar.url.warn.fg = colors[3]
110 104
 
111
-c.colors.tabs.bar.bg = xresources['*color0']
105
+c.colors.tabs.bar.bg = colors[0]
112 106
 
113
-c.colors.tabs.even.bg = xresources['*color0']
114
-c.colors.tabs.even.fg = xresources['*color7']
107
+c.colors.tabs.even.bg = colors[0]
108
+c.colors.tabs.even.fg = colors[7]
115 109
 
116
-c.colors.tabs.odd.bg = xresources['*color0']
117
-c.colors.tabs.odd.fg = xresources['*color7']
110
+c.colors.tabs.odd.bg = colors[0]
111
+c.colors.tabs.odd.fg = colors[7]
118 112
 
119
-c.colors.tabs.selected.even.bg = xresources['*color7']
120
-c.colors.tabs.selected.even.fg = xresources['*color0']
113
+c.colors.tabs.selected.even.bg = colors[7]
114
+c.colors.tabs.selected.even.fg = colors[0]
121 115
 
122
-c.colors.tabs.selected.odd.bg = xresources['*color7']
123
-c.colors.tabs.selected.odd.fg = xresources['*color0']
116
+c.colors.tabs.selected.odd.bg = colors[7]
117
+c.colors.tabs.selected.odd.fg = colors[0]
124 118
 
125
-c.colors.webpage.bg = xresources['*color7']
119
+c.colors.webpage.bg = colors[7]
126 120
 
127
-c.hints.border = '1px solid ' + xresources['*color7']
121
+c.hints.border = '1px solid ' + colors[7]
128 122
 
129 123
 c.statusbar.hide = True
130 124
 c.tabs.show = 'multiple'

Loading…
Cancel
Save