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

Only gedit works as text editor #29

Open
Lowrida opened this issue Jan 15, 2022 · 6 comments
Open

Only gedit works as text editor #29

Lowrida opened this issue Jan 15, 2022 · 6 comments

Comments

@Lowrida
Copy link

Lowrida commented Jan 15, 2022

But i don't use gedit and have not installed it. I use xed and bluefish but conky does not open the scripts with them...

@Lowrida
Copy link
Author

Lowrida commented Jan 15, 2022

Fixed it. I made a script called gedit that starts bluefish!
But maybe it should be an option in settings to choose which editor you want?

@ghost
Copy link

ghost commented Jan 15, 2022 via email

@ghost
Copy link

ghost commented Jan 15, 2022 via email

@zcot
Copy link
Owner

zcot commented Jan 16, 2022

I see the button triggers this code: https://github.com/zcot/conky-manager2/blob/add-1.10-support/src/MainWindow.vala#L781

	private void btn_edit_clicked(){
		ConkyConfigItem item = selected_item();
		if (item != null) { exo_open_textfile(item.path); };
	}

(see exo_open_textfile)

And that is the following function: https://github.com/zcot/conky-manager2/blob/add-1.10-support/src/Utility.vala#L1219

	public bool exo_open_textfile (string txt){
				
		/* Tries to open the given text file in a text editor */
		
		string path;
		
		path = get_cmd_path ("exo-open");
		if ((path != null)&&(path != "")){
			return execute_command_script_async ("exo-open \"" + txt + "\"");
		}

		path = get_cmd_path ("gedit");
		if ((path != null)&&(path != "")){
			return execute_command_script_async ("gedit --new-document \"" + txt + "\"");
		}

		return false;
	}

(see the 2 lines with exo-open)

Maybe it should use xdg-open instead of exo-open(specific to Xfce).

Maybe it works if you edit those 2 references on lines 1225 and 1227 and recompile.

@Lowrida
Copy link
Author

Lowrida commented Feb 4, 2022

So how did you do that in your script @Lowrida? I used /usr/bin/xed $1 and the file is not passed from Conky-manager to xed... :-( But xed does open... LLAP

Made a script in /usr/bin called "gedit" and put the following in it:

#!/bin/bash
bluefish "$@"

Easy... ;)

@zcot
Copy link
Owner

zcot commented Jun 1, 2022

208b23d

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

2 participants