Solved Change active ttyv programmatically

Hi community,

is there a way to change the active ttyv with a script, instead of pressing ALT+F<N>?

I'm asking because I have a new desktop PC with a nvidia graphics card and the display never wakes up after suspend when I suspend from the graphical session. But resume after suspending from a console ttyv actual works and brings back the display. I can then change back to ttyv8 and everything is working fine (well, the console ttyvs behave a bit sluggish after that, but they still work). On my previous FreeBSD desktop PC with nvidia card I got around that problem with using syscons(4) instead of vt(4). But putting kern.vty=sc in loader.conf(5) with my new PC prevents FreeBSD from booting.

So I'd like to write a small 'suspend' script, which changes to a console ttyv and issues an acpiconf -s3 call.
 
FWIW, I found that if you are able to set the console resolution to the same resolution as your X desktop, switching back and forth between X and console works fine.
 
Looking back, I misread the OPs post and bungled it up with the link you provided above (coffee had not kicked in yet). Anyways, I have a couple of user workstations with ATOM processors (Z36xxx/Z37xxx)/Intel VLV Moble Desktop chipsets that use the VESA FB driver for display (Intel video driver does/did not support this chipset). Switching between X and console seemed to hang the system (blank screen), though you can secure shell into the box. Issuing a reboot just hangs it up. The only way to recover was to physically reboot the system. After playing around with the various console settings, I found that if I set the console FB resolution to the same resolution as X was running, I could switch between console and X without issue.

Apologies for the noise.
 
Back
Top