Skip to content

Commit 5b60192

Browse files
theCapyparaDavidy22
authored andcommitted
Add Sixel Support
Related to #1806 sem-ver: feature
1 parent 172a9c0 commit 5b60192

File tree

5 files changed

+54
-1
lines changed

5 files changed

+54
-1
lines changed

guake/data/org.guake.gschema.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,11 @@
171171
<summary>Audible bell</summary>
172172
<description>If true, the system alert sound will be played on a bell character.</description>
173173
</key>
174+
<key name="use-sixel" type="b">
175+
<default>false</default>
176+
<summary>Use Sixel</summary>
177+
<description>If true, terminals will render sixel escape sequences.</description>
178+
</key>
174179
<key name="window-width" type="i">
175180
<default>100</default>
176181
<summary>Window width.</summary>

guake/data/prefs.glade

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@
342342
<property name="top-padding">12</property>
343343
<property name="left-padding">12</property>
344344
<child>
345-
<!-- n-columns=3 n-rows=5 -->
345+
<!-- n-columns=3 n-rows=6 -->
346346
<object class="GtkGrid">
347347
<property name="visible">True</property>
348348
<property name="can-focus">False</property>
@@ -533,6 +533,28 @@
533533
<property name="top-attach">4</property>
534534
</packing>
535535
</child>
536+
<child>
537+
<object class="GtkCheckButton" id="use_sixel">
538+
<property name="label" translatable="yes">Render sixel escape sequences (images)</property>
539+
<property name="visible">True</property>
540+
<property name="can-focus">True</property>
541+
<property name="receives-default">False</property>
542+
<property name="halign">start</property>
543+
<property name="use-underline">True</property>
544+
<property name="draw-indicator">True</property>
545+
<signal name="toggled" handler="on_use_sixel_toggled" swapped="no"/>
546+
</object>
547+
<packing>
548+
<property name="left-attach">0</property>
549+
<property name="top-attach">5</property>
550+
</packing>
551+
</child>
552+
<child>
553+
<placeholder/>
554+
</child>
555+
<child>
556+
<placeholder/>
557+
</child>
536558
<child>
537559
<placeholder/>
538560
</child>

guake/prefs.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,10 @@ def on_use_audible_bell_toggled(self, chk):
481481
"""Changes the value of use_audible_bell in dconf"""
482482
self.settings.general.set_boolean("use-audible-bell", chk.get_active())
483483

484+
def on_use_sixel_toggled(self, chk):
485+
"""Changes the value of enable_sixel in dconf"""
486+
self.settings.general.set_boolean("use-sixel", chk.get_active())
487+
484488
# scrolling tab
485489

486490
def on_use_scrollbar_toggled(self, chk):
@@ -1182,6 +1186,10 @@ def load_configs(self):
11821186
value = self.settings.general.get_boolean("use-audible-bell")
11831187
self.get_widget("use_audible_bell").set_active(value)
11841188

1189+
# use sixel
1190+
value = self.settings.general.get_boolean("use-sixel")
1191+
self.get_widget("use_sixel").set_active(value)
1192+
11851193
self._load_screen_settings()
11861194

11871195
value = self.settings.general.get_boolean("quick-open-enable")

guake/terminal.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,15 @@ def configure_terminal(self):
211211
if hasattr(self, "set_alternate_screen_scroll"):
212212
self.set_alternate_screen_scroll(True)
213213

214+
enable_sixel = client.get_boolean("use-sixel")
215+
if enable_sixel:
216+
# TODO: Once Sixel support is stable and there's a release with it built-in by default,
217+
# we can use a version check like done above for other features.
218+
try:
219+
self.set_enable_sixel(True)
220+
except: # pylint: disable=bare-except
221+
log.warn("set_enable_sixel is not supported by your version of VTE")
222+
214223
self.set_can_default(True)
215224
self.set_can_focus(True)
216225

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
release_summary: >
2+
Add experimental support for displaying Sixels. This can be enabled with a new setting.
3+
4+
features:
5+
- add sixel support #1806
6+
7+
known_issues:
8+
- sixel support requires VTE to be compiled with `-Dsixel=true`, since support for it is still experimental.
9+

0 commit comments

Comments
 (0)