View previous topic :: View next topic |
Author |
Message |
lyallp Veteran
Joined: 15 Jul 2004 Posts: 1557 Location: Adelaide/Australia
|
Posted: Sun Oct 18, 2015 11:08 pm Post subject: Question: Scheduled task for GUI |
|
|
I use fluxbox as my dekstop manager.
I would like to run Pidgin and update the MOTD then close Pidgin down, as a scheduled task.
As I understand it, Pidgin will require a gui to run, meaning this is not something that cron can handle as I may not be logged in.
Is there a some tool that I can use which would only operate within the context of my current GUI session? _________________ ...Lyall |
|
Back to top |
|
|
Section_8 l33t
Joined: 22 May 2004 Posts: 627
|
Posted: Wed Oct 21, 2015 2:41 am Post subject: |
|
|
I may be misunderstanding the question, but with kde, something like this will launch a gui app from a simple bash script started from a user cron task:
Code: | #!/bin/bash
source .bashrc
export DISPLAY=:0.0
kwrite
|
|
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Wed Oct 21, 2015 8:54 am Post subject: |
|
|
Section_8 wrote: | Code: | #!/bin/bash
source .bashrc |
|
Section_8 ... note that .bashrc is for interactive shells, it shouldn't be sourced by scripts. In fact, it should have something like the following to prevent such a thing happening:
/etc/bash/bashrc
Code: | if [[ $- != *i* ]] ; then
return
fi |
best ... khay |
|
Back to top |
|
|
xaviermiller Bodhisattva
Joined: 23 Jul 2004 Posts: 8708 Location: ~Brussels - Belgique
|
Posted: Wed Oct 21, 2015 8:56 am Post subject: |
|
|
Hi!
Can't you use a text-based IRC client like irssi ? _________________ Kind regards,
Xavier Miller |
|
Back to top |
|
|
charles17 Advocate
Joined: 02 Mar 2008 Posts: 3664
|
Posted: Wed Oct 21, 2015 11:06 am Post subject: Re: Question: Scheduled task for GUI |
|
|
lyallp wrote: | I use fluxbox as my dekstop manager.
I would like to run Pidgin and update the MOTD then close Pidgin down, as a scheduled task. |
Why do you think you need an instant messenger client for MOTD? Why not a simple text editor?
Not sure, if this is about Larry? |
|
Back to top |
|
|
lyallp Veteran
Joined: 15 Jul 2004 Posts: 1557 Location: Adelaide/Australia
|
Posted: Wed Oct 21, 2015 12:17 pm Post subject: |
|
|
Pidgin has a status section on it's display.
I update the content of that status window using a bit of python and purple-remote.
I retrieve my updated text content from a 'word of the day' website.
So, I gather Pidgin requires a GUI to run and login to the IM accounts so that when I use purple-remote to update the status text, the IM services will update to reflect my new word of the day.
Hence, my query about a cron like tool which only runs within the context of a logged in GUI, not specific to KDE or Gnome. (I use fluxbox).
I am beginning to think I might simply create a login script that runs in the background, loops forever, starts Pidgin, updates the status, quits Pidgin, sleeps for 24 hours, and make my 'logout' terminate this script.
That will solve my requirement, although, in my opinion, not in an elegant way. _________________ ...Lyall |
|
Back to top |
|
|
Genone Retired Dev
Joined: 14 Mar 2003 Posts: 9529 Location: beyond the rim
|
Posted: Wed Oct 21, 2015 1:39 pm Post subject: |
|
|
Tried using finch instead of pidgin to avoid the GUI requirement? |
|
Back to top |
|
|
charles17 Advocate
Joined: 02 Mar 2008 Posts: 3664
|
Posted: Wed Oct 21, 2015 2:47 pm Post subject: |
|
|
lyallp wrote: | Pidgin has a status section on it's display.
I update the content of that status window using a bit of python and purple-remote.
I retrieve my updated text content from a 'word of the day' website. |
net-misc/wget is your friend.
Modify motd_rotate.sh from the link above to isolate the desired snippet and do drop it into /etc/motd |
|
Back to top |
|
|
lyallp Veteran
Joined: 15 Jul 2004 Posts: 1557 Location: Adelaide/Australia
|
Posted: Wed Oct 21, 2015 7:45 pm Post subject: |
|
|
People still seem to think I am talking about /etc/motd.
Nope. Pidgin Status text. I am happy with pidgin, I have a way of updating the status via script, I just want to automate it.
_________________ ...Lyall |
|
Back to top |
|
|
|