2013年12月27日 星期五

讓 Lubuntu 12.10 / 13.04 / 13.10 以後消失的 截屏 快速鍵 重現

不知道怎麼搞得Lubuntu 據說再 12.10 以後就把這個 截屏 的快速鍵給取消了!
奇怪的是我再使用 Lubuntu 12.10 / 13.04 的時候好像都沒有發現這個問題
直到最近禿驢我再有需要的時候徒然發現這個好用的功能不見了!
查尋了一下 Google 大神 後發現原來我印象中的這個好用的功能已經消失了一年了!

無奈之下只好手動把這個功能給安裝上去

其實 Lubuntu 的 截屏 程序 其實是調用 gnome-screenshot 這個程式的
可是就在不知情的情況下 Lubnutu 預設就不給他安裝上去,可是就算你已經安裝上去卻仍得使用GUI的介面下去操作!似乎Lubuntu 沒有把這程式歸類連結!

首先我們得先把 gnome-screenshot 給安裝進去

sudo apt-get install gnome-screenshot

接著我們得修改一下 ~/.config/openbox/lubuntu-rc.xml

sudo gedit ~/.config/openbox/lubuntu-rc.xml

找到 
<!-- Launch scrot when Print is pressed -->
<keybind key="Print">
  <action name="Execute">
    <command>....</command>
  </action>
</keybind>  

將他修改成
<!-- Launch scrot when Print is pressed -->
<keybind key="Print">
  <action name="Execute">
    <command>gnome-screenshot -b  ~/%Y:%m:%d:%H:%M:%S.png</command>
  </action>
</keybind>  
如此這般當你按下 Prnt Scrn 就會馬上將現在的整個畫面不包含滑鼠儲存再你的圖片資料夾中

接著當然是我們關心的 Alt+Prnt Scrn  的部份囉

找到

<!-- Take a screenshot of the current window with scrot when Alt+Print are pressed -->
    <keybind key="A-Print">
      <action name="Execute">
       <command>....</command>
      </action>
    </keybind> 


<!-- Take a screenshot of the current window with scrot when Alt+Print are pressed -->
    <keybind key="A-Print">
      <action name="Execute">
        <command>gnome-screenshot -w  ~/%Y:%m:%d:%H:%M:%S.png</command>
      </action>
    </keybind>

如此這般當你按下 Alt+Prnt Scrn  就會馬上將現在的工作視窗畫面不包含滑鼠儲存再你的圖片資料夾中

不過如此一來您得重新開機後才能使用,如果不想重新開機或者重新開機後仍有問題
哪我們得要重置一下 Lubuntu 的 openbox 環境參數強制讓他以我們修改後的lubuntu-rc.xml
指定的按鍵為準

再終端機中輸入以下指令

openbox --reconfigure

如此一來我們奢望的快速截屏功能就重現了

順便介紹一下 gnome-screenshot 相關的參數


gnome-screenshot [選項…] 拍下整個螢幕

說明選項:
  -h, --help                   顯示說明的選項
  --help-all                   顯示所有的說明選項
  --help-gtk                   顯示 GTK+ 選項

應用程式選項:
  -c, --clipboard              將擷圖直接傳送至剪貼簿
  -w, --window                 擷取單一視窗而不是整個畫面
  -a, --area                   擷取畫面的一個區域而不是全螢幕
  -b, --include-border         螢幕擷圖包含視窗邊框
  -B, --remove-border          自螢幕擷圖移除視窗邊框
  -p, --include-pointer        螢幕擷圖包含滑鼠指標
  -d, --delay=秒後             在指定的時間後(秒)拍攝螢幕擷圖
  -e, --border-effect=效果     加到視窗邊框的效果(陰影、邊框或沒有)
  -i, --interactive            互動設定選項
  -f, --file=檔案名稱          螢幕擷圖直接儲存到這個檔案

  --display=畫面               使用的 X 畫面


沒有留言:

張貼留言