LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   How do I add a simple calendar into taskbar or background of my wm. (https://www.linuxquestions.org/questions/slackware-14/how-do-i-add-a-simple-calendar-into-taskbar-or-background-of-my-wm-819442/)

number22 07-12-2010 01:09 PM

How do I add a simple calendar into taskbar or background of my wm.
 
I often use cal command in xterm to get calendar info, is there a better way to dock it into my taskbar, or into background of my windows(blackbox, fvwm, etc), sample codes are appreciated.

chetamonye 07-12-2010 02:08 PM

Quote:

Originally Posted by number22 (Post 4031104)
I often use cal command in xterm to get calendar info, is there a better way to dock it into my taskbar, or into background of my windows(blackbox, fvwm, etc), sample codes are appreciated.

I don't know how you would modify this for blackbox, but I use openbox with tint2. I also have zenity installed. This allows me to bring up a calendar dialog box.

In the tint2 area of the clock I added the following:

Code:

    clock_lclick_command = /home/whatever/call_calendar.sh
This calls the following:

Code:

#!/bin/bash
# call_calendar.sh
# 02/12/10 - Chetamonye
# Pop up Calendar and/or run
# scheduling program
# run a program or use a web calendar
# add or remove '#' to just choose one.

CAL_GET=`zenity --calendar --text "Cancel to close. Ok to schedule an appt" --title "My Calendar"`

case $? in
        0)
                #sunbird ;; put program here and remove line below
                google-chrome http://www.google.com/calendar/render ;;
        1)
        exit ;;
        255)
                echo "Box closed.";;
esac

If you click on cancel, it closes the calendar. If you click on OK, you go to your google calendar. It's a simple script so you should be able to modify it.

You could just change tint2 to call a script that pops up xterm and pass cal to it.

Hope this helps.


Chet

slugman 07-12-2010 04:41 PM

well
 
I know you where looking for better window manager integration... however an alternative is to utilize cal with ~/.bashrc. This way every time you login, you are presented with a nice output of cal.

i.e. my example ~/.bashrc

Code:

#!/bin/bash
#~/.bash_rc
cal -3
alias wpa="wpa_supplicant -B -iwlan0 -Dwext -c/etc/wpa_supplicant.conf"

Just make sure to create an accompanying ~/.bash_profile to go with it.
Code:

#!/bin/bash
#~/.bash_profile
if [ -f ~/.bashrc ]; then
  source ~/.bashrc
fi


slakmagik 07-12-2010 06:38 PM

It would be somewhat abusing the program, since it's meant to tail files, but you could play around with making root-tail display a file containing the output of cal. If you wanted to use chetamonye's approach but didn't want to use zenity, Xdialog has a calendar widget, too. I'm sure there are many other routes. For instance, if you use gkrellm, you can bind a mini-xterm running cal or Xdialog/zenity or whatever to the clock button. Etc.

gapan 07-13-2010 06:06 AM

I'm sure you can also use conky for this.

number22 07-13-2010 08:35 AM

thanks for everyone's reply.
If I remembered correctly, Slackware used to have xcal which is much easier to dock it, but I can't find it anymore. I want everything original from slackware, so I don't have to use 3rd party software, and extreme lightweight on computer resource.

jovanoti 07-13-2010 08:50 AM

Quote:

Originally Posted by chetamonye (Post 4031148)
I don't know how you would modify this for blackbox, but I use openbox with tint2. I also have zenity installed. This allows me to bring up a calendar dialog box.

...

He could use kdialog instead zenity, thus he'll not need to install additional applications.

bathory 07-13-2010 08:57 AM

Hi,

You can add in ~/.xinitrc, something like:
Code:

xterm -hold  -geometry 20x8-0+0 -e cal

number22 07-13-2010 09:08 AM

Quote:

Originally Posted by bathory (Post 4031853)
Hi,

You can add in ~/.xinitrc, something like:
Code:

xterm -hold  -geometry 20x8-0+0 -e cal

thanks a lot, how do I make it automatic update everyday?

bathory 07-13-2010 09:27 AM

You can use a cronjob that runs every midnight+1min.
If you know the pid you can use, something like "kill -HUP <xterm-pid>"

allend 07-13-2010 05:45 PM

Another approach is to run the 'orage' calendar application. It can be set up to always appear on your desktop.

baxzius 07-13-2010 06:24 PM

Hey number22..
you can use a complete calendar application.
first of all what's your window manager?
Gnome?

Kde?
XFCE4?

or
local light weight one?
look......
its specific according to window manager.
you can download orag the calendar applicaition from the internet. then you can compile it,make it and add it to the taskbar.

frankbell 07-13-2010 07:37 PM

Check out dock apps. I use a couple in Fluxbox and they do what I need them to.

number22 07-13-2010 08:40 PM

thanks for everyone reply, I use blackbox, WM and fvwm(not so much this day), anyway, only use lightweight wm, and prefer using everything straight out box from Slackware, keep my system as lean as possible.

frankbell 07-14-2010 08:51 PM

number22, dockapps should work fine with blackbox and its cousins.

http://blackboxwm.sourceforge.net/ManPages/blackbox

Here's a screenshot of my Fluxbox with gkrellm running as a dock app in the Fluxbox slit.


All times are GMT -5. The time now is 01:35 AM.