LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 871|回复: 2

suse下桌面blackbox 的安装配置记录

[复制链接]
发表于 2007-2-11 13:53:57 | 显示全部楼层 |阅读模式
环境 suse 10.1  FZSongTi 方正宋体  zh_CN.UTF-8  gdm

下载安装桌面blackbox:通过smart工具安装了三个包blackbox、bbtools 和 bbtools-gui
blackbox-0.70.1-13
bbtools-2006.1.25-12
bbtools-gui-2006.1.25-12

三个包的内容分别为
blackbox: 桌面系统,登录后只发现一个主菜单(menu)和一个工具条。中文显示为方块。
bbtools: 有捷键工具bbkeys  
bbtools-gui: blackbox的配置工具,没更新,无法配置快捷键bbkeys,不用。


一、配置文件
blackbox的个人配置文件总共为三处
    ~/.bbkeysrc 文件:快捷键配置
    ~/.blackbox/ 文件夹:  菜单文件 menu
    ~/.blackboxrc 文件:设置menu文件的路径

共需三处修改
    ~/.bbkeysrc 从 /usr/share/bbkeys/bbkeysrc 复制过来,参照它的样式修改
    ~/.blackbox/menu 从/usr/share/blackbox/menu复制过来 ,参照它的样式修改
    ~/.blackboxrc文件:添加如下一行,表明菜单的位置
           session.menuFile:   ~/.blackbox/menu


配置文件 小结
  都是小配置,建立和修改几个配置文件,配置文件都位于~文件夹

二、自动启动bbkeys
设置自动启动bbkeys,修改或者新建两个文件
~/.profile 文件加入两行:
   WM=${WINDOWMANAGER##/*/}
   test -r $HOME/.xinitrc-$WM && source $HOME/.xinitrc-$WM

~/.xinitrc-blackbox文件加入一行:
   bbkeys &


三、桌面和菜单中文为显示为方块,修改一下样式
参照menu文件的提示,所有系统样式在三个目录
/usr/share/blackbox/styles/
/usr/share/fluckbox/styles/
/usr/share/openbox/styles/
将里面的所有字体字符串如lucida 、lucidasans 等等 替换为FZSongTi


参考:
man:  blackbox bbkeys bbkeysrc
/usr/share/doc/packages/bbtools/bbkeys/*
http://lists.suse.com/archive/suse-linux-e/2002-Mar/2782.html
http://asgardsrealm.net/lurker/m ... 08.45789d8d.en.html
 楼主| 发表于 2007-2-17 11:42:10 | 显示全部楼层

styles 文件 字体编辑脚本

因为原来在kde桌面下系统缺省的字体都设为FZSongTi,所以blackbox样式的字体可以不用设置,所以我将下面三个目录下的样式文件中的设置字体的行都注释掉。
/usr/share/blackbox/styles/
/usr/share/fluxbox/styles/
/usr/share/openbox/styles/

命令行如下
su
for file in $(find /usr/share/blackbox/styles/ /usr/share/fluxbox/styles/ /usr/share/openbox/styles/ -maxdepth 1 -type f); do sed -i 's/^.*.font.*/\!&/g' $file ;done
for file in $(find /usr/share/blackbox/styles/ /usr/share/fluxbox/styles/ /usr/share/openbox/styles/  -maxdepth 1 -type f); do sed -i 's/^.*.Font.*/\!&/g' $file ;done
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-2-17 12:04:44 | 显示全部楼层

设置随机桌面 背景

一、工具准备
fluxbox-1.0rc2-2的fbsetbg程序
WindowMaker-0.92.0-23的wmsetbg程序
刚开始玩suse时不知道哪些该装不该装,所以以前就统统装好了,一看都有,感觉很舒服。

二、新建执行脚本/home/name/random-bg.py

#! /usr/bin/env python
"""
wallpaper - finds a random picture and sets it as wallpaper

        you need another program (this uses bsetbg) for actually
        setting the wallpaper

In a unix/linux/bsd system, you can schedule this to run regularly
using crontab.  For example, I run this every hour. So I go
to a shell and run
       crontab -e
This opens up my crontab file. I add the following line:
01 * * * * /usr/local/bin/wallpaper > /dev/null
learn more about cron format at
    http://www.uwsg.iu.edu/edcert/sl ... ation/crontab5.html
"""
# all the folders you want to scan
folders = [
#'/home/name/picture/cg',
'/home/name/picture/0915',
'/home/name/picture/green',
'/home/name/picture/linux',
'/home/name/picture/luzhu',
'/home/name/picture/winxp',
'/home/name/picture/lanling',
'/home/name/picture/classic',
#上面是所有的桌面文件夹
    ]

# these are the valid image types - case sensitive
use_types = ['.jpg', '.gif', '.png']


# the command to execute for setting wallpaper. %s will be
# substituted by the image path
#cmd = "bsetbg -f %s"
cmd = "fbsetbg -r %s"

# ---------------- main routine ------------------------------
import os
from random import choice


# initialize a list to hold all the images that can be found
imgs = []

for d in folders: #for each item in folders
    if os.path.exists(d) and os.path.isdir(d): #is it a valid folder?
   try: imgs.append(d)   
#        for f in os.listdir(d):                #get all files in that folder
#
#           try:  #splitext[1] may fail
#                if os.path.splitext(f)[1] in use_types: #is that file of proper type?
#                    imgs.append(d + os.sep + f)         #if so, add it to our list
        except:
                pass

wallpaper = choice(imgs)   #get a random entry from our list
#print cmd % wallpaper
os.system(cmd % wallpaper) #execute the command

三、设置自动启动
创建链接 ln-s /home/name/random-bg.py /usr/local/bin/random-bg
在.xinitrc-blackbox文件加入一行 300秒执行一次
watch -n 300 random-bg

参考
man: watch fbsetbg wmsetbg
http://vsbabu.org/mt/archives/20 ... ndom_wallpaper.html
http://moongroup.com/pipermail/s ... 02-June/007667.html
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表