LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-31-2022, 11:39 AM   #16
jon Elson
Member
 
Registered: May 2018
Posts: 60

Original Poster
Rep: Reputation: Disabled

Well, here's additional info about the app. Because it accesses GPIO, it needs to be run with sudo, unless I can figure out the right priviledge to run it as normal user. So, maybe the sudo causes it to not use the regular user's .gtkrc-2.0 file. I tried to put these files in the /root directory, but that didn't seem to have an effect. Gtk does not permit you to make the program owned by root:root and set for u+s file permissions.
I have split another app into two parts and have them communicate via rpc, but that was quite complicated.

Another issue is that the system seems to have at least part of gtk3.0 installed, In /usr/lib, I see such files as libseed-gtk3.so.0 and seed-gtk3
but I don't see libgtk-3.0 (or libgtk-2.0 either) so I must be looking in the wrong place.

I do not have strace on this system, or at least, don't know how to use it.
This is a Beagle Board running :
3.2.19-x13 #1 SMP Tue Jun 5 08:48:31 UTC 2012 armv7l armv7l armv7l GNU/Linux

At one point I did get it to change the fonts of the toolbar in emacs, but now that is not happening. I think it was one of the .gtkrc-3.0 files that did that. I'm guessing that the font I am calling out with gtk-font-name = is the wrong syntax. Can you suggest how to format what you get with fc-list to make a good .gtkrc-2.0 file?
Here's what fc-list gives :

DejaVu Sans:style=Bold
DejaVu Sans:style=Book
DejaVu Sans Mono:style=Book
DejaVu Sans Mono:style=Bold
DejaVu Serif:style=Book
DejaVu Serif:style=Bold
Thanks much for your help so far!
Jon
 
Old 08-31-2022, 07:49 PM   #17
EdGr
Member
 
Registered: Dec 2010
Location: California, USA
Distribution: I run my own OS
Posts: 999

Rep: Reputation: 471Reputation: 471Reputation: 471Reputation: 471Reputation: 471
Try putting in /usr/share/gtk-2.0/gtkrc

Code:
gtk-font-name = "DejaVu Sans 14"
strace would make debugging this problem trivial.
Ed
 
Old 09-01-2022, 09:13 AM   #18
jon Elson
Member
 
Registered: May 2018
Posts: 60

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by EdGr View Post
Try putting in /usr/share/gtk-2.0/gtkrc

Code:
gtk-font-name = "DejaVu Sans 14"
strace would make debugging this problem trivial.
Ed
Astonishingly, this did nothing. I created files /usr/share/gtk-2.0/gtkrc and .gtkrc with gtk-font-name = "DejaVu Sans 32"
in them, and there is no change! I also put the same files under /usr/share/gtk-3.0, still no difference.
OK, one thing to note is that the embedded system is NOT running an X windows server. I connect to it either with a MS Windows system with putty and xming, or a Linux system that IS running X Windows. Maybe the issue is all on those X server systems.
The system does have :/usr/lib/arm-linux-gnueabihf/libgtk-3-0:
total 64
drwxr-xr-x 2 root root 4096 Jun 18 2012 .
drwxr-xr-x 35 root root 24576 Jun 18 2012 ..
-rwxr-xr-x 1 root root 9808 May 21 2012 gtk-query-immodules-3.0
-rwxr-xr-x 1 root root 22556 May 21 2012 gtk-update-icon-cache-3.0
but I'm not sure that is the whole gtk-3.0 library.
There is also :
usr/lib/arm-linux-gnueabihf/libgtk-3.so.0.400.2 which is a 3 mb file, so it looks like gtk-3 is available. I just have to
hack the Makefile to link to it.

Last edited by jon Elson; 09-01-2022 at 09:44 AM.
 
Old 09-01-2022, 10:23 AM   #19
jon Elson
Member
 
Registered: May 2018
Posts: 60

Original Poster
Rep: Reputation: Disabled
OK, so now I am trying to build the app with gtk-3.0
Previously, I had this in the Makefile:
COMMONSW = -c -D__unix__ `pkg-config --cflags --libs gtk+-2.0 libglade-2.0` -export-dynamic
OPTSW = -g $(COMMONSW)
LDFLAGS = -Wall -g `pkg-config --cflags --libs gtk+-2.0 libglade-2.0` -export-dynamic


CC = gcc
COMMONSW = -c -D__unix__ `pkg-config --cflags --libs gtk-3.0 libglade-2.0` -export-dynamic
OPTSW = -g $(COMMONSW)
LDFLAGS = -Wall -g `pkg-config --cflags --libs gtk-3 libglade-2.0` -export-dynamic

PROGOBJS= scdrvr.o scaler.o

all : Program

Program: $(PROGOBJS)
gcc -o scaler $(PROGOBJS) $(LDFLAGS)

scaler.o: scaler.c
$(CC) $(OPTSW) $<

scdrvr.o: scdrvr.c
$(CC) $(OPTSW) $<

clean:
rm -f *.o
[/code]
But, I get this error:
Package gtk-3.0 was not found in the pkg-config search path.
OK, so this gtk+-2.0 syntax must be something special for make, when I put in gtk+-3.0 it started pulling in the gtk 3.0 files, but then I run into lots of version compatabilty errors. Looks like a HUGE mess. I'm not sure I can handle that big a conversion.
Any suggestions to make it easier?
Thanks,
Jon

Last edited by jon Elson; 09-01-2022 at 10:46 AM.
 
Old 09-01-2022, 10:55 AM   #20
jon Elson
Member
 
Registered: May 2018
Posts: 60

Original Poster
Rep: Reputation: Disabled
OK, now I got it to compile and link with gtk3.0, but I get :

/home/elson/scaler3/scaler.c:246: undefined reference to `gtk_entry_set_attributes'

Here's the line from the c source :

gtk_entry_set_attributes(Pscaler[0], attr);

IS this syntax wrong?
Thanks,
Jon
 
Old 09-01-2022, 11:11 AM   #21
jon Elson
Member
 
Registered: May 2018
Posts: 60

Original Poster
Rep: Reputation: Disabled
Well, here's some new info, now that the app is linked with gtk3.0 :
scaler:884): Gtk-WARNING **: Failed to parse /root/.config/gtk-3.0/settings.ini: Key file contains line 'style "user-font"' which is not a key-value pair, group, or comment

(scaler:884): Gtk-WARNING **: Theme parsing error: gtk.css:6:17: Junk at end of value

(scaler:884): Gtk-WARNING **: Theme parsing error: gtk-keys.css:4:13: Expected a valid selector

And, here is the contents of /root/.config/gtk-3.0/settings.ini :

style "user-font"
{
font_name="DejaVu Sans 24"
}
widget_class "*" style "user-font"

gtk-theme-name="QtCurve"
gtk-font-name="DejaVu Sans 24"

Anybody see what I did wrong there?
Thanks,
Jon
 
Old 09-01-2022, 12:32 PM   #22
jon Elson
Member
 
Registered: May 2018
Posts: 60

Original Poster
Rep: Reputation: Disabled
New, I have this in /root/.config/gtk-3.0/settings.ini :
[Settings]
gtk-application-prefer-dark-theme = false
gtk-theme-name = Zukitwo
gtk-fallback-icon-theme = gnome
gtk-icon-theme-name = Faenza-Dark
gtk-font-name = DejaVu Sans 36
And, it gets rid of the first 2 warning messages, but the 3rd one about gtk-keys.css remains. So far, I have not found this file.
But, it still doesn't change the font size of the app.
Thanks,

Jon
 
Old 09-01-2022, 12:58 PM   #23
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,616

Rep: Reputation: 2554Reputation: 2554Reputation: 2554Reputation: 2554Reputation: 2554Reputation: 2554Reputation: 2554Reputation: 2554Reputation: 2554Reputation: 2554Reputation: 2554

Using [code]..[/code] tags would make all these posts easier to read...

 
Old 09-01-2022, 02:17 PM   #24
EdGr
Member
 
Registered: Dec 2010
Location: California, USA
Distribution: I run my own OS
Posts: 999

Rep: Reputation: 471Reputation: 471Reputation: 471Reputation: 471Reputation: 471
Jon - I think if I came back to this thread in a day, you will have it figured out.

Yes, the GTK 2 gtkrc and the GTK 3 settings.ini have different syntax. I believe that "style" and "widget_class" are not valid in the latter.

The GTK 3 gtk.css has a third syntax.

You can dump the settings by running gtk-query-settings.
Ed
 
Old 09-01-2022, 07:25 PM   #25
jon Elson
Member
 
Registered: May 2018
Posts: 60

Original Poster
Rep: Reputation: Disabled
Wow, gtk-query-settings sure give a lot of info on my Ubuntu desktop system, but it is not available on the embedded system. Darn!
 
Old 09-02-2022, 10:16 AM   #26
jon Elson
Member
 
Registered: May 2018
Posts: 60

Original Poster
Rep: Reputation: Disabled
Well, I have not solved anything yet. To make it simpler, I am running the app logged directly into root, so as to avoid any effects that sudo might cause. I have put this is the /root/.config/gtk-3.0/settings.ini file :
[Settings]
gtk-font-name = DejaVu Sans 36
I don't get any error on this, but it seems to have no effect on anything. If I do botch the syntax, I do get an error, but if I put gibberish in the font name, there is no error.
If I could just set all displayed fonts to be larger, that would solve the issue, this embedded computer is just to run one program and serve a GUI over ssh.
The program gsettings DOES exist there, but I am still trying to find where the default font/size is set.
Thanks for any hints,
Jon

Last edited by jon Elson; 09-02-2022 at 10:23 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to change font and font size in fluxbox installed along with xbmcbuntu digdogger Linux - General 3 01-14-2017 05:30 PM
[SOLVED] How to change the default font-family and font-size under kde 4.8.4? kite Slackware 3 07-07-2012 11:55 AM
How to change font color and font size in terminal ? wlaw Linux - Newbie 3 05-15-2007 08:57 PM
gtk_widget_modify for GtkEntry Gitti Linux - Software 0 05-18-2006 06:04 AM
gtk+ to connect GtkEntry prabhakar_kushwaha Programming 3 10-20-2005 12:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration