关于解决ubuntu中Docky软件断电自动关闭的问题(Linux: Docky Closes After Waking Up From Suspend (Ubuntu 14.04))

本文提供了一种解决Docky在Ubuntu系统从挂起到唤醒过程中自动关闭的方法。通过创建两个脚本文件并设置执行权限,可以确保Docky在系统挂起及电源插拔时正常工作。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

解决办法:

Run following commands to create /etc/pm/sleep.d/20_docky file with root access.  
在终端中使用root权限运行下面的代码创建文件...
$ sudo gedit /etc/pm/sleep.d/20_docky
Copy and paste file contents from box below:
复制黏贴下面的内容到文件中:
#!/bin/sh
case $1 in
resume)
USER=`who | grep ":0" | head -1 | cut -d" " -f1`
USERHOME=/home/$USER
export XAUTHORITY="$USERHOME/.Xauthority"
export DISPLAY=":0"
su $USER --c "dbus-launch /usr/bin/docky >/dev/null" &
exit 0;
;;
esac
And make it executable to solve problem for suspend:

修改权限为可执行:
$ sudo chmod ugo+x /etc/pm/sleep.d/20_docky
Run following commands to create /etc/pm/power.d/20_docky file with root access:
再创建另一个文件:
$ sudo gedit /etc/pm/power.d/20_docky
Copy and paste file contents from box below:
复制黏贴下面内容到里面:
#!/bin/sh
USER=`who | grep ":0" | head -1 | cut -d" " -f1`
USERHOME=/home/$USER
export XAUTHORITY="$USERHOME/.Xauthority"
export DISPLAY=":0"
su $USER --c "dbus-launch /usr/bin/docky >/dev/null" &
exit 0;

And make it executable to solve problem for plug/unplug power cable:
修改权限:
$ sudo chmod ugo+x /etc/pm/power.d/20_docky
 
… and there you go. Fixed!
哦了!

参考:

http://www.ramblgyrl.com/2014/08/linux-docky-closes-after-waking-up-from-suspend-ubuntu-14-04/

http://tieba.baidu.com/p/3118161397

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值