Tutorials/Modify KDE Software Defaults/zh-tw: Difference between revisions

From KDE Wiki Sandbox
m (Created page with "教學/修改 KDE 默認設定")
 
(Updating to match new version of source page)
 
(6 intermediate revisions by one other user not shown)
Line 1: Line 1:
<languages />
<languages />


There are 3 basic scenarios when you want to modify default settings:
有3種基本情況時,您需要修改預設值:
* You are system administrator and get a dozen new users every day. You want the new users to have certain settings that are not default for a KDE Plasma Desktop
* 您是系統管理員,每天增加12個新用戶。 你希望新用戶擁有相同的設定但KDE Plasma桌面的預設值不符合
* You are system administrator and want to change the desktop or system settings of all your users. Logging in as each user and do the changes in [[Special:myLanguage/System_Settings|System Settings]] is not an option.
* 您是系統管理員,需要修改所有用戶的桌面或系統設定。 登入為該用戶再用[[Special:myLanguage/System_Settings|系統設定]]修改並不是一種好選擇。
* You have several KDE desktop machines: maybe a computer at work behind a proxy, a machine at home and some virtual machines for testing. You re-setup computers frequently and want your settings to be rolled out identically afterwards
* 你有幾台KDE 桌面的機器,也許在工作中的電腦在proxy內,一台在家裡和一些進行測試的虛擬機。您要頻繁地重新安裝電腦,希望您的設定將再次套用。


In any case you will have to make changes to the setting files in ~/.kde or ~/.kde4 or /usr/local/share or /usr/share.
不管怎樣,你都是要改 ~/.kde ~/.kde4 /usr/local/share /usr/share的設定檔案。


== /etc/skel ==
== /etc/skel ==
When a new user is created, the content from /etc/skel is copied to his home directory. If you want to change the settings for all future users, just change the files in /etc/skel.
 
當創建一個新的用戶時複製 /etc/skel目錄的內容到他的家目錄。如果今後您要想修改所有用戶的設定,只需要修改/etc/skel目錄中的檔案。


== Examples ==
== Examples ==
To change the default browser, use the program [[Special:myLanguage/System_Settings|System Settings]]. However, there are situations where you cannot call '''systemsettings'''. In this case you can use the following script. It changes the default browser to Firefox:
To change the default browser, use the program [[Special:myLanguage/System_Settings|System Settings]]. However, there are situations where you cannot call '''kcmshell5''' to open System Settings. In this case you can use the following script. It changes the default browser to Firefox:


{{Input|1=<nowiki>#!/bin/bash
{{Input|1=<nowiki>#!/bin/bash
Line 20: Line 21:
# The key for default browser is BrowserApplication.
# The key for default browser is BrowserApplication.
cd
cd
cd .kde4/share/config
cd .kde/share/config
# first delete all the old entries for BrowserApplication
# first delete all the old entries for BrowserApplication
sed -i 's/BrowserApplication\[\$e\]=.*//g' kdeglobals
sed -i 's/BrowserApplication\[\$e\]=.*//g' kdeglobals
Line 28: Line 29:
grep "\[General\]" kdeglobals || echo -e "\n[General]\nBrowserApplication[\$e]=!firefox" >> kdeglobals</nowiki>}}
grep "\[General\]" kdeglobals || echo -e "\n[General]\nBrowserApplication[\$e]=!firefox" >> kdeglobals</nowiki>}}


[[Category:Tutorials]]
[[Category:教學/zh-tw]]
[[Category:System]]
[[Category:系統/zh-tw]]
[[Category:Advanced Users]]
[[Category:高階用戶/zh-tw]]

Latest revision as of 12:20, 26 March 2017

有3種基本情況時,您需要修改預設值:

  • 您是系統管理員,每天增加12個新用戶。 你希望新用戶擁有相同的設定但KDE Plasma桌面的預設值不符合
  • 您是系統管理員,需要修改所有用戶的桌面或系統設定。 登入為該用戶再用系統設定修改並不是一種好選擇。
  • 你有幾台KDE 桌面的機器,也許在工作中的電腦在proxy內,一台在家裡和一些進行測試的虛擬機。您要頻繁地重新安裝電腦,希望您的設定將再次套用。

不管怎樣,你都是要改 ~/.kde 或 ~/.kde4 或 /usr/local/share 或 /usr/share的設定檔案。

/etc/skel

當創建一個新的用戶時複製 /etc/skel目錄的內容到他的家目錄。如果今後您要想修改所有用戶的設定,只需要修改/etc/skel目錄中的檔案。

Examples

To change the default browser, use the program System Settings. However, there are situations where you cannot call kcmshell5 to open System Settings. In this case you can use the following script. It changes the default browser to Firefox:

#!/bin/bash
# This file sets up a computer as tstaerk likes it. Call it after you have performed the OS installation.
# 1. set default browser to firefox # 1.1. for SUSE Linux, where we have to look in .kde4 instead of .kde # The key for default browser is BrowserApplication. cd cd .kde/share/config # first delete all the old entries for BrowserApplication sed -i 's/BrowserApplication\[\$e\]=.*//g' kdeglobals # add BrowserApplication to the General section if a General section exists sed -i 's/\[General\]/\[General\]\nBrowserApplication\[\$e\]=!firefox/g' kdeglobals # add a General section and the key BrowerserApplication if no General section exists grep "\[General\]" kdeglobals || echo -e "\n[General]\nBrowserApplication[\$e]=!firefox" >> kdeglobals