2014年5月18日

ubuntu14.04關機

在13.04時可以使用dconf組態編輯器來調,在ubuntu 14.04卻不見了,找了好久,都找不到解決方法,今天查了一些資料,記錄一下:
首先確認indicator-session已經安裝好了

再來使用指令模式來啟用,這個指令不需進入總管模式
gsettings set com.canonical.indicator.session  suppress-logout-restart-shutdown true
這樣就可以快速關機(按下設定/關機)少一個動作。
在ubuntu 16.04這樣還不行,加上
sudo vim  /etc/acpi/events/powerbtn
加上一條
action=/sbin/poweroff
 儲存後執行
sudo acpid restart

如果圖形介面可以的話是要調整下圖。


2014年5月15日

nautilus-open-as-root ubuntu 14.04

在ubuntu 14.04中又找不到nautilus-open-as-root套件,想把它裝起來,找到做法,記錄一下
1.在使用者的家目錄
$cd ~/.local/share/nautilus/scripts
$touch open-as-root
$chmod 755 open-as-root
$vim open-as-root
加入以下內容

#!/bin/bash
#
# this code will determine exactly the path and the type of object,
# then it will decide use gedit or nautilus to open it by ROOT permission
#
# Determine the path
if [ -e -n $1 ]; then
obj="$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS"
else
base="`echo $NAUTILUS_SCRIPT_CURRENT_URI | cut -d'/' -f3- | sed 's/%20/ /g'`"
obj="$base/${1##*/}"
fi
# Determine the type and run as ROOT
if [ -f "$obj" ]; then
gksu gedit "$obj"
elif [ -d "$obj" ]; then
gksu nautilus "$obj"
fi
exit 0

另一做法(事實上做法差不多)

2014年5月8日

scratch2轉sb sb2轉exe

看到人家分享,記一下好查詢
可以把sb2轉sb
sb2轉exe

http://wiki.scratch.mit.edu/wiki/Porting_Scratch_Projects

sb2 轉 sb
把sb2上傳到下列網站即可
http://kurt.herokuapp.com/20to14

sb2轉exe
先下載程式(不好載,要有耐心)
http://pan.baidu.com/s/1pJLhOdd

sb轉app
安裝BYOB
http://wiki.scratch.mit.edu/wiki/Build_Your_Own_Blocks_%28BYOB%29_%28Scratch_Modification%29

scratch2語言

scrtach2每次出來都要按地球,選語言才能變成中文,有點煩,找了很多文件,也沒看到,於是到檔案中亂翻

在/opt/Scratch 2/share/locale資料夾中有一個lang_list.txt檔案

可以把其他語言都刪掉,剩下zh_TW,正體中文,這樣進去後只剩下英文和中文兩個選項,不會很長不好選,沒達成目標,但有好一點。記錄一下。
附註:英文去不掉,預設會有,把locale資料夾刪掉,就剩下英文了。