LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-19-2014, 08:40 PM   #1
jamison20000e
Senior Member
 
Registered: Nov 2005
Location: ...uncanny valley... infinity\1975; (randomly born:) Milwaukee, WI, US( + travel,) Earth&Mars (I wish,) END BORDER$!◣◢┌∩┐ Fe26-E,e...
Distribution: any GPL that work on freest-HW; has been KDE, CLI, Novena-SBC but open.. http://goo.gl/NqgqJx &c ;-)
Posts: 4,888
Blog Entries: 2

Rep: Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567
Question Hi. Execute .bashrc line in tty but not in Konsole or DE


I've set info and a Fortune to run on login. To give myself a few seconds for looking it over and fun I've set a script to run that plays with my LEDs (here's a .bashrc snipit:)
Code:
...
date
./screenfetch-dev
fortune
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' _
sh ./ledFUN
echo
...
(to simplify I took out the Ruby script e.g;)
Quote:
...
ruby sysInfoFortune_ETC.rb
...
(that runs up until the sh... and a ledFUN snip
Code:
#!/bin/sh -e
setleds +scroll
sleep .1
setleds +caps
sleep .1
setleds +num
sleep .1
setleds -num
sleep .3
...
after that my prompt pops up... but more than halve the time I startx, then when I need the prompt (each time any terminal in KDE\Xfce\so-on) I see this:
Code:
...
KDGKBLED: Invalid argument
Error reading current flags setting. Maybe you are not on the console?
KDGKBLED: Invalid argument
Error reading current flags setting. Maybe you are not on the console?
KDGKBLED: Invalid argument
Error reading current flags setting. Maybe you are not on the console?
KDGKBLED: Invalid argument
Error reading current flags setting. Maybe you are not on the console?
KDGKBLED: Invalid argument
Error reading current flags setting. Maybe you are not on the console?
KDGKBLED: Invalid argument
Error reading current flags setting. Maybe you are not on the console?
KDGKBLED: Invalid argument
Error reading current flags setting. Maybe you are not on the console?
KDGKBLED: Invalid argument
Error reading current flags setting. Maybe you are not on the console?
KDGKBLED: Invalid argument
Error reading current flags setting. Maybe you are not on the console?
KDGKBLED: Invalid argument
Error reading current flags setting. Maybe you are not on the console?
KDGKBLED: Invalid argument
Error reading current flags setting. Maybe you are not on the console?
KDGKBLED: Invalid argument
Error reading current flags setting. Maybe you are not on the console?
KDGKBLED: Invalid argument
Error reading current flags setting. Maybe you are not on the console?
...
I only want the LED display\wait after logging in and the info and Fortune every time.

Any ideas or questions would be greatly appreciated?

Last edited by jamison20000e; 06-19-2014 at 08:56 PM.
 
Old 06-19-2014, 11:54 PM   #2
coralfang
Member
 
Registered: Nov 2010
Location: Bristol, UK
Distribution: Slackware, FreeBSD
Posts: 836
Blog Entries: 3

Rep: Reputation: 297Reputation: 297Reputation: 297
You can use tty to get the console name, this should work:
Code:
#!/bin/sh -e
tty | grep "/dev/tty[0-9]" > /dev/null

if [ $? -eq 0 ]; then
        setleds +scroll
        sleep .1
        setleds +caps
        sleep .1
        setleds +num
        sleep .1
        setleds -num
        sleep .3
fi
 
1 members found this post helpful.
Old 06-20-2014, 05:51 PM   #3
jamison20000e
Senior Member
 
Registered: Nov 2005
Location: ...uncanny valley... infinity\1975; (randomly born:) Milwaukee, WI, US( + travel,) Earth&Mars (I wish,) END BORDER$!◣◢┌∩┐ Fe26-E,e...
Distribution: any GPL that work on freest-HW; has been KDE, CLI, Novena-SBC but open.. http://goo.gl/NqgqJx &c ;-)
Posts: 4,888

Original Poster
Blog Entries: 2

Rep: Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567
Works Perfect, Thank You!!!
 
  


Reply

Tags
ed, led, setleds, tty, wm



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Slackware64 13.0, konsole and tty marnold Slackware 2 01-13-2010 01:52 PM
can a tty execute command on another tty? BeacoN Linux - Desktop 3 11-08-2008 09:39 AM
Konsole - which pseudo-tty per session? theNbomr Linux - Software 5 11-07-2006 04:39 PM
konsole problem: /etc/bashrc not found Nalorin Linux - Software 1 12-18-2005 10:34 PM
KDE 3.4 - Konsole doesn't read ~/.bashrc merchtemeagle Linux - Software 7 04-27-2005 12:01 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration