Re: [kde] how to use kdialog --font ?
On Monday 26 Oct 2015 20:31:48 J. Leslie Turriff wrote: > I want to use kdialog to display a table of values, and to make the output > columns line up, the simplest way is to display the data with a monospace > font, e.g. DejaVu Sans Mono. kdialog --help-qt shows option -fn > or --font , but does not describe the format of the string. > > For testing, I've tried all of the following, but none seem to do anything: > > kdialog --font 'DejaVu Sans Mono' --msgbox 'Does this use the right font?' > kdialog --font 'dejavu sans mono' --msgbox 'Does this use the right font?' > kdialog --font '-*-dejavu sans mono-medium-r' --msgbox 'Does this use the > right font?' > (This last after using xfontsel to see the X definition, just in case.) > > I've searched the web for documentation and hints, and come up empty. I've > looked at the QT class documentation, but those are c++ calls, so don't > tell anything about kdialog. > > Does anyone out there know how the --font string should be formatted? > > Leslie I've just done a "kdialog ?" and there is no reference to a "--font" and thats using this version Qt: 4.8.7 KDE Development Platform: 4.14.12 KDialog: 1.0 ___ This message is from the kde mailing list. Account management: https://mail.kde.org/mailman/listinfo/kde. Archives: http://lists.kde.org/. More info: http://www.kde.org/faq.html.
Re: [kde] how to use kdialog --font ?
ianseeks posted on Tue, 27 Oct 2015 08:05:49 + as excerpted: > On Monday 26 Oct 2015 20:31:48 J. Leslie Turriff wrote: >> I want to use kdialog to display a table of values, and to make >> the output columns line up, the simplest way is to display the data >> with a monospace font, e.g. DejaVu Sans Mono. kdialog --help-qt >> shows option -fn or --font , but does not describe the >> format of the string. [snip the details as not relevant to this particular subthread] > I've just done a "kdialog ?" and there is no reference to a "--font" > and thats using this version > Qt: 4.8.7 > KDE Development Platform: 4.14.12 > KDialog: 1.0 The two of you are using two different sets of help output. For most kde executables, --help (or ?, which was new to me) will output help text in two sections. The first section is generic parameters such as --help itself, the section is command-specific options, followed by command specific arguments. You (ianseeks) were looking at the ?/--help output and apparently focused on the (command specific) Options section, which, you correctly noted, contains no --font or similar option. However, the OP (J Leslie Turrif) specifically mentioned help output found under --help-qt, which is qt-specific help that generally applies to all qt-based programs, pretty much regardless of what they actually are. Similarly, --help-kde is kde-specific help that generally applies to all kde-based programs, pretty much regardless of what they are. --help-all should list all the above, the generic options, followed by the command specific options, followed by the qt options, then the kde options, and finally the command arguments. And it can be observed that --help-qt (as well as --help-kde and --help-all) is indeed listed under the generic options (at least for my kdialog 1.0, on kde 4.14.13, on qt 4.8.7) section when invoking kdialog --help or kdialog ? . And, --help-qt (and the qt section under --help-all) does indeed list both --fn and --font, as synonyms for each other. So... the --fn/--font option is a generic qt option, that should work with most qt-based apps, and is actually a generic option included due to the app being qt-based, even if in some cases --fn/--font won't apply, or will be overridden by something else. So far so good. But I don't have an answer to the original question, because while I've occasionally used some other qt option and had it work, I've never needed to use that one. Also, kdialog is a rather unusual application, and I'm not /entirely/ sure it honors that particular qt option at all. What I could suggest as the way I'd try figuring it out here is this. Try using the --fn/--font option with other more traditional qt apps. In particular, if you have any non-kde qt-based apps (based on the same qt major version, right now qt4 and qt5 based apps are out, and a test on a qt5 app while kdialog is based on qt4, or the reverse, a qt5 based kdialog with a test on a qt4 app, won't be particularly helpful), try using the -- font option on them, and see if you can get it to work there, where it's much more likely not to be overridden. Once you get it working there, you'll know the font name pattern to use, and can try the same thing on kdialog. It may also be that in the kde environment, kde overrides the normal qt font options, and may override it here, as well. So it may also be worth trying that qt-based non-kde app in a non-kde desktop environment, perhaps failsafe, if your distro provides such a login option, or gnome or one of the gtk-based desktop environments. Again, if you get it working there, you can try the font name pattern that worked there under kde to see if it works under kde as well. Meanwhile, my google-foo might be a bit better than yours. Searching on... qt command line option "--font" ... (the quotes around font being critical), the first hit is to a page of qt 4.8 embedded documentation, with command-line-options down the page. Here's a direct link: http://doc.qt.io/qt-4.8/qt-embedded-running.html#command-line-options The first option listed there is -fn . It says "The font should be specified using an X logical font description." However, that doesn't tell me a whole lot. The example isn't a whole lot better in that it doesn't show size or weight or anything, but here it is: -fn helvetica Two things to note about that: 1) -fn not --fn. So try it with just one -. It might just work, or again, it may be that kde adapted that and it really is two -- under kde. Trying it both ways is the only way to know for sure. 2) If you have the helvetica font installed, you can try the example verbatim, and if it works, go from there. If it doesn't, again, try a different qt-based app, to be sure that kdialog isn't overriding it for some reason. Another hit, this one in the documentation for pyqt, adds an interesting caveat: -fn or -font font, defines the application font. Th
Re: [kde] how to use kdialog --font ?
On Tuesday 27 Oct 2015 10:03:06 Duncan wrote: > ianseeks posted on Tue, 27 Oct 2015 08:05:49 + as excerpted: > > On Monday 26 Oct 2015 20:31:48 J. Leslie Turriff wrote: > >> I want to use kdialog to display a table of values, and to make > >> the output columns line up, the simplest way is to display the data > >> with a monospace font, e.g. DejaVu Sans Mono. kdialog --help-qt > >> shows option -fn or --font , but does not describe the > >> format of the string. > > [snip the details as not relevant to this particular subthread] > > > I've just done a "kdialog ?" and there is no reference to a "--font" > > and thats using this version > > Qt: 4.8.7 > > KDE Development Platform: 4.14.12 > > KDialog: 1.0 > > The two of you are using two different sets of help output. > > For most kde executables, --help (or ?, which was new > to me) will output help text in two sections. The first section is > generic parameters such as --help itself, the section is command-specific > options, followed by command specific arguments. > > You (ianseeks) were looking at the ?/--help output and apparently focused > on the (command specific) Options section, which, you correctly noted, > contains no --font or similar option. seemed the sensible thing to do at time. :o) > However, the OP (J Leslie Turrif) specifically mentioned help output > found under --help-qt, which is qt-specific help that generally applies > to all qt-based programs, pretty much regardless of what they actually > are. Similarly, --help-kde is kde-specific help that generally applies > to all kde-based programs, pretty much regardless of what they are. > --help-all should list all the above, the generic options, followed by > the command specific options, followed by the qt options, then the kde > options, and finally the command arguments. > > And it can be observed that --help-qt (as well as --help-kde and > --help-all) is indeed listed under the generic options (at least for my > kdialog 1.0, on kde 4.14.13, on qt 4.8.7) section when invoking > kdialog --help or kdialog ? . perhaps the qt/kde options should be listed at the same time something along the lines of "man rpm" i.e. get all the options into the open thanks for the enlightenment. > And, --help-qt (and the qt section under --help-all) does indeed list > both --fn and --font, as synonyms for each other. > > > So... the --fn/--font option is a generic qt option, that should work > with most qt-based apps, and is actually a generic option included due to > the app being qt-based, even if in some cases --fn/--font won't apply, or > will be overridden by something else. > > > So far so good. But I don't have an answer to the original question, > because while I've occasionally used some other qt option and had it > work, I've never needed to use that one. Also, kdialog is a rather > unusual application, and I'm not /entirely/ sure it honors that > particular qt option at all. > > What I could suggest as the way I'd try figuring it out here is this. > > Try using the --fn/--font option with other more traditional qt apps. In > particular, if you have any non-kde qt-based apps (based on the same qt > major version, right now qt4 and qt5 based apps are out, and a test on a > qt5 app while kdialog is based on qt4, or the reverse, a qt5 based kdialog > with a test on a qt4 app, won't be particularly helpful), try using the -- > font option on them, and see if you can get it to work there, where it's > much more likely not to be overridden. > > Once you get it working there, you'll know the font name pattern to use, > and can try the same thing on kdialog. > > It may also be that in the kde environment, kde overrides the normal qt > font options, and may override it here, as well. So it may also be worth > trying that qt-based non-kde app in a non-kde desktop environment, > perhaps failsafe, if your distro provides such a login option, or gnome > or one of the gtk-based desktop environments. Again, if you get it > working there, you can try the font name pattern that worked there under > kde to see if it works under kde as well. > > > Meanwhile, my google-foo might be a bit better than yours. Searching > on... > > qt command line option "--font" > > ... (the quotes around font being critical), the first hit is to a page > of qt 4.8 embedded documentation, with command-line-options down the > page. Here's a direct link: > > http://doc.qt.io/qt-4.8/qt-embedded-running.html#command-line-options > > The first option listed there is -fn . It says "The font should be > specified using an X logical font description." However, that doesn't > tell me a whole lot. The example isn't a whole lot better in that it > doesn't show size or weight or anything, but here it is: > > -fn helvetica > > Two things to note about that: > > 1) -fn not --fn. So try it with just one -. It might just work, or > again, it may be that kde adapted that and it really is two -- under kde
Re: [kde] how to use kdialog --font ?
It appears to me that kdialog is ignoring the '--font' option. (kdialog has a lot of "missing features", "misfeatures", etc. it's a shame) However, Ref: https://nowardev.wordpress.com/2013/06/28/kdialog-set-fonts/ $ kdialog --geometry 1024x768 --msgbox "$(cat /etc/motd)" renders a monospace font, but in an unre-sizable fixed window :-( (i.e. --geometry is ignored) This seems to mostly work: $ cat /tmp/kdialog.txt The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. This is a paragraph. $kdialog --geometry 1024x768 --textbox /tmp/kdialog.txt The "HTML" parser seems to be very limited. It is line oriented (i.e. a terminates any current deviation from defaults, so you have to prefix every line with what you want). 'font-color' is not supported, i suppose many things aren't. So, this example works (IT WORKS FOR ME(TM)) $ lsblk | sed -e 's/^//;s/$/<\/pre>/' > /tmp/kdialog.txt $ kdialog --geometry 1024x768 --textbox /tmp/kdialog.txt --or-- kdialog --textinputbox "$(lsblk | sed -e 's/^//;s/$/<\/pre>/')" "" 1 1 but the following does not (using bash process substitution) $ kdialog --geometry 1024x768 --textbox <(lsblk | sed -e 's/^//;s/$/<\/pre>/') kdialog does funky things with file handles, so you might be able to mangle that up, but otherwise, probably easiest to make a temporary file, and use a shell trap to ensure it gets removed. As a REALLY Ugly hack, you can use the kdialogrc KDE config file: you could use maketemp to create a temporary hierarchy and populate: FAKE_KDE_HOME=/tmp/kdeFOO/ FAKE_KDE_CONFIG=/tmp/kdeFOO/share/config cat >> ${FAKE_KDE_CONFIG}/kdialogrc << "EOF" [General] font=Sans Serif,20,-1,5,50,0,0,0,0,0 EOF # NOTE: i do not know what format that font-spec is in, that's just an example from a distro (arch?) creating a /usr/share/kde4/config/kdialogrc # NOTE: it's up to you to figure out the correct specification. I *think* then: KDEHOME=${FAKE_KDE_HOME} kdialog ... That also changes the Button font to what you specify in the [General] group font key. --stephen On Tue, Oct 27, 2015 at 5:02 AM, ianseeks wrote: > On Tuesday 27 Oct 2015 10:03:06 Duncan wrote: > > ianseeks posted on Tue, 27 Oct 2015 08:05:49 + as excerpted: > > > On Monday 26 Oct 2015 20:31:48 J. Leslie Turriff wrote: > > >> I want to use kdialog to display a table of values, and to make > > >> the output columns line up, the simplest way is to display the data > > >> with a monospace font, e.g. DejaVu Sans Mono. kdialog --help-qt > > >> shows option -fn or --font , but does not describe the > > >> format of the string. > > > > [snip the details as not relevant to this particular subthread] > > > > > I've just done a "kdialog ?" and there is no reference to a "--font" > > > and thats using this version > > > Qt: 4.8.7 > > > KDE Development Platform: 4.14.12 > > > KDialog: 1.0 > > > > The two of you are using two different sets of help output. > > > > For most kde executables, --help (or ?, which was new > > to me) will output help text in two sections. The first section is > > generic parameters such as --help itself, the section is command-specific > > options, followed by command specific arguments. > > > > You (ianseeks) were looking at the ?/--help output and apparently focused > > on the (command specific) Options section, which, you correctly noted, > > contains no --font or similar option. > > seemed the sensible thing to do at time. :o) > > > However, the OP (J Leslie Turrif) specifically mentioned help output > > found under --help-qt, which is qt-specific help that generally applies > > to all qt-based programs, pretty much regardless of what they actually > > are. Similarly, --help-kde is kde-specific help that generally applies > > to all kde-based programs, pretty much regardless of what they are. > > --help-all should list all the above, the generic options, followed by > > the command specific options, followed by the qt options, then the kde > > options, and finally the command arguments. > > > > And it can be observed that --help-qt (as well as --help-kde and > > --help-all) is indeed listed under the generic options (at least for my > > kdialog 1.0, on kde 4.14.13, on qt 4.8.7) section when invoking > > kdialog --help or kdialog ? . > > perhaps the qt/kde options should be listed at the same time something > along > the lines of "man rpm" i.e. get all the options into the open > > thanks for the enlightenment. > > > And, --help-qt (and the qt section under --help-all) does indeed list > > both --fn and --font, as synonyms for each other. > > > > > > So... the --fn/--font option is a generic qt option, that should work > > with most qt-based apps, and is actually a generic option included due to > > the app being qt-based, even if in some c
Re: [kde] how to use kdialog --font ?
Looks like 'kdialog' supports Qt Style Sheets. I haven't played with these before. Appears to be a variant of CSS. $ kdialog --stylesheet ~/tmp/kdialog.qss --msgbox "$(lsblk)" $ cat ~/tmp/kdialog.qss * { font-family: monospace; font-size: 16; } > I'm not sure if there's a way to identify the Qt components in use by 'kdialog' . (something like firefox' web developer "Inspect" would be awesome) I grabbed a copy of XnView's stylesheet file: "XnView/UI/style_sheet.qss" to start with. using it unchanged renders kdialog with a nice black background, but not monospaced, of course. That's probably the best way to handle kdialog's failings in other areas. There's also a Style "Theme" (--style). I guess i have to look into this stuff more. (this is more like the older X AppDefaults configurations to style X11 applications) --stephen -- Stephen Dowdy - Systems Administrator - NCAR/RAL 303.497.2869 - sdo...@ucar.edu- http://www.ral.ucar.edu/~sdowdy/ ___ This message is from the kde mailing list. Account management: https://mail.kde.org/mailman/listinfo/kde. Archives: http://lists.kde.org/. More info: http://www.kde.org/faq.html.
Re: [kde] how to use kdialog --font ?
On Tuesday, 2015-10-27, 11:29:44, Stephen Dowdy wrote: > I'm not sure if there's a way to identify the Qt components in use > by 'kdialog' > . > (something like firefox' web developer "Inspect" would be awesome) Gammaray Very likely packaged by your distribution. Cheers, Kevin -- Kevin Krammer, KDE developer, xdg-utils developer KDE user support, developer mentoring signature.asc Description: This is a digitally signed message part. ___ This message is from the kde mailing list. Account management: https://mail.kde.org/mailman/listinfo/kde. Archives: http://lists.kde.org/. More info: http://www.kde.org/faq.html.
Re: [kde] how to use kdialog --font ?
On Tue, Oct 27, 2015 at 12:28 PM, Kevin Krammer wrote: > > I'm not sure if there's a way to identify the Qt components in use > > by 'kdialog' > > . > > (something like firefox' web developer "Inspect" would be awesome) > > Gammaray Kevin, thanks! Package "gammaray" on "Debian Jessie". Looks like it might take some research on using it effectively (it finds a kdialog, but can't connect to it (greyed out in selection widget). and: $ gammaray --pid 9236 No probe found for ABI qt4.8-x86_64 $ kdialog --version Qt: 4.8.6 KDE Development Platform: 4.14.2 KDialog: 1.0 $ aptitude show gammaray Package: gammaray State: installed Version: 2.1.0-3+b1 Depends: libc6 (>= 2.14), libcgraph6, libgcc1 (>= 1:4.1.1), libgvc6, libqt5core5a (>= 5.3.0), libqt5designer5 (>= 5.0.2), libqt5gui5 (>= 5.2.0), libqt5network5 (>= 5.0.2), libqt5printsupport5 (>= 5.2.0), libqt5script5 (>= 5.0.2), libqt5scripttools5 (>= 5.0.2), libqt5svg5 (>= 5.0.2), libqt5webkit5 (>= 5.0.2), libqt5widgets5 (>= 5.2.0), libstdc++6 (>= 4.4.0), qtbase-abi-5-3-2 ... Dunno if 'gammaray' for Qt5 can operate on a Qt 4 app? Ah, never mind... # aptitude install gammaray-probe-qt4 ;) (i now see some UI layout goodness) thanks, again, --stephen -- Stephen Dowdy - Systems Administrator - NCAR/RAL 303.497.2869 - sdo...@ucar.edu- http://www.ral.ucar.edu/~sdowdy/ ___ This message is from the kde mailing list. Account management: https://mail.kde.org/mailman/listinfo/kde. Archives: http://lists.kde.org/. More info: http://www.kde.org/faq.html.
Re: [kde] how to use kdialog --font ?
On Tuesday, 2015-10-27, 13:05:15, Stephen Dowdy wrote: > Ah, never mind... > > # aptitude install gammaray-probe-qt4 > > ;) (i now see some UI layout goodness) :) CTRL+SHIFT+Left Click on any part in the observed application (in your case kdialog), should jump to that object in Gammaray's tree. You can then also adjust properties at runtime, e.g. the stylesheet property. See http://doc.qt.io/qt-4.8/stylesheet-examples.html for small example stylesheets. Cheers, Kevin -- Kevin Krammer, KDE developer, xdg-utils developer KDE user support, developer mentoring signature.asc Description: This is a digitally signed message part. ___ This message is from the kde mailing list. Account management: https://mail.kde.org/mailman/listinfo/kde. Archives: http://lists.kde.org/. More info: http://www.kde.org/faq.html.
[kde] Qt stylesheets : per-user default qss capability? (was Re: how to use kdialog --font ?)
On Tue, Oct 27, 2015 at 1:24 PM, Kevin Krammer wrote: > > CTRL+SHIFT+Left Click on any part in the observed application (in your case > kdialog), should jump to that object in Gammaray's tree. > > You can then also adjust properties at runtime, e.g. the stylesheet > property. > > See http://doc.qt.io/qt-4.8/stylesheet-examples.html for small example > stylesheets. > > Kevin, Great stuff, exactly what i was looking for. 'strace' reveals no default search for .qss files (at least in 'kdialog'). So, is there a way to create a user stylesheet that all Qt apps will reference? One that can be obtained via Environment Variable or perhaps an entry (or several) in Trolltech.conf? ( adding a key "style=windows" to the INI group "[Qt]" in Trolltech.conf will do the same (i think) as setting your KDE default Qt Widget style, but it'd be nice to have a stylesheet key, which i can't find reference for) QT_STYLE_OVERRIDE="windows" kdialog --msgbox "$(lsblk)" doesn't seem to work, so maybe that's a Qt5 only thing (kdialog --style "windows", however, does work as expected) If so, one could create a "userStyle.qss" that had stuff like: KDialog > QWidget > QLabel { font-family: monospace; font-size: 16; background-color: rgb(40,40,40); color:rgb(220,220,220); } which, theoretically should only apply to KDialog (executable, or i think there's an API?) (unfortunately, the labels in KDialog don't have class/id AFAICT, so you hit all of them) But having one place to tweak styles would be useful. I suppose this is getting low-level enough that reliance from one release to another might get "iffy". thanks, --stephen -- Stephen Dowdy - Systems Administrator - NCAR/RAL 303.497.2869 - sdo...@ucar.edu- http://www.ral.ucar.edu/~sdowdy/ ___ This message is from the kde mailing list. Account management: https://mail.kde.org/mailman/listinfo/kde. Archives: http://lists.kde.org/. More info: http://www.kde.org/faq.html.
Re: [kde] SLOW KDE login after update
CS DBA wrote: > Created a new user, login still slow > > anyone know which config file is the issue? kf5-kservice is (probably) the culprit, get kf5-5.15.0, https://bodhi.fedoraproject.org/updates/FEDORA-2015-176062173b -- Rex ___ This message is from the kde mailing list. Account management: https://mail.kde.org/mailman/listinfo/kde. Archives: http://lists.kde.org/. More info: http://www.kde.org/faq.html.