![]() The workaround is to become root and execute the chmod command. NOTE: For some reason on Ubuntu 9.04 the above command will not work, the file will not be made executable. KERNEL="dock.0", ATTR="0", RUN+="/etc/thinkpad/dock.sh 0"ĭOCKED=$(cat /sys/devices/platform/dock.0/docked) Note: For Ubuntu 9.10 and 10.04 you need to do this slightly different as explained in post 20 (). Thanks to Steven King on pointing me how to go about this Make sure you have libpurple-bin installed - sudo apt-get install libpurple-bin The sounds used are from OpenOffice 3.0, the path changes for previous versions. Make sure that the gnome power management option for laptop lid closed is set to do nothing. Now you can test that it works by opening and closing your laptop lid. #This runs so that root can run the following command under the user's environmentĭISPLAY=:0.0 su your_user -c "aplay /usr/lib/openoffice/basis3.0/share/gallery/sounds/sparcle.wav"ĭISPLAY=:0.0 su your_user -c "purple-remote 'setstatus?status=available&message=I am here.'"ĭISPLAY=:0.0 su your_user -c "aplay /usr/lib/openoffice/basis3.0/share/gallery/sounds/falling.wav"ĭISPLAY=:0.0 su your_user -c "purple-remote 'setstatus?status=away&message=My laptop lid is closed.'" Grep -q closed /proc/acpi/button/lid/LID/stateĪnd finally lets create the files open and close. Now create the file that will call different scripts according to open or close events. So run:Īnd right after line #!/bin/bash paste /home/your_user/lid_event ![]() There is a file /etc/acpi/lid.sh which runs every time your lid open or closes. Ubuntu makes it easy to catch the laptop lid open and close events. This will execute every time you start your computer and the call to source ~/.Xdbus loads the DBUS_SESSION_BUS_ADDRESS and XAUTHORITY environment variables before executing the purple-remote command for Pidgin. System -> Preferences -> Sessions and click Add. # Export XAUTHORITY value on startup so it can be used by cron # Export the dbus session address on startup so it can be used by any other environmentĮnv | grep DBUS_SESSION_BUS_ADDRESS > $HOME/.XdbusĮcho 'export DBUS_SESSION_BUS_ADDRESS' > $HOME/.Xdbus In order to make the environment variables available for root: Many thanks to Earl Ruby for pointing me on how to do this So we need to do a little hack so that root can run commands on our user's X environment. ![]() It is important to understand that these events will be catched by processes owned by root. ***I am not responsible if you mess things up, please be careful!*** The script part works fine, the dock part needs a slight change, see post 48 () for details. 14/04/10: Tested this on a Thikpad W500 with Ubuntu 9.10. 27/02/10: If you want to implement the lid solution on a laptop with multiple users then look at posts 32, 33 () and 40 () from airtonix. Make sure throughout the tutorial you change your_user with your actual user on the scripts and also feel free to save scripts on different paths updating the paths on the scripts of course. 20/07/09: I just tested this on a T61p with Ubuntu 9.04 and it work fine, there is one minor thing to look, stated below. This tutorial is just to point people towards the right solution. Things might slightly change depending on the laptop or linux distribution. This was tested on a Lenovo Thinkpad T61 and a T61p both running Ubuntu 8.10. When I dock my laptop into the docking station -> play a "docked" sound When I undock my laptop from the docking station -> play a "undock" sound When the lid is opened -> play an "opening" sound and set my Pidgin status to available with a message saying "I am here." When the lid closes -> play a "closing" sound and set my Pidgin status to away with a message saying "My laptop lid is closed." I will show a specific example which consist in: How to run a script for each of those events. How to catch the laptop dock and undock events.ģ. How to catch the lid open and close events.Ģ. I tried the same thing with a second Ubuntu 22.04 host and get the same thing.1. I get similar behaviour if I disable Remote Desktop in the Sharing settings. If I select Xvnc and some credentials then I get a blank green screen. If I click Ok the it takes me back to the login dialog. Sending login info to session manager, please wait. If I leave the credentials blank I get an Ok dialog with this message: Connecting to sesman ip 127.0.0.1 port 3350 Selecting Xorg and some login credentials causes the window to close. the standard mstsc.exe client) on Windows and connect to the IP address of the Ubuntu server, I get this login dialog: I've enabled Remote Desktop in the (Ubuntu) Sharing Settings, however when I run the Remote Desktop client (i.e. I'm trying to get the Remote Desktop feature working on Ubuntu (Desktop) 22.04, but I can't seem to connect to my Ubuntu desktop from a Windows (10) PC.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |