LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   Caja's zoom settings (https://www.linuxquestions.org/questions/linux-desktop-74/cajas-zoom-settings-4175644419/)

Grabby 12-16-2018 11:26 PM

Caja's zoom settings
 
In Caja's default settings the next zoom increment after 200% is 400%, which is a bit too much for me.
I am trying to find a way to tweak the settings in order to set an intermediate step between those two, i.e. 300%.

I think I have identified the relevant configuration file that needs to be tweaked for that purpose, but due to my limited skills I am not sure how to tweak it.
Can someone help me?

The path of that config file is:

/usr/share/glib-2.0/schemas/org.mate.caja.gschema.xml

In contains explicit mentions to zoom settings (search for 'zoom').

Thanks for the help

--Grabby

ondoho 12-18-2018 01:45 AM

dconf or gconf, i guess, is the tool of choice to manipulate these "schemas".
it probably also needs to be the verison compatible with MATE.

RockDoctor 12-18-2018 06:48 PM

Looking at lines 44-52 in /usr/share/glib-2.0/schemas/org.mate.caja.gschema.xml, the zoom values are just enumerations:
Code:

  <enum id="org.mate.caja.ZoomLevel">
    <value nick="smallest" value="0"/>
    <value nick="smaller" value="1"/>
    <value nick="small" value="2"/>
    <value nick="standard" value="3"/>
    <value nick="large" value="4"/>
    <value nick="larger" value="5"/>
    <value nick="largest" value="6"/>
  </enum>

rather than the actual zoom percentages, which means those percentages are defined elsewhere. dconf-editor just shows the nicknames above for the caja zoom levels

Grabby 12-19-2018 01:30 PM

Quote:

Originally Posted by RockDoctor (Post 5938802)
Looking at lines 44-52 in /usr/share/glib-2.0/schemas/org.mate.caja.gschema.xml, the zoom values are just enumerations:
Code:

  <enum id="org.mate.caja.ZoomLevel">
    <value nick="smallest" value="0"/>
    <value nick="smaller" value="1"/>
    <value nick="small" value="2"/>
    <value nick="standard" value="3"/>
    <value nick="large" value="4"/>
    <value nick="larger" value="5"/>
    <value nick="largest" value="6"/>
  </enum>

rather than the actual zoom percentages, which means those percentages are defined elsewhere. dconf-editor just shows the nicknames above for the caja zoom levels

Yes, I had noticed that, but I was not able to find out where those values are defined.

hydrurga 12-19-2018 02:38 PM

Quote:

Originally Posted by Grabby (Post 5939096)
Yes, I had noticed that, but I was not able to find out where those values are defined.

They appear to be hard-coded in the source code. The actual icon size values equating to the various zoom levels are defined in libcaja-private/caja-icon-info.h:

Code:

    /* Nominal icon sizes for each Caja zoom level.
    * This scheme assumes that icons are designed to
    * fit in a square space, though each image needn't
    * be square. Since individual icons can be stretched,
    * each icon is not constrained to this nominal size.
    */
#define CAJA_ICON_SIZE_SMALLEST        16
#define CAJA_ICON_SIZE_SMALLER        24
#define CAJA_ICON_SIZE_SMALL        32
#define CAJA_ICON_SIZE_STANDARD        48
#define CAJA_ICON_SIZE_LARGE        72
#define CAJA_ICON_SIZE_LARGER        96
#define CAJA_ICON_SIZE_LARGEST  192


ondoho 12-21-2018 01:18 AM

^ these icon sizes are also widely accepted standard sizes for freedesktop icon themes.

Grabby 01-11-2019 05:11 AM

Quote:

Originally Posted by hydrurga (Post 5939107)
They appear to be hard-coded in the source code. The actual icon size values equating to the various zoom levels are defined in libcaja-private/caja-icon-info.h

Thanks for taking the time to look into this, I appreciate.

Too bad those settings are hard-coded, because I really need to have an intermediate zoom setting between 200% and 400%. The gap is too much.

I have a couple of related questions:

1) if I decide to modify the source and then recompile the whole thing, will it be enough to remove Caja and then download the program's master branch from Github and use make? I am not a professional programmer, so I was wondering if perhaps there is something else to do that I do not know.

2) how long approximately will compiling Caja take, minutes or hours? (my CPU is intel i7 8th gen)

Thanks a lot again, this is a wonderful forum

Grabby

hydrurga 01-11-2019 06:14 AM

I'm certainly not an expert on this, Grabby, but rather than potentially muck up your system, I would suggest setting up a virtual machine or a dual boot so that you can use a test system for playing around with Caja. If you are going to play around with your main system, I recommend making a system snapshot/backup/image first.

First things first. I suggest creating an issue about the zoom settings here - https://github.com/mate-desktop/caja/issues. Sometimes it takes a while for someone to respond, but the developers tend to look at the issue reports so it's a good place for your issue to be noticed.

Next, ask questions about the zoom settings on a MATE forum or subreddit - details here: https://mate-desktop.org/community/

Then, depending on the answers you receive, you can look at hacking Caja. If you do, I would suggest you download the latest released version rather than the latest code - see http://pub.mate-desktop.org/releases/1.21/

I don't think it would take you long at all to build Caja. Replacing your current version of an integral component of the desktop with a new one compiled at your own hand may prove interesting though.

Grabby 01-11-2019 11:06 AM

Thanks a lot, hydrurga, for your very comprehensive and helpful answer!! I will follow your suggestions.

hydrurga 01-11-2019 11:08 AM

Quote:

Originally Posted by Grabby (Post 5947749)
Thanks a lot, hydrurga, for your very comprehensive and helpful answer!! I will follow your suggestions.

No problem. :) Let us know how you get on.

ondoho 01-11-2019 01:41 PM

Quote:

Originally Posted by Grabby (Post 5947577)
1) if I decide to modify the source and then recompile the whole thing, will it be enough to remove Caja and then download the program's master branch from Github and use make? I am not a professional programmer, so I was wondering if perhaps there is something else to do that I do not know.

you can always try to 'make' (as normal user, not as root) without actually installing it.
the executable usually gets dropped in some subfolder.
you can try running it from there.
if you're lucky it will Just Work, and you are not endangering any system files.

no idea how long the compile will take; getting all the dependencies right, dev versions of libraries on debian-based distros, etc., will probably take longer than the actual compilation.

Grabby 01-12-2019 03:43 PM

@ondoho: I followed your suggestion and after modifying the source I compiled it as non-root. Compilation went OK. The executable file was created in the ./src subdirectory, and it runs. Only, for some strange reason the version of Caja that runs is not the one I compiled (version 1.21.3, as displayed by the autogen.sh file) but the one previously on the system (version 1.20.3). I could tell by looking at the About dialog.

Of course I used the ./ before the filename of the executable, and yet the program loaded is the default one that was already present on the system.
I even tried changing the name of the executable to avoid any possible name conflict and I ran it again, so there is no doubt that the program loaded is the one I compiled -- once again, the program runs fine, but it is not the version I compiled.

Any idea how to make sure that the program loaded is the one in the current directory?

Grabby 01-12-2019 04:17 PM

It just came to my mind that since Caja is always running in the background (because it manages the desktop icons) there may be a problem with loading into memory another version of it, so I am redirected to the Caja that is the default on the system. Could this be the reason?

ondoho 01-13-2019 02:43 AM

both could be responsible.
you can try
Code:

while pidof caja; do killall caja; sleep 1; done; ./caja
(this should exit after 1s and start your custom caja; if not caja is automatically respawning itself).
but even if you manage to kill the caja process for goosd, it's probably still calling upon system resources, sth like /lib/caja/version.gui maybe... the answer to that lies in the sources and possibly in the compilation options.

Grabby 01-13-2019 12:40 PM

Quote:

Originally Posted by ondoho (Post 5948407)
both could be responsible.
you can try
Code:

while pidof caja; do killall caja; sleep 1; done; ./caja
(this should exit after 1s and start your custom caja; if not caja is automatically respawning itself).
but even if you manage to kill the caja process for goosd, it's probably still calling upon system resources, sth like /lib/caja/version.gui maybe... the answer to that lies in the sources and possibly in the compilation options.

Caja is respawning itself, as you predicted, in an endless loop. I think it's time to give up on this. I will probably keep the binary and try to run it in another desktop environment when I have a chance.

RockDoctor 01-13-2019 05:12 PM

Quote:

Originally Posted by Grabby (Post 5948566)
Caja is respawning itself, as you predicted, in an endless loop. I think it's time to give up on this. I will probably keep the binary and try to run it in another desktop environment when I have a chance.

I would do the following:
  1. back up the original caja
  2. replace the original with my self-compiled copy
  3. log out, then log back in
If it works, great, if not, log in to a console and restore the original

Grabby 01-28-2019 12:24 AM

Quote:

Originally Posted by RockDoctor (Post 5948680)
I would do the following:
  1. back up the original caja
  2. replace the original with my self-compiled copy
  3. log out, then log back in
If it works, great, if not, log in to a console and restore the original

I was about to do this, but then I noticed something odd: the size of the executable compiled by me is 10 MB whereas the size of the original caja (in /usr/bin) is about 2 MB. How can the size be so different? Should I go ahead?

RockDoctor 01-28-2019 09:10 AM

I would definitely go ahead and try it, but keep that backup handy.

RockDoctor 01-28-2019 09:48 AM

1 Attachment(s)
I was curious, so I tried it myself. I'm running Fedora Rawhide, so I downloaded the caja source rpm and the needed devel files and rebuilt caja using 144 (300%) as the largest icon size instead of the default 192 (400%). Both my original and my rebuilt /usr/bin/caja files are only about 2 MB, but the caja rpm itself was about 4.2 MB, and I had to install the caja-schemas rpm (13.1 MB), and the caja-core-extensions rpm (also 13.1 MB). The attached image show icons at 100%, 200%, and 300%

Grabby 01-28-2019 10:27 PM

Quote:

Originally Posted by RockDoctor (Post 5954476)
I was curious, so I tried it myself. I'm running Fedora Rawhide, so I downloaded the caja source rpm and the needed devel files and rebuilt caja using 144 (300%) as the largest icon size instead of the default 192 (400%). Both my original and my rebuilt /usr/bin/caja files are only about 2 MB, but the caja rpm itself was about 4.2 MB, and I had to install the caja-schemas rpm (13.1 MB), and the caja-core-extensions rpm (also 13.1 MB). The attached image show icons at 100%, 200%, and 300%

When you rebuilt it, did you just use its own config? I am not expert at all with this, so I am wondering whether perhaps I did something wrong or missed something.
What I did was:
1. I ran ./autogen.sh
2. I built with ./make

RockDoctor 01-29-2019 06:30 PM

Quote:

Originally Posted by Grabby (Post 5954790)
When you rebuilt it, did you just use its own config?

I used rpmbuild which used Fedora's spec file (which I did not modify) to build the rpm's after I changed the icon size. Fedora uses a configuration that includes
Code:

--disable-static \
--disable-schemas-compile \
--disable-update-mimedb

which may explain why your self-compiled caja binary is so much larger

Grabby 01-29-2019 06:47 PM

I forgot to mention: instead of using a package from a distro (like Fedora), I had downloaded the program directly from Github.

RockDoctor 01-29-2019 07:01 PM

I assumed you used the actual caja source. What distro are you using? If your distro has a source package and the tools build the binary from it, that would definitely be the easiestway to go.

Grabby 01-29-2019 07:15 PM

Sorry, I did not explain myself well, I did build from source. I downloaded it from the official Caja account on Github.
My OS is Manjaro. I still do not know how to build via the package manager. I will look into it.
What I did was simply: running autogen.sh and then ./make

RockDoctor 01-29-2019 07:28 PM

I have manjaro installed, but never tried to build a package for it. I'm going to try my Fedora-compiled version of the caja binary on it. Will be back in a few minutes to let you know if it worked

RockDoctor 01-29-2019 07:33 PM

I have manjaro installed, but never tried to build a package for it. I'm going to try my Fedora-compiled version of the caja binary on it.

Tried it - doesn't work. Fedora version requires libselinux.so.1, and I don't believe Manjaro uses selinux.

RockDoctor 01-29-2019 07:40 PM

But here's how I performed the trial (which you should be able to do, also)
  1. open a terminal and become root (sudo su)
  2. copy /usr/bin/caja to my home directory
  3. copy my replacement caja to /usr/bin
  4. logout
  5. log back in
  6. my desktop icons didn't show, so I knew something wasn't right. I opened a terminal window and tried to run caja
  7. gave me error message
  8. logout
  9. from the Manjaro login screen, open a console (Alt-F2)
  10. login
  11. sudo su
  12. copy the Manjaro caja back to /usr/bin
  13. log out of console
  14. Alt-F7 to get back to the graphical login screen
  15. login
  16. everything is back to the way it was

Grabby 01-31-2019 10:40 AM

Quote:

Originally Posted by RockDoctor (Post 5955238)
But here's how I performed the trial (which you should be able to do, also)
  1. open a terminal and become root (sudo su)
  2. copy /usr/bin/caja to my home directory
  3. copy my replacement caja to /usr/bin
  4. logout
  5. log back in
  6. my desktop icons didn't show, so I knew something wasn't right. I opened a terminal window and tried to run caja
  7. gave me error message
  8. logout
  9. from the Manjaro login screen, open a console (Alt-F2)
  10. login
  11. sudo su
  12. copy the Manjaro caja back to /usr/bin
  13. log out of console
  14. Alt-F7 to get back to the graphical login screen
  15. login
  16. everything is back to the way it was

Thanks a lot for taking the time to write this mini-tutorial, I appreciate it.
I think the best thing for me is to stop playing with the idea of modifying Caja myself, as I would surely mess up. Instead, I have already filed a feature request in their bug tracking system.
Thanks to everyone for the help


All times are GMT -5. The time now is 02:36 AM.