aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/terminal.ui
diff options
context:
space:
mode:
authorJuhani Krekelä2021-06-25 17:59:53 +0300
committerWolfgang Müller2021-06-26 12:12:45 +0200
commitb70083a5f4404e2422ff0a0aadd023a661164fae (patch)
treed700ce1ff3e07ff73e05ca41387ca88d11633e28 /terminal.ui
parentb497a49d8bd2a345dd30a9f55dc4976560df157f (diff)
downloadweltschmerz-b70083a5f4404e2422ff0a0aadd023a661164fae.tar.gz
Add feature to open a new terminal
Add ability to open a new weltschmerz terminal, either from context menu or with a key combination. The new terminal is opened in the directory indicated with OSC 7, allowing quickly opening additional terminals while working. Preferably this would launch the user's preferred terminal, as defined in per-user settings, but this is not possible with glib[1]. For this reason the option always launches another weltschmerz. weltschmerz is launched using bare Process.spawn_async() on the name of the program as defined in weltschmerz.vala. We considered using the AppInfo database to retrieve the name of executable instead, but as there is no way to query the database for terminal emulators we would have to go through every single program installed on the computer and try to find one called weltschmerz. As the change would merely replace the requirement of having weltschmerz in PATH with the requirement of having a .desktop file with the name in one of the standardized locations, this would not be worth it. [1] https://gitlab.gnome.org/GNOME/glib/-/issues/338
Diffstat (limited to 'terminal.ui')
-rw-r--r--terminal.ui18
1 files changed, 18 insertions, 0 deletions
diff --git a/terminal.ui b/terminal.ui
index c22fbec..345c543 100644
--- a/terminal.ui
+++ b/terminal.ui
@@ -52,6 +52,11 @@
<property name="can-focus">False</property>
<property name="icon-name">document-open</property>
</object>
+ <object class="GtkImage" id="open_terminal_item_image">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="icon-name">utilities-terminal</property>
+ </object>
<object class="GtkMenu" id="standard_context_menu">
<property name="visible">True</property>
<property name="can-focus">False</property>
@@ -93,6 +98,19 @@
</object>
</child>
<child>
+ <object class="GtkImageMenuItem" id="open_terminal_item">
+ <property name="label" translatable="yes">Open _terminal</property>
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="tooltip-text" translatable="yes">Open new terminal window in the current directory</property>
+ <property name="use-underline">True</property>
+ <property name="image">open_terminal_item_image</property>
+ <property name="use-stock">False</property>
+ <signal name="activate" handler="open_terminal" swapped="no"/>
+ <accelerator key="t" signal="activate" modifiers="GDK_SHIFT_MASK | GDK_CONTROL_MASK"/>
+ </object>
+ </child>
+ <child>
<object class="GtkImageMenuItem" id="open_directory_item">
<property name="label" translatable="yes">_Open directory</property>
<property name="visible">True</property>