Ubuntu 16.04键盘快捷键Alt + F4获取挂起/关机/重启菜单?


1

我想设置条件键盘快捷键(Alt + F4),只有在桌面具有焦点时按下它才会显示暂停/关闭/重启菜单,否则只需关闭活动窗口。

谢谢

Answers:


0

我在Ubuntu MATE上使用这个脚本,它使用caja作为文件管理器。

   #!/bin/bash

   activewindowname=$(xdotool getwindowfocus getwindowname)
   if [ "$activewindowname" == "x-caja-desktop" ]; then
     gnome-session-quit --power-off
   else
     xdotool windowclose `xdotool getactivewindow`
   fi

复制此代码,将其另存为脚本并为Alt + F4创建自定义快捷方式

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.