Posts: 146
Eperbab
Joined: 10 Dec 2012
#1
Hello,

After installing some packages, the /usr/local/bin/exitantix.sh script doesn't work anymore. I'm tracking Debian testing.
When I'm running the script in terminal, I get this error message:"Attempt to unlock mutex that was not locked".

This issue seems to be related to a change in glib:
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://forums.debian.net/viewtopic.php?f=6&t=117788"
linktext was:"http://forums.debian.net/viewtopic.php?f=6&t=117788"
====================================


SpaceFM, and other packages may be also effected. Should I downgrade libglib2.0-0 to 2.40, or do something else?
anticapitalista
Posts: 5,955
Site Admin
Joined: 11 Sep 2007
#2
You will have to wait until it is properly fixed in Debian.

You can safely install spacefm and gtkdialog from antiC testing repo
Posts: 850
fatmac
Joined: 26 Jul 2012
#3
I think 'anti' just mistyped, & antiC should be antiX. __{{emoticon}}__
Posts: 1,062
Dave
Joined: 20 Jan 2010
#4
Here is the code for the newer session exit scripts.
GUI (named desktop-session-exit) from 14 A3

Code: Select all

#!/usr/bin/env python

import gtk
import gettext
import os
import sys
#Variables
ButtonWidth = 150
ButtonHeight = 120
ICONS ="/usr/share/icons/antiX-1"
#End

class mainWindow():
    def build_button_box(self,image,text):
       #Taken from lagopus's antixcc.py script from START marker line to END marker line,
       #slightly modified to meet needs of this script
       # START #######################################
        self.button_box = gtk.HBox(False, 2)
        self.button_box.set_spacing(8)
        button_label = gtk.Label(_(text))

        pixbuf = gtk.gdk.pixbuf_new_from_file(image)
        button_icon = gtk.Image()
        button_icon.set_from_pixbuf(pixbuf)
                
        button_icon.set_size_request(-1, 60)
        self.button_box.pack_start(button_icon, False)
        self.button_box.pack_start(button_label, False)

        # needed, otherwise even calling show_all on the notebook won't
        # make the hbox contents appear.
        self.button_box.show_all()
        # END #######################################
    
    def button_clicked(self, widget, command):
        os.system(command)
        sys.exit()
    
    def build_button(self,image,text,command,side):
        self.build_button_box(image,text)
        Button = gtk.Button()
        Button.add(self.button_box)
        Button.connect("clicked", self.button_clicked, command)
        #Button.set_size_request(ButtonWidth, ButtonHeight)
        if side =="left":
            self.leftbox.pack_start(Button,  expand=True, fill=True, padding=0)
        elif side =="right":
            self.rightbox.pack_start(Button,  expand=True, fill=True, padding=0)
        else:
            self.mainbox.pack_start(Button,  expand=True, fill=True, padding=0)
        Button.show()

    def __init__(self):
        window = gtk.Window(gtk.WINDOW_TOPLEVEL)
        window.set_title("Exit Session")
        window.connect("destroy", lambda w: gtk.main_quit())
        window.set_position(gtk.WIN_POS_CENTER)
        window.set_default_size(400,0)
        
        self.mainbox = gtk.VBox()
        window.add(self.mainbox)
        self.mainbox.show()
        
        self.packbox = gtk.HBox()
        self.mainbox.pack_start(self.packbox)
        self.packbox.show()
        
        self.leftbox = gtk.VBox()
        self.packbox.pack_start(self.leftbox)
        self.leftbox.show()
        
        self.rightbox = gtk.VBox()
        self.packbox.pack_start(self.rightbox)
        self.rightbox.show()

        self.build_button(ICONS+"/lock.svg","Lock Screen","desktop-session-exit.sh -L","left")
        self.build_button(ICONS+"/hibernate.svg","Hibernate","desktop-session-exit.sh -h","left")
        self.build_button(ICONS+"/reboot.svg","Reboot","desktop-session-exit.sh -r","left")
        
        self.build_button(ICONS+"/logout.svg","Log Out","desktop-session-exit.sh -l","right")
        self.build_button(ICONS+"/suspend.svg","Suspend","desktop-session-exit.sh -S","right")
        self.build_button(ICONS+"/shutdown.svg","Shutdown","desktop-session-exit.sh -s","right")
        
        self.build_button(ICONS+"/upgrade.svg","Restart Session","desktop-session-exit.sh -R","main") 
        
        window.show()

gettext.install(domain ="desktop-session-exit", unicode   = False, codeset   = 'utf-8')
mainWindow()
gtk.main()
copy and save in a file (name it what you wish)

And the backend for the GUI

Code: Select all

#!/bin/bash
#exit  antix bash backend

help() {
    echo"Usage:"
    echo"-l | --logout     Logout of the current session";
    echo"-L | --lock       Lock the current session";
    echo"-h | --hibernate  Set the machine into hibernate";
    echo"-s | --shutdown   Shutdown your machine";
    echo"-S | --suspend    Set the machine into suspend";
    echo"-r | --reboot     Reboot your machine";
    echo"-R | --restart    Restart the session";
    }

case $1 in
-l|--logout)
    desktop-session-logout
    ;;
-L|--lock)
    xlock
    ;;
-h|--hibernate)
    dbus-send --system --print-reply --dest="org.freedesktop.UPower" /org/freedesktop/UPower org.freedesktop.UPower.Hibernate
    ;;
-s|--shutdown)
    if which persist-config &> /dev/null; then
        sudo persist-config --shutdown --command poweroff
    else
        sudo poweroff
    fi
    ;;
-S|--suspend)
    dbus-send --system --print-reply --dest="org.freedesktop.UPower" /org/freedesktop/UPower org.freedesktop.UPower.Suspend
    ;;
-r|--reboot)
    if which persist-config &> /dev/null; then
        sudo persist-config --shutdown --command reboot
    else
        sudo reboot
    fi
    ;;
-R|--Restart)
    desktop-session-restart
    ;;
*)
    echo"$1 Not an option"
    help;
    ;;
esac
Save it as desktop-session-exit.sh, then change whatever you need for the various actions. ( this will probably be the same as exitantix.sh )
Place both scripts in /usr/local/bin
chmod both to chmod 755
run the gui in place of exitantix.sh