I thought Geany automatically showed "Read Only" in title bar, on opening root owned or protected files, or it changed the tab background or text. From the menu, you can manually mark a file read-only & it changes the tab text to green - for me. I want it to prominently auto-indicate RO files, when I open them.
In the manual, https://www.geany.org/manual/current/index.html#customizing-geany-s-appearan... -says,
"/To override GTK+ CSS styles, you can use traditional mechanisms or you can create a file named //geany.css//in the user configuration directory (usually //~/.config/geany//)/..."
"/Geany offers a number of CSS IDs ("properties"?) which can be used to //taylor//[tailor] its //appearence//appearance. Among the more interesting include:/
"/geany-document-status-/*/readyonly/**/`/*/- the style for document tab labels when the document is read-only"/ [Note: the backward mark (grave) after "read*y*only" AND the extra 'y' in line above are probably typos]?
"Style for... tab labels" - means changing text color, weight and style: "color: #FFFF00;" "font-style: italic;"
Tried common syntax changes for this - not working. Should it be "readonly", or maybe "read-only?" Tried both - no change. I assume the css property / selector should have a period or # mark in front of "geany-document-status-read...?"
In my ~/.config/geany directory there's a "gtk-3.0" folder. I don't remember if I created it. There is a geany.css file in it w/ some -GtkScrollbar properties (that don't seem to affect Geany).
In Preferences/Various, the STATUSBAR template line has %w (to show mode RO or INS or OVR). Doesn't recognize read-only (root) files, until I manually set it to RO via the menu. Then status bar shows RO. Thanks!
You appear to have misunderstood the read-only setting on a document.
The "read-only" is a property of the document, ie the _buffer_ in memory, not the original file. Its there to allow a user to stop themselves from modifying the buffer, it has nothing to do with the file the buffer was loaded from.
Even if you load a file you can't write in its original location, nothing stops you from saving it elsewhere, and in fact thats exactly what happens with Geany config files, they are read from the installed system location (which most users can't edit) and saved in the users config directory.
And finally, writability depends on more than just the protections of the file the buffer was loaded from. Depending on the writing method selected it can also depend on creation permissions in the directory, if the file is on a windows shared filesystem, if its on a remote filesystem and rename is unavailable etc. So it is not a simple or cheap operation to know if the buffer will be writable.
And of course that can change at any time if protections are changed, mounted devices unmounted, remote connections dropped, the saving settings changed etc so it would only be an indication of the situation when the file is loaded.
With the styling and the status bar, they just show the document read only setting so will not show anything if a system file is loaded, or are you saying they don't work if you set the document read only in the UI?
Cheers Lex
On Sun, 13 Sep 2020 at 08:40, bendov@gmx.com wrote:
I thought Geany automatically showed "Read Only" in title bar, on opening root owned or protected files, or it changed the tab background or text. From the menu, you can manually mark a file read-only & it changes the tab text to green - for me. I want it to prominently auto-indicate RO files, when I open them.
In the manual, https://www.geany.org/manual/current/index.html#customizing-geany-s-appearan... -says,
"/To override GTK+ CSS styles, you can use traditional mechanisms or you can create a file named //geany.css//in the user configuration directory (usually //~/.config/geany//)/..."
"/Geany offers a number of CSS IDs ("properties"?) which can be used to //taylor//[tailor] its //appearence//appearance. Among the more interesting include:/
"/geany-document-status-/*/readyonly/**/`/*/- the style for document tab labels when the document is read-only"/ [Note: the backward mark (grave) after "read*y*only" AND the extra 'y' in line above are probably typos]?
"Style for... tab labels" - means changing text color, weight and style: "color: #FFFF00;" "font-style: italic;"
Tried common syntax changes for this - not working. Should it be "readonly", or maybe "read-only?" Tried both - no change. I assume the css property / selector should have a period or # mark in front of "geany-document-status-read...?"
In my ~/.config/geany directory there's a "gtk-3.0" folder. I don't remember if I created it. There is a geany.css file in it w/ some -GtkScrollbar properties (that don't seem to affect Geany).
In Preferences/Various, the STATUSBAR template line has %w (to show mode RO or INS or OVR). Doesn't recognize read-only (root) files, until I manually set it to RO via the menu. Then status bar shows RO. Thanks!
Users mailing list Users@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/users
On 9/12/20 9:00 PM, Lex Trotman wrote:
/With the styling and the status bar, they just show the document read only setting so will not show anything if a system file is loaded, //*or are you saying they don't work if you set the document read only in the UI?*/
Cheers Lex
Meant to get back sooner - covid-19 & other stuff going on. In answer to your question (highlighted), yes, uh no, uh... maybe?
I want Geany to automatically show if a file was opened w/o correct permissions to edit & save in same path, the way many editors do. In Geany, you have to *manually* go into a menu to mark it RO. If you opened a file w/o correct permissions, it is read only, as far as editing & saving it to the same location.
Apparently Geany doesn't have prefs to automatically change tab style for files opened as RO?
Many editors allow preferences to change tab BG and / or font color for files opened as RO. The editors that offer such prefs, probably do it for a reason. Thanks.
On Thu, 29 Oct 2020 at 16:15, bendov@gmx.com wrote:
On 9/12/20 9:00 PM, Lex Trotman wrote:
/With the styling and the status bar, they just show the document read only setting so will not show anything if a system file is loaded, //*or are you saying they don't work if you set the document read only in the UI?*/
Cheers Lex
Meant to get back sooner - covid-19 & other stuff going on. In answer to your question (highlighted), yes, uh no, uh... maybe?
I want Geany to automatically show if a file was opened w/o correct permissions to edit & save in same path, the way many editors do. In Geany, you have to *manually* go into a menu to mark it RO. If you opened a file w/o correct permissions, it is read only, as far as editing & saving it to the same location.
So if somebody provides the code (which works on Windows and Linux and OSX) to calculate if a file can be written to its original location, not forgetting such things as SElinux and ACLs on Linux and Windows, and how it will be used _without_ forcing the buffer to be read-only, then we can look at it.
As I have said before just because the original location is not writable does not mean a buffer should be readonly, a modified buffer can always be saved elsewhere, and that capability is required for the editing of Geany's own configuration settings.
Apparently Geany doesn't have prefs to automatically change tab style for files opened as RO?
It does, and it is documented https://www.geany.org/manual/current/index.html#customizing-geany-s-appearan....
Many editors allow preferences to change tab BG and / or font color for files opened as RO. The editors that offer such prefs, probably do it for a reason.
Whatever their reason is, it is irrelevant to Geany unless its applicability is documented.
Cheers Lex
Thanks.
Users mailing list Users@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/users