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

Terminal shortcut doesn't open default terminal #53

Open
fhgalano opened this issue Sep 30, 2024 · 7 comments
Open

Terminal shortcut doesn't open default terminal #53

fhgalano opened this issue Sep 30, 2024 · 7 comments

Comments

@fhgalano
Copy link

Based on the discussion here: cosmic-settings #444, it looks like the planned implementation for the default terminal is the xdg-terminal-exec spec.

I'm not sure if that is still the plan, but right now the defined shortcut for Open a terminal will call whatever executable is found from which cosmic-desktop (as defined in data/system_actions.ron). Should this be updated to call xdg-terminal-exec or some other env variable?

System Info:
OS: Arch Linux x86_64
Host: Laptop 13 (AMD Ryzen 7040Series) A5
Kernel: 6.10.10-arch1-1
Shell: bash 5.2.37
Resolution: 2256x1504
DE: COSMIC
Theme: Breeze-Dark [GTK2], Breeze [GTK3]
Icons: breeze [GTK2/3]
Terminal: alacritty
CPU: AMD Ryzen 5 7640U w/ Radeon 760M Graphics (12) @ 4.971GHz
GPU: AMD ATI c1:00.0 Phoenix1

@awilkins
Copy link

awilkins commented Feb 3, 2025

I've found you can edit this setting with a user-level config file ... but the setting doesn't "stick" across reboots.

(what I suspect is going on is that the daemon picks up the user config being edited and applies the setting ... but doesn't do a initial load of these on logon)

pop-os/cosmic-settings#933

xdg-terminal-exec would appear to be the plan as per comments on #70

@dmac-au
Copy link

dmac-au commented Feb 4, 2025

@mmstick is there a way to stop the user file ~/.config/cosmic/com.system76.CosmicSettings.Shortcuts/v1/system_actions from being ignored after a reboot?

I'd rather not edit /usr/share/cosmic and break packages or have to re-edit after an update.

**EDIT

Oh nevermind, I just noticed you can change your terminal in Default Applications in Cosmic Settings. This is what happens when your on vacation when the next alpha is releases. Let's see how that goes

**Another Edit

That didn't seem to work on my Fedora build, I think it added an application/x-terminal-emulator to my .config/mimeapps.list but the Super+T shortcut still isn't launching my terminal and is launching cosmic-term instead.

Thanks

@mmstick
Copy link
Member

mmstick commented Feb 4, 2025

The local .config path shouldn't be ignored. It should override the system config path (/etc/cosmic) and the distribution config path (/usr/share/cosmic). If it gets ignored, it may be because of a syntax error. You should look at the cosmic-comp log to see if any errors may have been logged for it.

@dmac-au
Copy link

dmac-au commented Feb 4, 2025

Okay so I've reset things so I could replicate the issue.

I have created .config/cosmic/com.system76.CosmicSettings.Shortcuts/v1/system_actions containing the following (I removed the other contents of the file when copying from /usr/share):

{
    /// Opens the system default terminal
    Terminal: "ghostty",
}

When I save that file, it does as it should and when I hit Super+T to open a terminal, I get ghostty.

After I reboot however, I get cosmic-term.

Here is my cosmic-comp log:

cosmic-comp[1928]: failed to read local shortcuts config 'system_actions': GetKey("system_actions", Os { code: 2, kind: NotFound, message: "No such file or directory" })

Here is my file permissions:

ll .config/cosmic/com.system76.CosmicSettings.Shortcuts/v1/
total 8.0K
-rw-r--r--. 1 danmac danmac 298 Feb  3 16:30 custom
-rw-r--r--. 1 danmac danmac  71 Feb  4 20:52 system_actions

Once I open the file in vim, save and close it ghostty becomes the default again. just touching the file doesn't seem to work either.

Grateful for any assistance and let me know if you think it's related to the Fedora packages and I'll bug Ryan

@fhgalano
Copy link
Author

fhgalano commented Feb 4, 2025

I'm not sure why it's not correctly loading the shortcut edits from .config/ on startup

In regards to touching the file: it seems like that is just how the watcher is designed based on what I'm reading here, but I don't have a clear understanding about what events are triggered by touch

@fhgalano
Copy link
Author

fhgalano commented Feb 4, 2025

In the past, I just edited the /usr/share/<blah>/system_actions and that seems to hold until there is an update pulled in. It's definitely annoying to do every time there is an update, but this should be fixed once system_actions is updated to use a non-program-specific call like xdg_terminal_exec - and it seems like that's the plan

@mmstick
Copy link
Member

mmstick commented Feb 4, 2025

@fhgalano That was fixed today by pop-os/cosmic-comp#1197

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants