I am working on a embedded Linux project using Qt, when the Qt program runs, it does not sit on the middle of the 7" LCD,so I used "fbset -move -step" to move it,then it is ok.
But when the board is switched off and on again, the setting is lost, the Qt program still not sit on the middle of the LCD. I checked the etc/fb.modes, and I also modified it, but the problem still remains. Can anyone help me?
Very lucky this time, I solved the question by myself. After "fbset -move -step", I printed the current setting using "fbset" command, and then I write these setting into the /etc/fb.modes. If you want to use this setting every bootup, you should add one line in /etc/rc.local: fbset mymode (the name you set in the fb.modes).
You can output the current settings by running fbset with no arguments other than -s/--show or -fb:
# fbset
mode "1024x768-60"
# D: 65.003 MHz, H: 48.365 kHz, V: 60.006 Hz
geometry 1024 768 1024 768 16
timings 15384 160 24 29 3 136 6
hsync high
vsync high
rgba 5/11,6/5,5/0,0/0
endmode
And you can write that into a file:
fbset >>/etc/local.fb.modes
Edit to rename the mode, add any comments you want; you can then use your new file with the -db argument:
fbset -db /etc/local.fb.modes --all "1024x768-60"
You can put that command into your /etc/rc.local to take effect every boot.
Tip: if setting mode in /etc/rc.local fails with:
systemctl status rc-local.service -l
"open /dev/fb0: No such file or directory"
Then simply run "fbset" 1st before setting mode:
/etc/rc.local
fbset
fbset -g 800 600 800 600 32
Had this problem in VMWare..
Related
I use Tera Term's console connect to Raspberry Pi 3 but the visible lines only 24.
Here is the environment variable
root#raspberrypi:~# export
...
declare -x LINES="24"
...
For expanding the visible lines, I remove the code "shopt -s checkwinsize" in the file "/etc/bash.bashrc" and I add code "export LINES=50" in the file "~/.bashrc".
Unfortunately, after the device reboot, the visible lines still is 24.
How to expand the visible lines?
It's my fault.
Just only to modify the .vimrc and add the line setting as below.
set lines=50
Now I can use vim to edit file with 50 visible lines.
RStudio is great IDE for R development. I wonder if there is any way for nice support HiDPI resolution?
I currently have 13 inch display and 3200x1800 resolution, it is even hard to read RStudio options to adjust more appropriate setting.
This is of course not an RStudio issue but general issue related to high resolution display which requires HiDPI support to make it reasonably usable.
Posting it here as question because RStudio still doesn't allow to fill questions/issues on github.
RStudio is a Qt application. I've solved this by setting a scaling factor in Qt with this environment variable (note it must be an integer):
export QT_DEVICE_PIXEL_RATIO=2
The Arch wiki has some excellent advice on getting HiDPI working.
UPDATE: This solution is only for WINDOWS!
There is a simple solution for you, it comes from the option "Compatibility" of the execute file.
Close all current RStudio windows.
Right click on the shortcut of RStudio (or the original exe file) and choose Properties
In the RStudio Properties pop-up windows, choose the tab Compatibility
Tick on option Override hide DPI scaling... and then choose System from the drop-down list.
Apply > OK.
(Re)open Rstudio to see the change
Note that, on the HiDPI screen, resolution of modified RStudio is not so good but it really solved the bad scale problem.
You can also apply this technique to other apps without supporting HiDPI.
I use the following bash script to determine the current screen resolution and substitute the scaling factor by 1 (normal resolution) or 1.75 (high resolution) in the RStudio desktop file:
#!/bin/bash
# Determine resolution
width=$(xdpyinfo | grep 'dimensions:' | grep -o -E '[0-9]+' | head -1 | sed -e 's/^0\+//')
echo "Screen width is $width pixels"
if [ $width -gt 3000 ]; then
echo "High resolution detected -> setting zoom level to 1.75"
sed -i 's/view.zoomLevel.*/view.zoomLevel=1.75/' ~/.config/RStudio/desktop.ini
else
echo "Normal resolution detected -> setting zoom level to 1.0"
sed -i 's/view.zoomLevel.*/view.zoomLevel=1/' ~/.config/RStudio/desktop.ini
fi
QT_QPA_PLATFORMTHEME=gtk2 /usr/lib/rstudio/bin/rstudio %F
I am on Ubuntu 17.10. If I want to use the GTK theme, I have to set the QT_QPA_PLATFORMTHEME environment variable.
When i use command format the output is:
AVAILABLE DISK SELECTIONS:
0. c0d0 <DEFAULT cyl 1302 alt 2 hd 255 sec 63>
/pci#0,0/pci-ide#7,1/ide#0/cmdk#0,0
1. c2t0d0 <DEFAULT cyl 1020 alt 2 hd 64 sec 32>
/pci#0,0/pci15ad,1976#10/sd#0,0
But after searching in /dev/dsk $ /dev/rdsk using ls i found:
bash-3.00# ls
c0d0p0 c0d0s11 c0d0s5 c1t0d0p3 c1t0d0s14 c1t0d0s8 c2t0d0s1 c2t0d0s3
c0d0p1 c0d0s12 c0d0s6 c1t0d0p4 c1t0d0s15 c1t0d0s9 c2t0d0s10 c2t0d0s4
c0d0p2 c0d0s13 c0d0s7 c1t0d0s0 c1t0d0s2 c2t0d0p0 c2t0d0s11 c2t0d0s5
c0d0p3 c0d0s14 c0d0s8 c1t0d0s1 c1t0d0s3 c2t0d0p1 c2t0d0s12 c2t0d0s6
c0d0p4 c0d0s15 c0d0s9 c1t0d0s10 c1t0d0s4 c2t0d0p2 c2t0d0s13 c2t0d0s7
c0d0s0 c0d0s2 c1t0d0p0 c1t0d0s11 c1t0d0s5 c2t0d0p3 c2t0d0s14 c2t0d0s8
c0d0s1 c0d0s3 c1t0d0p1 c1t0d0s12 c1t0d0s6 c2t0d0p4 c2t0d0s15 c2t0d0s9
c0d0s10 c0d0s4 c1t0d0p2 c1t0d0s13 c1t0d0s7 c2t0d0s0 c2t0d0s2
Question 1
I know that c0d0p0 is fdisk partitions because i'm on x86 system not spark but still i don't understand why it appeared even though i never used fdisk?
Question 2
As you saw at format output i only have c0d0 [IDE] and c2t0d0 [SCSI] but i don't have c1t0d0s0 ?!! i even used devfsadm -C and still it exists.
i used format /dev/rdsk/c1t0d0s0 and told me No disk found!
I dont understand what is this exactly and using ls -l is sure points on a device file at /device
bash-3.00# ls -l c1t0d0s0
lrwxrwxrwx 1 root root 52 Nov 29 2012 c1t0d0s0 -> ../../devices/pci#0,0/pci-ide#7,1/ide#1/sd#0,0:a,raw
so can you please tell me what is that exactly and how can i remove it?
1: No need to use fdisk to get c0d0p0, the OS provision every possible entry (partition/slice) regardless of whether they actually exist or not.
2: This device is likely not handled by format, might a CD/DVD drive or a remote device (USB key, drive, ...)
TI OMAP 4460 + Android file system + Android Linux kernel 3.0
I have set CONFIG_LOGO, CONFIG_VT and CONFIG_FRAMEBUFFER_CONSOLE in kernel config, logo image type is CLUT224.
Then I saw strange things, almost 10 seconds later after kernel booting, a broken image appeared, looked like the head of the penguin, only several pixels of lines on the top of sreen. Then I reboot again and agian, sometimes I saw the 'ANDROID' characters, just below the penguin's head, but sometimes not.
see the linkenter link description here
My colleague reminded me I should disable the Android booting logo('ANDROID' characters, to be exactly), because it needs to open a tty console. That might have effect on something?
Besides, why the penguin logo showed up so late? I added some print in drivers/video/fbmem.c
fb_do_show_logo(), this function was called at 3 seconds after kernel booting. Why I saw the logo at 10 seconds?
Straight to the point; I'd like to create a script in UNIX to open two windows at a specific location on the screen, enter in username and password (which would be given by the user as an argument) and then execute another script.
I'd like to know if this is possible and if so; where should I look?
I'm new to UNIX, but am quite familiar with scripting and programming.
EDIT after thb and notfed responded
I am currently running SunOS 5.6 on OS X
Regarding the location of the windows, review X(7) -- that is, type the command man 7 X at the terminal and review the result -- and scroll down that man page to the section GEOMETRY SPECIFICATIONS, if your version of the man page has such a section. In brief, to have the program xfoo open its window with a size of 200 horizontally and 160 vertically, with its upper left corner at coordinates (40, 100), give the command xfoo -geometry 200x160+40+100.
This may not be a complete answer to your question, since you prudently have not given full details, but one suspects that it will set you on the right track, so to speak.
Regarding your authentication question, the crypt(3) manpage and its SEE ALSO section might help. For more advanced handling, see Libpam, where PAM stands for Pluggable Authentication Modules.
If the two windows are Xterms, then there's an easy way to do this;
Note this is from a ksh script, but should work in bash
## This is how big (how many columns & rows) your Xterm will be
GEOM0=198x20
GEOM1=98x45
## Colors
COLOR="-bg black -fg white -cr red"
## Xterm Options (See Man page)
XOPTS="+ah +ai -b 2 -cb +cn -j -ls -rw -aw -si +sk"
## Scroll-back Buffer
SCRLB="9999"
## Commands to execute (you could put an SSH command here)
CMD0="-e /bin/gtail -F /var/adm/messages"
CMD1="-e /bin/gtail -F /var/log/secure"
TITLE="-title Something Clever Here "
TERMBIN=/usr/openwin/bin/xterm
# PLACEMENT
# We specify where we want the window to pop-up by adding "+#+#" to the GEOM.
################################################################################
## Top-Left corner (For my monitor, that's "+2+2")
${TERMBIN} ${XOPTS} -sl ${SCRLB} -fn 6x10 ${COLOR} -geometry ${GEOM0}+2+2 ${TITLE} ${CMD0} &
## Top-Center (For my monitor, that's "+2+233")
${TERMBIN} ${XOPTS} -sl ${SCRLB} -fn 6x10 ${COLOR} -geometry ${GEOM1}+2+233 ${TITLE} ${CMD1} &