Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[mini HOWTO] xclock on desktop a la desklet
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
mordredP
Apprentice
Apprentice


Joined: 17 Oct 2005
Posts: 155
Location: bari.italy.€urope.earth

PostPosted: Fri Nov 25, 2005 12:14 am    Post subject: [mini HOWTO] xclock on desktop a la desklet Reply with quote

this is my first howto, i hope you'll like it :P

here's a screenshot

well.. for our purpose we need xorg (actually it is this that will provide us xclock) and devilspie. The latter is a software that can detect if a window has been launched and it can force some options on the window. We will make it not to draw the titlebar and other "window decorations" from xclock, wi'll need just the content of the window. We'll also hide xclock from taskbar and pager. Ready?

Code:

# emerge devilspie


once we have done this we should have devilspie v0.10 correctly installed in our system (atm portage offers that devilspie version, which uses a quite different config file from the last versions. I'll update the howto if need be)

now we must configure devilspie

Code:

# nano -w ~/.devilspie.xml


and we put this inside it:

Code:

<devilspie>
  <flurb>
    <matchers>
      <matcher name="DevilsPieMatcherWindowName">
        <property name="application_name" value="xclock"/>
      </matcher>
    </matchers>
    <actions>
      <action name="DevilsPieActionDecorate">
        <property name="decorated" value="FALSE"/>
      </action>
      <action name="DevilsPieActionSetWorkspace">
        <property name="pinned" value="TRUE"/>
      </action>
      <action name="DevilsPieActionSetGeometry">
        <property name="xoffset" value="62"/>
        <property name="yoffset" value="75"/>
        <property name="width" value="220"/>
        <property name="height" value="220"/>
      </action>
      <action name="DevilsPieActionHide">
        <property name="skip-tasklist" value="TRUE"/>
        <property name="skip-pager" value="TRUE"/>
      </action>
    </actions>
  </flurb>
</devilspie>


(adjust the values as you see fit)

we must now make devilspie and xclock run with our DE. This applies to XFCE:

Code:

# cd ~/Desktop/Autostart/
# ln -s /usr/bin/devilspie
# ln -s /usr/bin/xclock


just restart your DE and everything should work well.
_________________
People fall into 10 groups: those who know binary and those who don't
dosmary.netsons.org
01010110
Back to top
View user's profile Send private message
Cabalist
n00b
n00b


Joined: 17 Feb 2004
Posts: 32

PostPosted: Fri Nov 25, 2005 6:06 am    Post subject: Reply with quote

Would you mind dumping the rest of your (I assume) Torsmo config on us? In particular that snazzy console! Did you do that with the same method as the clock?

This is also great by the way! Thanks! :)
Back to top
View user's profile Send private message
mordredP
Apprentice
Apprentice


Joined: 17 Oct 2005
Posts: 155
Location: bari.italy.€urope.earth

PostPosted: Fri Nov 25, 2005 11:37 am    Post subject: Reply with quote

Cabalist wrote:
Would you mind dumping the rest of your (I assume) Torsmo config on us? In particular that snazzy console! Did you do that with the same method as the clock?

This is also great by the way! Thanks! :)


I am using conky, which has a config similar to the torsmo one.. here it is my stripped down .conkyrc:

Code:

background yes
use_xft yes
on_bottom yes
xftfont Bitstream Vera Sans Mono-9
xftalpha 0.8
update_interval 2
total_run_times 0
own_window no
own_window_transparent yes
own_window_colour white
double_buffer yes
minimum_size 300 300
maximum_width 300
draw_shades yes
draw_outline no
draw_borders yes
stippled_borders 1
border_margin 8
border_width 1
default_color black
default_shade_color grey
default_outline_color black
alignment top_left
gap_x 20
gap_y 53
no_buffers yes
uppercase no
cpu_avg_samples 4
net_avg_samples 4
override_utf8_locale no
use_spacer no
# ${exec cat ~/logo1.1.txt} put this inside the script to draw some ascii picture
TEXT
[${pre_exec whoami}@$nodename  $sysname $kernel on $machine]
$stippled_hr
$stippled_hr
${time %a %d %b %Y}${alignr}[${time %H:%M}]
uptime: $uptime ${alignr}Mins:  01m  05m  15m
${alignr}Load: $loadavg
$stippled_hr
[CPU1 ${cpu cpu1}%]${alignr}[CPU2 ${cpu cpu2}%]
${cpugraph cpu1 20,145 535456 8D8E90}${alignr}${cpugraph cpu2 20,145 535456 8D8E90}
${exec cat /proc/cpuinfo | grep "model name" -m1 | cut -c14-}${alignr}${i2c temp 1} C
MotherBoard: ${alignr}${i2c temp 2} C
RAM usage:${alignr}$mem/$memmax - $memperc%
${color
swap usage:${alignr} $swap/$swapmax - $swapperc%
${color
$stippled_hr
eth0:${alignr}${addr eth0}
down:${downspeed eth0} k/s${alignr}up:${upspeed eth0} k/s
${downspeedgraph eth0 20,145 535456 8D8E90}${alignr}${upspeedgraph eth0 20,145 535456 8D8E90}
total: ${totaldown eth0}${alignr}total: ${totalup eth0}
excalibur.net WAN ip${alignr}${execi 300 nicelookup <put your dynamic hostname here>}
${texeci 60 checkup dosmary 3}
${texeci 60 checkup camelot 3}
$stippled_hr
disk usage:${alignr}$diskio/s
${diskiograph 20,0 535456 8D8E90}
root:${alignr}${fs_used /}/${fs_size /} - ${fs_used_perc /}%
${color
home:${alignr}${fs_used /home/}/${fs_size /home/} - ${fs_used_perc /home/}%
${color
$stippled_hr
Processes: $processes${alignr}Running:$running_processes
top CPU${alignr}PID     CPU%   MEM%
 ${top name 1}${alignr}${top pid 1} ${top cpu 1} ${top mem 1}
 ${top name 2}${alignr}${top pid 2} ${top cpu 2} ${top mem 2}
 ${top name 3}${alignr}${top pid 3} ${top cpu 3} ${top mem 3}
top MEM${alignr}PID     CPU%   MEM%   ${top_mem name 1}${alignr}${top_mem pid 1} ${top_mem cpu 1} ${top_mem mem 1}
 ${top_mem name 2}${alignr}${top_mem pid 2} ${top_mem cpu 2} ${top_mem mem 2}
 ${top_mem name 3}${alignr}${top_mem pid 3} ${top_mem cpu 3} ${top_mem mem 3}
$stippled_hr


(i can post the small scripts too if you like)

just insert line breaks as you see fit (beginning and end of the script. We'll need the line breaks to recover some space for the console..
About the console: it's aterm and i am launching it with this line:

Code:
aterm -name aterm -sl 3000 -fg black -tr +sb -sr -sk -fade 40 -bl -tn xterm -g 50x10+18+868 -C -fn 6x10 &


also, if you don't want it to show in taskbar/pager add this to the .devilspie.xml

Code:

<flurb>
    <matchers>
      <matcher name="DevilsPieMatcherWindowName">
        <property name="application_name" value="aterm"/>
      </matcher>
    </matchers>
    <actions>
      <action name="DevilsPieActionSetWorkspace">
        <property name="pinned" value="TRUE"/>
      </action>
      <action name="DevilsPieActionHide">
        <property name="skip-tasklist" value="TRUE"/>
        <property name="skip-pager" value="TRUE"/>
      </action>
    </actions>
  </flurb>


and you should be set :).
_________________
People fall into 10 groups: those who know binary and those who don't
dosmary.netsons.org
01010110
Back to top
View user's profile Send private message
blwrd
n00b
n00b


Joined: 19 Jul 2003
Posts: 6

PostPosted: Thu Dec 08, 2005 5:55 pm    Post subject: Reply with quote

Nice tip!
That inspired to try something similar. With enlightenment you can remove borders from any window. And this is the result. :)
_________________
Linux IS user friendly, it is just selective who its friends are
Back to top
View user's profile Send private message
opentaka
l33t
l33t


Joined: 18 Feb 2005
Posts: 840
Location: Japan

PostPosted: Mon Jan 02, 2006 9:13 pm    Post subject: Reply with quote

I really liked your idea putting aterm into conky, and I also liked your howto on xclock, pretty nice!
_________________
"Being defeated is often a temporary condition. Giving up is what makes it permanent" - Marilyn vos Savant
Back to top
View user's profile Send private message
secret_of_nimh
n00b
n00b


Joined: 11 Jan 2006
Posts: 5

PostPosted: Sat Jan 14, 2006 1:49 am    Post subject: trouble with xclock showing up seamlessly with conky Reply with quote

hey! this is a pretty neat little thing, just a few questions.

I can't really get my xclock to show up at the top of my system monitor quite the same way you had it, add that to the fact that i can't get it transparent either.

Did you want to see my .devilspie.xml and .conkyrc config files?

Thanks!
Back to top
View user's profile Send private message
mordredP
Apprentice
Apprentice


Joined: 17 Oct 2005
Posts: 155
Location: bari.italy.€urope.earth

PostPosted: Sat Jan 14, 2006 11:15 am    Post subject: Re: trouble with xclock showing up seamlessly with conky Reply with quote

secret_of_nimh wrote:

I can't really get my xclock to show up at the top of my system monitor quite the same way you had it, add that to the fact that i can't get it transparent either.


Let's have a look at them..
Anyway xclock is not transparent, that's just a trick (you can have that effect if you make xclock's background blend with your desktop's background). You also need to add some line feed in your .conkyrc to leave some space for it if you want it not to override conky.
_________________
People fall into 10 groups: those who know binary and those who don't
dosmary.netsons.org
01010110
Back to top
View user's profile Send private message
secret_of_nimh
n00b
n00b


Joined: 11 Jan 2006
Posts: 5

PostPosted: Sun Jan 15, 2006 12:01 am    Post subject: Reply with quote

here's my conky.rc ... i figured out how to get the aterm to show up at the bottom, but don't know how to auto-run the command when gnome boots up...

Quote:
# THIS CONFIG RELIES ON 2 SCRIPTS, CPUSPEED AND CPUTEMP
# YOUR SYSTEM MAY NOT REQUIRE THEM, REPLACE AS DESIRED

# maintain spacing between certain elements
use_spacer yes

own_window_transparent yes
# set to yes if you want tormo to be forked in the background
background no

use_xft yes

# Xft font when Xft is enabled
xftfont Bitstream Vera Sans Mono-7
#xftfont Andale Mono-9
#xftfont Clean-8
#xftfont cubicfive10:pixelsize=8
#xftfont squaredance10:pixelsize=14
#xftfont swf!t_v02:pixelsize=10

# Text alpha when using Xft
xftalpha 1
mail_spool $MAIL

# Update interval in seconds
update_interval 1.0

# Create own window instead of using desktop (required in nautilus)
own_window yes

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# Minimum size of text area
minimum_size 280 5

# Draw shades?
draw_shades yes

# Draw outlines?
draw_outline no # amplifies text

# Draw borders around text
draw_borders no

# Stippled borders?
stippled_borders 0

# border margins
border_margin 9

# border width
border_width 1

# Default colors and also border colors, grey90 == #e5e5e5
default_color grey90
default_shade_color black
default_outline_color DarkGrey

# Text alignment, other possible values are commented
#alignment top_left
#alignment top_right
alignment bottom_left
#alignment bottom_right

# Gap between borders of screen and text
gap_x 24
gap_y 24

# Subtract file system buffers from used memory?
no_buffers yes

# set to yes if you want all text to be in uppercase
uppercase no

# stuff after 'TEXT' will be formatted on screen

TEXT
${color #ffcb48}$nodename$color ${color #828282}$sysname $kernel on $machine$$
${color #ffcb48}UPTIME:$color $uptime

${color #ffcb48}PROCESSING$color
${color #98c2c7}CPU:$color ${execi 5 cpuspeed}MHz $cpu%
${execi 5 cputemp}\uffff°C
${color #78af78}$cpubar
${color #78af78}${cpugraph 78af78 a3a3a3}

${color #98c2c7}NAME PID CPU% MEM%
${color #e5e5e5}${top name 1} ${top pid 1} ${top cpu 1} ${top mem 1}
${color #c4c4c4}${top name 2} ${top pid 2} ${top cpu 2} ${top mem 2}
${color #a3a3a3}${top name 3} ${top pid 3} ${top cpu 3} ${top mem 3}
${color #828282}${top name 4} ${top pid 4} ${top cpu 4} ${top mem 4}

${color #ffcb48}DATA$color
${color #98c2c7}RAM:$color $memperc% ${color
#78af78}${membar 6}${color}

${color #98c2c7}NAME PID CPU% MEM%
${color #e5e5e5}${top_mem name 1} ${top_mem pid 1} ${top_mem cpu 1}
${top_mem mem 1}
${color #c4c4c4}${top_mem name 2} ${top_mem pid 2} ${top_mem cpu 2}
${top_mem mem 2}
${color #a3a3a3}${top_mem name 3} ${top_mem pid 3} ${top_mem cpu 3}
${top_mem mem 3}
${color #828282}${top_mem name 4} ${top_mem pid 4} ${top_mem cpu 4}
${top_mem mem 4}

${color #98c2c7}Swap:$color $swapperc% ${color
#78af78}${swapbar 6}$color
${color #98c2c7}/:$color ${fs_free_perc /}% $fs_free ${color
#78af78}${fs_bar 6 /}$color

${color #98c2c7}Networking:
Down:${color #8844ee} ${downspeed eth0} k/s${color lightgrey} ${offset 70$${color #78af78}${downspeedgraph eth0 32,150 ff0000 0000ff} $alignr${color #78a$


and here's my .devilspie.xml

Quote:


<devilspie>
<flurb>
<matchers>
<matcher name="DevilsPieMatcherWindowName">
<property name="application_name" value="xclock"/>
</matcher>
</matchers>
<actions>
<action name="DevilsPieActionDecorate">
<property name="decorated" value="FALSE"/>
</action>
<action name="DevilsPieActionSetWorkspace">
<property name="pinned" value="TRUE"/>
</action>
<action name="DevilsPieActionSetGeometry">
<property name="xoffset" value="25"/>
<property name="yoffset" value="171"/>
<property name="width" value="300"/>
<property name="height" value="200"/>
</action>
<action name="DevilsPieActionHide">
<property name="skip-tasklist" value="TRUE"/>
<property name="skip-pager" value="TRUE"/>
</action>
</actions>
</flurb>
<flurb>
<matchers>
<matcher name="DevilsPieMatcherWindowName">
<property name="application_name" value="aterm"/>
</matcher>
</matchers>
<actions>
<action name="DevilsPieActionSetWorkspace">
<property name="pinned" value="TRUE"/>
</action>
<action name="DevilsPieActionHide">
<property name="skip-tasklist" value="TRUE"/>
<property name="skip-pager" value="TRUE"/>
</action>
</actions>
</flurb>
<flurb>
<matchers>
<matcher name="DevilsPieMatcherWindowName">
<property name="application_name" value="conky"/>
</matcher>
</matchers>
<actions>
<action name="DevilsPieActionHide">
<property name="skip-tasklist" value="TRUE"/>
<property name="skip-pager" value="TRUE"/>
</action>
<action name="DevilsPieActionSetWorkspace">
<property name="pinned" value="TRUE"/>
</action>
</actions>
</flurb>

</devilspie>


and do you know the xclock command to make it blend with your background?

thanks for any help!
Back to top
View user's profile Send private message
mordredP
Apprentice
Apprentice


Joined: 17 Oct 2005
Posts: 155
Location: bari.italy.€urope.earth

PostPosted: Sun Jan 15, 2006 11:59 am    Post subject: Reply with quote

Your config looks ok, and if you manage to position xclock and aterm in the right place then they surely are.

secret_of_nimh wrote:

and do you know the xclock command to make it blend with your background?


as i said before, that's just a trick. Xclock can only have a solid background wich you can set (man xclock) so you'd have to use a solid-color bg or a bg that's got some solid-color areas..
_________________
People fall into 10 groups: those who know binary and those who don't
dosmary.netsons.org
01010110
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks 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