Skip to content

Commit d6d8f34

Browse files
veractormtwebster
authored andcommitted
cs_default.py: Add entry for terminal exec-arg
Terminals have options to provide it with a command to run, which may vary between different terminals. The option text is saved in the `org.cinnamon.desktop.default-applications.terminal` GSettings schema, and used in various places in the Cinnamon desktop. This was previously not configurable in a GUI and will require the user to enter a gsettings command, so add the functionality to "Preferred Applications". Fixes #10938.
1 parent c575a29 commit d6d8f34

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

files/usr/share/cinnamon/cinnamon-settings/modules/cs_default.py

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,23 @@ def onChanged(self, button):
309309
command_key = self.active_items[index_num]
310310
self.settings.set_string("exec", command_key)
311311

312+
class TerminalExecArgEntry(Gtk.Entry):
313+
def __init__(self):
314+
super(TerminalExecArgEntry, self).__init__()
315+
316+
self.connect("changed", self.onChanged)
317+
318+
self.settings = Gio.Settings.new(TERMINAL_SCHEMA)
319+
self.key_value = self.settings.get_string("exec-arg")
320+
321+
self.get_buffer().set_text(self.key_value, -1)
322+
323+
self.set_placeholder_text("exec-arg")
324+
self.set_tooltip_text(_("Command-line option for your terminal to execute a passed-in command."))
325+
326+
def onChanged(self, entry):
327+
self.settings.set_string("exec-arg", entry.get_buffer().get_text())
328+
312329
class DefaultCalculatorButton(Gtk.AppChooserButton):
313330
def __init__(self):
314331
super(DefaultCalculatorButton, self).__init__()
@@ -581,9 +598,15 @@ def on_module_selected(self):
581598
widget = SettingsWidget()
582599
button = DefaultTerminalButton()
583600
label = MnemonicLabel(_("Terminal"), button)
584-
size_group.add_widget(button)
601+
entry = TerminalExecArgEntry()
602+
603+
box = Gtk.VBox()
604+
box.pack_start(button, False, False, 0)
605+
box.pack_start(entry, False, False, 0)
606+
size_group.add_widget(box)
607+
585608
widget.pack_start(label, False, False, 0)
586-
widget.pack_end(button, False, False, 0)
609+
widget.pack_end(box, False, False, 0)
587610
settings.add_row(widget)
588611

589612
# Calculator

0 commit comments

Comments
 (0)