zcot / conky-manager2

Fork of GUI for managing Conky widgets. Support added for latest conky config version, and works with Ubuntu 16-22, Mint 18-21 and more.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Only gedit works as text editor

Lowrida opened this issue · comments

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...

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?

commented

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.

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... ;)