SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2012-02-16 16:31:50

sparky
#! Member
Registered: 2011-09-22
Posts: 66

[Solved]Run xorg conditionally depending on local or remote login

Here's the situation,

When i am at home i like to start xorg upon login so i ve added the following line at the bottom of my .profile

startx

What i would like to achieve is when i try to ssh my box remotely, i want that line ignored. is there anyway to do this?

thank you all

Last edited by sparky (2012-02-17 14:53:12)

Offline

Help fund CrunchBang, donate to the project!

#2 2012-02-17 10:54:30

xaos52
The Good Doctor
From: Planet of the @s
Registered: 2011-06-24
Posts: 4,493

Re: [Solved]Run xorg conditionally depending on local or remote login

This might work, but I would put it in $HOME/.bashrc, not in $HOME/.profile:
Put it somewhere near the end of .bashrc

function ontty1 ()
{
    RESULT=$(tty|sed 's/\/dev\///');
    [[ $RESULT == 'tty1' ]] && return 0 || return 1
}
if ontty1; then startx; fi

hth

Offline

#3 2012-02-17 14:53:53

sparky
#! Member
Registered: 2011-09-22
Posts: 66

Re: [Solved]Run xorg conditionally depending on local or remote login

awesome! thank you smile

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo