antiright-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Antiright-devel] antiright/src ACE


From: Jeffrey Bedard
Subject: [Antiright-devel] antiright/src ACE
Date: Sat, 30 Jul 2005 16:35:45 -0400

CVSROOT:        /cvsroot/antiright
Module name:    antiright
Branch:         
Changes by:     Jeffrey Bedard <address@hidden> 05/07/30 20:35:45

Modified files:
        src            : ACE 

Log message:
        Implemented windowmanager kill.  Added stand-alone mp3 player.
        Improved appearance of desktop menu and logout panel.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/src/ACE.diff?tr1=1.53&tr2=1.54&r1=text&r2=text

Patches:
Index: antiright/src/ACE
diff -u antiright/src/ACE:1.53 antiright/src/ACE:1.54
--- antiright/src/ACE:1.53      Sat Jul 23 17:10:09 2005
+++ antiright/src/ACE   Sat Jul 30 20:35:44 2005
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 
 #    AntiRight (c) 2002-2005 Jeffrey Bedard address@hidden
- 
+
 #    This file is part of AntiRight.
 
 #     AntiRight is free software; you can redistribute it and/or
@@ -29,10 +29,10 @@
 }
 ACE_Check_Configuration_File()
 {
-    # This probably should be replaced with a for loop.  
-    # In such the likely prefixes are what will be processed.  
+    # This probably should be replaced with a for loop.
+    # In such the likely prefixes are what will be processed.
     if [ ! -f ~/.antiright ]; then
-       if [ -e /usr/local/share/antiright/system.antiright ]; then 
+       if [ -e /usr/local/share/antiright/system.antiright ]; then
            cp /usr/local/share/antiright/system.antiright ~/.antiright
        elif [ -e /usr/share/antiright/system.antiright ]; then
            cp /usr/share/antiright/system.antiright ~/.antiright
@@ -41,11 +41,11 @@
        # If ~/.antiright doesnt contain the text "revision" it does
        # not keep track of revisions and therefore is an old version.
        if [ "$(grep revision ~/.antiright)" = "" ]; then
-           # Backup customizations.  
+           # Backup customizations.
            mv ~/.antiright ~/.antiright.old
-           # Restore2 ~/.antiright with a new instance.  
+           # Restore2 ~/.antiright with a new instance.
            ACE_Check_Configuration_File
-           # Alert the user.  
+           # Alert the user.
            echo 'Your old ~/.antiright has been saved to ~/.antiright.old'
            echo 'This is due to the use of a new revision of the file,'
            echo 'changing the theme support.'
@@ -111,7 +111,8 @@
 Play_Next()
 {
     Setup_Juke_Environment
-    if [ "$(ps xa | grep mpg123 | grep -v grep | grep -v renice | grep -v 
pidof)" = "" ]; then
+    if [ "$(ps xa | grep mpg123 | grep -v grep | grep -v renice | grep -v 
pidof)"\
+       = "" ]; then
        killall $mp3player
        echo "#!/bin/sh" > /tmp/ACE.$$
        echo "$mp3player -Z $mp3dir/*.mp3 2>> ~/.antiright_mp3s" >> /tmp/ACE.$$
@@ -199,27 +200,27 @@
 {
     cal | arshell -Am -Aw -p -geometry 200x200
 }
-Desktop()
+desk_init()
 {
     Setup_Juke_Environment
     create_fake_song_file
     echo '#!/bin/sh' > /tmp/ACE.$$
     arbmdir=$bmdir/antiright
- 
- #    POSITION="$(ACE desker_position)"
-#     if [ "$POSITION" = "upper_left" ]; then
-#      GEOMETRY="+0+0"
-#     elif [ "$POSITION" = "upper_right" ]; then
-#      GEOMETRY="-0+0"
-#     elif [ "$POSITION" = "lower_left" ]; then
-#      GEOMETRY="+0-0"
-#     elif [ "$POSITION" = "lower_right" ]; then
-#      GEOMETRY="-0-0"
-#     else
-#      GEOMETRY="+0+0"
-#     fi
+}
+Music()
+{
+    desk_init
+    $ARSHELL -Am -UL 'ACE -A Juke_Song' -r 1\
+       -Ai 'ACE -A Play_Next \# Play' $arbmdir/play.xpm\
+       -Ai 'ACE -A Stop' $arbmdir/stop.xpm\
+       -Ai 'ACE -A Pause' $arbmdir/pause.xpm\
+       -Ai 'ACE -A Resume' $arbmdir/resume.xpm &
+}
+Desktop()
+{
+    desk_init
 
-    echo  "$ARSHELL -W DESKTOP\\" >> /tmp/ACE.$$ 
+    echo  "$ARSHELL -W DESKTOP\\" >> /tmp/ACE.$$
     if [ "$(ACE is_clocked)" = "1" ]; then
        echo " -Ac\\" >> /tmp/ACE.$$
     fi
@@ -228,25 +229,69 @@
     if [ "$PAGED" = "1" ]; then
        echo "  -Ai 'vdesk 1' $arbmdir/1.xpm -Ai 'vdesk 2' $arbmdir/2.xpm  -Ai 
'vdesk 3' $arbmdir/3.xpm -Ai 'vdesk 4' $arbmdir/4.xpm\\" >> /tmp/ACE.$$
     fi
-    echo " -Ai 'ACE -A Play_Next \# Play' $arbmdir/play.xpm -Ai 'ACE -A Stop' 
$arbmdir/stop.xpm -Ai 'ACE -A Pause' $arbmdir/pause.xpm -Ai 'ACE -A Resume' 
$arbmdir/resume.xpm -Ai 'ACE Lock' $arbmdir/lock.xpm -Ai 'ACE -A 
restart_dialog' $arbmdir/refresh.xpm -Ai 'ACE -A Settings' 
$arbmdir/settings.xpm -Ai 'ACE' $arbmdir/ace.xpm  -Ai 'ACE -L Run' 
$arbmdir/runner.xpm -Ai 'ACE Terminal' $arbmdir/terminal.xpm -Ai 'ACE -A Alarm' 
$arbmdir/clock.xpm -Ai 'ACE -A Sticky_Note' $arbmdir/sticky.xpm -Ai 'ACE 
Calculator' $arbmdir/calculator.xpm -Ai 'ACE -A Background_Editor' 
$arbmdir/palate.xpm   -Ai 'ACE File_Manager' $arbmdir/folder.xpm -Ai 'ACE -A 
File_System_Panel File_Systems' $arbmdir/disk.xpm -Ai 'ACE Mail' 
$arbmdir/mail.xpm -Ai 'ACE Cal' $arbmdir/calendar.xpm  -Ai 'ACE Load_Meter' 
$arbmdir/meter.xpm   -Ai 'ACE Editor' $arbmdir/text_editor.xpm -Ai 'ACE 
Browser' $arbmdir/www.xpm -Ai 'ACE CD_Player' $arbmdir/music.xpm -Ai 'afract & 
# Fractals' $arbmdir/fractal.xpm -Ai 'pongr & # PONGr' $arbmdir/pong.xpm\\" >> 
/tmp/ACE.$$ 
+    echo " -Ai 'ACE -A Play_Next \# Play' $arbmdir/play.xpm -Ai 'ACE -A Stop' 
$arbmdir/stop.xpm -Ai 'ACE -A Pause' $arbmdir/pause.xpm -Ai 'ACE -A Resume' 
$arbmdir/resume.xpm -Ai 'ACE Lock' $arbmdir/lock.xpm -Ai 'ACE -A 
restart_dialog' $arbmdir/refresh.xpm -Ai 'ACE -A Settings' 
$arbmdir/settings.xpm -Ai 'ACE' $arbmdir/ace.xpm  -Ai 'ACE -L Run' 
$arbmdir/runner.xpm -Ai 'ACE Terminal' $arbmdir/terminal.xpm -Ai 'ACE -A Alarm' 
$arbmdir/clock.xpm -Ai 'ACE -A Sticky_Note' $arbmdir/sticky.xpm -Ai 'ACE 
Calculator' $arbmdir/calculator.xpm -Ai 'ACE -A Background_Editor' 
$arbmdir/palate.xpm   -Ai 'ACE File_Manager' $arbmdir/folder.xpm -Ai 'ACE -A 
File_System_Panel File_Systems' $arbmdir/disk.xpm -Ai 'ACE Mail' 
$arbmdir/mail.xpm -Ai 'ACE Cal' $arbmdir/calendar.xpm  -Ai 'ACE Load_Meter' 
$arbmdir/meter.xpm   -Ai 'ACE Editor' $arbmdir/text_editor.xpm -Ai 'ACE 
Browser' $arbmdir/www.xpm -Ai 'ACE CD_Player' $arbmdir/music.xpm -Ai 'afract & 
# Fractals' $arbmdir/fractal.xpm -Ai 'pongr & # PONGr' $arbmdir/pong.xpm\\" >> 
/tmp/ACE.$$
+
+    # Get the full screen geometry.
     GEOMETRY=$(xdpyinfo | grep dimensions | awk '{print $2}')
-    echo " -geometry $GEOMETRY -xrm '*marginHeight: 0' -xrm '*marginWidth: 0' 
-xrm '*spacing: 0' -xrm '*XmPushButton.marginWidth: 2'  -xrm 
'AntiRight.borderWidth: 1' -xrm '*overrideRedirect: True' -xrm 
'*shadowThickness: 0' -xrm '*background: $(ACE background)' -xrm '*foreground: 
$(ACE foreground)' -xrm '*borderWidth: 0' -xrm '*borderColor: $(ACE 
background)' -l &" >> /tmp/ACE.$$
+
+    # This ensures that a correctly rendered window is produced, even
+    # if the xdpyinfo binary is not present.
+
+    if [ "$GEOMETRY" = "" ]; then
+       GEOMETRY='+0+0'
+    fi
+
+    echo " -geometry $GEOMETRY -xrm '*marginHeight: 0' -xrm '*marginWidth: 0' 
-xrm '*spacing: 0' -xrm '*XmPushButton.marginWidth: 2'  -xrm 
'AntiRight.borderWidth: 1' -xrm '*overrideRedirect: True' -xrm 
'*shadowThickness: 0' -xrm '*background: $(ACE background)' -xrm '*foreground: 
$(ACE foreground)' -xrm '*borderWidth: 0' -xrm '*borderColor: $(ACE 
background)' -l -xrm '*XmMenuShell*.background: grey64' -xrm 
'*XmMenuShell*.shadowThickness: 1' -xrm '*XmMenuShell*.foreground: white' -xrm 
'*XmMenuShell*.fontList: -*-helvetica-bold-r-*-*-14-*-*-*-*-*-*-*' &" >> 
/tmp/ACE.$$
     chmod +x /tmp/ACE.$$
     /tmp/ACE.$$
-    rm -f /tmp/ACE.$$
+    #rm -f /tmp/ACE.$$
 }
 restart_desktop()
 {
     ACE -A killdesk
     ACE -A Desktop
 }
+killwm()
+{
+    WINDOWMANAGER=$(cat ~/.xinitrc | grep WINDOWMANAGER | cut -d '=' -f 2)
+    if [ "$WINDOWMANAGER" = "" ]; then
+       $ARSHELL -ADm "Please set WINDOWMANGER in ~/.xinitrc."
+    else
+       killall $WINDOWMANAGER
+    fi
+}
+ARI()
+{
+    $ARSHELL 'cd /home/jefbed/src/antiright; make install; arshell -ADm Done; 
echo Install' > /dev/null &
+}
 restart_dialog()
 {
-    $ARSHELL -E\
+    # Get the full screen geometry.
+    GEOMETRY=$(xdpyinfo | grep dimensions | awk '{print $2}')
+    X_DIM=$(xdpyinfo | grep dimensions | awk '{print $2}' | cut -d x -f 1)
+    Y_DIM=$(xdpyinfo | grep dimensions | awk '{print $2}' | cut -d x -f 2)
+    # This ensures that a correctly rendered window is produced, even
+    # if the xdpyinfo binary is not present.
+
+    if [ "$GEOMETRY" = "" ]; then
+       GEOMETRY='+0+0'
+    else
+        GEOMETRY="+$(($X_DIM/2))+$(($Y_DIM/2))"
+    fi
+    #echo $GEOMETRY
+    $ARSHELL -r 2 -E -W Exit?\
        'ACE -A restart_desktop Restart'\
        'ACE -A killdesk Quit'\
        'ACE Lock'\
-       'echo Cancel'
+       'echo Cancel'\
+       -xrm "*fontList: -*-helvetica-bold-r-*-*-25-*-*-*-*-*-*-*"\
+       -xrm "*foreground: white"\
+       -xrm "*background: grey64"\
+       -xrm "*shadowThickness: 1"\
+       -xrm "*transient: True"\
+       -xrm "*overrideRedirect: True"\
+       -geometry $GEOMETRY
+
 }
 return_pseudorandom_color()
 {
@@ -302,7 +347,7 @@
 }
 Message_Dialog()
 {
-    $ARSHELL -ADm "$(echo $1 | tr '_' ' ')" 
+    $ARSHELL -ADm "$(echo $1 | tr '_' ' ')"
 }
 Help_Dialog()
 {
@@ -345,7 +390,7 @@
            mail_or_users="Mail."
        fi
     fi
-    # In order to conserve space, only the 5 minute load is given.  
+    # In order to conserve space, only the 5 minute load is given.
     echo -n\
         ' ' $date_and_time $(uptime | cut -d : -f 4 | cut -d , -f 2)\
        $mail_or_users
@@ -390,11 +435,11 @@
 {
     local xmcd_path="$(which xmcd)"
 
-    # This allows the conditional to work with NetBSD's which command.  
+    # This allows the conditional to work with NetBSD's which command.
     if [ "$(echo $xmcd_path | cut -d ' ' -f 1)" == "no" ]; then
        xmcd_path=""
     fi
-    # Run xmcd if available.  
+    # Run xmcd if available.
     if [ "$xmcd_path" != "" ]; then
        xmcd &
     else
@@ -482,7 +527,6 @@
        'ACE -A Load_Meter'\
            'ACE -A System_Accounting'\
            "xload -bg red4 -fg yellow -hl yellow & # X_Load"
-           
 }
 System_Accounting()
 {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]