Register
It is currently Thu Feb 22, 2018 12:28 am

Alternative window manager use with remote login via RDP


All times are UTC


Post new topic Reply to topic  [ 5 posts ] 
Author Message
 PostPosted: Sat Sep 17, 2016 5:50 am   
New Member
User avatar

Joined: Tue Feb 03, 2009 3:11 am
Posts: 49
Location: Iowa
I hope somebody notices this question since this board does not seem very active lately:

I have an SSH server on my home computer that runs Manjaro Linux, which is an Archlinux derivative. I log in to this host via Putty and rdp from my windows work computer without any problem. However, since the monitor set up and resolutions are very different at home and office, some of my KDE desktop settings get broken during the remote session and these need to be readjusted the next time I log in locally at home. To avoid this issue, I want to put a couple of line of code in .xinitrc that would check whether I am loging in locally or remotely, and would start fluxbox instead of kde in case of a login over ssh. The code below always starts fluxbox, which probably means that the sddm screen doesn't use tty1:

Code:
if [[ $(tty) != '/dev/tty1' ]]; then
    fbsetbg /home/hako/Wallpapers/*
    exec startfluxbox
fi


Any help will be greatly appreciated


Top
 Profile  
 PostPosted: Sat Sep 17, 2016 4:45 pm   
Linux Guru
User avatar

Joined: Sat Apr 03, 2004 12:39 am
Posts: 12346
Location: Clinton Township, Michigan
Hi Hakova,

Based on your comment that the code always starts fluxbox, you may want to come up with a different mechanism; using tty1 as the trigger doesn't seem like it would make much difference.

Unfortunately, other than offering that opinion, I don't have a good alternative to offer, though there are interactive (vs. non-interactive) choices that you may want to research.

_________________
Brian Masinick
Distros: MX-16, antiX, Debian


Top
 Profile WWW YIM  
 PostPosted: Sat Sep 17, 2016 4:47 pm   
Linux Guru
User avatar

Joined: Sat Apr 03, 2004 12:39 am
Posts: 12346
Location: Clinton Township, Michigan
See if the suggestions at http://unix.stackexchange.com/questions ... nteractive are of any help.

_________________
Brian Masinick
Distros: MX-16, antiX, Debian


Top
 Profile WWW YIM  
 PostPosted: Sat Sep 17, 2016 6:23 pm   
New Member
User avatar

Joined: Tue Feb 03, 2009 3:11 am
Posts: 49
Location: Iowa
Thank you masinick for the link. I came up with a not-so-elegant solution being inspired by the information provided in that link. I noticed that my .bashrc was sourced in my .bash_profile. I learned from your link that bash determines at startup if its input will be via a remote connection and then reads .bashrc only if it is the case. I commented out the line in my .bash_profile that sources my .bashrc and confirmed that it is not sourced at the next login. Then I switched my original code in .xinitrc to the following:
Code:
if [[ $EDITOR = "/usr/bin/mcedit" ]]; then
    fbsetbg /home/hako/Wallpapers/*
    exec startfluxbox
fi

The EDITOR variable is defined in the .bashrc, which is not read at the startup when I login locally. This allows me to log in to KDE locally without also launching fluxbox. I haven't tried if this will work when I log in from my work computer, but I believe it should.
Curiously, the terminal in KDE (konsole) launches with .bashrc already sourced. It must be treated as a remote terminal by the system I suppose.
Thank you for the information/inspiration. Please let me know what you think :wave: .


Top
 Profile  
 PostPosted: Mon Sep 19, 2016 1:03 am   
Linux Guru
User avatar

Joined: Sat Apr 03, 2004 12:39 am
Posts: 12346
Location: Clinton Township, Michigan
That is a creative solution. While it may not scale or work in every situation, as long as it gets the job done right now you are OK. The ENV variables themselves - and I believe there is one for interactive activities, may have provided a more direct solution, but as long as it works and as long as it is for personal use, keep with what you have. If you are developing professionally, I'd use specific logic guaranteed to work with only an interactive desktop or a server console. To me, that is a bit more safe and likely to work in a variety of scenarios.

Congratulations nevertheless on a successful solution!

_________________
Brian Masinick
Distros: MX-16, antiX, Debian


Top
 Profile WWW YIM  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


Powered by phpBB © 2012 phpBB Group
© 2003 - 2012 USA LINUX USERS GROUP