Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Question: Scheduled task for GUI
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
lyallp
Veteran
Veteran


Joined: 15 Jul 2004
Posts: 1557
Location: Adelaide/Australia

PostPosted: Sun Oct 18, 2015 11:08 pm    Post subject: Question: Scheduled task for GUI Reply with quote

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
View user's profile Send private message
Section_8
l33t
l33t


Joined: 22 May 2004
Posts: 627

PostPosted: Wed Oct 21, 2015 2:41 am    Post subject: Reply with quote

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
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Wed Oct 21, 2015 8:54 am    Post subject: Reply with quote

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
View user's profile Send private message
xaviermiller
Bodhisattva
Bodhisattva


Joined: 23 Jul 2004
Posts: 8708
Location: ~Brussels - Belgique

PostPosted: Wed Oct 21, 2015 8:56 am    Post subject: Reply with quote

Hi!

Can't you use a text-based IRC client like irssi ?
_________________
Kind regards,
Xavier Miller
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3664

PostPosted: Wed Oct 21, 2015 11:06 am    Post subject: Re: Question: Scheduled task for GUI Reply with quote

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
View user's profile Send private message
lyallp
Veteran
Veteran


Joined: 15 Jul 2004
Posts: 1557
Location: Adelaide/Australia

PostPosted: Wed Oct 21, 2015 12:17 pm    Post subject: Reply with quote

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
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9529
Location: beyond the rim

PostPosted: Wed Oct 21, 2015 1:39 pm    Post subject: Reply with quote

Tried using finch instead of pidgin to avoid the GUI requirement?
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3664

PostPosted: Wed Oct 21, 2015 2:47 pm    Post subject: Reply with quote

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
View user's profile Send private message
lyallp
Veteran
Veteran


Joined: 15 Jul 2004
Posts: 1557
Location: Adelaide/Australia

PostPosted: Wed Oct 21, 2015 7:45 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum