(转)小小的研究了一下linux下的”注册表“ gconf-editor
最近學習linux,剛上手gedit,首先要解決的一定是編碼的問題,總結(jié)一下方法,思路有下:
一.用圖形化界面設(shè)置的方法
運行g(shù)conf-editor,在彈出的對話框中選擇:/apps/gedit-2/preferences/encodings/auto_detected ,雙擊auto_detected后添加一個編碼:GB18030,保存即可。
?
二.用命令行,在終端輸入下面命令即可:
gconftool-2 --set /apps/gedit-2/preferences/encodings/auto_detected --type List --list-type string ["UTF-8","GB2312","CURRENT","ISO-8859-15","UTF-16"]
?
gconftool-2 --set /apps/gedit-2/preferences/encodings/shown_in_menu --type List --list-type string ["GB2312","ISO-8859-15"]
和圖形界面的簡單比較一些舊不難發(fā)現(xiàn)他是怎么工作的
首先是gconftool-2命令,后面是參數(shù) --set,表示要進行設(shè)置,再后面是鍵所在地址/apps/gedit-2/preferences/encodings/auto_detected,再后面是鍵值類型--type List參數(shù),表示他是一個列表,再后面是列表元素類型 --list-type string,表示列表元素是字符串,最后就是自己要設(shè)置的內(nèi)容了,["UTF-8","GB2312","CURRENT","ISO-8859-15","UTF-16"],這是一個列表,其中每一個元素都是字符串,和前面對應(yīng),執(zhí)行后會用["UTF-8","GB2312","CURRENT","ISO-8859-15","UTF-16"]這個列表覆蓋原來的列表,即鍵值
?
【附錄】下面再列舉幾個可能有用的命令:
調(diào)整窗口按鈕:
gconftool-2 --set /apps/metacity/general/button_layout --type string "maximize,minimize,close:menu" gconftool-2 --set /apps/metacity/general/button_layout --type string "menu:minimize,maximize,close"
桌面不顯示已掛載卷圖標:
gconftool-2 --set /apps/nautilus/desktop/volumes_visible --type bool 0
?
標題欄鼠標中鍵卷起窗口:
gconftool-2 --set /apps/gwd/mouse_wheel_action --type string shade
?
桌面顯示“計算機”圖標:
gconftool-2 --set /apps/nautilus/desktop/computer_icon_visible --type bool 1
?
桌面顯示用戶主文件夾圖標:
gconftool-2 --set /apps/nautilus/desktop/home_icon_visible --type bool 1
?
桌面顯示”回收站“圖標:
gconftool-2 --set /apps/nautilus/desktop/trash_icon_visible --type bool 1
?
桌面顯示”網(wǎng)絡(luò)服務(wù)器“圖標?
gconftool-2 --set /apps/nautilus/desktop/network_icon_visible --type bool 1
?
三. 直接修改配置文件
? ?思想:linux下,一切都是文件! 所以修改文件一定能解決問題。
1.用戶級的: ?cd ~【pwd :/root 或者自己創(chuàng)建的任意用戶user1:/user1】之后運行以下命令
1 vi .gconf/apps/gedit-2/preferences/encodings/%gconf.xml
修改方法:
1 <pre class="xml" style="margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-image: initial; vertical-align: baseline; overflow-x: visible; overflow-y: visible; width: auto; line-height: 1.333; font-family: Consolas, monospace, 'Courier New'; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; clear: none; text-align: left; " name="code"><span style="color:#808080;"><em></em></span><pre name="code" class="plain"><!-- 添加或修改,記得包含GBK --> 2 <entry name="auto_detected" mtime="1297330539" type="list" ltype="string"> 3 <li type="string"><stringvalue>UTF-8</stringvalue></li> 4 <li type="string"><stringvalue>GBK</stringvalue></li> 5 <li type="string"><stringvalue>CURRENT</stringvalue></li> 6 <li type="string"><stringvalue>ISO-8859-15</stringvalue></li> 7 <li type="string"><stringvalue>UTF-16</stringvalue></li> 8 </entry></pre><br> 9 <pre></pre> 10 <pre></pre> 11 <p></p> 12 <pre></pre> 13 <pre></pre> 14 <span style="font-size:16px; color:#333333">2.系統(tǒng)全局的:</span> 15 <p></p> 16 <p style="text-align:left"><span style="font-family:Tahoma,Arial,Helvetica,sans-serif; color:#333333"><span style="letter-spacing:2px; line-height:18px"></span></span></p> 17 <pre name="code" class="plain" style="font-size:12px; "> sudo vi /usr/share/gconf/schemas/gedit.schemas 18 </pre><span style="font-size:16px">修改方法:</span> 19 <p></p> 20 <p style="text-align:left"><span style="font-family:Tahoma,Arial,Helvetica,sans-serif; color:#333333"><span style="letter-spacing:2px; line-height:18px"></span></span></p> 21 <pre name="code" class="plain" style="font-size:12px; "><!-- 找到 /schemas/apps/gedit-2/preferences/encodings/auto_detected 22 修改下面的 locale en_US,加上GBK --> 23 <locale name="en_GB"> 24 <default>[UTF-8,GBK,CURRENT,ISO-8859-15,UTF-16]</default> 25 </locale></pre><br> 26 <span style="color:rgb(51,51,51); font-family:Tahoma,Arial,Helvetica,sans-serif; line-height:18px; text-align:left; background-color:rgb(247,247,247)"><span style="font-size:16px">因為我的用戶已經(jīng)存在,用戶級配置已經(jīng)生成,所以需要改用戶級的,(若未生成,那就改全局的吧)</span></span><br> 27 <br> 28 <br> 29 <p></p> 30 <p style="text-align:left"><span style="font-family:Tahoma,Arial,Helvetica,sans-serif; font-size:12px; color:#333333"><span style="letter-spacing:2px; line-height:18px"><br> 31 </span></span></p> 32 <p style="text-align:left"><span style="font-family:Tahoma,Arial,Helvetica,sans-serif; font-size:12px; color:#333333"><span style="letter-spacing:2px; line-height:18px"><br> 33 </span></span></p> 34 <p style="text-align:left"><span style="font-family:Tahoma,Arial,Helvetica,sans-serif; font-size:12px; color:#333333"><span style="letter-spacing:2px; line-height:18px"><br> 35 </span></span></p> 36 <p style="text-align:left"><span style="font-family:Tahoma,Arial,Helvetica,sans-serif; font-size:12px; color:#333333"><span style="letter-spacing:2px; line-height:18px"><br> 37 </span></span></p> 38 <p style="text-align:left"><span style="font-family:Tahoma,Arial,Helvetica,sans-serif; font-size:12px; color:#333333"><span style="letter-spacing:2px; line-height:18px"><br> 39 </span></span></p> 40 41 </pre>
?
轉(zhuǎn)載于:https://www.cnblogs.com/habibah-chang/p/3875134.html
總結(jié)
以上是生活随笔為你收集整理的(转)小小的研究了一下linux下的”注册表“ gconf-editor的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 为什么宽景到家的隐形纱窗价格比普通纱窗贵
- 下一篇: 三维bfs