首页 > 其他 > 详细

slax自启动程序

时间:2019-10-15 14:56:39      阅读:70      评论:0      收藏:0      [点我收藏+]

Fluxbox 本身提供了自启动程序的功能。~/.fluxbox/startup 文件是一个像启动 Fluxbox 一样自启动应用程序的脚本。# 标记是注释。

一个简单的例子:

 1 #!/bin/sh
 2 #
 3 # fluxbox startup-script:
 4 #
 5 # Lines starting with a ‘#‘ are ignored.
 6 
 7 # Change your keymap:
 8 xmodmap "/root/.Xmodmap"
 9 
10 # merge xresource settings
11 xrdb -merge ~/.Xresources
12 
13 # set keyboard layout
14 fbsetkb $(cat ~/.fluxbox/kblayout)
15 
16 # setup bookmarks for file manager
17 gtk-bookmarks-update
18 
19 # Share common directories with guest user. This is necessary
20 # because some apps like chromium must be running under guest
21 for dir in Desktop Documents Downloads Music Pictures Public Templates Videos; do
22    if ! mountpoint /root/$dir; then
23       mount --bind /home/guest/$dir /root/$dir
24    fi
25 done
26 
27 # set background color and big wait mouse cursor
28 xsetroot -solid ‘#111111‘
29 xsetroot -xcf /usr/share/icons/breeze_cursors/cursors/watch 37
30 
31 # disable screen blanking
32 xset s off
33 xset -dpms
34 
35 # volume icon in system tray. Can fail if no soundcard is detected
36 volumeicon &
37 tilda &                                                                                                              //add  tilda startup
38 
39 # preload compton and fluxbox to cache
40 (compton --help; fluxbox --help) >/dev/null 2>&1
41 
42 # Keep black screen for first second while the sound plays.
43 # This slows startup a little, but it is nicer effect.
44 SND=/usr/share/sounds/startup.wav
45 if [ -r $SND ]; then
46    cat $SND > /dev/null # preload
47    aplay $SND &
48    sleep 1 &
49    SOUNDPID=$!
50 fi
51 
52 # Debian-local change:
53 #   - fbautostart has been added with a quick hack to check to see if it
54 #     exists. If it does, we‘ll start it up by default.
55 which fbautostart > /dev/null
56 if [ $? -eq 0 ]; then
57     fbautostart
58 fi
59 
60 # We need to postpone compton after fluxbox starts, else it won‘t set
61 # the transparency of toolbar properly... So we check the fehbg file,
62 # which is created by fluxbox at the phase when it sets background.
63 # Once the file exist, fluxbox-toolbar is already started
64 
65 SIGNAL1=~/.fehbg
66 SIGNAL2=~/.fehbg2
67 
68 rm -f $SIGNAL1 2>/dev/null
69 rm -f $SIGNAL2 2>/dev/null
70 
71 (
72    while [ ! -e $SIGNAL1 ]; do
73       sleep 0.1
74    done

    tilda &

slax自启动程序

原文:https://www.cnblogs.com/guochaoxxl/p/11677047.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!