Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

Need to Write a Script: Some Help

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
4 posts • Page 1 of 1
Author
Message
baigsabeeh
Guru
Guru
User avatar
Posts: 520
Joined: Wed Sep 28, 2005 7:51 pm
Location: North Brunswick, NJ

Need to Write a Script: Some Help

  • Quote

Post by baigsabeeh » Thu Nov 01, 2007 1:07 pm

Hi, folks! I want to write a script that will basically act as a text-based login manager that local (/etc/init.d/local) will run. I want to be able to input the user, print the session choices, and select the desired session. I also want to be able to enter a series of sessions on the first run, and I want to be able to enter a new session, if I install another window manager or desktop environment. Is this possible to do using Bash scripting? If not, then what would be the best way to write this? Can it be done as a script? Do you guys have any other ideas and advice?
BSD > SysV > Linux
BSD FTW!
Top
Wietze
n00b
n00b
User avatar
Posts: 37
Joined: Fri Jun 10, 2005 6:42 pm

  • Quote

Post by Wietze » Thu Nov 01, 2007 1:27 pm

I'd use the default login and run it automatically after that.
then do the rest with a little bash scripting.
Top
bunder
Bodhisattva
Bodhisattva
Posts: 5956
Joined: Sat Apr 10, 2004 5:13 am

  • Quote

Post by bunder » Thu Nov 01, 2007 2:53 pm

Moved from Off the Wall to Portage & Programming. :wink:
Neddyseagoon wrote:The problem with leaving is that you can only do it once and it reduces your influence.
banned from #gentoo since sept 2017
Top
baigsabeeh
Guru
Guru
User avatar
Posts: 520
Joined: Wed Sep 28, 2005 7:51 pm
Location: North Brunswick, NJ

  • Quote

Post by baigsabeeh » Sun Nov 04, 2007 1:12 am

This is what I have so far. I haven't implemented the session input feature yet, but I'm having some trouble. The script runs fine, except that the series of commands to get a dwm session running don't work right. The problem is that the dwm-session.sh file executes after X runs, so it can't find a display to run on. Is there a way I can fix this? I don't want to use the startx file because that defeats the purpose of this script.

Code: Select all

#!/bin/bash

# Read and assign choice to a.
echo "1. Xfce"
echo "2. dwm"
echo "Please enter selection: "

read a

# If choice is 1, then run Xfce.
if [ "$a" -eq 1 ]
then
  startxfce4
fi 

# If choice is 2, then run dwm.
if [ "$a" -eq 2 ]
then 
  X;  exec /home/sabeeh/Programming/Bash-scripts/dwm-session.sh
fi
BSD > SysV > Linux
BSD FTW!
Top
Post Reply

4 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy