当前时区为 UTC + 8 小时



发表新帖 回复这个主题  [ 6 篇帖子 ] 
作者 内容
1 楼 
 文章标题 : jwm+xterm+conky+byobu
帖子发表于 : 2010-08-14 1:13 
头像

注册: 2009-05-31 17:40
帖子: 737
地址: NO
送出感谢: 2
接收感谢: 1
jwm: ~/.jwmrc
代码:
<?xml version="1.0"?>

<JWM>

   <!-- The root menu, if this is undefined you will not get a menu. -->
   <!-- Additional RootMenu attributes: onroot, labeled, label -->
      <RootMenu height="18" onroot="3">
      <Program label="XTerm">xterm -geometry 80x24+291+291</Program>
      <Separator/>
       <Menu label="Internet">       
         <Program label="Chrome">google-chrome</Program>
         <Program label="Email">evolution</Program>
         <Program label="Firefox">firefox</Program>
         <Program label="Empathy">empathy</Program>
      </Menu>
      <Menu label="Office">       
         <Program label="LYX">lyx</Program>
         <Program label="JabRef">jabref</Program>
         <Program label="Dictionary">stardict</Program>
         <Program label="OpenOffice">soffice</Program>
     <Program label="Mendeley">mendeleydesktop</Program>
     </Menu>
      <Menu label="Media">       
         <Program label="Totem">totem</Program>
         <Program label="Recorder">gnome-sound-recorder</Program>
          <Program label="Rhythmbox">rhythmbox</Program>
         <Program label="VLC">vlc</Program>
    <Program label="Brasero">brasero</Program>
      </Menu>
      <Menu label="Utilities">
        <Program label="Gedit">gedit</Program>
         <Program label="Xcalc">xcalc</Program>
         <Program label="Feh">feh -g 640x514 ~/.backgrounds</Program>
    <Program label="Synaptic">gksudo synaptic</Program>
     <Program label="Nautilus">nautilus --no-desktop</Program>
          </Menu>     
      <Separator/>
      <Program label="Config">gvim +141 ~/.jwmrc</Program>
      <Restart label="Restart" />
      <Exit label="Exit" confirm="true"/>
   </RootMenu>

   <Group>
      <Name>gmrun</Name>
      <Name>conky</Name>
      <Option>noborder</Option>
      <Option>nolist</Option>
      <Option>notitle</Option>
   </Group>
 

   <!-- Additional tray attributes: autohide, width, border, layer, layout -->
   <Tray  x="0" y="-1" height="26">
        <TrayButton popup="Menu" label="A">root:3</TrayButton>             
      <TaskList/>
       <Pager/>
      <TrayButton label="D" popup="_">showdesktop</TrayButton>
  </Tray>
   

   <!-- Visual Styles -->

   <WindowStyle>
      <Font>LiHei Pro-11:bold</Font>
      <Width>4</Width>
      <Height>24</Height>
   <Active>
         <Text>gray70</Text>
         <Title>grey30:grey20</Title>
         <Corner>grey30</Corner>
         <Outline>grey10</Outline>
      </Active>
      <Inactive>
         <Text>gray60</Text>
         <Title>grey20:grey30</Title>
         <Corner>grey20</Corner>
         <Outline>black</Outline>
      </Inactive>
   </WindowStyle>

   <TaskListStyle>
      <Font>LiHei Pro-10</Font>
      <ActiveForeground>gray70</ActiveForeground>
      <ActiveBackground>gray15</ActiveBackground>
      <Foreground>gray60</Foreground>
      <Background>gray10</Background>
   </TaskListStyle>

   <!-- Additional TrayStyle attribute: insert -->
   <TrayStyle>
      <Font>Liberation Mono-10:bold</Font>
      <Background>gray10</Background>
      <Foreground>gray70</Foreground>
   </TrayStyle>

   <PagerStyle>
      <Outline>black</Outline>
      <Foreground>gray60</Foreground>
      <Background>gray10</Background>
      <ActiveForeground>gray70</ActiveForeground>
      <ActiveBackground>gray15</ActiveBackground>
   </PagerStyle>

   <MenuStyle>
      <Font>Trebuchet MS-10</Font>
      <Foreground>gray70</Foreground>
      <Background>gray10</Background>
      <ActiveForeground>white</ActiveForeground>
      <ActiveBackground>gray30:gray10</ActiveBackground>
   </MenuStyle>

   <PopupStyle>
      <Font>LiHei Pro-10</Font>
      <Outline>black</Outline>
      <Foreground>black</Foreground>
      <Background>gray70</Background>
   </PopupStyle>

<ClockStyle>
      <Font>Liberation Mono-10:bold</Font>
      <Foreground>gray70</Foreground>
      <Background>gray10</Background>
</ClockStyle>

   <IconPath>
      $HOME/.icons/jwm
   </IconPath>

   <!-- Virtual Desktops -->
   <!-- Desktop tags can be contained within Desktops for desktop names. -->
   <Desktops count="2">
      <!-- Default background. Note that a Background tag can be
           contained within a Desktop tag to give a specific background
           for that desktop .Valid types: solid gradient image tile command
           -->
        <Desktop Name="One">
           <!--  <Background type="tile">~/.backgrounds/nba.png</Background>-->
        </Desktop>
 <Desktop Name="Two">
    <!--  <Background type="command">feh --bg-center ~/.backgrounds/monk.jpg</Background>-->
      </Desktop>
   </Desktops>

   <!-- Double click speed (in milliseconds) -->
   <DoubleClickSpeed>400</DoubleClickSpeed>
   <!-- Double click delta (in pixels) -->
   <DoubleClickDelta>2</DoubleClickDelta>
   <!-- The focus model (sloppy or click) -->
   <FocusModel>click</FocusModel>
   <!-- The snap mode (none, screen, or border) -->
   <SnapMode distance="10">border</SnapMode>
   <!-- The move mode (outline or opaque) -->
   <MoveMode>opaque</MoveMode>
   <!-- The resize mode (outline or opaque) -->
   <ResizeMode>opaque</ResizeMode>

   <!-- Key bindings-->
   <Key key="Up">up</Key>
   <Key key="Down">down</Key>
   <Key key="Right">right</Key>
   <Key key="Left">left</Key>
   <Key key="Return">select</Key>
   <Key key="Escape">escape</Key>
   <Key mask="A" key="Tab">nextstacked</Key>
   <Key mask="A" key="F4">close</Key>
   <!--Key mask="A" key="2">desktop2</Key-->
   <Key mask="A" key="F1">root:3</Key>
   <Key mask="A" key="F3">window</Key>
   <Key mask="A" key="F2">exec: gmrun</Key>
   <Key key="Print">exec:import -pause 3 -frame screen.jpg</Key>

   <StartupCommand>feh --bg-center ~/.backgrounds/wood.jpg</StartupCommand>
    <!--<StartupCommand>gnubiff --noconfigure --systemtray</StartCommand>-->
    <StartupCommand>gnome-volume-control-applet</StartupCommand>
   <StartupCommand>conky</StartupCommand>
    <!--<StartupCommand>nm-applet</StartupCommand>-->
     
        <!-- Additional tray attributes: autohide, width, border, layer, layout-->
 <Tray autohide="false" valign="top" halign="center" border="0" height="26">   
      <TrayButton popup="fm" label="Fm">exec: rox</TrayButton> 
      <TrayButton popup="winefish" label="Wi">exec: winefish</TrayButton>
      <TrayButton popup="tomboy" label="Tb">exec: tomboy</TrayButton>
      <TrayButton popup="chrome" label="Ch">exec: google-chrome</TrayButton>
      <TrayButton popup="empathy" label="Em">exec: empathy</TrayButton>
      <TrayButton popup="firefox" label="Fx">exec: firefox</TrayButton>     
      <TrayButton popup="gedit" label="Ge">exec: gedit</TrayButton>
      <TrayButton popup="vim" label="Vi">exec: gvim</TrayButton> 
      <TrayButton popup="xterm" label=Xt">exec: xterm -e byobu</TrayButton>

  </Tray>

  <Tray autohide="false" valign="top" halign="left" border="0" height="26">
<TrayButton popup="moc" label="M">exec: xterm -geometry 74x20+0+24 -e mocp</TrayButton>
<TrayButton popup="play" label="1">exec: mocp -p</TrayButton>
<TrayButton popup="next" label="+">exec: mocp -f</TrayButton>
<TrayButton popup="pause" label="=">exec: mocp -G</TrayButton>
<TrayButton popup="prev" label="-">exec: mocp -r</TrayButton>
<TrayButton popup="exit" label="0">exec: mocp -x</TrayButton>
</Tray>

<Tray autohide="false" valign="top" halign="right" border="0" height="26">
        <Dock/>   
       <Swallow name="xload" width="48">
         xload -nolabel -bg black -fg red -hl white -update 1
     </Swallow>   
     <Clock format="%H:%M" width="56">xterm -geometry 74x20-0+24 -e calcurse</Clock>
     <TrayButton popup="exit" label="E">exec: gksu poweroff</TrayButton>
</Tray>


</JWM>



xterm: ~/.Xresources
代码:
!! Xft
Xft.dpi:96
Xft.hinting: true
!Xft.antialias: true
Xft.hintstyle: hintnone
Xft.rgba:      rgb
!!Xft.lcdfilter: lcddefault

!!Xcursor.theme: Vanilla-DMZ-AA

!! X Utils
!xpdf.title: PDF

xterm*termName:  xterm-256color
xterm*locale: true
xterm*utf8: 2
xterm*preeditType: Root
xterm*titleModes: 2
xterm*utf8Fonts: true
xterm*utf8Latin1: true
xterm*forceBoxChars: true
xterm*cursorUnderLine: true
xterm*fontMenu*fontdefault*Label: Default
xterm*faceName: Lucida Console:pixelsize=14
xterm*faceNameDoublesize: LiHei Pro:pixelsize=14
xterm*charClass: 33:48,37-38:48,45-47:48,64:48,58:48,126:48,61:48,63:48,43:48,35:38
xterm*trimSelection: true
xterm*faceSize: 10
xterm*faceSize1: 10
xterm*faceSize2: 10
xterm*faceSize3: 10
xterm*faceSize4: 10
xterm*faceSize5: 10
xterm*faceSize6: 10
xterm*cjkWidth:  false
xterm*xftAntialias: true
!xterm*background: #1c5572
!xterm*foreground: white
!xterm*background: gray20
!xterm*foreground: gray85
xterm*scrollKey: true
xterm*scrollTtyOutput: false
xterm*scrollBar: false
xterm*Scrollbar*foreground: #000000
xterm*loginshell: true
xterm*rightScrollBar: false
xterm*jumpScroll:  false
xterm*SaveLines: 1000
xterm*eightBitInput: false
xterm*altSendsEscape: true

*background:    #1C1C1C
*foreground:    #B5B5B5

*color0: #1C1C1C   
*color8:   #3D3A3A 

*color1:   #FE4365
*color9:   #FC9D9A

*color2:    #BBF144
*color10:   #C7F464

*color3:    #F8CA00
*color11:    #FEDA3A

*color4:    #556270
*color12:    #697785

*color5:    #73626E
*color13:  #B38184

*color6:   #3B8686
*color14:  #7ED0CA

*color7:    #808080
*color15:   #DAD3D3



conky: ~/.lua/scripts/conky_widgets.lua
代码:
--[[
Conky Widgets by londonali1010 (2009)

This script is meant to be a "shell" to hold a suite of widgets for use in Conky.

To configure:
+ Copy the widget's code block (will be framed by --(( WIDGET NAME )) and --(( END WIDGET NAME )), with "[" instead of "(") somewhere between "require 'cairo'" and "function conky_widgets()", ensuring not to paste into another widget's code block
+ To call the widget, add the following between "cr = cairo_create(cs)" and "cairo_destroy(cr)" at the end of the script:
   NAME_OF_FUNCTION(cr, OPTIONS)
+ Replace OPTIONS with the options for your widget (should be specified in the widget's code block)

Call this script in Conky using the following before TEXT (assuming you save this script to ~/scripts/conky_widgets.lua):
   lua_load ~/scripts/conky_widgets.lua
   lua_draw_hook_pre widgets
   
Changelog:
+ v1.1 -- Simplified calls to widgets by implementing a global drawing surface, and included imlib2 by default (03.11.2009)
+ v1.0 -- Original release (17.10.2009)
]]

require 'cairo'
require 'imlib2'

--[[ AIR CLOCK WIDGET ]]
--[[ v1.1 by londonali1010 (2009) ]]
--[[ Options (xc, yc, size):
   "xc" and "yc" are the x and y coordinates of the centre of the clock, in pixels, relative to the top left of the Conky window
   "size" is the total size of the widget, in pixels ]]

function air_clock(xc, yc, size)
   local offset = 0
   
   shadow_width = size * 0.03
   shadow_xoffset = 0
   shadow_yoffset = size * 0.01
   
   if shadow_xoffset >= shadow_yoffset then
      offset = shadow_xoffset
   else offset = shadow_yoffset
   end
   
   local clock_r = (size - 2 * offset) / (2 * 1.25)
      
   show_seconds=true
   
   -- Grab time
   
   local hours=os.date("%I")
   local mins=os.date("%M")
   local secs=os.date("%S")
   
   secs_arc=(2*math.pi/60)*secs
   mins_arc=(2*math.pi/60)*mins
   hours_arc=(2*math.pi/12)*hours+mins_arc/12
   
   -- Drop shadow
   
   local ds_pat=cairo_pattern_create_radial(xc+shadow_xoffset,yc+shadow_yoffset,clock_r*1.25,xc+shadow_xoffset,yc+shadow_yoffset,clock_r*1.25+shadow_width)
   cairo_pattern_add_color_stop_rgba(ds_pat,0,0,0,0,0.2)
   cairo_pattern_add_color_stop_rgba(ds_pat,1,0,0,0,0)
   
   cairo_move_to(cr,0,0)
   cairo_line_to(cr,conky_window.width,0)
   cairo_line_to(cr,conky_window.width, conky_window.height)
   cairo_line_to(cr,0,conky_window.height)
   cairo_close_path(cr)
   cairo_new_sub_path(cr)
   cairo_arc(cr,xc,yc,clock_r*1.25,0,2*math.pi)
   cairo_set_source(cr,ds_pat)
   cairo_set_fill_rule(cr,CAIRO_FILL_RULE_EVEN_ODD)
   cairo_fill(cr)
   
   -- Glassy border
   
   cairo_arc(cr,xc,yc,clock_r*1.25,0,2*math.pi)
   cairo_set_source_rgba(cr,0.5,0.5,0.5,0.2)
   cairo_set_line_width(cr,1)
   cairo_stroke(cr)
   
   local border_pat=cairo_pattern_create_linear(xc,yc-clock_r*1.25,xc,yc+clock_r*1.25)
   
   cairo_pattern_add_color_stop_rgba(border_pat,0,1,1,1,0.7)
   cairo_pattern_add_color_stop_rgba(border_pat,0.3,1,1,1,0)
   cairo_pattern_add_color_stop_rgba(border_pat,0.5,1,1,1,0)
   cairo_pattern_add_color_stop_rgba(border_pat,0.7,1,1,1,0)
   cairo_pattern_add_color_stop_rgba(border_pat,1,1,1,1,0.7)
   cairo_set_source(cr,border_pat)
   cairo_arc(cr,xc,yc,clock_r*1.125,0,2*math.pi)
   cairo_close_path(cr)
   cairo_set_line_width(cr,clock_r*0.25)
   cairo_stroke(cr)
   
   -- Set clock face
   
   cairo_arc(cr,xc,yc,clock_r,0,2*math.pi)
   cairo_close_path(cr)
   
   local face_pat=cairo_pattern_create_radial(xc,yc-clock_r*0.75,0,xc,yc,clock_r)
   
   cairo_pattern_add_color_stop_rgba(face_pat,0,1,1,1,0.9)
   cairo_pattern_add_color_stop_rgba(face_pat,0.5,1,1,1,0.9)
   cairo_pattern_add_color_stop_rgba(face_pat,1,0.9,0.9,0.9,0.9)
   cairo_set_source(cr,face_pat)
   cairo_fill_preserve(cr)
   cairo_set_source_rgba(cr,0.5,0.5,0.5,0.2)
   cairo_set_line_width(cr, 1)
   cairo_stroke (cr)
   
   -- Draw hour hand
   
   xh=xc+0.7*clock_r*math.sin(hours_arc)
   yh=yc-0.7*clock_r*math.cos(hours_arc)
   cairo_move_to(cr,xc,yc)
   cairo_line_to(cr,xh,yh)
   
   cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
   cairo_set_line_width(cr,5)
   cairo_set_source_rgba(cr,0,0,0,0.5)
   cairo_stroke(cr)
   
   -- Draw minute hand
   
   xm=xc+0.9*clock_r*math.sin(mins_arc)
   ym=yc-0.9*clock_r*math.cos(mins_arc)
   cairo_move_to(cr,xc,yc)
   cairo_line_to(cr,xm,ym)
   
   cairo_set_line_width(cr,3)
   cairo_stroke(cr)
   
   -- Draw seconds hand
   
   if show_seconds then
      xs=xc+0.9*clock_r*math.sin(secs_arc)
      ys=yc-0.9*clock_r*math.cos(secs_arc)
      cairo_move_to(cr,xc,yc)
      cairo_line_to(cr,xs,ys)
   
      cairo_set_line_width(cr,1)
      cairo_stroke(cr)
   end

   cairo_set_line_cap(cr, CAIRO_LINE_CAP_BUTT)
end

--[[ END AIR CLOCK WIDGET ]]

--[[ CLOCK HANDS WIDGET ]]
--[[ v1.1 by londonali1010 (2009) ]]
--[[ Options (xc, yc, colour, alpha, show_secs, size):
   "xc" and "yc" are the x and y coordinates of the centre of the clock hands, in pixels, relative to the top left corner of the Conky window
   "colour" is the colour of the clock hands, in Ox33312c formate
   "alpha" is the alpha of the hands, between 0 and 1
   "show_secs" is a boolean; set to TRUE to show the seconds hand, otherwise set to FALSE
   "size" is the total size of the widget (e.g. twice the length of the minutes hand), in pixels ]]

function clock_hands(xc, yc, colour, alpha, show_secs, size)
   local function rgb_to_r_g_b(colour,alpha)
      return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
   end
   
   local secs,mins,hours,secs_arc,mins_arc,hours_arc
   local xh,yh,xm,ym,xs,ys

   secs=os.date("%S")
   mins=os.date("%M")
   hours=os.date("%I")

   secs_arc=(2*math.pi/60)*secs
   mins_arc=(2*math.pi/60)*mins+secs_arc/60
   hours_arc=(2*math.pi/12)*hours+mins_arc/12

   xh=xc+0.4*size*math.sin(hours_arc)
   yh=yc-0.4*size*math.cos(hours_arc)
   cairo_move_to(cr,xc,yc)
   cairo_line_to(cr,xh,yh)

   cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
   cairo_set_line_width(cr,5)
   cairo_set_source_rgba(cr,rgb_to_r_g_b(colour,alpha))
   cairo_stroke(cr)

   xm=xc+0.5*size*math.sin(mins_arc)
   ym=yc-0.5*size*math.cos(mins_arc)
   cairo_move_to(cr,xc,yc)
   cairo_line_to(cr,xm,ym)

   cairo_set_line_width(cr,3)
   cairo_stroke(cr)

   if show_secs then
      xs=xc+0.5*size*math.sin(secs_arc)
      ys=yc-0.5*size*math.cos(secs_arc)
      cairo_move_to(cr,xc,yc)
      cairo_line_to(cr,xs,ys)

      cairo_set_line_width(cr,1)
      cairo_stroke(cr)
   end

   cairo_set_line_cap(cr,CAIRO_LINE_CAP_BUTT)
end

--[[ END CLOCK HANDS WIDGET ]]

--[[ RING WIDGET ]]
--[[ v1.1 by londonali1010 (2009) ]]
--[[ Options (name, arg, max, bg_colour, bg_alpha, xc, yc, radius, thickness, start_angle, end_angle):
   "name" is the type of stat to display; you can choose from 'cpu', 'memperc', 'fs_used_perc', 'battery_used_perc'.
   "arg" is the argument to the stat type, e.g. if in Conky you would write ${cpu cpu0}, 'cpu0' would be the argument. If you would not use an argument in the Conky variable, use ''.
   "max" is the maximum value of the ring. If the Conky variable outputs a percentage, use 100.
   "bg_colour" is the colour of the base ring.
   "bg_alpha" is the alpha value of the base ring.
   "fg_colour" is the colour of the indicator part of the ring.
   "fg_alpha" is the alpha value of the indicator part of the ring.
   "x" and "y" are the x and y coordinates of the centre of the ring, relative to the top left corner of the Conky window.
   "radius" is the radius of the ring.
   "thickness" is the thickness of the ring, centred around the radius.
   "start_angle" is the starting angle of the ring, in degrees, clockwise from top. Value can be either positive or negative.
   "end_angle" is the ending angle of the ring, in degrees, clockwise from top. Value can be either positive or negative, but must be larger (e.g. more clockwise) than start_angle. ]]

function ring(name, arg, max, bgc, bga, fgc, fga, xc, yc, r, t, sa, ea)
   local function rgb_to_r_g_b(colour, alpha)
      return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
   end
   
   local function draw_ring(pct)
      local angle_0 = sa * (2 * math.pi/360) - math.pi/2
      local angle_f = ea * (2 * math.pi/360) - math.pi/2
      local pct_arc = pct * (angle_f - angle_0)

      -- Draw background ring

      cairo_arc(cr, xc, yc, r, angle_0, angle_f)
      cairo_set_source_rgba(cr, rgb_to_r_g_b(bgc, bga))
      cairo_set_line_width(cr, t)
      cairo_stroke(cr)
   
      -- Draw indicator ring

      cairo_arc(cr, xc, yc, r, angle_0, angle_0 + pct_arc)
      cairo_set_source_rgba(cr, rgb_to_r_g_b(fgc, fga))
      cairo_stroke(cr)
   end
   
   local function setup_ring()
      local str = ''
      local value = 0
      
      str = string.format('${%s %s}', name, arg)
      str = conky_parse(str)

      value = tonumber(str)
      if value == nil then value = 0 end
      pct = value/max
      
      draw_ring(pct)
   end   
   
   local updates = conky_parse('${updates}')
   update_num = tonumber(updates)
   
   if update_num > 5 then setup_ring() end
end

--[[ END RING WIDGET ]]

--[[ RING (COUNTER-CLOCKWISE) WIDGET ]]
--[[ v1.1 by londonali1010 (2009) ]]
--[[ Options (name, arg, max, bg_colour, bg_alpha, xc, yc, radius, thickness, start_angle, end_angle):
   "name" is the type of stat to display; you can choose from 'cpu', 'memperc', 'fs_used_perc', 'battery_used_perc'.
   "arg" is the argument to the stat type, e.g. if in Conky you would write ${cpu cpu0}, 'cpu0' would be the argument. If you would not use an argument in the Conky variable, use ''.
   "max" is the maximum value of the ring. If the Conky variable outputs a percentage, use 100.
   "bg_colour" is the colour of the base ring.
   "bg_alpha" is the alpha value of the base ring.
   "fg_colour" is the colour of the indicator part of the ring.
   "fg_alpha" is the alpha value of the indicator part of the ring.
   "x" and "y" are the x and y coordinates of the centre of the ring, relative to the top left corner of the Conky window.
   "radius" is the radius of the ring.
   "thickness" is the thickness of the ring, centred around the radius.
   "start_angle" is the starting angle of the ring, in degrees, counter-clockwise from top. Value can be either positive or negative.
   "end_angle" is the ending angle of the ring, in degrees, counter-clockwise from top. Value can be either positive or negative, but must be larger (e.g. more counter-clockwise) than start_angle. ]]

function ring_ccw(name, arg, max, bgc, bga, fgc, fga, xc, yc, r, t, sa, ea)
   local function rgb_to_r_g_b(colour, alpha)
      return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
   end
   
   local function draw_ring(pct)
      local angle_0 = sa * (2 * math.pi/360) - math.pi/2
      local angle_f = ea * (2 * math.pi/360) - math.pi/2
      local pct_arc = pct * (angle_f - angle_0)

      -- Draw background ring

      cairo_arc_negative(cr, xc, yc, r, angle_0, angle_f)
      cairo_set_source_rgba(cr, rgb_to_r_g_b(bgc, bga))
      cairo_set_line_width(cr, t)
      cairo_stroke(cr)
   
      -- Draw indicator ring

      cairo_arc_negative(cr, xc, yc, r, angle_0, angle_0 - pct_arc)
      cairo_set_source_rgba(cr, rgb_to_r_g_b(fgc, fga))
      cairo_stroke(cr)
   end
   
   local function setup_ring()
      local str = ''
      local value = 0
      
      str = string.format('${%s %s}', name, arg)
      str = conky_parse(str)
      
      value = tonumber(str)
      if value == nil then value = 0 end
      pct = value/max
      
      draw_ring(pct)
   end   
   
   local updates = conky_parse('${updates}')
   update_num = tonumber(updates)
   
   if update_num > 5 then setup_ring() end
end

--[[ END RING (COUNTER-CLOCKWISE) WIDGET ]]

--[[ ROUNDED RECTANGLE WIDGET ]]
--[[ v1.0 by londonali1010 (2009) ]]
--[[ Options (x0, y0, width, height, radius, colour, alpha):
   "x0" and "y0" are the coordinates (in pixels) of the top left of the rectangle, relative to the top left of the Conky window.
   "width" and "height" are the width and height of the rectangle, respectively.
   "radius" is the rounding radius of the corners, in pixels.
   "colour" is the colour of the rectangle, in format 0xRRGGBB.
   "alpha" is the transparency of the rectangle, from 0.0 (transparent) -> 1.0 (opaque) ]]

function round_rect(x0, y0, w, h, r, colour, alpha)
   local function rgb_to_r_g_b(colour, alpha)
      return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
   end
   
   cairo_move_to(cr, x0, y0)
   cairo_rel_move_to(cr, r, 0)
   cairo_rel_line_to(cr, w-2*r, 0)
   cairo_rel_curve_to(cr, r, 0, r, 0, r, r)
   cairo_rel_line_to(cr, 0, h-2*r)
   cairo_rel_curve_to(cr, 0, r, 0, r, -r, r)
   cairo_rel_line_to(cr, -(w-2*r), 0)
   cairo_rel_curve_to(cr, -r, 0, -r, 0, -r, -r)
   cairo_rel_line_to(cr, 0, -(h-2*r))
   cairo_rel_curve_to(cr, 0, -r, 0, -r, r, -r)
   cairo_close_path(cr)

   cairo_set_source_rgba(cr, rgb_to_r_g_b(colour, alpha))
   cairo_fill(cr)
end
   
--[[ END ROUNDED RECTANGLE WIDGET ]]


function conky_widgets()
   if conky_window == nil then return end
   local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
   cr = cairo_create(cs)

   air_clock(100, 100, 100)
   
   cairo_destroy(cr)
end



附件:
screen.jpg
screen.jpg [ 156.05 KiB | 被浏览 6480 次 ]



_________________
No.
页首
 用户资料  
 
2 楼 
 文章标题 : Re: jwm+xterm+conky+byobu
帖子发表于 : 2010-08-14 1:27 

注册: 2010-05-23 18:26
帖子: 68
地址: China
送出感谢: 0 次
接收感谢: 0 次
:em09


_________________
好吧


页首
 用户资料  
 
3 楼 
 文章标题 : Re: jwm+xterm+conky+byobu
帖子发表于 : 2011-04-30 22:21 
头像

注册: 2008-11-20 22:50
帖子: 628
系统: ArchLinux
送出感谢: 0 次
接收感谢: 0 次
墙纸不错哦


_________________
===我的小窝===
无聊吗?点我吧,楼主迫切期待你的光临~~
又一个轮子
------------------------------------
这年头,没有1000贴都不好意思见人了
------------------------------------
献丑不如藏拙
------------


页首
 用户资料  
 
4 楼 
 文章标题 : Re: jwm+xterm+conky+byobu
帖子发表于 : 2011-04-30 22:28 
头像

注册: 2008-04-26 12:41
帖子: 11000
送出感谢: 11
接收感谢: 38
玩什么的都有 :em09


_________________
[新手必读]wubi安装常见问题(FAQ)
[分享]装双系统的同学必看——Windows与Linux系统共享交换分区的方法
kde下唯美的暗黑内透主题(无需编译)
无穷老机上的Trinity Desktop Environment


页首
 用户资料  
 
5 楼 
 文章标题 : Re: jwm+xterm+conky+byobu
帖子发表于 : 2014-10-07 11:10 

注册: 2007-02-09 8:33
帖子: 92
地址: 深圳福田
送出感谢: 6
接收感谢: 1
楼主,我用的是 jwm ,然后,又用了, guake terminal,两者好像有冲突。

guake terminal 的 快捷键是 F12,在 jwm 下,我一按 F12,就全屏白的,有时什么反应也没有,不知楼主有没用过 guake terminal,如何解决。

另,还有两问:

1. 鼠标放上去之后,会自动将当前窗口设焦点,即活动窗口,这个如何改,不让他自动成为活动窗口。
2. 默认是左键点出桌面菜单,我想改成右键点出,如何改?

谢谢楼主分享此文,并感谢楼主能回答我的问题,谢谢!


页首
 用户资料  
 
6 楼 
 文章标题 : Re: jwm+xterm+conky+byobu
帖子发表于 : 2014-10-07 11:21 

注册: 2007-02-09 8:33
帖子: 92
地址: 深圳福田
送出感谢: 6
接收感谢: 1
onroot="12"

表示 鼠标左键,中键,能调出系统菜单,对吧?
改成3 表示右键?

有没办法,在 Start 菜单,就是任务栏里那个 JWM 标志那里,点左键,而在桌面上点右键呢?


页首
 用户资料  
 
显示帖子 :  排序  
发表新帖 回复这个主题  [ 6 篇帖子 ] 

当前时区为 UTC + 8 小时


在线用户

正在浏览此版面的用户:没有注册用户 和 1 位游客


不能 在这个版面发表主题
不能 在这个版面回复主题
不能 在这个版面编辑帖子
不能 在这个版面删除帖子
不能 在这个版面提交附件

前往 :  
本站点为公益性站点,用于推广开源自由软件,由 DiaHosting VPSBudgetVM VPS 提供服务。
我们认为:软件应可免费取得,软件工具在各种语言环境下皆可使用,且不会有任何功能上的差异;
人们应有定制和修改软件的自由,且方式不受限制,只要他们自认为合适。

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
简体中文语系由 王笑宇 翻译