Tutorials/Modify KDE Software Defaults: Difference between revisions

From KDE Wiki Sandbox
No edit summary
(Use .kde in stead of .kde4 for system settings)
 
(13 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Template:I18n/Language Navigation Bar|Tutorials/Modify KDE defaults}}
<languages />
<translate>


There are 3 basic scenarios when you want to modify KDE defaults:
<!--T:1-->
* you are system administrator and get a dozen new users every day. You want that the new users have certain settings that are not default for KDE
There are 3 basic scenarios when you want to modify default settings:
* you are system administrator and want to change the KDE settings of all your users. Logging in as a user and do the changes in [[systemsettings]] is not an option.
* 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
* you have several KDE 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 again afterwards
* 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.
* 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


In any case you will have to make the setting files in ~/.kde or ~/.kde4 or /usr/local/share or /usr/share change.  
<!--T:2-->
In any case you will have to make changes to the setting files in ~/.kde or ~/.kde4 or /usr/local/share or /usr/share.  


= /etc/skel =
== /etc/skel == <!--T:3-->
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.
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.


= examples =
== Examples == <!--T:4-->
To change the default browser, use the program systemsettings. 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:
<pre>
#!/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 for KDE to firefox
<!--T:5-->
{{Input|1=<nowiki>#!/bin/bash
# This file sets up a computer as tstaerk likes it. Call it after you have performed the OS installation.</nowiki><br /><nowiki>
# 1. set default browser to firefox
# 1.1. for SUSE Linux, where we have to look in .kde4 instead of .kde
# 1.1. for SUSE Linux, where we have to look in .kde4 instead of .kde
# 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 27: Line 30:
sed -i 's/\[General\]/\[General\]\nBrowserApplication\[\$e\]=!firefox/g' kdeglobals
sed -i 's/\[General\]/\[General\]\nBrowserApplication\[\$e\]=!firefox/g' kdeglobals
# add a General section and the key BrowerserApplication if no General section exists
# add a General section and the key BrowerserApplication if no General section exists
grep "\[General\]" kdeglobals || echo -e "\n[General]\nBrowserApplication[\$e]=!firefox" >> kdeglobals
grep "\[General\]" kdeglobals || echo -e "\n[General]\nBrowserApplication[\$e]=!firefox" >> kdeglobals</nowiki>}}
</pre>
 
<!--T:7-->
[[Category:Tutorials]]
[[Category:System]]
[[Category:Advanced Users]]
</translate>

Latest revision as of 12:15, 26 March 2017

There are 3 basic scenarios when you want to modify default settings:

  • 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
  • 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 System Settings is not an option.
  • 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

In any case you will have to make changes to the setting files in ~/.kde or ~/.kde4 or /usr/local/share or /usr/share.

/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.

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