瀏覽代碼

User-level boot process fixes

Maxim Kammerer 11 年之前
父節點
當前提交
163dcb872d

+ 1 - 1
src/etc/portage/sets/apps

@@ -10,6 +10,7 @@ app-text/tree
 sys-apps/less
 app-editors/nano
 app-editors/hexedit
+sys-devel/bc
 
 # Applications
 gnome-extra/zenity
@@ -26,7 +27,6 @@ app-text/evince
 www-client/firefox
 mail-client/claws-mail
 app-crypt/gpa
-sci-libs/libqalculate
 net-irc/hexchat
 
 # Plugins

+ 16 - 22
src/home/anon/bin/x11/gen-wallpaper

@@ -12,33 +12,26 @@ vmfont=/usr/share/fonts/dejavu/DejaVuSans.ttf
 
 profile=/var/run/usage-profile
 
-timeout=120
+# Single parameter is width:height of work area (see "wait-panel")
+dim=${1:-600:600}
 
-height=`xwininfo -root | sed -n 's/^  Height: //p'`
-wheight=${height}
-
-# Wait for the taskbar to come up
-w=
-while [ ${#w} -lt ${timeout}  -a  ${height} = ${wheight} ]; do
-    sleep 0.2
+if [ ! -e ${png} ]; then
+    width=${dim%:*}
+    height=${dim#*:}
 
-    if xprop -root _NET_WORKAREA | grep -q =; then
-        wheight=`xprop -root '=$3' _NET_WORKAREA | cut -d= -f2`
+    # Calculate logo size
+    size=${width}
+    if [ "${height}" -lt "${size}" ]; then
+        size=${height}
     fi
-
-    w=${w}X
-done
-
-if [ ! -e ${png} ]; then
-    calc=`xprop -root '=round(min($2-$0, $3-$1\) * 2/3\)' _NET_WORKAREA | cut -d= -f2`
-    size=`qalc -t "${calc}"`
+    size=$((size * 2/3))
 
     # Do not use the logo if gentoo=nologo has been specified
     if [ -e ${silentflag} ]; then
         cp ${silentpng} ${png}
     # Black background is needed for xlock (display +matte has no antialiasing)
     elif [ ! -s ${vmtype}  -a  ! -s ${profile} ]; then
-        exec rsvg-convert --background-color=black -h ${size} -o ${png} ${svg}
+        exec rsvg-convert --background-color=black -h "${size}" -o ${png} ${svg}
     else
         warning=
         if [ -s ${vmtype} ]; then
@@ -48,11 +41,12 @@ if [ ! -e ${png} ]; then
             warning="${warning:+${warning}\n}irregular profile\n(`cat ${profile}`)"
         fi
 
-        texty=`qalc -t "round(${size} * 3/8)"`
-        textpt=`qalc -t "${size} * 13/400"`
+        texty=$((size * 3/8))
+        textpt=$((size * 130/400))
+        textpt=`echo "${textpt}" | sed 's/.$/.\0/'`
 
-        exec rsvg-convert --background-color=black -h ${size} ${svg} \
-             | convert -font ${vmfont} -pointsize ${textpt} -fill yellow -gravity center \
+        exec rsvg-convert --background-color=black -h "${size}" ${svg} \
+             | convert -font ${vmfont} -pointsize "${textpt}" -fill yellow -gravity center \
                -draw "text 0,${texty} 'Warning:\n${warning}'" - ${png}
     fi
 fi

+ 25 - 0
src/home/anon/bin/x11/wait-panel

@@ -0,0 +1,25 @@
+#!/bin/sh -e
+
+# Timeout (s)
+timeout=15
+
+# Screen dimensions
+dim=`xprop -root '=$0:$1' _NET_DESKTOP_GEOMETRY`
+dim=${dim#*=}
+wdim=${dim}
+
+# Wait for the taskbar to come up
+w=0
+while [ ${w} -lt $((timeout*5))  -a  "${dim}" = "${wdim}" ]; do
+    sleep 0.2
+
+    if xprop -root _NET_WORKAREA | grep -q =; then
+        wdim=`xprop -root '=$2 - $0:$3 - $1' _NET_WORKAREA`
+        wdim=${wdim#*=}
+        wdim=`expr ${wdim%:*}`:`expr ${wdim#*:}`
+    fi
+
+    w=$((w+1))
+done
+
+echo "${wdim}"

+ 1 - 0
src/home/anon/config/shell/profile

@@ -38,6 +38,7 @@ export GTK_IM_MODULE=uim
 export QT_IM_MODULE=uim
 
 # Application settings
+export BC_ENV_ARGS="-ql"
 export BROWSER=firefox
 export LESS="-R -M --shift 16 -Swi -x4"
 export LESSHISTFILE=-

+ 9 - 4
src/home/anon/config/x11/xsession

@@ -20,6 +20,11 @@ fi
 setxkbmap ${X11_KBD_LAYOUT:+-layout ${X11_KBD_LAYOUT}} ${X11_KBD_VARIANT:+-variant ${X11_KBD_VARIANT}} \
           ${X11_KBD_COMPOSE:+-option compose:${X11_KBD_COMPOSE}} &
 
+# Must exist for gpg-agent's gnome-keyring-daemon's subdirectory
+if [ ! -e ${XDG_CACHE_HOME} ]; then
+    mkdir ${XDG_CACHE_HOME}
+fi
+
 # Launch daemons
 # assume [ -z "${DBUS_SESSION_BUS_ADDRESS}" ]
 # eval `dbus-launch --sh-syntax`
@@ -44,9 +49,10 @@ $wm & export WM_PID=$!
 lxpanel &
 
 # Delay launch of other apps until the task bar is up
-# (and generate wallpaper along the way)
-${prefix}/gen-wallpaper
-pcmanfm -d --desktop &
+dim=`${prefix}/wait-panel`
+
+# Generate and set wallpaper
+( ${prefix}/gen-wallpaper "${dim}";  exec pcmanfm -d --desktop ) &
 
 # Launch automatic lid-autolock
 ${prefix}/lid-xlock & LIDXLOCK_PID=$!
@@ -56,7 +62,6 @@ syndaemon -d -t -k -i 2 &
 
 # Launch clipboard, NetworkManager and Bluetooth applets (use tray -> after panel)
 nm-applet --sm-disable &
-bluetooth-applet &
 
 # Launch input method daemons
 # uim-toolbar-gtk-systray is squashed by lxpanel (#405025)

+ 0 - 4
src/root/setup

@@ -258,10 +258,6 @@ sinfo "Generating localization, timezone and keyboard layout menus"
 ${helpdir}/gen-locale-menu
 
 
-# sinfo "Fixing Ambiance/Radiance themes"
-# sed -ri '/\<(text|icon|box)-shadow:|\<inset / s/([0-9])px\>/\1/g' /usr/share/themes/{Radiance,Ambiance}*/gtk-3.0/{,apps/}*.css
-
-
 sinfo "Fixing miscellaneous directory permissions"
 # (#444734, FreeDesktop: #58787)
 chown root:polkitd {/etc,/usr/share}/polkit-1/rules.d