DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD General

FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 12th September 2008
rex rex is offline
Real Name: Nikhil Rathod
Shell Scout
 
Join Date: May 2008
Location: Chicago
Posts: 114
Default Execute a command during login

I'm in process of selecting a window manager for one of my old desktops. I came across wm2. It is great. only problem is as it can't be configured I need to find a way to execute a command at login time to set the wallpaper.

Is there a way I can do that?
Reply With Quote
  #2   (View Single Post)  
Old 12th September 2008
ninjatux's Avatar
ninjatux ninjatux is offline
Real Name: Baqir Majlisi
Spam Deminer
 
Join Date: May 2008
Location: Antarctica
Posts: 293
Default

You can use a shell script to start X and the window manager and complete any other commands you would like afterward. You can use feh to set wallpaper.
__________________
"UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity."
MacBook Pro (Darwin 9), iMac (Darwin 9), iPod Touch (Darwin 9), Dell Optiplex GX620 (FreeBSD 7.1-STABLE)
Reply With Quote
  #3   (View Single Post)  
Old 12th September 2008
rex rex is offline
Real Name: Nikhil Rathod
Shell Scout
 
Join Date: May 2008
Location: Chicago
Posts: 114
Default

on my system X starts automatically and I use slim as login manager.
Reply With Quote
  #4   (View Single Post)  
Old 12th September 2008
18Googol2's Avatar
18Googol2 18Googol2 is offline
Real Name: whoami
Spam Deminer
 
Join Date: Apr 2008
Location: pwd
Posts: 283
Default

An example of X startup script (~/.xsession)

Code:
#!/bin/sh
linux-opera -notrayicon &
pidgin &
gnome-terminal --geometry=126x40+0+0 & 
fluxbox
__________________
The power of plain text? It can control an entire OS
Reply With Quote
  #5   (View Single Post)  
Old 12th September 2008
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Default

You can always check how your login manager knows what program to execute (e.g. wm2) and set it at a custom script. This is basically what ~/.xinitrc (X) or ~/.xsession (XDM) is for I think, but it's been a long time since I setup stuff that way...



My system uses GDM and a custom session file defined as executing a init.sh script in my home directory, instead of a window manager directly. Where ~/init.sh serves to execute a few programs in the background (e.g. my wall paper rotator, pidgin&, etc) and finally launches my window manager: blackbox, and being a humble shell script owned by my user, I can edit it later without being root lol.

While still working essentially the same way as X.
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
execute commands from xinitrc rex FreeBSD General 3 22nd October 2008 10:24 PM
ruby execute commands remotely Dr_Death_UAE Programming 0 18th August 2008 11:23 AM
Cron won't execute a perl script ivanatora FreeBSD General 4 17th August 2008 07:53 AM
How can i login to my FreeBSD ?? ceramic FreeBSD Installation and Upgrading 4 28th July 2008 11:56 AM
How to set up ssh login cssgalactic FreeBSD General 12 28th June 2008 06:00 PM


All times are GMT. The time now is 10:50 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick