https://wiki.archlinux.org/api.php?action=feedcontributions&user=Morwel&feedformat=atomArchWiki - User contributions [en]2024-03-29T11:41:40ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=CPU_frequency_scaling&diff=388577CPU frequency scaling2015-07-28T02:19:47Z<p>Morwel: /* CPU frequency driver */ Clarification when acpi-cpufreq is used instead of powernow-k8</p>
<hr />
<div>[[Category:Power management]]<br />
[[Category:CPU]]<br />
[[ar:CPU Frequency Scaling]]<br />
[[cs:CPU Frequency Scaling]]<br />
[[de:Cpufrequtils]]<br />
[[el:CPU Frequency Scaling]]<br />
[[es:CPU frequency scaling]]<br />
[[fr:Cpufreq]]<br />
[[it:CPU Frequency Scaling]]<br />
[[ja:CPU 周波数スケーリング]]<br />
[[pt:CPU Frequency Scaling]]<br />
[[ru:CPU frequency scaling]]<br />
[[sk:CPU Frequency Scaling]]<br />
[[tr:Işlemci frekansını ölçekleme]]<br />
[[zh-CN:CPU Frequency Scaling]]<br />
{{Related articles start}}<br />
{{Related|Power saving}}<br />
{{Related|Laptop Mode Tools}}<br />
{{Related|pm-utils}}<br />
{{Related|PHC}}<br />
{{Related articles end}}<br />
<br />
CPU frequency scaling enables the operating system to scale the CPU frequency up or down in order to save power. CPU frequencies can be scaled automatically depending on the system load, in response to ACPI events, or manually by userspace programs.<br />
<br />
CPU frequency scaling is implemented in Linux kernel, the infrastructure is called ''cpufreq''. Since kernel 3.4 the necessary modules are loaded automatically and the recommended [[#Scaling governors|ondemand governor]] is enabled by default. However, userspace tools like [[#cpupower|cpupower]], [[acpid]], [[Laptop Mode Tools]], or GUI tools provided for your desktop environment, may still be used for advanced configuration.<br />
<br />
== Userspace tools ==<br />
<br />
=== thermald ===<br />
<br />
{{AUR|thermald}} is a Linux daemon used to prevent the overheating of platforms. This daemon monitors temperature and applies compensation using available cooling methods.<br />
<br />
By default, it monitors CPU temperature using available CPU digital temperature sensors and maintains CPU temperature under control, before HW takes aggressive correction action. If there is a skin temperature sensor in thermal sysfs, then it tries to keep skin temperature under 45C.<br />
<br />
=== i7z ===<br />
{{Pkg|i7z}} a better i7 (and now i3, i5) (CPU) reporting tool for Linux. It can be launched from a Terminal with the command {{ic|i7z}} or as GUI with {{ic|i7z-gui}}<br />
<br />
{{Note|{{Pkg|i7z}}-0.27.2 has been released on September 2012. It is recommended to use {{AUR|i7z-git}} instead, particularly with newer hardware.}}<br />
<br />
=== cpupower ===<br />
<br />
{{Pkg|cpupower}} is a set of userspace utilities designed to assist with CPU frequency scaling. The package is not required to use scaling, but is highly recommended because it provides useful command-line utilities and a [[systemd]] service to change the governor at boot.<br />
<br />
The configuration file for ''cpupower'' is located in {{ic|/etc/default/cpupower}}. This configuration file is read by a bash script in {{ic|/usr/lib/systemd/scripts/cpupower}} which is activated by ''systemd'' with {{ic|cpupower.service}}. You may want to enable {{ic|cpupower.service}} to start at boot.<br />
<br />
== CPU frequency driver ==<br />
<br />
{{Note|<br />
* As of kernel 3.4, the native CPU module is loaded automatically.<br />
* Starting with kernel 3.9, the new {{ic|pstate}} power scaling driver is used automatically for modern Intel CPUs instead of the other drivers below. This driver takes priority over other drivers and in fact is inbuilt as opposed to being a module. This driver is currently automatically used for Sandy Bridge and Ivy Bridge type CPUs. If you encounter a problem while using this driver, add {{ic|intel_pstate&#61;disable}} to your kernel line. You can use the same user space utilities with this driver but cannot control it.<br />
* Even P State behavior mentioned above can be influenced with {{ic|/sys/devices/system/cpu/intel_pstate}}, e.g. Intel Turbo Boost can be deactivated with {{ic|# echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo}} for keeping CPU-Temperatures low.<br />
* Additional control for modern Intel CPUs is available with the [https://01.org/linux-thermal-daemon Linux Thermal Daemon] (available as {{AUR|thermald}}), which proactively controls thermal using P-states, T-states, and the Intel power clamp driver. thermald can also be used for older Intel CPUs. If the latest drivers are not available, then the daemon will revert to x86 model specific registers and the Linux ‘cpufreq subsystem’ to control system cooling.<br />
}}<br />
<br />
''cpupower'' requires modules to know the limits of the native CPU:<br />
<br />
{| class="wikitable"<br />
!Module!!Description<br />
|-<br />
| intel_pstate || This driver implements a scaling driver with an internal governor for Intel Core (SandyBridge and newer) processors.<br />
|-<br />
| acpi-cpufreq || CPUFreq driver which utilizes the ACPI Processor Performance States. This driver also supports Intel Enhanced SpeedStep (previously supported by the deprecated speedstep-centrino module).<br />
|-<br />
| speedstep-lib || CPUFreq drive for Intel speedstep enabled processors (mostly atoms and older pentiums (< 3)) <br />
|-<br />
| powernow-k8 || CPUFreq driver for K8/K10 Athlon64/Opteron/Phenom processors. Since linux 3.7 'acpi-cpufreq' will automaticly be used for more modern CPUs from this family.<br />
|-<br />
| pcc-cpufreq || This driver supports Processor Clocking Control interface by Hewlett-Packard and Microsoft Corporation which is useful on some Proliant servers.<br />
|-<br />
| p4-clockmod || CPUFreq driver for Intel Pentium 4 / Xeon / Celeron processors. When enabled it will lower CPU temperature by skipping clocks.<br>You probably want to use a Speedstep driver instead.<br />
|}<br />
<br />
To see a full list of available modules, run:<br />
<br />
$ ls /usr/lib/modules/$(uname -r)/kernel/drivers/cpufreq/<br />
<br />
Load the appropriate module (see [[Kernel modules]] for details). Once the appropriate cpufreq driver is loaded, detailed information about the CPU(s) can be displayed by running<br />
<br />
$ cpupower frequency-info<br />
<br />
=== Setting maximum and minimum frequencies ===<br />
<br />
In rare cases, it may be necessary to manually set maximum and minimum frequencies.<br />
<br />
To set the maximum clock frequency (''clock_freq'' is a clock frequency with units: GHz, MHz):<br />
<br />
# cpupower frequency-set -u ''clock_freq''<br />
<br />
To set the minimum clock frequency:<br />
<br />
# cpupower frequency-set -d ''clock_freq''<br />
<br />
To set the CPU to run at a specified frequency:<br />
<br />
# cpupower frequency-set -f ''clock_freq''<br />
<br />
{{Note|<br />
* To adjust for only a single CPU core, append {{ic|-c ''core_number''}}.<br />
* The governor, maximum and minimum frequencies can be set in {{ic|/etc/default/cpupower}}.<br />
}}<br />
<br />
== Scaling governors ==<br />
<br />
Governors (see table below) are power schemes for the CPU. Only one may be active at a time. For details, see the [https://www.kernel.org/doc/Documentation/cpu-freq/governors.txt kernel documentation] in the kernel source.<br />
<br />
{| class="wikitable"<br />
!Governor!!Description<br />
|-<br />
| ondemand || Dynamically switch between CPU(s) available if at 95% cpu load<br />
|-<br />
| performance || Run the cpu at max frequency<br />
|-<br />
| conservative || Dynamically switch between CPU(s) available if at 75% load<br />
|-<br />
| powersave || Run the cpu at the minimum frequency<br />
|-<br />
| userspace || Run the cpu at user specified frequencies<br />
|}<br />
<br />
Depending on the scaling driver, one of these governors will be loaded by default:<br />
* {{ic|ondemand}} for AMD and older Intel CPU.<br />
* {{ic|powersave}} for Intel Sandy Bridge and newer CPU.<br />
<br />
To activate a particular governor, run:<br />
<br />
# cpupower frequency-set -g ''governor''<br />
<br />
{{Note|<br />
* To adjust for only a single CPU core, append {{ic|-c ''core_number''}} to the command above.<br />
* Activating a governor requires that specific [[kernel module]] (named {{ic|cpufreq_''governor''}}) is loaded. As of kernel 3.4, these modules are loaded automatically.<br />
}}<br />
<br />
Alternatively, you can activate a governor on every available CPU manually:<br />
# echo ''governor'' | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor >/dev/null<br />
<br />
{{Tip|To monitor cpu speed in real time, run:<br />
$ watch grep \"cpu MHz\" /proc/cpuinfo<br />
}}<br />
<br />
=== Tuning the ondemand governor ===<br />
<br />
See the [https://www.kernel.org/doc/Documentation/cpu-freq/governors.txt kernel documentation] for details.<br />
<br />
==== Switching threshold ====<br />
<br />
To set the threshold for stepping up to another frequency:<br />
<br />
# echo -n ''percent'' > /sys/devices/system/cpu/cpufreq/<governor>/up_threshold<br />
<br />
To set the threshold for stepping down to another frequency:<br />
<br />
# echo -n ''percent'' > /sys/devices/system/cpu/cpufreq/<governor>/down_threshold<br />
<br />
==== Sampling rate ====<br />
<br />
The sampling rate determines how frequently the governor checks to tune the CPU. Setting {{ic|sampling_down_factor}} greater than 1 improves performance by reducing the overhead of load evaluation and keeping the CPU at its highest clock frequency due to high load. This tunable has no effect on behavior at lower CPU frequencies/loads.<br />
<br />
To read the value (default = 1), run:<br />
<br />
$ cat /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor<br />
<br />
To set the value, run:<br />
<br />
# echo -n ''value'' > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor<br />
<br />
== Interaction with ACPI events ==<br />
<br />
Users may configure scaling governors to switch automatically based on different ACPI events such as connecting the AC adapter or closing a laptop lid. A quick example is given below, however it may be worth reading full article on [[acpid]].<br />
<br />
Events are defined in {{ic|/etc/acpi/handler.sh}}. If the {{Pkg|acpid}} package is installed, the file should already exist and be executable. For example, to change the scaling governor from {{ic|performance}} to {{ic|conservative}} when the AC adapter is disconnected and change it back if reconnected:<br />
<br />
{{hc|/etc/acpi/handler.sh|<nowiki><br />
[...]<br />
<br />
ac_adapter)<br />
case "$2" in<br />
AC*)<br />
case "$4" in<br />
00000000)<br />
echo "conservative" >/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor <br />
echo -n $minspeed >$setspeed<br />
#/etc/laptop-mode/laptop-mode start<br />
;;<br />
00000001)<br />
echo "performance" >/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor<br />
echo -n $maxspeed >$setspeed<br />
#/etc/laptop-mode/laptop-mode stop<br />
;;<br />
esac<br />
;;<br />
*) logger "ACPI action undefined: $2" ;;<br />
esac<br />
;;<br />
<br />
[...]<br />
</nowiki>}}<br />
<br />
== Privilege granting under GNOME ==<br />
<br />
{{Out of date|See the note below.}}<br />
<br />
{{Note|systemd introduced logind which handles consolekit and policykit actions. The following code below does not work. With logind, simply edit in the file {{ic|/usr/share/polkit-1/actions/org.gnome.cpufreqselector.policy}} the <defaults> elements according to your needs and the polkit manual [http://www.freedesktop.org/software/polkit/docs/latest/polkit.8.html].}}<br />
<br />
[[GNOME]] has a nice applet to change the governor on the fly. To use it without the need to enter the root password, simply create following file:<br />
<br />
{{hc|/var/lib/polkit-1/localauthority/50-local.d/org.gnome.cpufreqselector.pkla|2=<br />
[org.gnome.cpufreqselector]<br />
Identity=unix-user:''user''<br />
Action=org.gnome.cpufreqselector<br />
ResultAny=no<br />
ResultInactive=no<br />
ResultActive=yes<br />
}}<br />
<br />
Where the word ''user'' is replaced with the username of interest.<br />
<br />
The {{AUR|desktop-privileges}} package in the [[AUR]] contains a similar {{ic|.pkla}} file for authorizing all users of the {{ic|power}} [[group]] to change the governor.<br />
<br />
== Troubleshooting ==<br />
<br />
{{Accuracy}}<br />
<br />
* Some applications, like [[ntop]], do not respond well to automatic frequency scaling. In the case of ntop it can result in segmentation faults and lots of lost information as even the {{ic|on-demand}} governor cannot change the frequency quickly enough when a lot of packets suddenly arrive at the monitored network interface that cannot be handled by the current processor speed.<br />
<br />
* Some CPU's may suffer from poor performance with the default settings of the {{ic|on-demand}} governor (e.g. flash videos not playing smoothly or stuttering window animations). Instead of completely disabling frequency scaling to resolve these issues, the aggressiveness of frequency scaling can be increased by lowering the ''up_threshold'' [[sysctl]] variable for each CPU. See [[#Switching_threshold|how to change the on-demand governor's threshold]].<br />
<br />
* Sometimes the on-demand governor may not throttle to the maximum frequency but one step below. This can be solved by setting max_freq value slightly higher than the real maximum. For example, if frequency range of the CPU is from 2.00 GHz to 3.00 GHz, setting max_freq to 3.01 GHz can be a good idea.<br />
<br />
* Some combinations of [[ALSA]] drivers and sound chips may cause audio skipping as the governor changes between frequencies, switching back to a non-changing governor seems to stop the audio skipping.<br />
<br />
=== BIOS frequency limitation ===<br />
<br />
Some CPU/BIOS configurations may have difficulties to scale to the maximum frequency or scale to higher frequencies at all. This is most likely caused by BIOS events telling the OS to limit the frequency resulting in {{ic|/sys/devices/system/cpu/cpu0/cpufreq/bios_limit}} set to a lower value.<br />
<br />
Either you just made a specific Setting in the BIOS Setup Utility, (Frequency, Thermal Management, etc.) you can blame a buggy/outdated BIOS or the BIOS might have a serious reason for throttling the CPU on it's own.<br />
<br />
Reasons like that can be (assuming your machine's a notebook) that the battery is removed (or near death) so you're on AC-power only. In this case a weak AC-source might not supply enough electricity to fulfill extreme peak demands by the overall system and as there is no battery to assist this could lead to data loss, data corruption or in worst case even hardware damage!<br />
<br />
Not all BIOS'es limit the CPU-Frequency in this case, but for example most IBM/Lenovo Thinkpads do. Refer to thinkwiki for more [http://www.thinkwiki.org/wiki/Problem_with_CPU_frequency_scaling thinkpad related info on this topic].<br />
<br />
If you checked there's not just an odd BIOS setting and you know what you're doing you can make the Kernel ignore these BIOS-limitations.<br />
<br />
{{Warning|Make sure you read and understood the section above. CPU frequency limitation is a safety feature of your BIOS and you should not need to work around it.}}<br />
<br />
A special parameter has to be passed to the processor module.<br />
<br />
For trying this temporarily change the value in {{ic|/sys/module/processor/parameters/ignore_ppc}} from {{ic|0}} to {{ic|1}}.<br />
<br />
For setting it permanent refer to [[Kernel_modules#Configuration|Kernel modules]] or just read on.<br />
Add {{ic|1=processor.ignore_ppc=1}} to your kernel boot line or create<br />
{{hc|/etc/modprobe.d/ignore_ppc.conf|2=# If the frequency of your machine gets wrongly limited by BIOS, this should help<br />
options processor ignore_ppc=1}}<br />
<br />
== See also ==<br />
<br />
* [https://www.kernel.org/doc/Documentation/cpu-freq/index.txt Linux CPUFreq - kernel documentation]<br />
* [http://www.reddit.com/r/linux/comments/1hdogn/acpi_cpufreq_or_intel_pstates/ Comprehensive explanation of pstate]</div>Morwelhttps://wiki.archlinux.org/index.php?title=Steam&diff=332623Steam2014-08-27T00:34:22Z<p>Morwel: Add link to AUR package for steam fonts</p>
<hr />
<div>[[Category:Gaming]]<br />
[[ja:Steam]]<br />
[[zh-CN:Steam]]<br />
{{Related articles start}}<br />
{{Related|Steam/Wine}}<br />
{{Related|Steam/Game-specific troubleshooting}}<br />
{{Related articles end}}<br />
From [[Wikipedia:Steam (software)|Wikipedia]]:<br />
: ''Steam is a digital distribution, digital rights management, multiplayer and communications platform developed by Valve Corporation. It is used to distribute games and related media online, from small independent developers to larger software houses.''<br />
<br />
[http://store.steampowered.com/about/ Steam] is best known as the platform needed to play Source Engine games (e.g. Half-Life 2, Counter-Strike). Today it offers many games from many other developers.<br />
<br />
==Installation==<br />
<br />
{{Note|<br />
* Arch Linux is '''not''' [https://support.steampowered.com/kb_article.php?ref&#61;1504-QHXN-8366 officially supported].<br />
* Because the Steam client is a 32-bit application, you will need to enable the [[multilib]] repository if you have a 64-bit system. It may also make sense to install {{Grp|multilib-devel}} to provide some important multilib libraries.<br />
}}<br />
<br />
Steam can be installed with the package {{Pkg|steam}}, available in the [[official repositories]]. If you have a 64-bit system, enable the [[multilib]] repository first.<br />
<br />
Steam is not supported on this distribution. As such some fixes are needed on the users part to get things functioning properly:<br />
<br />
*Steam makes heavy usage of the Arial font. A decent Arial font to use is {{Pkg|ttf-liberation}} or [[#Text is corrupt or missing|the fonts provided by Steam]]. Asian languages require {{Pkg|wqy-zenhei}} to display properly.<br />
<br />
*If you have a 64-bit system, you will need to install [[Xorg#Driver installation|the 32-bit version of your graphics driver]] (the package in the ''Multilib Package'' column) to run 32-bit games.<br />
<br />
*If you have a 64-bit system, you will need to install {{pkg|lib32-alsa-plugins}} to enable sound in 32-bit games.<br />
<br />
*Several games have dependencies which may be missing from your system. If a game fails to launch (often without error messages) then make sure all of the libraries listed in [[Steam/Game-specific troubleshooting]] are installed.<br />
<br />
== Starting Steam ==<br />
<br />
=== Big Picture Mode (with a Display Manager) ===<br />
<br />
To start Steam in Big Picture Mode from a Display Manager (such as LightDM), create a {{ic|/usr/share/xsessions/steam-big-picture.desktop}} file with the following content:<br />
<br />
{{hc|/usr/share/xsessions/steam-big-picture.desktop|<nowiki><br />
[Desktop Entry]<br />
Name=Steam Big Picture Mode<br />
Comment=Start Steam in Big Picture Mode<br />
Exec='/usr/bin/steam -bigpicture'<br />
TryExec='/usr/bin/steam -bigpicture'<br />
Icon=<br />
Type=Application</nowiki>}}<br />
<br />
Alternatively, under Steam > Settings > Interface, check 'Start Steam in Big Picture Mode' and start Steam normally. This can behave slightly better with certain window managers than the command line option.<br />
<br />
=== Silent Mode ===<br />
<br />
If your steam main window is showing at startup, you can add the {{ic|-silent}} parameter to your startup command to hide the window:<br />
/usr/bin/steam -silent %U<br />
<br />
alternatively, you can edit the following desktop file, and manually add the parameter:<br />
<br />
{{hc|~/.config/autostart/steam.desktop|<nowiki><br />
[Desktop Entry]<br />
Name=Steam<br />
Comment=Application for managing and playing games on Steam<br />
Exec=/usr/bin/steam -silent %U<br />
Icon=steam<br />
Terminal=false<br />
Type=Application<br />
Categories=Network;FileTransfer;Game;<br />
MimeType=x-scheme-handler/steam;<br />
Actions=Store;Community;Library;Servers;Screenshots;News;Settings;BigPicture;Friends;<br />
...</nowiki>}}<br />
<br />
== Troubleshooting ==<br />
<br />
{{Note|In addition to being documented here, any bug/fix/error should be, if not already, reported on Valve's bug tracker on their [https://github.com/ValveSoftware/steam-for-linux GitHub page].}}<br />
<br />
=== The close button only minimizes the window ===<br />
<br />
: Valve GitHub [https://github.com/ValveSoftware/steam-for-linux/issues/1025 issue 1025]<br />
<br />
To close the Steam window (and remove it from the taskbar) when you press '''x''', but keep Steam running in the tray, set the environment variable {{ic|STEAM_FRAME_FORCE_CLOSE}} to {{ic|1}}. You can do this by launching Steam using the following command.<br />
$ STEAM_FRAME_FORCE_CLOSE=1 steam<br />
<br />
If you start steam with the .desktop file, you need to replace the {{ic|Exec}} with following line:<br />
Exec=sh -c 'STEAM_FRAME_FORCE_CLOSE=1 steam' %U<br />
<br />
=== Flash not working on 64-bit systems ===<br />
<br />
: Steam Support [https://support.steampowered.com/kb_article.php?ref=1493-GHZB-7612 article]<br />
<br />
First ensure {{Pkg|lib32-flashplugin}} is installed. It should be working at this point, if not create a local Steam Flash plugin folder:<br />
$ mkdir ~/.steam/bin32/plugins/<br />
and set a symbolic link to the global lib32 flash plugin file in your upper new folder<br />
$ ln -s /usr/lib32/mozilla/plugins/libflashplayer.so ~/.steam/bin32/plugins/<br />
<br />
=== Text is corrupt or missing ===<br />
<br />
The Steam Support [https://support.steampowered.com/kb_article.php?ref=1974-YFKL-4947 instructions] for Windows seem to work on Linux also.<br />
You could either install them via the [https://aur.archlinux.org/packages/steam-fonts/ AUR package]:<br />
$ yaourt steam-fonts<br />
or install them manually by downloading [https://support.steampowered.com/downloads/1974-YFKL-4947/SteamFonts.zip SteamFonts.zip] and [[fonts#Manual installation|install]] them (copying to {{ic|/usr/share/fonts/}} or {{ic|~/.fonts/}} works also).<br />
<br />
=== SetLocale('en_US.UTF-8') fails at game startup ===<br />
<br />
Uncomment {{ic|en_US.UTF-8 UTF-8}} in {{ic|/etc/locale.gen}} and then run {{ic|locale-gen}} as root.<br />
<br />
=== The game crashes immediately after start ===<br />
<br />
If your game crashes immediately, try disabling: ''"Enable the Steam Overlay while in-game"'' in game ''Properties''.<br />
<br />
=== OpenGL not using direct rendering ===<br />
<br />
: Steam Support [https://support.steampowered.com/kb_article.php?ref=9938-EYZB-7457 article]<br />
<br />
You have probably not installed your 32-bit graphics driver correctly. See [[Xorg#Driver installation]] for which packages to install.<br />
<br />
You can check/test if it is installed correctly by installing {{Pkg|lib32-mesa-demos}} and running the following command:<br />
$ glxinfo32 | grep OpenGL.<br />
<br />
=== libGL error when running certain games ===<br />
<br />
If you receive an error like the following {{ic|Failed to load libGL: undefined symbol: xcb_send_fd}}, it could be due to an outdated steam runtime library. Deleting {{ic|~/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libxcb.so.1}} will force Steam to load the library version installed by pacman.<br />
<br />
=== OpenGL GLX context is not using direct rendering, which may cause performance problems, or steam crash Xorg ===<br />
<br />
Steam ships its own versions of some libraries, and they sometimes are too old to work with archlinux system libraries.<br />
Removing the library supplied by Steam means Steam has to use the newer arch-specific version. [https://bbs.archlinux.org/viewtopic.php?pid=1416098#p1416098 Forum thread].<br />
<br />
{{bc|<br />
rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libstdc++.so.6<br />
rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/i386/lib/i386-linux-gnu/libgcc_s.so.1<br />
rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/lib/x86_64-linux-gnu/libgcc_s.so.1<br />
rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/lib/x86_64-linux-gnu/libstdc++.so.6<br />
}}<br />
<br />
=== Problems with 64-bit games like XCOM ===<br />
Steam ships its own versions of some libraries, and they sometimes are too old to work with archlinux system libraries.<br />
Removing the library supplied by Steam means Steam has to use the newer arch-specific version. [https://bbs.archlinux.org/viewtopic.php?pid=1428375#p1428375].<br />
<br />
{{bc|rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/lib/x86_64-linux-gnu/libgcc_s.so.1<br />
rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/lib/x86_64-linux-gnu/libstdc++.so.6}}<br />
<br />
=== No audio in certain games ===<br />
<br />
If there is no audio in certain games, and the suggestions provided in [[Steam/Game-specific troubleshooting]] do not fix the problem, [[#Using native runtime]] may provide a successful workaround.<br />
<br />
=== You are missing the following 32-bit libraries, and Steam may not run: libGL.so.1 ===<br />
<br />
You may encounter this error when you launch Steam at first time. Make sure you have installed lib32-version of all your video driver. For example, if you have installed {{Pkg|catalyst-utils-pxp}}, {{Pkg|xf86-video-dri}}, {{Pkg|intel-dri}}, {{Pkg|mesa-libgl}} for AMD and Intel double card, then you should install {{Pkg|lib32-catalyst-utils-pxp}}, {{Pkg|lib32-intel-dri}}, {{Pkg|lib32-mesa-libgl}}.<br />
<br />
=== Games do not launch on older intel hardware ===<br />
<br />
On older Intel hardware, if the game immediately crashes when run, it may be because your hardware doesn't directly support the latest OpenGL. It appears as a gameoverlayrenderer.so error in /tmp/dumps/mobile_stdout.txt, but looking in /tmp/gameoverlayrenderer.log it shows a GLXBadFBConfig error. <br />
<br />
This can be fixed, however, by forcing the game to use a later version of OpenGL than it wants. Right click on the game, select Properties. Then, click "Set Launch Options" in the "General" tab and paste the following:<br />
<br />
MESA_GL_VERSION_OVERRIDE=3.1 MESA_GLSL_VERSION_OVERRIDE=140 %command%<br />
<br />
This will force the game to use the latest version of OpenGL.<br />
<br />
=== X crashes when Steam starts (Radeon open source driver) ===<br />
<br />
There is [https://bugs.freedesktop.org/show_bug.cgi?id=79325 a bug] in {{Pkg|glamor-egl}} 0.6.0 (used by the open source Radeon driver) which causes X to crash when trying to start Steam. Installing {{AUR|glamor-egl-git}} from the AUR is a workaround until a new glamour version is released.<br />
<br />
=== Some games fail to start ===<br />
<br />
Occationally some games fail to load with output similar to the following:<br />
{{bc|ERROR: ld.so: object '~/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.}}<br />
In these cases the included libstdc++.so is conflicting with something [https://bbs.archlinux.org/viewtopic.php?id=181171 explained here]. The solution seems to be setting the environmental variable STEAM_RUNTIME to 0, and running the following command: {{bc|rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libstdc++.so.6}}<br />
<br />
== Launching games with custom commands, such as Bumblebee/Primus ==<br />
<br />
Steam has fortunately added support for launching games using your own custom command. To do so, navigate to the Library page, right click on the selected game, click Properties, and Set Launch Options. Steam replaces the tag {{ic|%command%}} with the command it actually wishes to run. For example, to launch Team Fortress 2 with primusrun and at resolution 1920x1080, you would enter:<br />
<br />
primusrun %command% -w 1920 -h 1080<br />
<br />
If you are running the [[Linux-ck]] kernel, you may have some success in reducing overall latencies and improving performance by launching the game in SCHED_ISO (low latency, avoid choking CPU) via {{Pkg|schedtool}}<br />
<br />
# schedtool -I -e %command% ''other arguments''<br />
<br />
=== Killing standalone compositors when launching games ===<br />
<br />
Further to this, utilising the {{ic|%command%}} switch, you can kill standalone compositors (such as Xcompmgr or [[Compton]]) - which can cause lag and tearing in some games on some systems - and relaunch them after the game ends by adding the following to your game's launch options.<br />
<br />
killall compton && %command%; nohup compton &<br />
<br />
Replace {{ic|compton}} in the above command with whatever your compositor is. You can also add -options to {{ic|%command%}} or {{ic|compton}}, of course.<br />
<br />
Steam will latch on to any processes launched after {{ic|%command%}} and your Steam status will show as in game. So in this example, we run the compositor through {{ic|nohup}} so it is not attached to Steam (it will keep running if you close Steam) and follow it with an ampersand so that the line of commands ends, clearing your Steam status.<br />
<br />
== Using native runtime ==<br />
<br />
Steam, by default, ships with a copy of every library it uses, packaged within itself, so that games can launch without issue. This can be a resource hog, and the slightly out-of-date libraries they package may be missing important features (Notably, the OpenAL version they ship lacks HRTF and surround71 support). To use your own system libraries, you can run Steam with:<br />
<br />
$ STEAM_RUNTIME=0 steam<br />
<br />
However, if you're missing any libraries Steam makes use of, this will fail to launch properly. An easy way to find the missing libraries is to run the following commands:<br />
<br />
$ cd ~/.local/share/Steam/ubuntu12_32<br />
$ LD_LIBRARY_PATH=".:${LD_LIBRARY_PATH}" ldd $(file *|sed '/ELF/!d;s/:.*//g')|grep 'not found'|sort|uniq<br />
<br />
{{Note|The libraries will have to be 32-bit, which means you may have to download some from the AUR if on x86_64, such as NetworkManager.}}<br />
<br />
Once you've done this, run steam again with {{ic|1=STEAM_RUNTIME=0 steam}} and verify it's not loading anything outside of the handful of steam support libraries:<br />
<br />
$ cat /proc/$(pidof steam)/maps|sed '/\.local/!d;s/.* //g'|sort|uniq<br />
<br />
== Skins for Steam ==<br />
<br />
{{Note|Using skins that are not up-to-date with the version of the Steam client may cause visual errors.}}<br />
<br />
The Steam interface can be fully customized by copying its various interface files in its skins directory and modifying them.<br />
<br />
An extensive list of skins can be found on [http://forums.steampowered.com/forums/showthread.php?t=1161035 Steam's forums].<br />
<br />
=== Steam skin manager ===<br />
<br />
The process of applying a skin to Steam can be greatly simplified using {{AUR|steam-skin-manager}} from the AUR. The package also comes with a hacked version of the Steam launcher which allows the window manager to draw its borders on the Steam window.<br />
<br />
As a result, skins for Steam will come in two flavors, one with and one without window buttons. The skin manager will prompt you whether you use the hacked version or not, and will automatically apply the theme corresponding to your GTK+ theme if it is found. You can of course still apply another skin if you want.<br />
<br />
The package ships with two themes for the default Ubuntu themes, Ambiance and Radiance.<br />
<br />
== Changing the Steam friends notification placement ==<br />
<br />
{{Note|A handful of games do not support this, for example this can not work with XCOM: Enemy Unknown.}}<br />
<br />
=== Method 1: Use a skin ===<br />
You can create a skin that does nothing but change the notification corner. To save yourself from creating these manually I have uploaded them to mediafire. You can [http://www.mediafire.com/download/lnt2cjlbcdccm11/Steam-Notifications.zip download them here] and then extract them into your home folder (make sure it is not extracted into a subdirectory, i.e. the .local folder in the zip needs to go into your home directory) after that you will have to open Steam, go to it's Settings, and enter the Interface tab. Then in the drop-down list where it says '''< default skin >''' you can select the desired skin and finally move that notification out of your way!<br />
<br />
If you would like to manually create the files, here is how you can do it. First you need to create the directories:<br />
<br />
mkdir -p $HOME/Top-Right/resource<br />
cp -R $HOME/.steam/steam/resource/styles $HOME/Top-Right/resource/<br />
mv $HOME/Top-Right $HOME/.local/share/Steam/skins/<br />
cd .local/share/Steam/skins/<br />
cp -R Top-Right Top-Left && cp -R Top-Right Bottom-Right<br />
<br />
Then with a text editor of your choosing open the file you wish to modify, the '''gameoverlay.style''' will change the corner for the in-game overlay whereas the '''steam.style''' will change it for your desktop. In this example I will use nano and the in-game overlay file.<br />
<br />
nano Top-Right/resource/styles/gameoverlay.style<br />
<br />
Now find the entry: '''Notifications.PanelPosition''' in whichever file you opened and change it to the appropriate value, for example for Top-Right:<br />
<br />
Notifications.PanelPosition "TopRight"<br />
<br />
This line will look the same in both files. Repeat the process for all the 3 variants (Top-Right, Top-Left and Bottom-Left) and adjust the corners for the desktop and in-game overlay to your satisfaction for each skin, then save the files.<br />
<br />
To finish you will have to select the skin in Steam as explained above. You can use these files across distributions and even between Windows and Linux (OS X has it's own entry for the desktop notification placement)<br />
<br />
=== Method 2: On The Fly Patch ===<br />
This method is more compatible with future updates of Steams since the files in the skins above are updated as part of steam and as such if the original files change, the skin will not follow the graphics update to steam and will have to be re-created every time something like that happens. Doing things this way will also give you the ability to use per-game notification locations as you can run a patch changing the location of the notifications by specifying it in the launch options for games.<br />
<br />
Steam updates the files we need to edit everytime it updates (which is everytime it is launched) so the most effective way to do this is patching the file after Steam has already been launched.<br />
<br />
First you will need [http://www.mediafire.com/download/ao3dhpdg9omj94r/topright.patch this patch][http://pastebin.com/FWHZNdUU (pastebin ver)]. you can edit the entry and change it between "BottomRight"(default), "TopRight" "TopLeft" and "BottomLeft" but I will assume you used "TopRight" as in the original file. Save that file as '''$HOME/.steam/topright.patch'''.<br />
<br />
{{Note|For pastebin to work you need to copy the raw data from line 1 through line 12 (line 12 is whitespace, but the patch will fail without it, this is why I provided a mediafire version too) you basically need to start copying behind the "-" sign at the bottom of the raw paste data and go up from there.}}<br />
<br />
Next create an alias in your '''$HOME/.bashrc'''<br />
alias steam_topright='pushd $HOME/.steam/ && patch -p1 -f -r - --no-backup-if-mismatch < topright.patch && popd'<br />
<br />
Log out and back in to refresh the aliases. Launch Steam and wait for it to fully load, then run the alias <br />
<br />
# steam_topright<br />
<br />
And most games you launch after this will have their notification in the upper right corner.<br />
<br />
You can also duplicate the patch and make more aliases for the other corners if you don't want all games to use the same corner so you can switch back.<br />
<br />
To automate the process you will need a script file as steam launch options cannot read your aliases. The location and name of the file could for example be '''$HOME/.scripts/steam_topright.sh''', and assuming that's the path you used, it needs to be executable<br />
chmod +755 $HOME/.scripts/steam_topright.sh<br />
<br />
The contents of the file should be the following:<br />
#!/bin/sh<br />
#<br />
pushd $HOME/.steam/ && patch -p1 -f -r - --no-backup-if-mismatch < topright.patch && popd<br />
<br />
And the launch options should be something like the following.<br />
<br />
$HOME/.scripts/steam_topright.sh && %command%<br />
<br />
There is another file in the same folder as '''gameoverlay.style''' folder called '''steam.style''' which has an entry with the exact same function as the file we patched and will change the notification corner for the desktop only (not in-game), but for editing this file to actually work it has to be set before steam is launched and the folder set to read-only so steam cannot re-write the file. Therefore the only two ways to modify that file is to make the directory read only so steam cannot change it when it is launched (can break updates) or making a skin like in method 1.<br />
<br />
== See also ==<br />
* https://wiki.gentoo.org/wiki/Steam</div>Morwelhttps://wiki.archlinux.org/index.php?title=Cgit&diff=249088Cgit2013-03-03T22:59:53Z<p>Morwel: /* Basic Configuration */</p>
<hr />
<div>[[Category:Version Control System]]<br />
[http://hjemli.net/git/cgit/ Cgit] is an attempt to create a fast web interface for the git scm, using a<br />
builtin cache to decrease server io-pressure.<br />
<br />
==Installation==<br />
Installing cgit is rather simple as it's available in the Community repository:<br />
{{bc|# pacman -S cgit}}<br />
<br />
In order to actually use cgit you will of course also need to have some webserver installed on your system, like for example [[Apache]].<br />
<br />
==Configuration of Web Server==<br />
===Apache===<br />
You may add the following either to the end of your {{ic|/etc/httpd/conf/httpd.conf}} file or place it in a separate file inside the {{ic|/etc/httpd/conf/extra/}} directory.<br />
#<br />
# cgit configuration for apache<br />
#<br />
<br />
ScriptAlias /cgit/ "/usr/lib/cgit/cgit.cgi/"<br />
Alias /cgit-css "/usr/share/webapps/cgit/"<br />
<Directory "/usr/share/webapps/cgit/"><br />
AllowOverride None<br />
Options None<br />
Order allow,deny<br />
Allow from all<br />
</Directory><br />
<Directory "/usr/lib/cgit/"><br />
AllowOverride None<br />
Options ExecCGI FollowSymlinks<br />
Order allow,deny<br />
Allow from all<br />
</Directory><br />
<br />
===Lighttpd===<br />
Information for Lighttpd and cgit is scarse... The following configuration will let you access cgit through http://your.server.com/cgit with http://your.server.com/git redirecting to it. It's not perfect (for example you'll see "cgit.cgi" in all repos' url) but works.<br />
<br />
Create the file '''/etc/lighttpd/conf.d/cgit.conf''':<br />
server.modules += ("mod_redirect",<br />
"mod_alias",<br />
"mod_cgi",<br />
"mod_fastcgi",<br />
"mod_rewrite" )<br />
<br />
var.webapps = "/usr/share/webapps/"<br />
$HTTP["url"] =~ "^/cgit" {<br />
server.document-root = webapps<br />
server.indexfiles = ("cgit.cgi")<br />
cgi.assign = ("cgit.cgi" => "")<br />
mimetype.assign = ( ".css" => "text/css" )<br />
}<br />
url.redirect = (<br />
"^/git/(.*)$" => "/cgit/cgit.cgi/$1",<br />
)<br />
Just include this file in '''/etc/lighttpd/lighttpd.conf''':<br />
include "conf.d/cgit.conf"<br />
and restart lighttpd.<br />
<br />
==Configuration of Cgit==<br />
===Basic Configuration===<br />
Before you can start adding repositories you will first have to create the basic cgit configuration file at {{ic|/etc/cgitrc}}.<br />
<br />
#<br />
# cgit config<br />
#<br />
<br />
css=/cgit-css/cgit.css<br />
logo=/cgit-css/cgit.png<br />
<br />
# if you don't want that webcrawler (like google) index your site<br />
robots=noindex, nofollow<br />
<br />
===Adding repositories===<br />
Now you can add your repos:<br />
<br />
#<br />
# List of repositories.<br />
# This list could be kept in a different file (e.g. '/etc/cgitrepos')<br />
# and included like this:<br />
# include=/etc/cgitrepos<br />
#<br />
<br />
repo.url=MyRepo<br />
repo.path=/srv/git/MyRepo.git<br />
repo.desc=This is my git repository<br />
<br />
repo.url=MyOtherRepo<br />
repo.path=/srv/git/MyOtherRepo.git<br />
repo.desc=That's my other git repository<br />
<br />
If you prefer not having to manually specify each repository it's also possible to configure cgit to search for them:<br />
<br />
scan-path=/srv/git/<br />
<br />
For detailed documentation about the available settings in this configuration file, please see the manage (`man cgitrc`).<br />
<br />
===Syntax highlighting===<br />
Cgit supports syntax highlighting when viewing blobs. To enable syntax highlighting, you have to install the {{Pkg|highlight}} package.<br />
<br />
# pacman -S highlight<br />
<br />
Edit {{ic|/usr/lib/cgit/filters/syntax-highlighting.sh}}. Comment out version 2 and comment in version 3.<br />
You may want to add {{ic|--inline-css}} to the options of highlight for a more colorfull output without editing cgit's css file.<br />
{{bc|<br />
# This is for version 2<br />
#exec highlight --force -f -I -X -S "$EXTENSION" 2>/dev/null<br />
<br />
# This is for version 3<br />
exec highlight --force --inline-css -f -I -O xhtml -S "$EXTENSION" 2>/dev/null<br />
}}<br />
Enable the filter in {{ic|/etc/cgitrc}}<br />
<br />
source-filter=/usr/lib/cgit/filters/syntax-highlighting.sh<br />
<br />
==Integration==<br />
===Gitosis===<br />
If you want to integrate with gitosis you will have to run two commands to give apache permission to look though the folder.<br />
<br />
# chgrp http /srv/gitosis<br />
# chmod a+rx /srv/gitosis<br />
<br />
===Gitolite===<br />
If you added repositories managed by gitolite you have to change the permissions, so the web server can access the files.<br />
* Change permission for future repositories:<br />
** Edit {{ic|~/.gitolite.rc}} of your gitolite user. Change the UMASK to 0022<br />
** See also: http://gitolite.com/gitolite/external.html#umask<br />
* Change permission for existing repositories:<br />
** Run the following two commands (as root or gitolite-user):<br />
***{{ic|# find /path/to/the/repository/ -type d -exec chmod og+rx {} \;}}<br />
***{{ic|# find /path/to/the/repository/ -type f -exec chmod og+r {} \;}}<br />
<br />
==References==<br />
* http://hjemli.net/git/cgit/<br />
* http://hjemli.net/git/cgit/about/<br />
* http://hjemli.net/git/cgit/tree/README<br />
* http://hjemli.net/git/cgit/tree/cgitrc.5.txt</div>Morwelhttps://wiki.archlinux.org/index.php?title=Cgit&diff=249078Cgit2013-03-03T21:21:46Z<p>Morwel: Add section about gitolite integration</p>
<hr />
<div>[[Category:Version Control System]]<br />
[http://hjemli.net/git/cgit/ Cgit] is an attempt to create a fast web interface for the git scm, using a<br />
builtin cache to decrease server io-pressure.<br />
<br />
==Installation==<br />
Installing cgit is rather simple as it's available in the Community repository:<br />
{{bc|# pacman -S cgit}}<br />
<br />
In order to actually use cgit you will of course also need to have some webserver installed on your system, like for example [[Apache]].<br />
<br />
==Configuration of Web Server==<br />
===Apache===<br />
You may add the following either to the end of your {{ic|/etc/httpd/conf/httpd.conf}} file or place it in a separate file inside the {{ic|/etc/httpd/conf/extra/}} directory.<br />
#<br />
# cgit configuration for apache<br />
#<br />
<br />
ScriptAlias /cgit/ "/usr/lib/cgit/cgit.cgi/"<br />
Alias /cgit-css "/usr/share/webapps/cgit/"<br />
<Directory "/usr/share/webapps/cgit/"><br />
AllowOverride None<br />
Options None<br />
Order allow,deny<br />
Allow from all<br />
</Directory><br />
<Directory "/usr/lib/cgit/"><br />
AllowOverride None<br />
Options ExecCGI FollowSymlinks<br />
Order allow,deny<br />
Allow from all<br />
</Directory><br />
<br />
===Lighttpd===<br />
Information for Lighttpd and cgit is scarse... The following configuration will let you access cgit through http://your.server.com/cgit with http://your.server.com/git redirecting to it. It's not perfect (for example you'll see "cgit.cgi" in all repos' url) but works.<br />
<br />
Create the file '''/etc/lighttpd/conf.d/cgit.conf''':<br />
server.modules += ("mod_redirect",<br />
"mod_alias",<br />
"mod_cgi",<br />
"mod_fastcgi",<br />
"mod_rewrite" )<br />
<br />
var.webapps = "/usr/share/webapps/"<br />
$HTTP["url"] =~ "^/cgit" {<br />
server.document-root = webapps<br />
server.indexfiles = ("cgit.cgi")<br />
cgi.assign = ("cgit.cgi" => "")<br />
mimetype.assign = ( ".css" => "text/css" )<br />
}<br />
url.redirect = (<br />
"^/git/(.*)$" => "/cgit/cgit.cgi/$1",<br />
)<br />
Just include this file in '''/etc/lighttpd/lighttpd.conf''':<br />
include "conf.d/cgit.conf"<br />
and restart lighttpd.<br />
<br />
==Configuration of Cgit==<br />
===Basic Configuration===<br />
Before you can start adding repositories you will first have to create the basic cgit configuration file at {{ic|/etc/cgitrc}}.<br />
<br />
#<br />
# cgit config<br />
#<br />
<br />
css=/cgit-css/cgit.css<br />
logo=/cgit-css/cgit.png<br />
<br />
===Adding repositories===<br />
Now you can add your repos:<br />
<br />
#<br />
# List of repositories.<br />
# This list could be kept in a different file (e.g. '/etc/cgitrepos')<br />
# and included like this:<br />
# include=/etc/cgitrepos<br />
#<br />
<br />
repo.url=MyRepo<br />
repo.path=/srv/git/MyRepo.git<br />
repo.desc=This is my git repository<br />
<br />
repo.url=MyOtherRepo<br />
repo.path=/srv/git/MyOtherRepo.git<br />
repo.desc=That's my other git repository<br />
<br />
If you prefer not having to manually specify each repository it's also possible to configure cgit to search for them:<br />
<br />
scan-path=/srv/git/<br />
<br />
For detailed documentation about the available settings in this configuration file, please see the manage (`man cgitrc`).<br />
<br />
===Syntax highlighting===<br />
Cgit supports syntax highlighting when viewing blobs. To enable syntax highlighting, you have to install the {{Pkg|highlight}} package.<br />
<br />
# pacman -S highlight<br />
<br />
Edit {{ic|/usr/lib/cgit/filters/syntax-highlighting.sh}}. Comment out version 2 and comment in version 3.<br />
You may want to add {{ic|--inline-css}} to the options of highlight for a more colorfull output without editing cgit's css file.<br />
{{bc|<br />
# This is for version 2<br />
#exec highlight --force -f -I -X -S "$EXTENSION" 2>/dev/null<br />
<br />
# This is for version 3<br />
exec highlight --force --inline-css -f -I -O xhtml -S "$EXTENSION" 2>/dev/null<br />
}}<br />
Enable the filter in {{ic|/etc/cgitrc}}<br />
<br />
source-filter=/usr/lib/cgit/filters/syntax-highlighting.sh<br />
<br />
==Integration==<br />
===Gitosis===<br />
If you want to integrate with gitosis you will have to run two commands to give apache permission to look though the folder.<br />
<br />
# chgrp http /srv/gitosis<br />
# chmod a+rx /srv/gitosis<br />
<br />
===Gitolite===<br />
If you added repositories managed by gitolite you have to change the permissions, so the web server can access the files.<br />
* Change permission for future repositories:<br />
** Edit {{ic|~/.gitolite.rc}} of your gitolite user. Change the UMASK to 0022<br />
** See also: http://gitolite.com/gitolite/external.html#umask<br />
* Change permission for existing repositories:<br />
** Run the following two commands (as root or gitolite-user):<br />
***{{ic|# find /path/to/the/repository/ -type d -exec chmod og+rx {} \;}}<br />
***{{ic|# find /path/to/the/repository/ -type f -exec chmod og+r {} \;}}<br />
<br />
==References==<br />
* http://hjemli.net/git/cgit/<br />
* http://hjemli.net/git/cgit/about/<br />
* http://hjemli.net/git/cgit/tree/README<br />
* http://hjemli.net/git/cgit/tree/cgitrc.5.txt</div>Morwelhttps://wiki.archlinux.org/index.php?title=Cgit&diff=249071Cgit2013-03-03T19:32:50Z<p>Morwel: Added section about syntax highlighting</p>
<hr />
<div>[[Category:Version Control System]]<br />
[http://hjemli.net/git/cgit/ Cgit] is an attempt to create a fast web interface for the git scm, using a<br />
builtin cache to decrease server io-pressure.<br />
<br />
==Installation==<br />
Installing cgit is rather simple as it's available in the Community repository:<br />
{{bc|# pacman -S cgit}}<br />
<br />
In order to actually use cgit you will of course also need to have some webserver installed on your system, like for example [[Apache]].<br />
<br />
==Configuration of Web Server==<br />
===Apache===<br />
You may add the following either to the end of your {{ic|/etc/httpd/conf/httpd.conf}} file or place it in a separate file inside the {{ic|/etc/httpd/conf/extra/}} directory.<br />
#<br />
# cgit configuration for apache<br />
#<br />
<br />
ScriptAlias /cgit/ "/usr/lib/cgit/cgit.cgi/"<br />
Alias /cgit-css "/usr/share/webapps/cgit/"<br />
<Directory "/usr/share/webapps/cgit/"><br />
AllowOverride None<br />
Options None<br />
Order allow,deny<br />
Allow from all<br />
</Directory><br />
<Directory "/usr/lib/cgit/"><br />
AllowOverride None<br />
Options ExecCGI FollowSymlinks<br />
Order allow,deny<br />
Allow from all<br />
</Directory><br />
<br />
===Lighttpd===<br />
Information for Lighttpd and cgit is scarse... The following configuration will let you access cgit through http://your.server.com/cgit with http://your.server.com/git redirecting to it. It's not perfect (for example you'll see "cgit.cgi" in all repos' url) but works.<br />
<br />
Create the file '''/etc/lighttpd/conf.d/cgit.conf''':<br />
server.modules += ("mod_redirect",<br />
"mod_alias",<br />
"mod_cgi",<br />
"mod_fastcgi",<br />
"mod_rewrite" )<br />
<br />
var.webapps = "/usr/share/webapps/"<br />
$HTTP["url"] =~ "^/cgit" {<br />
server.document-root = webapps<br />
server.indexfiles = ("cgit.cgi")<br />
cgi.assign = ("cgit.cgi" => "")<br />
mimetype.assign = ( ".css" => "text/css" )<br />
}<br />
url.redirect = (<br />
"^/git/(.*)$" => "/cgit/cgit.cgi/$1",<br />
)<br />
Just include this file in '''/etc/lighttpd/lighttpd.conf''':<br />
include "conf.d/cgit.conf"<br />
and restart lighttpd.<br />
<br />
==Configuration of Cgit==<br />
===Basic Configuration===<br />
Before you can start adding repositories you will first have to create the basic cgit configuration file at {{ic|/etc/cgitrc}}.<br />
<br />
#<br />
# cgit config<br />
#<br />
<br />
css=/cgit-css/cgit.css<br />
logo=/cgit-css/cgit.png<br />
<br />
===Adding repositories===<br />
Now you can add your repos:<br />
<br />
#<br />
# List of repositories.<br />
# This list could be kept in a different file (e.g. '/etc/cgitrepos')<br />
# and included like this:<br />
# include=/etc/cgitrepos<br />
#<br />
<br />
repo.url=MyRepo<br />
repo.path=/srv/git/MyRepo.git<br />
repo.desc=This is my git repository<br />
<br />
repo.url=MyOtherRepo<br />
repo.path=/srv/git/MyOtherRepo.git<br />
repo.desc=That's my other git repository<br />
<br />
If you prefer not having to manually specify each repository it's also possible to configure cgit to search for them:<br />
<br />
scan-path=/srv/git/<br />
<br />
For detailed documentation about the available settings in this configuration file, please see the manage (`man cgitrc`).<br />
<br />
===Syntax highlighting===<br />
Cgit supports syntax highlighting when viewing blobs. To enable syntax highlighting, you have to install the {{Pkg|highlight}} package.<br />
<br />
# pacman -S highlight<br />
<br />
Edit {{ic|/usr/lib/cgit/filters/syntax-highlighting.sh}}. Comment out version 2 and comment in version 3.<br />
You may want to add {{ic|--inline-css}} to the options of highlight for a more colorfull output without editing cgit's css file.<br />
{{bc|<br />
# This is for version 2<br />
#exec highlight --force -f -I -X -S "$EXTENSION" 2>/dev/null<br />
<br />
# This is for version 3<br />
exec highlight --force --inline-css -f -I -O xhtml -S "$EXTENSION" 2>/dev/null<br />
}}<br />
Enable the filter in {{ic|/etc/cgitrc}}<br />
<br />
source-filter=/usr/lib/cgit/filters/syntax-highlighting.sh<br />
<br />
==Gitosis Integration==<br />
If you want to integrate with gitosis you will have to run two commands to give apache permission to look though the folder.<br />
<br />
# chgrp http /srv/gitosis<br />
# chmod a+rx /srv/gitosis<br />
<br />
==References==<br />
* http://hjemli.net/git/cgit/<br />
* http://hjemli.net/git/cgit/about/<br />
* http://hjemli.net/git/cgit/tree/README<br />
* http://hjemli.net/git/cgit/tree/cgitrc.5.txt</div>Morwelhttps://wiki.archlinux.org/index.php?title=Cgit&diff=248923Cgit2013-03-02T18:32:59Z<p>Morwel: Add example config option</p>
<hr />
<div>[[Category:Version Control System]]<br />
[http://hjemli.net/git/cgit/ Cgit] is an attempt to create a fast web interface for the git scm, using a<br />
builtin cache to decrease server io-pressure.<br />
<br />
==Installation==<br />
Installing cgit is rather simple as it's available in the Community repository:<br />
{{bc|# pacman -S cgit}}<br />
<br />
In order to actually use cgit you will of course also need to have some webserver installed on your system, like for example [[Apache]].<br />
<br />
==Configuration==<br />
===Apache===<br />
You may add the following either to the end of your {{ic|/etc/httpd/conf/httpd.conf}} file or place it in a separate file inside the {{ic|/etc/httpd/conf/extra/}} directory.<br />
#<br />
# cgit configuration for apache<br />
#<br />
<br />
ScriptAlias /cgit/ "/usr/lib/cgit/cgit.cgi/"<br />
Alias /cgit-css "/usr/share/webapps/cgit/"<br />
<Directory "/usr/share/webapps/cgit/"><br />
AllowOverride None<br />
Options None<br />
Order allow,deny<br />
Allow from all<br />
</Directory><br />
<Directory "/usr/lib/cgit/"><br />
AllowOverride None<br />
Options ExecCGI FollowSymlinks<br />
Order allow,deny<br />
Allow from all<br />
</Directory><br />
<br />
===Lighttpd===<br />
Information for Lighttpd and cgit is scarse... The following configuration will let you access cgit through http://your.server.com/cgit with http://your.server.com/git redirecting to it. It's not perfect (for example you'll see "cgit.cgi" in all repos' url) but works.<br />
<br />
Create the file '''/etc/lighttpd/conf.d/cgit.conf''':<br />
server.modules += ("mod_redirect",<br />
"mod_alias",<br />
"mod_cgi",<br />
"mod_fastcgi",<br />
"mod_rewrite" )<br />
<br />
var.webapps = "/usr/share/webapps/"<br />
$HTTP["url"] =~ "^/cgit" {<br />
server.document-root = webapps<br />
server.indexfiles = ("cgit.cgi")<br />
cgi.assign = ("cgit.cgi" => "")<br />
mimetype.assign = ( ".css" => "text/css" )<br />
}<br />
url.redirect = (<br />
"^/git/(.*)$" => "/cgit/cgit.cgi/$1",<br />
)<br />
Just include this file in '''/etc/lighttpd/lighttpd.conf''':<br />
include "conf.d/cgit.conf"<br />
and restart lighttpd.<br />
<br />
===cgit===<br />
Before you can start adding repositories you will first have to create the basic cgit configuration file at {{ic|/etc/cgitrc}}.<br />
<br />
#<br />
# cgit config<br />
#<br />
<br />
css=/cgit-css/cgit.css<br />
logo=/cgit-css/cgit.png<br />
<br />
==Adding repositories==<br />
Now you can add your repos:<br />
<br />
#<br />
# List of repositories.<br />
# This list could be kept in a different file (e.g. '/etc/cgitrepos')<br />
# and included like this:<br />
# include=/etc/cgitrepos<br />
#<br />
<br />
repo.url=MyRepo<br />
repo.path=/srv/git/MyRepo.git<br />
repo.desc=This is my git repository<br />
<br />
repo.url=MyOtherRepo<br />
repo.path=/srv/git/MyOtherRepo.git<br />
repo.desc=That's my other git repository<br />
<br />
If you prefer not having to manually specify each repository it's also possible to configure cgit to search for them:<br />
<br />
scan-path=/srv/git/<br />
<br />
For detailed documentation about the available settings in this configuration file, please see the manage (`man cgitrc`).<br />
<br />
==Gitosis Integration==<br />
If you want to integrate with gitosis you will have to run two commands to give apache permission to look though the folder.<br />
<br />
# chgrp http /srv/gitosis<br />
# chmod a+rx /srv/gitosis<br />
<br />
==References==<br />
* http://hjemli.net/git/cgit/<br />
* http://hjemli.net/git/cgit/about/<br />
* http://hjemli.net/git/cgit/tree/README<br />
* http://hjemli.net/git/cgit/tree/cgitrc.5.txt</div>Morwel