[Geany-Users] automatically show "Read Only" when opening root owned

Lex Trotman elextr at xxxxx
Sun Sep 13 02:00:20 UTC 2020


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 at 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-appearance-using-gtk-3-css
> -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 at lists.geany.org
> https://lists.geany.org/cgi-bin/mailman/listinfo/users


More information about the Users mailing list