list some different ways, but need to verify by yourself carefully.
1. silly way....killall nm-applet
2. /etc/acpi/wireless.sh
3. script file by Paul Liu
For old/new version (remark lines are for old version)
#!/bin/sh
#dbus-send --system --type=method_call \
# --dest=org.freedesktop.NetworkManager \
# /org/freedesktop/NetworkManager \
# org.freedesktop.NetworkManager.setWirelessEnabled \
# boolean:false
#dbus-send --system --print-reply --type=method_call \
# --dest=org.freedesktop.NetworkManager \
# /org/freedesktop/NetworkManager \
# org.freedesktop.NetworkManager.getWirelessEnabled
STAT=`dbus-send --system --print-reply --type=method_call \
--dest=org.freedesktop.NetworkManager \
/org/freedesktop/NetworkManager \
org.freedesktop.DBus.Properties.Get \
string:org.freedesktop.NetworkManager \
string:WirelessEnabled | grep variant | awk '{ print $3 }'`
case "$STAT" in
true)
NEWSTAT="false"
;;
*)
NEWSTAT="true"
;;
esac
dbus-send --system --type=method_call \
--dest=org.freedesktop.NetworkManager \
/org/freedesktop/NetworkManager \
org.freedesktop.DBus.Properties.Set \
string:org.freedesktop.NetworkManager \
string:WirelessEnabled variant:boolean:$NEWSTAT
星期一, 6月 15, 2009
星期四, 6月 11, 2009
how to build a debian package (.deb)
need some packages first
dh-make
build-essential
devscripts
pbuilder
cdbs
00 change the changelog and control file to be your own files, it will be authorize through internet.
1. create a test folder
2. in test folder create a project-version folder (like abc-1.1)
3. in abc-1.1 folder, exec "dh_make native" and select "s" option
4. then we have "debian" folder there, inside has example files
** replace some files **
5. in abc-1.1 folder, create etc/pm/config.d/unload file
6. in debian folder, create a file named "install"
7. add "etc/pm/config.d/unload /etc/pm/config.d" in replace file.
*** script file ***
8. add your script into postinst file (you can remove all *.ex file, only left one for modifying.)
9. script better includes #!/bin/bash
10. back to abc-1.1 folder, and run "debuild -i -I -sa" or try this "debuild -us -uc -b"
list some example files.
changelog:
minix-config (1.1) jaunty; urgency=low
* update for ppa
-- Juergen Chiu Thu, 11 Jun 2009 10:38:49 +0000
postinst:
#!/bin/sh
set -e
#Sound
amixer sset "Input Source" "Front Mic"
amixer -q set "Front Mic" 0% unmute
amixer -q set "Front Mic Boost" 10% unmute
amixer -q set "Capture" 100% unmute
#DEBHELPER#
rules:
#!/usr/bin/make -f
include /usr/share/cdbs/1/rules/debhelper.mk
binary-install/minix-config::
install -d $(CURDIR)/debian/minix-config/etc/pm/config.d/
install -m 644 $(CURDIR)/etc/pm/config.d/10minix_module $(CURDIR)/debian/minix-config/etc/pm/config.d/
binary-fixup/minix-config::
dh_gconf --priority=16
dh-make
build-essential
devscripts
pbuilder
cdbs
00 change the changelog and control file to be your own files, it will be authorize through internet.
1. create a test folder
2. in test folder create a project-version folder (like abc-1.1)
3. in abc-1.1 folder, exec "dh_make native" and select "s" option
4. then we have "debian" folder there, inside has example files
** replace some files **
5. in abc-1.1 folder, create etc/pm/config.d/unload file
6. in debian folder, create a file named "install"
7. add "etc/pm/config.d/unload /etc/pm/config.d" in replace file.
*** script file ***
8. add your script into postinst file (you can remove all *.ex file, only left one for modifying.)
9. script better includes #!/bin/bash
10. back to abc-1.1 folder, and run "debuild -i -I -sa" or try this "debuild -us -uc -b"
list some example files.
changelog:
minix-config (1.1) jaunty; urgency=low
* update for ppa
-- Juergen Chiu
postinst:
#!/bin/sh
set -e
#Sound
amixer sset "Input Source" "Front Mic"
amixer -q set "Front Mic" 0% unmute
amixer -q set "Front Mic Boost" 10% unmute
amixer -q set "Capture" 100% unmute
#DEBHELPER#
rules:
#!/usr/bin/make -f
include /usr/share/cdbs/1/rules/debhelper.mk
binary-install/minix-config::
install -d $(CURDIR)/debian/minix-config/etc/pm/config.d/
install -m 644 $(CURDIR)/etc/pm/config.d/10minix_module $(CURDIR)/debian/minix-config/etc/pm/config.d/
binary-fixup/minix-config::
dh_gconf --priority=16
訂閱:
文章 (Atom)