Tiny Core Base > TCB Tips & Tricks
xvesa - how can i read the current resolution to use it as a variable?
netnomad:
hi friends, hi roberts,
i want to make my desktop flexible for different resolutions in xvesa.
for that goal i want to read or get the current resolution.
in my examples i looked just for the y-value,
because i want to place my desktop pager in the left bottom corner.
would you tell me a way to place something in the left bottom corner?
f.e. like the concept of positioning wbar or a panel!?
another goal is to position mnttool on the right up corner...:)
first i tried to use
--- Code: ---awk ' BEGIN{FS=",";} { $1= "";} {sub(/^[ \t]+/, ""); print}' /sys/devices/platform/vesafb.0/graphics/fb0/virtual_size
--- End code ---
although it stores a suitable value,
i guess that this virtual_size has not too much to do with my current resolution...
later i tried
--- Code: ---Xvesa -listmodes 2>&1 | grep ^0x | awk '{ printf "%s\n",$2 }' | sort -n > /tmp/xvesamodes
awk ' BEGIN{FS="x";} { $1= "";} { $3= "";} {sub(/[ \t]+$/, "")} {sub(/^[ \t]+/, ""); print}' /tmp/xvesamodes | sed '$!d'
--- End code ---
but Xvesa -listmodes offers so many resolutions that someones display cannot support,
so the highest resolution is not always the suitable one.
i guess that this one-liners are looking ugly for experienced coders, so please, don't mind...:)
so do you know a way, every hint is welcomed!
thank you
curaga:
Please read the watcher info file,
http://ftp.nluug.nl/pub/metalab/distributions/tinycorelinux/4.x/x86/tcz/watcher.tcz.info
It has a quick howto on using the X standard -g (-geometry) option that most apps accept. With it you can position apps easily with no knowledge of the screen size.
--
For getting the screen resolution, if you can't read .xsession, xdpyinfo and xwininfo can tell you.
netnomad:
hi curaga,
thank you for your reply.
ipager doesn't have such an -g option, but it's good that you've mentioned it, i guess that i will need it later.
i had success with xwininfo, it works without dependencies, so i don't need to install the heavy xorg-package...
--- Code: ---#!/bin/sh
MYY="$(xwininfo -root | awk '/Height:/,/Height:/' | sed 's/Height: / /g' | sed 's/ //g')"
sleep 1
ipager -c ~/.ipager/ipager$MYY.conf 2>/dev/null &
--- End code ---
thank you for your hints!
curaga:
Many apps support the -g option via their toolkit (and so not listed in their --help etc).
Just curious, do you launch xvesa some different way, that the resolution is not in .xsession?
netnomad:
yes, you are right!
1. in my .xsession i control the 1280x1024x24-resolution of my mainly used systems.
2. when i use my netbook then i use over syslinux the command-line "xvesa=1024x600x32" and my .xsession-entry stays untouched.
Though i really love and heavily use my ipager in the left bottom corner, i read the resolution of xwininfo and choose the compatible ipager-config-file f.e. ipager1024.conf.
by the way, ipager doesn't know a -g option:
tc@box:~$ ipager -g +88+88
ipager: invalid option -- 'g'
Navigation
[0] Message Index
[#] Next page
Go to full version