Start Leafpad with wordwrap enabled?[SOLVED]

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

Start Leafpad with wordwrap enabled?[SOLVED]

#1 Post by greengeek »

I would like to force Leafpad to start with wordwrap already enabled but can't find the syntax to do so. Wordwrap is available in the options menu.

I've tried entering the following into a console:
leafpad wrap=1 (which makes a file called "wrap=1")
leafpad wordwrap =1
leafpad wordwrap=true
leafpad option wordwrap=1
leafpad $wrap
leafpad $wrap=1
leafpad --wrap

My google skills are failing me. Is it possible to pass arguments to Leafpad in this way?
Last edited by greengeek on Tue 09 Apr 2013, 17:25, edited 1 time in total.

PaulR
Posts: 249
Joined: Wed 04 May 2005, 18:45
Location: UK

#2 Post by PaulR »

Hi greengeek

leafpad --help-all

...seems to say it's not possible :(

Paul

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#3 Post by greengeek »

Thanks Paul. - I wonder if there is a way to get a script to pass the required parameters immediately AFTER opening leafpad, even though it appears they can't be passed at the time of initial execution?

Also - I have just noticed that in Precise 5.5 leafpad opens with wordwrap already enabled so I will scout around and see if I can see how that is done.

EDIT :I think I have found how it's done in Precise 5.5

If I open the hidden file /root/.config/leafpad/leafpadrc I see the following:

Code: Select all

0.8.18.1
671
450
Monospace 12
1
0
0
and it seems to be the "1" below "monospace 12" which determines if wordwrap is on or not.

I have just tried modifying this in a different puppy and it works!

There is no doubt some other way this can be achieved too, so any info/guesses welcome!

PaulR
Posts: 249
Joined: Wed 04 May 2005, 18:45
Location: UK

#4 Post by PaulR »

Good find!

Why don't you just read-in/set the word-wrap flag/write out the config file then call leafpad? (You could always rewrite the original values if you wanted to restore the settings).

Paul

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#5 Post by seaside »

For some odd reason, leafpad doesn't seem to make a default config file. However, if you make a blank file named "/root/.config/leafpad/leafpadrc" and then start leafpad and make config changes, those changes are all then saved.

Next time leapad is started all those changed settings are in effect.

Cheers,
s

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#6 Post by greengeek »

Excellent. Thanks for the tips. I now have leafpad doing what I want. Will mark thread as solved.

Post Reply