Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add run in terminal to executable text file preferences #3405

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SerenaLynas
Copy link

When opening an executable text file, by default it asks whether to run it, including an option to "Run in Terminal". In prefs, you can set what you want so you don't have to specify every time, but curiously "Run in Terminal" is missing from the prefs. This adds it to prefs.

I was not able to get a dev environment set up to run it; the documentation on that seems hidden away and I don't have the time to find it.

@@ -1234,6 +1234,23 @@ along with . If not, see <http://www.gnu.org/licenses/>.
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkRadioButton" id="scripts_execute_terminal_radiobutton">
<property name="label" translatable="yes">_Run executable text files in the terminal when they are opened</property>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can get rid of the _ in front of Run - this would normally indicate that pressing R should select this option. In reality these shortcuts don't work on this page, so we can leave it out (don't change the other options, as they've already been translated, and any change will void those translations).

<property name="use-underline">True</property>
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw-indicator">True</property>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to have:

<property name="group">scripts_execute_radiobutton</property>

This is in every entry except scripts_execute_radiobutton itself, and ties the other buttons together with that one (otherwise you have 2 buttons active at once).

@mtwebster
Copy link
Member

Hi, this is a bit incomplete:

I've made a couple of inline comments for the glade file.

You also need to make the actual stored settings aware of this new option:

diff --git a/libnemo-private/org.nemo.gschema.xml b/libnemo-private/org.nemo.gschema.xml
index f54c1dde..1f2d7efc 100644
--- a/libnemo-private/org.nemo.gschema.xml
+++ b/libnemo-private/org.nemo.gschema.xml
@@ -14,6 +14,7 @@
     <value nick="launch" value="0"/>
     <value nick="display" value="1"/>
     <value nick="ask" value="2"/>
+    <value nick="terminal" value="3"/>
   </enum>
 
   <enum id="org.nemo.FolderView">
diff --git a/src/nemo-file-management-properties.c b/src/nemo-file-management-properties.c
index 994e9e66..b9155099 100644
--- a/src/nemo-file-management-properties.c
+++ b/src/nemo-file-management-properties.c
@@ -203,6 +203,7 @@ static const char * const executable_text_values[] = {
        "launch",
        "display",
        "ask",
+    "terminal",
        NULL
 };

Otherwise this preference is never even stored.

If you're running Mint, building is as simple as enabling 'source repositories' in your Software Sources in the start menu, then:

apt build-dep nemo   # installs the sources required to build
cd nemo # your local repo

# build and package
dpkg-buildpackage

#install
cd ..
sudo dpkg -i *.deb

@mtwebster mtwebster added the Blocked Needs rebase, changes, or discussion label May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blocked Needs rebase, changes, or discussion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants