SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2012-05-25 16:06:14

hias
Member
From: Monaco di Baviera
Registered: 2011-01-11
Posts: 13

CrunchBang repository in Debian - apt pinning

Hello,

I hope I can describe what I intend to do with my poor englisch...

I'm running a normal Debian Wheezy install with openbox, a bit inspired by #!, but with default debian sources. The only thing I really miss is the shutdown/reboot/standby dialog in #! provided by the cb-exit package (in Waldorf).

So I thought about adding the #! Waldorf repo to my sources.list and install just the cb-exit package and look what happens (it's not my main system !). But I don't want to get all the other packages from the #! Waldorf repo and stick on the default Debian sources.

So I tried apt-pinning, created a /etc/apt/preferences.d/pinning file:

Package: *
Pin: origin deb http://packages.crunchbanglinux.org/waldorf/ waldorf main
Pin-Priority: 1

Is this pinning file correct ?
Is it possible to add the shutdown/reboot/standby dialog by just installing cb-exit (and dependencies) to a default Debian system with Openbox ?

Thanks Hias

Last edited by hias (2012-05-25 16:07:36)


Desktop:     Ubuntu 12.04 (Gnome-Shell)
Notebooks: Toshiba Satellite Pro A 10 - #!-Waldorf,
                   Thinkpad X60s - Debian Wheezy (Gnome)

Offline

Help fund CrunchBang, donate to the project!

#2 2012-05-25 16:09:41

machinebacon
#! unstable
From: PRC
Registered: 2009-07-02
Posts: 6,212
Website

Re: CrunchBang repository in Debian - apt pinning

Hello,

I think you can make it a tad easier:

#!/usr/bin/env python

import pygtk
pygtk.require('2.0')
import gtk
import os
import getpass

class cb_exit:
    def disable_buttons(self):
        self.cancel.set_sensitive(False)
        self.logout.set_sensitive(False)
        self.suspend.set_sensitive(False)
        self.reboot.set_sensitive(False)
        self.shutdown.set_sensitive(False)

    def cancel_action(self,btn):
        self.disable_buttons()
        gtk.main_quit()

    def logout_action(self,btn):
        self.disable_buttons()
        self.status.set_label("Exiting Openbox, please standby...")
        os.system("openbox --exit")

    def suspend_action(self,btn):
        self.disable_buttons()
        self.status.set_label("Suspending, please standby...")
        os.system("cb-lock")
        os.system("dbus-send --system --print-reply --dest=\"org.freedesktop.UPower\" /org/freedesktop/UPower org.freedesktop.UPower.Suspend")
        gtk.main_quit()

    def reboot_action(self,btn):
        self.disable_buttons()
        self.status.set_label("Rebooting, please standby...")
        os.system("dbus-send --system --print-reply --dest=\"org.freedesktop.ConsoleKit\" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart")

    def shutdown_action(self,btn):
        self.disable_buttons()
        self.status.set_label("Shutting down, please standby...")
        os.system("dbus-send --system --print-reply --dest=\"org.freedesktop.ConsoleKit\" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop")

    def create_window(self):
        self.window = gtk.Window()
        title = "Log out " + getpass.getuser() + "? Choose an option:"
        self.window.set_title(title)
        self.window.set_border_width(5)
        self.window.set_size_request(500, 80)
        self.window.set_resizable(False)
        self.window.set_keep_above(True)
        self.window.stick
        self.window.set_position(1)
        self.window.connect("delete_event", gtk.main_quit)
        windowicon = self.window.render_icon(gtk.STOCK_QUIT, gtk.ICON_SIZE_MENU)
        self.window.set_icon(windowicon)

        
        #Create HBox for buttons
        self.button_box = gtk.HBox()
        self.button_box.show()
        
        #Cancel button
        self.cancel = gtk.Button(stock = gtk.STOCK_CANCEL)
        self.cancel.set_border_width(4)
        self.cancel.connect("clicked", self.cancel_action)
        self.button_box.pack_start(self.cancel)
        self.cancel.show()
        
        #Logout button
        self.logout = gtk.Button("_Log out")
        self.logout.set_border_width(4)
        self.logout.connect("clicked", self.logout_action)
        self.button_box.pack_start(self.logout)
        self.logout.show()
        
        #Suspend button
        self.suspend = gtk.Button("_Suspend")
        self.suspend.set_border_width(4)
        self.suspend.connect("clicked", self.suspend_action)
        self.button_box.pack_start(self.suspend)
        self.suspend.show()
        
        #Reboot button
        self.reboot = gtk.Button("_Reboot")
        self.reboot.set_border_width(4)
        self.reboot.connect("clicked", self.reboot_action)
        self.button_box.pack_start(self.reboot)
        self.reboot.show()
        
        #Shutdown button
        self.shutdown = gtk.Button("_Power off")
        self.shutdown.set_border_width(4)
        self.shutdown.connect("clicked", self.shutdown_action)
        self.button_box.pack_start(self.shutdown)
        self.shutdown.show()
        
        #Create HBox for status label
        self.label_box = gtk.HBox()
        self.label_box.show()
        self.status = gtk.Label()
        self.status.show()
        self.label_box.pack_start(self.status)
        
        #Create VBox and pack the above HBox's
        self.vbox = gtk.VBox()
        self.vbox.pack_start(self.button_box)
        self.vbox.pack_start(self.label_box)
        self.vbox.show()
        
        self.window.add(self.vbox)
        self.window.show()
        
    def __init__(self):
        self.create_window()


def main():
    gtk.main()

if __name__ == "__main__":
    go = cb_exit()
    main()

That's the cb-exit file, save it as /usr/bin/cb-exit


Start Distrohopping here! -> Break your own... cool  VSIDO  cool LinuxCNC  kiss Frugalware <- It's all just a kernel.

Offline

#3 2012-05-28 22:46:04

hias
Member
From: Monaco di Baviera
Registered: 2011-01-11
Posts: 13

Re: CrunchBang repository in Debian - apt pinning

Hi machinebacon,

thanks a lot, seems to work.

By the way, the pinning file is incorrect, the line

deb http://packages.crunchbanglinux.org/waldorf/ waldorf main

must contain a mistake, because apt is complaining about it. Have to look into the VM on the Xubuntu system, but tonight I rather go to bed.

Thanks Hias


Desktop:     Ubuntu 12.04 (Gnome-Shell)
Notebooks: Toshiba Satellite Pro A 10 - #!-Waldorf,
                   Thinkpad X60s - Debian Wheezy (Gnome)

Offline

#4 2012-05-29 02:48:50

hhh
Caught in the Vortex
From: Port Salerno
Registered: 2010-08-04
Posts: 1,479

Re: CrunchBang repository in Debian - apt pinning

@hias, maybe it's the last slash? On other forum posts I've seen it as...

deb http://packages.crunchbang.org/waldorf waldorf main

Offline

#5 2012-05-29 09:18:40

ivanovnegro
Ivan #000000
Registered: 2011-06-02
Posts: 5,259

Re: CrunchBang repository in Debian - apt pinning

^ Yes, it's

crunchbang.org

and not crunchbanglinux.org

Offline

#6 2012-05-29 16:56:54

hhh
Caught in the Vortex
From: Port Salerno
Registered: 2010-08-04
Posts: 1,479

Re: CrunchBang repository in Debian - apt pinning

Boy, I saw the slash but missed that? tongue

Offline

#7 2012-05-29 17:15:20

pvsage
Internal Affairs
From: North Carolina
Registered: 2009-10-18
Posts: 8,982

Re: CrunchBang repository in Debian - apt pinning

^ ...not the only one that missed it...


while ( ! ( succeed = try() ) );
We've earned a reputation as a nice, friendly community; please help us keep it that way.

Offline

#8 2012-05-29 18:47:30

hias
Member
From: Monaco di Baviera
Registered: 2011-01-11
Posts: 13

Re: CrunchBang repository in Debian - apt pinning

You are so right... roll

For me the topic is solved, thanks a lot.

Hias


Desktop:     Ubuntu 12.04 (Gnome-Shell)
Notebooks: Toshiba Satellite Pro A 10 - #!-Waldorf,
                   Thinkpad X60s - Debian Wheezy (Gnome)

Offline

#9 2012-05-29 19:02:09

ivanovnegro
Ivan #000000
Registered: 2011-06-02
Posts: 5,259

Re: CrunchBang repository in Debian - apt pinning

^ Then mark it as such. wink

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo