https://wiki.archlinux.org/api.php?action=feedcontributions&user=Cornholio&feedformat=atomArchWiki - User contributions [en]2024-03-28T13:34:35ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Bumblebee&diff=425277Bumblebee2016-03-12T03:34:25Z<p>Cornholio: Add reference to bumblebee-patched version of nvdock available in AUR</p>
<hr />
<div>[[Category:Graphics]]<br />
[[Category:X server]]<br />
[[es:Bumblebee]]<br />
[[fr:Bumblebee]]<br />
[[it:Bumblebee]]<br />
[[ja:Bumblebee]]<br />
[[ru:Bumblebee]]<br />
[[tr:Bumblebee]]<br />
[[zh-CN:Bumblebee]]<br />
{{Related articles start}}<br />
{{Related|NVIDIA Optimus}}<br />
{{Related|Nouveau}}<br />
{{Related|NVIDIA}}<br />
{{Related|Intel graphics}}<br />
{{Related articles end}}<br />
From Bumblebee's [https://github.com/Bumblebee-Project/Bumblebee/wiki/FAQ FAQ]:<br />
<br />
"''Bumblebee is an effort to make NVIDIA Optimus enabled laptops work in GNU/Linux systems. Such feature involves two graphics cards with two different power consumption profiles plugged in a layered way sharing a single framebuffer.''"<br />
<br />
== Bumblebee: Optimus for Linux ==<br />
<br />
[http://www.nvidia.com/object/optimus_technology.html Optimus Technology] is an ''[http://hybrid-graphics-linux.tuxfamily.org/index.php?title=Hybrid_graphics hybrid graphics]'' implementation without a hardware multiplexer. The integrated GPU manages the display while the dedicated GPU manages the most demanding rendering and ships the work to the integrated GPU to be displayed. When the laptop is running on battery supply, the dedicated GPU is turned off to save power and prolong the battery life. It has also been tested successfully with desktop machines with Intel integrated graphics and an nVidia dedicated graphics card. <br />
<br />
Bumblebee is a software implementation comprising of two parts:<br />
<br />
* Render programs off-screen on the dedicated video card and display it on the screen using the integrated video card. This bridge is provided by VirtualGL or primus (read further) and connects to a X server started for the discrete video card.<br />
* Disable the dedicated video card when it is not in use (see the [[#Power management]] section)<br />
<br />
It tries to mimic the Optimus technology behavior; using the dedicated GPU for rendering when needed and power it down when not in use. The present releases only support rendering on-demand, automatically starting a program with the discrete video card based on workload is not implemented.<br />
<br />
== Installation ==<br />
<br />
Before installing Bumblebee, check your BIOS and activate Optimus (older laptops call it "switchable graphics") if possible (BIOS doesn't have to provide this option). If neither "Optimus" or "switchable" is in the bios, still make sure both gpu's will be enabled and that the integrated graphics (igfx) is initial display (primary display). The display should be connected to the onboard integrated graphics, not the discrete graphics card. If integrated graphics had previously been disabled and discrete graphics drivers installed, be sure to remove {{ic|/etc/X11/xorg.conf}} or the conf file in {{ic|/etc/X11/xorg.conf.d}} related to the discrete graphics card.<br />
<br />
=== Installing Bumblebee with Intel/NVIDIA ===<br />
<br />
Install:<br />
* {{Pkg|bumblebee}} - The main package providing the daemon and client programs.<br />
: {{Note|{{Pkg|bumblebee}} depends on {{Pkg|mesa-libgl}} and provides all {{Pkg|nvidia-libgl}}, {{Pkg|nvidia-340xx-libgl}} and {{Pkg|nvidia-304xx-libgl}} to avoid dependency conflict between the respective libgl versions.}}<br />
* {{Pkg|mesa}} - An open-source implementation of the '''OpenGL''' specification.<br />
* {{Pkg|xf86-video-intel}} - Intel driver.<br />
* {{Pkg|nvidia}} or {{Pkg|nvidia-340xx}} or {{Pkg|nvidia-304xx}} - Install appropriate NVIDIA driver. For more information read [[NVIDIA#Installation]].<br />
<br />
For 32-bit ([[Multilib]] must be enabled) applications support on 64-bit machines, install:<br />
* {{Pkg|lib32-virtualgl}} - A render/display bridge for 32 bit applications.<br />
* {{Pkg|lib32-nvidia-utils}} or {{Pkg|lib32-nvidia-340xx-utils}} or {{Pkg|lib32-nvidia-304xx-utils}} - match the version of the 64 bit package.<br />
* {{Pkg|lib32-mesa-libgl}} and make sure that {{pkg|lib32-nvidia-libgl}} is '''not''' installed<br />
<br />
In order to use Bumblebee, it is necessary to add your regular ''user'' to the {{ic|bumblebee}} group:<br />
<br />
# gpasswd -a ''user'' bumblebee<br />
<br />
Also [[enable]] {{ic|bumblebeed.service}}. Reboot your system and follow [[#Usage]].<br />
<br />
=== Installing Bumblebee with Intel/Nouveau ===<br />
<br />
{{Expansion}}<br />
<br />
{{Note|This method is deprecated and will most likely not work anymore. Use the nvidia module instead. If you want nouveau, use [[PRIME]].}}<br />
<br />
Install:<br />
* {{Pkg|xf86-video-nouveau}} - experimental 3D acceleration driver.<br />
* {{Pkg|mesa}} - Mesa classic DRI with Gallium3D drivers and 3D graphics libraries.<br />
<br />
{{Note|1=If, when using {{ic|primusrun}} on a system with the nouveau driver, you are getting:<br />
primus: fatal: failed to load any of the libraries: /usr/$LIB/nvidia/libGL.so.1 <br />
/usr/$LIB/nvidia/libGL.so.1: Cannot open shared object file: No such file or directory<br />
<br />
You should add the following in {{ic|/usr/bin/primus}} after {{ic|PRIMUS_libGL}}:<br />
export PRIMUS_libGLa='/usr/$LIB/libGL.so.1'<br />
<br />
If you want, create a new script (for example ''primusnouveau'').<br />
}}<br />
<br />
== Usage ==<br />
<br />
=== Test ===<br />
<br />
Install {{Pkg|mesa-demos}} and use {{ic|glxgears}} to test if if Bumblebee works with your Optimus system:<br />
$ optirun glxgears -info<br />
<br />
If it fails, try the following commands:<br />
<br />
*64 bit system:<br />
$ optirun glxspheres64<br />
*32 bit system:<br />
$ optirun glxspheres32<br />
<br />
If the window with animation shows up - Optimus with Bumblebee is working.<br />
<br />
{{Note|If {{ic|glxgears}} failed, but {{ic|glxspheres''XX''}} worked, always replace "{{ic|glxgears}}" with "{{ic|glxspheres''XX''}}" in all cases.}}<br />
<br />
=== General usage ===<br />
<br />
$ optirun [options] ''application'' [application-parameters]<br />
<br />
For example, start Windows applications with Optimus:<br />
<br />
$ optirun wine application.exe<br />
<br />
For another example, open NVIDIA Settings panel with Optimus:<br />
<br />
$ optirun -b none nvidia-settings -c :8<br />
<br />
: {{Note|A patched version of {{Pkg|nvdock}} is available in the package {{AUR|nvdock-bumblebee}}}}<br />
<br />
For a list of the options for {{ic|optirun}}, view its manual page:<br />
<br />
$ man optirun<br />
<br />
== Configuration ==<br />
<br />
You can configure the behaviour of Bumblebee to fit your needs. Fine tuning like speed optimization, power management and other stuff can be configured in {{ic|/etc/bumblebee/bumblebee.conf}}<br />
<br />
=== Optimizing speed ===<br />
<br />
==== Using VirtualGL as bridge ====<br />
<br />
Bumblebee renders frames for your Optimus NVIDIA card in an invisible X Server with VirtualGL and transports them back to your visible X Server. Frames will be compressed before they are transported - this saves bandwidth and can be used for speed-up optimization of bumblebee:<br />
<br />
To use another compression method for a single application:<br />
<br />
$ optirun -c ''compress-method'' application<br />
<br />
The method of compress will affect performance in the GPU/CPU usage. Compressed methods will mostly load the CPU. However, uncompressed methods will mostly load the GPU.<br />
<br />
Compressed methods<br />
:*{{ic|jpeg}}<br />
:*{{ic|rgb}}<br />
:*{{ic|yuv}}<br />
<br />
Uncompressed methods<br />
:*{{ic|proxy}}<br />
:*{{ic|xv}}<br />
<br />
Here is a performance table tested with [[ASUS N550JV]] laptop and benchmark app {{AUR|unigine-heaven}}:<br />
<br />
{| class="wikitable"<br />
! Command !! FPS !! Score !! Min FPS !! Max FPS<br />
|-<br />
| optirun unigine-heaven || 25.0 || 630 || 16.4 || 36.1<br />
|-<br />
| optirun -c jpeg unigine-heaven || 24.2 || 610 || 9.5 || 36.8<br />
|-<br />
| optirun -c rgb unigine-heaven || 25.1 || 632 || 16.6 || 35.5<br />
|-<br />
| optirun -c yuv unigine-heaven || 24.9 || 626 || 16.5 || 35.8<br />
|-<br />
| optirun -c proxy unigine-heaven || 25.0 || 629 || 16.0 || 36.1<br />
|-<br />
| optirun -c xv unigine-heaven || 22.9 || 577 || 15.4 || 32.2<br />
|}<br />
{{Note|Lag spikes occurred when {{ic|jpeg}} compression method was used.}}<br />
<br />
To use a standard compression for all applications, set the {{ic|VGLTransport}} to {{ic|''compress-method''}} in {{ic|/etc/bumblebee/bumblebee.conf}}:<br />
<br />
{{hc|/etc/bumblebee/bumblebee.conf|2=<br />
[...]<br />
[optirun]<br />
VGLTransport=proxy<br />
[...]<br />
}}<br />
<br />
You can also play with the way VirtualGL reads back the pixels from your graphic card. Setting {{ic|VGL_READBACK}} environment variable to {{ic|pbo}} should increase the performance. Compare these two:<br />
<br />
# PBO should be faster.<br />
VGL_READBACK=pbo optirun glxgears<br />
# The default value is sync.<br />
VGL_READBACK=sync optirun glxgears<br />
<br />
{{Note|CPU frequency scaling will affect directly on render performance}}<br />
<br />
==== Primusrun ====<br />
<br />
{{Note|Since compositing hurts performance, invoking primus when a compositing WM is active is not recommended. See [[#Primus issues under compositing window managers]].}}<br />
{{ic|primusrun}} (from package {{Pkg|primus}}) is becoming the default choice, because it consumes less power and sometimes provides better performance than {{ic|optirun}}/{{ic|virtualgl}}. It may be run separately, but it does not accept options as {{ic|optirun}} does. Setting {{ic|primus}} as the bridge for {{ic|optirun}} provides more flexibility.<br />
<br />
For 32-bit applications support on 64-bit machines, install {{Pkg|lib32-primus}} ([[multilib]] must be enabled).<br />
<br />
Usage (run separately):<br />
$ primusrun glxgears<br />
<br />
Usage (as a bridge for {{ic|optirun}}):<br />
<br />
The default configuration sets {{ic|virtualgl}} as the bridge. Override that on the command line:<br />
$ optirun -b primus glxgears<br />
<br />
Or, set {{ic|1=Bridge=primus}} in {{ic|/etc/bumblebee/bumblebee.conf}} and you won't have to specify it on the command line.<br />
<br />
{{Tip|Refer to [[#Primusrun mouse delay/disable VSYNC]] if you want to disable {{ic|VSYNC}}. It can also remove mouse input delay lag and slightly increase the performance.}}<br />
<br />
=== Power management ===<br />
<br />
The goal of the power management feature is to turn off the NVIDIA card when it is not used by Bumblebee any more. If {{Pkg|bbswitch}} (or {{AUR|bbswitch-dkms}}) is installed, it will be detected automatically when the Bumblebee daemon starts. No additional configuration is necessary. However, {{Pkg|bbswitch}} is for [https://bugs.launchpad.net/ubuntu/+source/bbswitch/+bug/1338404/comments/6 Optimus laptops only and will not work on desktop computers]. So, Bumblebee power management is not available for desktop computers, and there is no reason to install {{Pkg|bbswitch}} on a desktop. (Nevertheless, the other features of Bumblebee do work on some desktop computers.)<br />
<br />
==== Default power state of NVIDIA card using bbswitch ====<br />
<br />
The default behavior of bbswitch is to leave the card power state unchanged. {{ic|bumblebeed}} does disable the card when started, so the following is only necessary if you use bbswitch without bumblebeed.<br />
<br />
Set {{ic|load_state}} and {{ic|unload_state}} module options according to your needs (see [https://github.com/Bumblebee-Project/bbswitch bbswitch documentation]).<br />
{{hc|/etc/modprobe.d/bbswitch.conf|2=<br />
options bbswitch load_state=0 unload_state=1<br />
}}<br />
<br />
==== Enable NVIDIA card during shutdown ====<br />
The NVIDIA card may not correctly initialize during boot if the card was powered off when the system was last shutdown. One option is to set {{ic|TurnCardOffAtExit&#61;false}} in {{ic|/etc/bumblebee/bumblebee.conf}}, however this will enable the card everytime you stop the Bumblebee daemon, even if done manually. To ensure that the NVIDIA card is always powered on during shutdown, add the following [[systemd]] service (if using {{pkg|bbswitch}}):<br />
<br />
{{hc|/etc/systemd/system/nvidia-enable.service|2=<br />
[Unit]<br />
Description=Enable NVIDIA card<br />
DefaultDependencies=no<br />
<br />
[Service]<br />
Type=oneshot<br />
ExecStart=/bin/sh -c 'echo ON > /proc/acpi/bbswitch'<br />
<br />
[Install]<br />
WantedBy=shutdown.target<br />
}}<br />
<br />
Then enable the service by running {{ic|systemctl enable nvidia-enable.service}} at the root prompt.<br />
<br />
==== Enable NVIDIA card after waking from suspend ====<br />
The bumblebee daemon may fail to activate the graphics card after suspending. A possible fix involves setting {{Pkg|bbswitch}} as the default method for power management in {{ic|/etc/bumblebee/bumblebee.conf}}:<br />
<br />
{{hc|/etc/bumblebee/bumblebee.conf|2=<br />
[driver-nvidia]<br />
PMmethod=bbswitch<br />
<br />
# ...<br />
<br />
[driver-nouveau]<br />
PMmethod=bbswitch<br />
}}<br />
<br />
{{Note|This fix seems to work only after rebooting the system. Restarting the bumblebee service is not enough.}}<br />
<br />
=== Multiple monitors ===<br />
<br />
==== Outputs wired to the Intel chip ====<br />
<br />
If the port (DisplayPort/HDMI/VGA) is wired to the Intel chip, you can set up multiple monitors with xorg.conf. Set them to use the Intel card, but Bumblebee can still use the NVIDIA card. One example configuration is below for two identical screens with 1080p resolution and using the HDMI out.<br />
<br />
{{hc|/etc/X11/xorg.conf|2=<br />
Section "Screen"<br />
Identifier "Screen0"<br />
Device "intelgpu0"<br />
Monitor "Monitor0"<br />
DefaultDepth 24<br />
Option "TwinView" "0"<br />
SubSection "Display"<br />
Depth 24<br />
Modes "1980x1080_60.00"<br />
EndSubSection<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen1"<br />
Device "intelgpu1"<br />
Monitor "Monitor1"<br />
DefaultDepth 24<br />
Option "TwinView" "0"<br />
SubSection "Display"<br />
Depth 24<br />
Modes "1980x1080_60.00"<br />
EndSubSection<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor0"<br />
Option "Enable" "true"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor1"<br />
Option "Enable" "true"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "intelgpu0"<br />
Driver "intel"<br />
Option "XvMC" "true"<br />
Option "UseEvents" "true"<br />
Option "AccelMethod" "UXA"<br />
BusID "PCI:0:2:0"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "intelgpu1"<br />
Driver "intel"<br />
Option "XvMC" "true"<br />
Option "UseEvents" "true"<br />
Option "AccelMethod" "UXA"<br />
BusID "PCI:0:2:0"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "nvidiagpu1"<br />
Driver "nvidia"<br />
BusID "PCI:0:1:0"<br />
EndSection<br />
<br />
}}<br />
<br />
You need to probably change the BusID for both the Intel and the NVIDIA card.<br />
<br />
{{hc|<nowiki>$ lspci | grep VGA</nowiki>|<br />
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)<br />
}}<br />
<br />
The BusID is 0:2:0<br />
<br />
==== Output wired to the NVIDIA chip ====<br />
<br />
On some notebooks, the digital Video Output (HDMI or DisplayPort) is hardwired to the NVIDIA chip. If you want to use all the displays on such a system simultaniously, you have to run 2 X Servers. The first will be using the Intel driver for the notebooks panel and a display connected on VGA. The second will be started through optirun on the NVIDIA card, and drives the digital display.<br />
<br />
There are currently several instructions on the web how such a setup can be made to work. One can be found on the bumblebee [https://github.com/Bumblebee-Project/Bumblebee/wiki/Multi-monitor-setup wiki page]. Another approach is described below.<br />
<br />
===== Using intel-virtual-output =====<br />
<br />
This method should obsolete the use of ''xf86-video-intel-virtual-crtc'' and ''hybrid-screenclone''. ''intel-virtual-output'' is a tool provided in the ''xf86-video-intel driver'' set, as of v2.99. When run in a terminal, it will daemonize itself unless the {{ic|-f}} switch is used. Once the tool is running, it activates Bumblebee (Bumblebee can be left as default install), and any displays attached will be automatically detected, and manageable via any desktop display manager such as xrandr or KDE Display.<br />
<br />
{{Note|In {{ic|/etc/bumblebee/xorg.conf.nvidia}} change the lines {{ic|UseEDID}} and {{ic|Option "AutoAddDevices" "false"}} to {{ic|"true"}}, if you are having trouble with device resolution detection.}}<br />
<br />
Commandline usage is as follows:<br />
<br />
intel-virtual-output [OPTION]... [TARGET_DISPLAY]...<br />
-d <source display> source display<br />
-f keep in foreground (do not detach from console and daemonize)<br />
-b start bumblebee<br />
-a connect to all local displays (e.g. :1, :2, etc)<br />
-S disable use of a singleton and launch a fresh intel-virtual-output process<br />
-v all verbose output, implies -f<br />
-V <category> specific verbose output, implies -f<br />
-h this help<br />
<br />
If no target displays are parsed on the commandline, ''intel-virtual-output'' will attempt to connect to any local display and then start bumblebee.[http://cgit.freedesktop.org/xorg/driver/xf86-video-intel/tree/tools/]<br />
<br />
The advantage of using ''intel-virtual-output'' in foreground mode is that once the external display is disconected, ''intel-virtual-output'' can then be killed and bumblebee will disable the nvidia chip. Games can be run on the external screen by first exporting the display {{ic|1=export DISPLAY=:8}}, and then running the game with {{ic|optirun ''game_bin''}}, however, cursor and keyboard are not fully captured. Use {{ic|1=export DISPLAY=:0}} to revert back to standard operation.<br />
<br />
===== xf86-video-intel-virtual-crtc and hybrid-screenclone =====<br />
<br />
This method uses a patched Intel driver, which is extended to have a VIRTUAL Display, and the program hybrid-screenclone which is used to copy the display over from the virtual display to a second X Server which is running on the NVIDIA card using Optirun. Credit goes to [http://judsonsnotes.com/notes/index.php?option=com_content&view=article&id=673:triple-head-monitors-on-thinkpad-t520&catid=37:tech-notes&Itemid=59 Triple-head monitors on a Thinkpad T520] {{Dead link|2014|10|03}} which has a detailed explanation on how this is done on a Ubuntu system.<br />
<br />
For simplicity, DP is used below to refer to the Digital Output (DisplayPort). The instructions should be the same if the notebook has a HDMI port instead.<br />
<br />
* Set system to use NVIDIA card exclusively, test DP/Monitor combination and generate xorg.nvidia.conf. This step is not required, but recommended if your system Bios has an option to switch the graphics into NVIDIA-only mode. To do this, first uninstall the bumblebee package and install just the NVIDIA driver. Then reboot, enter the Bios and switch the Graphics to NVIDIA-only. When back in Arch, connect you Monitor on DP and use startx to test if it is working in principle. Use Xorg -configure to generate an xorg.conf file for your NVIDIA card. This will come in handy further down below.<br />
<br />
* Reinstall bumlbebee and bbswitch, reboot and set the system Gfx back to Hybrid in the BIOS. <br />
* Install {{AUR|xf86-video-intel-virtual-crtc}}{{Broken package link|{{aur-mirror|xf86-video-intel-virtual-crtc}}}}, and replace your xf86-video-intel package with it.<br />
* Install {{AUR|screenclone-git}}{{Broken package link|{{aur-mirror|screenclone-git}}}}<br />
* Change these bumblebee.conf settings:<br />
{{hc|/etc/bumblebee/bumblebee.conf|2=<br />
KeepUnusedXServer=true<br />
Driver=nvidia<br />
}}<br />
{{Note|Leave the PMMethod set to "bumblebee". This is contrary to the instructions linked in the article above, but on arch this options needs to be left alone so that bbswitch module is automatically loaded}}<br />
* Copy the xorg.conf generated in Step 1 to {{ic|/etc/X11}} (e.g. {{ic|/etc/X11/xorg.nvidia.conf}}). In the [driver-nvidia] section of {{ic|bumblebee.conf}}, change {{ic|XorgConfFile}} to point to it.<br />
* Test if your {{ic|/etc/X11/xorg.nvidia.conf}} is working with {{ic|startx -- -config /etc/X11/xorg.nvidia.conf}}<br />
* In order for your DP Monitor to show up with the correct resolution in your VIRTUAL Display you might have to edit the Monitor section in your {{ic|/etc/X11/xorg.nvidia.conf}}. Since this is extra work, you could try to continue with your auto-generated file. Come back to this step in the instructions if you find that the resolution of the VIRTUAL Display as shown by xrandr is not correct.<br />
** First you have to generate a Modeline. You can use the tool [http://zi.fi/amlc/ amlc], which will genearte a Modeline if you input a few basic parameters. <br />
<br />
::Example: 24" 1920x1080 Monitor<br />
::start the tool with {{ic|amlc -c}}<br />
{{bc|Monitor Identifier: Samsung 2494<br />
Aspect Ratio: 2<br />
physical size[cm]: 60<br />
Ideal refresh rate, in Hz: 60<br />
min HSync, kHz: 40<br />
max HSync, kHz: 90<br />
min VSync, Hz: 50<br />
max VSync, Hz: 70<br />
max pixel Clock, MHz: 400}}<br />
<br />
This is the Monitor section which {{ic|amlc}} generated for this input:<br />
{{bc|Section "Monitor"<br />
Identifier "Samsung 2494"<br />
ModelName "Generated by Another Modeline Calculator"<br />
HorizSync 40-90<br />
VertRefresh 50-70<br />
DisplaySize 532 299 # Aspect ratio 1.778:1<br />
# Custom modes<br />
Modeline "1920x1080" 174.83 1920 2056 2248 2536 1080 1081 1084 1149 # 174.83 MHz, 68.94 kHz, 60.00 Hz<br />
EndSection # Samsung 2494}}<br />
<br />
Change your {{ic|xorg.nvidia.conf}} to include this Monitor section. You can also trim down your file so that it only contains ServerLayout, Monitor, Device and Screen sections. For reference, here is mine:<br />
{{hc|/etc/X11/xorg.nvidia.conf|<br />
Section "ServerLayout"<br />
Identifier "X.org Nvidia DP"<br />
Screen 0 "Screen0" 0 0<br />
InputDevice "Mouse0" "CorePointer"<br />
InputDevice "Keyboard0" "CoreKeyboard"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Samsung 2494"<br />
ModelName "Generated by Another Modeline Calculator"<br />
HorizSync 40-90<br />
VertRefresh 50-70<br />
DisplaySize 532 299 # Aspect ratio 1.778:1<br />
# Custom modes<br />
Modeline "1920x1080" 174.83 1920 2056 2248 2536 1080 1081 1084 1149 # 174.83 MHz, 68.94 kHz, 60.00 Hz<br />
EndSection # Samsung 2494<br />
<br />
Section "Device"<br />
Identifier "DiscreteNvidia"<br />
Driver "nvidia"<br />
BusID "PCI:1:0:0"<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen0"<br />
Device "DiscreteNvidia"<br />
Monitor "Samsung 2494"<br />
SubSection "Display"<br />
Viewport 0 0<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
}}<br />
* Plug in both external monitors and startx. Look at your {{ic|/var/log/Xorg.0.log}}. Check that your VGA Monitor is detected with the correct Modes there. You should also see a VIRTUAL output with modes show up.<br />
* Run {{ic|xrandr}} and three displays should be listed there, along with the supported modes.<br />
* If the listed Modelines for your VIRTUAL display doesn't have your Monitors native resolution, make note of the exact output name. For me that is {{ic|VIRTUAL1}}. Then have a look again in the Xorg.0.log file. You should see a message: "Output VIRTUAL1 has no monitor section" there. We will change this by putting a file with the needed Monitor section into {{ic|/etc/X11/xorg.conf.d}}. Exit and Restart X afterward.<br />
{{hc|/etc/X11/xorg.conf.d/20-monitor_samsung.conf|<br />
Section "Monitor"<br />
Identifier "VIRTUAL1"<br />
ModelName "Generated by Another Modeline Calculator"<br />
HorizSync 40-90<br />
VertRefresh 50-70<br />
DisplaySize 532 299 # Aspect ratio 1.778:1<br />
# Custom modes<br />
Modeline "1920x1080" 174.83 1920 2056 2248 2536 1080 1081 1084 1149 # 174.83 MHz, 68.94 kHz, 60.00 Hz<br />
EndSection # Samsung 2494<br />
}}<br />
* Turn the NVIDIA card on by running: {{ic|sudo tee /proc/acpi/bbswitch <<< ON}}<br />
* Start another X server for the DisplayPort monitor: {{ic|sudo optirun true}}<br />
* Check the log of the second X server in {{ic|/var/log/Xorg.8.log}}<br />
* Run xrandr to set up the VIRTUAL display to be the right size and placement, eg.: {{ic|xrandr --output VGA1 --auto --rotate normal --pos 0x0 --output VIRTUAL1 --mode 1920x1080 --right-of VGA1 --output LVDS1 --auto --rotate normal --right-of VIRTUAL1}}<br />
* Take note of the position of the VIRTUAL display in the list of Outputs as shown by xrandr. The counting starts from zero, i.e. if it is the third display shown, you would specify {{ic|-x 2}} as parameter to {{ic|screenclone}} (Note: This might not always be correct. If you see your internal laptop display cloned on the monitor, try {{ic|-x 2}} anyway.)<br />
* Clone the contents of the VIRTUAL display onto the X server created by bumblebee, which is connected to the DisplayPort monitor via the NVIDIA chip:<br />
: {{ic|screenclone -d :8 -x 2}}<br />
<br />
Thats it, all three displays should be up and running now.<br />
<br />
== Switch between discrete and integrated like Windows==<br />
<br />
In Windows, the way that Optimus works is NVIDIA has a whitelist of applications that require Optimus for, and you can add applications to this whitelist as needed. When you launch the application, it automatically decides which card to use.<br />
<br />
To mimic this behavior in Linux, you can use {{AUR|libgl-switcheroo-git}}{{Broken package link|{{aur-mirror|libgl-switcheroo-git}}}}. After installing, you can add the below in your .xprofile.<br />
<br />
{{hc|~/.xprofile|2=<br />
mkdir -p /tmp/libgl-switcheroo-$USER/fs<br />
gtkglswitch &<br />
libgl-switcheroo /tmp/libgl-switcheroo-$USER/fs &<br />
}}<br />
<br />
To enable this, you must add the below to the shell that you intend to launch applications from (I simply added it to the .xprofile file)<br />
export LD_LIBRARY_PATH=/tmp/libgl-switcheroo-$USER/fs/\$LIB${LD_LIBRARY_PATH+:}$LD_LIBRARY_PATH<br />
<br />
Once this has all been done, every application you launch from this shell will pop up a GTK+ window asking which card you want to run it with (you can also add an application to the whitelist in the configuration). The configuration is located in {{ic|$XDG_CONFIG_HOME/libgl-switcheroo.conf}}, usually {{ic|~/.config/libgl-switcheroo.conf}}<br />
<br />
{{Note|This tool acts by making a FUSE file system and then adding it into the dynamic library searching path, which may lead to slow speed or even segmentation faults when launching a software.}}<br />
<br />
== CUDA without Bumblebee==<br />
<br />
You can use CUDA without bumblebee. All you need to do is ensure that the nvidia card is on:<br />
<br />
# tee /proc/acpi/bbswitch <<< ON<br />
<br />
Now when you start a CUDA application it is going to automatically load all the necessary modules.<br />
<br />
To turn off the nvidia card after using CUDA do:<br />
<br />
# rmmod nvidia_uvm<br />
# rmmod nvidia<br />
# tee /proc/acpi/bbswitch <<< OFF<br />
<br />
== Troubleshooting ==<br />
<br />
{{Note|Please report bugs at [https://github.com/Bumblebee-Project/Bumblebee Bumblebee-Project]'s GitHub tracker as described in its [https://github.com/Bumblebee-Project/Bumblebee/wiki/Reporting-Issues wiki].}}<br />
<br />
=== [VGL] ERROR: Could not open display :8 ===<br />
<br />
There is a known problem with some wine applications that fork and kill the parent process without keeping track of it (for example the free to play online game "Runes of Magic")<br />
<br />
This is a known problem with VirtualGL. As of bumblebee 3.1, so long as you have it installed, you can use Primus as your render bridge:<br />
<br />
$ optirun -b primus wine ''windows program''.exe<br />
<br />
If this does not work, an alternative walkaround for this problem is:<br />
<br />
$ optirun bash<br />
$ optirun wine ''windows program''.exe<br />
<br />
If using NVIDIA drivers a fix for this problem is to edit {{ic|/etc/bumblebee/xorg.conf.nvidia}} and change Option {{ic|ConnectedMonitor}} to {{ic|CRT-0}}.<br />
<br />
=== Xlib: extension "GLX" missing on display ":0.0" ===<br />
<br />
If you tried to install the NVIDIA driver from NVIDIA website, this is not going to work.<br />
<br />
1. Uninstall that driver in the similar way:<br />
# ./NVIDIA-Linux-*.run --uninstall<br />
2. Remove generated by NVIDIA Xorg configuration file:<br />
# rm /etc/X11/xorg.conf<br />
3. (Re)install the correct NVIDIA driver: [[#Installing Bumblebee with Intel/NVIDIA]]<br />
<br />
=== [ERROR]Cannot access secondary GPU: No devices detected ===<br />
<br />
In some instances, running {{ic|optirun}} will return:<br />
<br />
[ERROR]Cannot access secondary GPU - error: [XORG] (EE) No devices detected.<br />
[ERROR]Aborting because fallback start is disabled.<br />
<br />
In this case, you will need to move the file {{ic|/etc/X11/xorg.conf.d/20-intel.conf}} to somewhere else, [[restart]] the bumblebeed daemon and it should work. If you do need to change some features for the Intel module, a workaround is to merge {{ic|/etc/X11/xorg.conf.d/20-intel.conf}} to {{ic|/etc/X11/xorg.conf}}.<br />
<br />
It could be also necessary to comment the driver line in {{ic|/etc/X11/xorg.conf.d/10-monitor.conf}}.<br />
<br />
If you're using the {{ic|nouveau}} driver you could try switching to the {{ic|nvidia}} driver.<br />
<br />
You might need to define the NVIDIA card somewhere (e.g. file {{ic|/etc/X11/xorg.conf.d}}), using the correct {{ic|BusID}} according to {{ic|lspci}} output:<br />
<br />
{{bc|<br />
Section "Device"<br />
Identifier "nvidiagpu1"<br />
Driver "nvidia"<br />
BusID "PCI:0:1:0"<br />
EndSection<br />
}}<br />
<br />
Observe that the format of {{ic|lspci}} output is in HEX, while in xorg it is in decimals. So if the output of {{ic|lspci}} is, for example, {{ic|0a:00.0}} the {{ic|BusID}} should be {{ic|PCI:10:0:0}}.<br />
<br />
<br />
==== NVIDIA(0): Failed to assign any connected display devices to X screen 0 ====<br />
<br />
If the console output is:<br />
<br />
[ERROR]Cannot access secondary GPU - error: [XORG] (EE) NVIDIA(0): Failed to assign any connected display devices to X screen 0<br />
[ERROR]Aborting because fallback start is disabled.<br />
<br />
You can change this line in {{ic|/etc/bumblebee/xorg.conf.nvidia}}:<br />
<br />
Option "ConnectedMonitor" "DFP"<br />
<br />
to:<br />
<br />
Option "ConnectedMonitor" "CRT"<br />
<br />
==== Failed to initialize the NVIDIA GPU at PCI:1:0:0 (GPU fallen off the bus / RmInitAdapter failed!) ====<br />
<br />
Add {{ic|1=rcutree.rcu_idle_gp_delay=1}} to the [[kernel parameters]] of the [[bootloader]] configuration (see also the original [https://bbs.archlinux.org/viewtopic.php?id=169742 BBS post] for a configuration example).<br />
<br />
==== Could not load GPU driver ====<br />
<br />
If the console output is:<br />
<br />
[ERROR]Cannot access secondary GPU - error: Could not load GPU driver<br />
<br />
and if you try to load the nvidia module you get:<br />
<br />
modprobe nvidia<br />
modprobe: ERROR: could not insert 'nvidia': Exec format error<br />
<br />
This could be because the nvidia driver is out of sync with the Linux kernel, for example if you installed the latest nvidia driver and haven't updated the kernel in a while. A full system update might resolve the issue. If the problem persists you should try manually compiling the nvidia packages against your current kernel, for example with {{Pkg|nvidia-dkms}} or by compiling {{pkg|nvidia}} from the [[ABS]].<br />
<br />
==== NOUVEAU(0): [drm] failed to set drm interface version ====<br />
<br />
Consider switching to the official nvidia driver. As commented [https://github.com/Bumblebee-Project/Bumblebee/issues/438#issuecomment-22005923 here], nouveau driver has some issues with some cards and bumblebee.<br />
<br />
=== /dev/dri/card0: failed to set DRM interface version 1.4: Permission denied ===<br />
<br />
This could be worked around by appending following lines in {{ic|/etc/bumblebee/xorg.conf.nvidia}} (see [https://github.com/Bumblebee-Project/Bumblebee/issues/580 here]):<br />
{{bc|<br />
Section "Screen"<br />
Identifier "Default Screen"<br />
Device "DiscreteNvidia"<br />
EndSection<br />
}}<br />
<br />
=== ERROR: ld.so: object 'libdlfaker.so' from LD_PRELOAD cannot be preloaded: ignored ===<br />
<br />
You probably want to start a 32-bit application with bumblebee on a 64-bit system. See the "For 32-bit..." section in [[#Installation]]. If the problem persists or if it is a 64-bit application, try using the [[#Primusrun|primus bridge]].<br />
<br />
=== Fatal IO error 11 (Resource temporarily unavailable) on X server ===<br />
<br />
Change {{ic|KeepUnusedXServer}} in {{ic|/etc/bumblebee/bumblebee.conf}} from {{ic|false}} to {{ic|true}}. Your program forks into background and bumblebee don't know anything about it.<br />
<br />
=== Video tearing ===<br />
<br />
Video tearing is a somewhat common problem on Bumblebee. To fix it, you need to enable vsync. It should be enabled by default on the Intel card, but verify that from Xorg logs. To check whether or not it is enabled for NVIDIA, run: <br />
<br />
$ optirun nvidia-settings -c :8<br />
<br />
{{ic|1=X Server XVideo Settings -> Sync to VBlank}} and {{ic|1=OpenGL Settings -> Sync to VBlank}} should both be enabled. The Intel card has in general less tearing, so use it for video playback. Especially use VA-API for video decoding (e.g. {{ic|mplayer-vaapi}} and with {{ic|-vsync}} parameter).<br />
<br />
Refer to the [[Intel#Video_tearing|Intel]] article on how to fix tearing on the Intel card.<br />
<br />
If it is still not fixed, try to disable compositing from your desktop environment. Try also disabling triple buffering.<br />
<br />
=== Bumblebee cannot connect to socket ===<br />
<br />
You might get something like:<br />
<br />
$ optirun glxspheres64<br />
or (for 32 bit):<br />
{{hc|$ optirun glxspheres32|<br />
[ 1648.179533] [ERROR]You've no permission to communicate with the Bumblebee daemon. Try adding yourself to the 'bumblebee' group<br />
[ 1648.179628] [ERROR]Could not connect to bumblebee daemon - is it running?<br />
}}<br />
<br />
If you are already in the {{ic|bumblebee}} group ({{ic|<nowiki>$ groups | grep bumblebee</nowiki>}}), you may try [https://bbs.archlinux.org/viewtopic.php?pid=1178729#p1178729 removing the socket] {{ic|/var/run/bumblebeed.socket}}.<br />
<br />
Another reason for this error could be that you haven't actually turned on both gpu's in your bios, and as a result, the Bumblebee daemon is in fact not running. Check the bios settings carefully and be sure intel graphics (integrated graphics - may be abbreviated in bios as something like igfx) has been enabled or set to auto, and that it's the primary gpu. Your display should be connected to the onboard integrated graphics, not the discrete graphics card.<br />
<br />
If you mistakenly had the display connected to the discrete graphics card and intel graphics was disabled, you probably installed Bumblebee after first trying to run Nvidia alone. In this case, be sure to remove the /etc/X11/xorg.conf or .../20-nvidia... configuration files. If Xorg is instructed to use Nvidia in a conf file, X will fail.<br />
<br />
=== Running X.org from console after login (rootless X.org) ===<br />
<br />
See [[Xorg#Rootless Xorg (v1.16)]].<br />
<br />
=== Primusrun mouse delay/disable VSYNC ===<br />
<br />
For {{ic|primusrun}}, {{ic|VSYNC}} is enabled by default and as a result, it could make mouse input delay lag or even slightly decrease performance. Test {{ic|primusrun}} without {{ic|VSYNC}}:<br />
<br />
$ vblank_mode=0 primusrun glxgears<br />
<br />
If you want to use it instead of {{ic|primusrun}}, create new file:<br />
<br />
{{hc|/usr/bin/optiprime|2=<nowiki><br />
#!/bin/sh<br />
vblank_mode=0 primusrun "$@"<br />
</nowiki>}}<br />
<br />
Make it executable:<br />
<br />
# chmod +x /usr/bin/optiprime<br />
<br />
Usage:<br />
<br />
$ optiprime glxgears<br />
<br />
In conclusion, it doesn't make significant performance improvement, but as mentioned above, it should remove mouse input delay lag.<br />
<br />
{| class="wikitable"<br />
! Command !! FPS !! Score !! Min FPS !! Max FPS<br />
|-<br />
| optiprime unigine-heaven || 31.5 || 793 || 22.3 || 54.8<br />
|-<br />
| primusrun unigine-heaven || 31.4 || 792 || 18.7 || 54.2<br />
|}<br />
''Tested with [[ASUS N550JV]] laptop and benchmark app {{AUR|unigine-heaven}}.''<br />
<br />
{{Note|To disable vertical synchronization system-wide, see [[Intel graphics#Disable Vertical Synchronization (VSYNC)]].}}<br />
<br />
=== Primus issues under compositing window managers ===<br />
<br />
Since compositing hurts performance, invoking primus when a compositing WM is active is not recommended.[https://github.com/amonakov/primus#issues-under-compositing-wms]<br />
If you need to use primus with compositing and see flickering or bad performance, synchronizing primus' display thread with the application's rendering thread may help:<br />
<br />
$ PRIMUS_SYNC=1 primusrun ...<br />
<br />
This makes primus display the previously rendered frame.<br />
<br />
=== Problems with bumblebee after resuming from standby ===<br />
<br />
In some systems, it can happens that the nvidia module is loaded after resuming from standby.<br />
The solution for this, is to install the {{pkg|acpi_call}} and {{pkg|acpi}} package.<br />
<br />
== See also ==<br />
<br />
* [http://www.bumblebee-project.org Bumblebee project repository]<br />
* [http://wiki.bumblebee-project.org/ Bumblebee project wiki]<br />
* [https://github.com/Bumblebee-Project/bbswitch Bumblebee project bbswitch repository]<br />
<br />
Join us at #bumblebee at freenode.net.</div>Cornholiohttps://wiki.archlinux.org/index.php?title=Xfce&diff=331534Xfce2014-08-20T20:12:59Z<p>Cornholio: /* Window manager */ Added information about how to change the default window manager that gets executed during xfce startup, since not all WMs support --replace</p>
<hr />
<div>[[Category:Desktop environments]]<br />
[[cs:Xfce]]<br />
[[de:Xfce]]<br />
[[es:Xfce]]<br />
[[fr:Xfce]]<br />
[[it:Xfce]]<br />
[[ja:Xfce]]<br />
[[pl:Xfce]]<br />
[[ru:Xfce]]<br />
[[tr:Xfce Masaüstü Ortamı]]<br />
[[uk:Xfce]]<br />
[[zh-CN:Xfce]]<br />
{{Related articles start}}<br />
{{Related|Desktop environment}}<br />
{{Related|Window manager}}<br />
{{Related|Xfwm}}<br />
{{Related|Thunar}}<br />
{{Related|LXDE}}<br />
{{Related|GNOME}}<br />
{{Related articles end}}<br />
<br />
[http://www.xfce.org Xfce] is a lightweight and modular [[Desktop environment]] currently based on GTK+ 2. To provide a complete user experience, it includes a window manager, a file manager, desktop and panel.<br />
<br />
== Installation ==<br />
<br />
Xfce can be installed from the {{Grp|xfce4}} group which is available in the official repositories. The {{Grp|xfce4-goodies}} group includes extra plugins and a number of useful utilities such as the {{Pkg|mousepad}} editor.<br />
<br />
== Starting Xfce ==<br />
<br />
=== Graphical login ===<br />
<br />
Choose ''Xfce Session'' from the menu in a [[display manager]] of choice.<br />
<br />
=== Virtual console ===<br />
<br />
There are two methods to start Xfce manually:<br />
<br />
* Run {{ic|startxfce4}} directly from the console.<br />
* Configure {{ic|~/.xinitrc}} to {{ic|exec startxfce4}} and then run {{ic|xinit}} or {{ic|startx}} from the console. See [[xinitrc]] for details.<br />
<br />
{{Note|The proper command for launching Xfce is {{ic|startxfce4}}, do not start {{ic|xfce4-session}} directly.}}<br />
<br />
{{Tip|To start Xfce automatically at login, see [[Start X at Login]].}}<br />
<br />
== Configuration ==<br />
<br />
{{Poor writing|Content duplication, hugely complex, poor style}}<br />
<br />
Xfce stores configuration options in [http://docs.xfce.org/xfce/xfconf/start Xfconf]. There are several ways to modify these options:<br />
<br />
* In the main menu, select [http://docs.xfce.org/xfce/xfce4-settings/start Settings] and the category you want to customize. Categories are programs usually located in {{ic|/usr/bin/xfce4-*}} and {{ic|/usr/bin/xfdesktop-settings}}.<br />
* {{ic|xfce4-settings-editor}} can see and modify all settings. Options modified here will take effect immediately. Use {{ic|xfconf-query}} to change settings from the commandline; see [http://docs.xfce.org/xfce/xfconf/xfconf-query the documentation] for details.<br />
* Settings are stored in XML files in {{ic|~/.config/xfce4/xfconf/xfce-perchannel-xml/}} which can be edited by hand. However, changes made here will ''not'' take effect immediately.<br />
<br />
=== Menu ===<br />
<br />
==== Whisker menu ====<br />
<br />
{{AUR|xfce4-whiskermenu-plugin}} from the [[AUR]] is an alternate application launcher. It shows a list of favorites and browses through all installed applications through category buttons.<br />
<br />
==== Edit entries ====<br />
<br />
{{Merge|Desktop entries}}<br />
<br />
To hide a menu item, add {{ic|1=NoDisplay=true}} in the respective [[Desktop entries]]. You can copy an entry in {{ic|/usr/share/applications}} to {{ic|.local/share/applications}} for user-specific changes, and to prevent application updates from overwriting changes.<br />
<br />
You can also edit the application's category by editing {{ic|.desktop}} files and modifying the {{ic|1=Categories=}} line.<br />
<br />
Alternatively, create the file {{ic|~/.config/menus/xfce-applications.menu}} and add the following:<br />
<br />
<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN"<br />
"http://www.freedesktop.org/standards/menu-spec/1.0/menu.dtd"><br />
<br />
<Menu><br />
<Name>Xfce</Name><br />
<MergeFile type="parent">/etc/xdg/menus/xfce-applications.menu</MergeFile><br />
<br />
<Exclude><br />
<Filename>xfce4-run.desktop</Filename><br />
<Filename>exo-terminal-emulator.desktop</Filename><br />
<Filename>exo-file-manager.desktop</Filename><br />
<Filename>exo-mail-reader.desktop</Filename><br />
<Filename>exo-web-browser.desktop</Filename><br />
<Filename>xfce4-about.desktop</Filename><br />
<Filename>xfhelp4.desktop</Filename><br />
</Exclude><br />
<br />
<Layout><br />
<Merge type="all"/><br />
<Separator/><br />
<Menuname>Settings</Menuname><br />
<Separator/><br />
<Filename>xfce4-session-logout.desktop</Filename><br />
</Layout><br />
</Menu><br />
<br />
The {{ic|<MergeFile>}} tag includes the default Xfce menu.<br />
<br />
The {{ic|<Exclude>}} tag excludes applications which we do not want to appear in the menu. Here we excluded some Xfce default shortcuts, but you can exclude {{ic|firefox.desktop}} or any other application.<br />
<br />
The {{ic|<Layout>}} tag defines the layout of the menu. The applications can be organized in folders or however we wish. For more details see the [http://wiki.xfce.org/howto/customize-menu Xfce wiki].<br />
<br />
Separate tools are also available for this task:<br />
<br />
* {{App|XAME|GUI tool written in Gambas designed specifically for editing menu entires in Xfce, it will not work in other environments.|http://www.redsquirrel87.com/XAME.html|{{AUR|xame}}}}<br />
* {{App|menulibre|An advanced menu editor that provides modern features in a clean, easy-to-use interface.|https://launchpad.net/menulibre|{{AUR|menulibre}}}}.<br />
* {{App|alacarte|Menu editor for GNOME|http://www.gnome.org/|{{Pkg|alacarte}}}}<br />
<br />
{{Note|Desktop entries which contain {{ic|<nowiki>OnlyShowIn=Xfce;</nowiki>}} will not appear in ''alacarte''. Similarly, entries with {{ic|<nowiki>OnlyShowIn=GNOME;</nowiki>}} will not show in the Xfce menu. {{AUR|alacarte-xfce}} and {{AUR|alacarte-lxde}} from the [[AUR]] address this issue; latter should work in and outside [[LXDE]].}}<br />
<br />
=== Desktop ===<br />
<br />
==== Transparent background for icon titles ====<br />
<br />
To change the default white background of desktop icon titles to something more suitable, create or edit {{ic|~/.gtkrc-2.0}}:<br />
<br />
{{bc|<nowiki><br />
style "xfdesktop-icon-view" {<br />
XfdesktopIconView::label-alpha = 10<br />
base[NORMAL] = "#000000"<br />
base[SELECTED] = "#71B9FF"<br />
base[ACTIVE] = "#71B9FF"<br />
fg[NORMAL] = "#fcfcfc"<br />
fg[SELECTED] = "#ffffff"<br />
fg[ACTIVE] = "#ffffff"<br />
}<br />
widget_class "*XfdesktopIconView*" style "xfdesktop-icon-view"<br />
</nowiki>}}<br />
<br />
==== Hide selected partitions ====<br />
<br />
{{Merge|udev}}<br />
<br />
If you wish to prevent certain partitions or drives appearing on the desktop, you can create a udev rule, for example {{ic|/etc/udev/rules.d/10-local.rules}}:<br />
<br />
KERNEL=="sda1", ENV{UDISKS_PRESENTATION_HIDE}="1"<br />
KERNEL=="sda2", ENV{UDISKS_PRESENTATION_HIDE}="1"<br />
<br />
shows all partitions with the exception of {{ic|sda1}} and {{ic|sda2}} on your desktop. Notice if you are using {{Pkg|udisks2}} the above will not work as {{ic|UDISKS_PRESENTATION_HIDE}} is no longer supported. Instead use {{ic|UDISKS_IGNORE}} as follows:<br />
<br />
KERNEL=="sda1", ENV{UDISKS_IGNORE}="1"<br />
KERNEL=="sda2", ENV{UDISKS_IGNORE}="1"<br />
<br />
==== Remove Thunar options from right-click menu ====<br />
<br />
Issue the following command:<br />
<br />
$ xfconf-query -c xfce4-desktop -v --create -p /desktop-icons/style -t int -s 0<br />
<br />
==== Kill window shortcut ====<br />
<br />
{{Accuracy|No explanation what the string does over a simple {{ic|xkill}} command}}<br />
<br />
Xfce does not support the ''kill window'' shortcut directly, but you can add one with a simple script. Ensure you have the '''xorg-xkill''' package installed.<br />
<br />
Create a script in {{ic|~/.config/xfce4/killwindow.sh}} with this content and make it executable (you can use {{ic|chmod 755 killwindow.sh}}).<br />
<br />
xkill -id "`xprop -root -notype | sed -n '/^_NET_ACTIVE_WINDOW/ s/^.*# *\|\,.*$//g p'`"<br />
<br />
Now associate a shortcut using {{ic|Settings -> Keyboard}} to that script.<br />
<br />
=== Window manager ===<br />
<br />
{{Poor writing|Cut to the chase}}<br />
<br />
The default window manager for Xfce is [[Xfwm]]. Users may either a) change the default window manager or b) launch the desired window manager after xfwm4 has started.<br />
<br />
==== Change the default window manager ====<br />
<br />
The global setting for window manager is contained within {{ic|/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml}}. The per-user configuration can be generated by executing:<br />
$ cp /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml<br />
<br />
Within these files the window manager is specified on the line just below that containing "Client0_Command". The line should be changed from {{bc|<nowiki><value type="string" value="xfwm4"/></nowiki>}} to {{bc|<nowiki><value type="string" value="window_manager_executable"/></nowiki>}}<br />
<br />
==== Replace the window manager ====<br />
<br />
To replace xfwm4 with another [[Window manager]] you can use the syntax 'name of window manager' '--replace' in a terminal.<br />
<br />
For example:<br />
<br />
* For {{Pkg|openbox}} the command is: {{ic|openbox --replace}}<br />
* For {{Pkg|metacity}} the command is: {{ic|metacity --replace}}<br />
<br />
To restore the native window manager again, first cancel the command by pressing {{ic|Ctrl+c}}, and then enter the following command:<br />
<br />
$ xfwm4 --replace<br />
<br />
Once the other window manager has taken over you can simply '''save the session'''. The {{ic|Save session for future logins}} option is available in the {{ic|logout...}} dialog box. It is also important to note that where restoring {{ic|xfwm4}} during a session, the {{ic|Save session for future logins}} option will have to be enabled on that occasion to make this change permanent. Not doing so may result in Openbox being restored again, as the previous saved session may be loaded instead. However, once {{ic|xfwm4}} has been restored, from the next session onwards there will no longer be any need to save future sessions.<br />
<br />
As an alternative you can add the window manager to the autostart list in Xfce. To do this, from the main menu, first select {{ic|Settings Manager}}, and then {{ic|session and startup}}. Once the application window opens, select the {{ic|Application Autostart}} tab to show all autostarted applications and programs, and click the {{ic|Add}} button to bring up the {{ic|Add Application}} window.<br />
<br />
The following details can be entered for each field:<br />
<br />
* '''Name''': openbox-wm<br />
* '''Description''': openbox-wm<br />
* '''Command''': openbox --replace<br />
<br />
{{Note|<br />
This method will not work with some window managers such as i3, since they do not support the --replace argument}}<br />
<br />
{{Tip|<br />
* The name and description fields are unimportant and are just there to indicate what the entry does. The command section has the same syntax as earlier e.g. 'Name of window manager' '--replace' as shown in the entries above.<br />
* Compiz may require commands different from the ones shown as there are several different ways to start it. For more information please see the [[Compiz#Xfce|Xfce section]] in the Compiz article.<br />
}}<br />
<br />
Once complete, click {{ic|OK}}, ensure that the checkbox next to the {{ic|openbox-wm}} entry is ticked, and then restart the session for the change to take place. The benefit of this method is that autostarted applications can be easily enabled and disabled at will via their autostart checkboxes. Consequently, to allow the native window manager - {{ic|xfwm4}} - to take back over, just clear the {{ic|openbox-wm}} tickbox and restart the session.<br />
<br />
If you replace [[Xfwm]] with a window manager that does not have a composite manager then you can use a standalone composite manager such as [[Xcompmgr]] or [[Compton]].<br />
<br />
=== Session ===<br />
<br />
==== Startup applications ====<br />
<br />
To launch custom applications when Xfce starts up, click the Applications Menu -> Settings -> Settings Manager and then choose the "Session and Startup" option and click the tab "Application Autostart".<br />
You will see a list of programs that get launched on startup. To add an entry, click the "Add" button and fill out the form, specifying the path to an executable you want to run.<br />
<br />
Alternatively you can use a command line script to launch your applications. This includes getting necessary environment variables into the GUI runtime.<br />
<br />
* Copy the file {{ic|/etc/xdg/xfce4/xinitrc}} to {{ic|~/.config/xfce4/}}<br />
* Edit this file. For example, you can add something like this somewhere in the middle:<br />
<br />
source $HOME/.bashrc<br />
# start rxvt-unicode server<br />
urxvtd -q -o -f<br />
<br />
==== Lock the screen ====<br />
<br />
To lock an Xfce4 session (through {{ic|xflock4}}) one of {{Pkg|xscreensaver}}, {{Pkg|gnome-screensaver}}, {{Pkg|slock}} or {{Pkg|xlockmore}} packages needs to be installed. [[Xscreensaver]] is the recommended option. Please consult its wiki page for more information.<br />
<br />
==== User switching ====<br />
<br />
Xfce4 has support for user switching when used with a [[Display manager]] that has this functionality - examples being [[lightdm]] and [[gdm]]. Please consult your display manager's wiki page for more information. When you have a display manager installed and configured correctly you can switch users from the 'action buttons' menu item in the panel.<br />
<br />
==== Disable sessions ====<br />
<br />
Xfce kiosk mode can be used to totally disable the saving of sessions. To disable sessions, create or edit the file {{ic|/etc/xdg/xfce4/kiosk/kioskrc}} and add the following:<br />
<br />
[xfce4-session]<br />
SaveSession=NONE<br />
<br />
=== Themes ===<br />
<br />
XFCE themes are available at [http://www.xfce-look.org]. ''Xfwm'' themes are stored in {{ic|/usr/share/themes/xfce4}}, and set in ''Settings'' > ''Window Manager''. [[GTK+]] themes are set in ''Settings'' > ''Appearance''.<br />
<br />
==== Consistency ====<br />
<br />
To achieve a uniform look for all applications it is advisable to use an up to date GTK+ 3 theme like the ''Adwaita'' theme as GTK+ 3 themes have inbuilt support for GTK+ 2 applications. <br />
<br />
For details see [[GTK+#GTK+ 3.x]] for GTK+ 3 and [[Uniform Look for Qt and GTK Applications]] for Qt.<br />
<br />
==== Cursors ====<br />
<br />
See [[Cursor Themes]]. Xfce sets themes in ''Settings'' > ''Mouse''.<br />
<br />
==== Icons ====<br />
<br />
See [[Icons]].<br />
<br />
==== Fonts ====<br />
<br />
See [[Font configuration]]. Xfce sets fonts in ''Settings'' > ''Appearance''.<br />
<br />
=== Sound ===<br />
<br />
==== Configuring xfce4-mixer ====<br />
<br />
{{Pkg|xfce4-mixer}} is the GUI mixer app / panel plugin made by the Xfce team. It is part of the xfce4 group, so you probably already have it installed. Xfce 4.6 uses {{Pkg|gstreamer}} as the backend to control volume, so first you have to make gstreamer cooperate with xfce4-mixer. One or more of the gstreamer plugin packages listed as optional dependencies to xfce4-mixer must be installed. Without one of these required plugins packages, the following error arises when clicking on the mixer panel item.<br />
<br />
GStreamer was unable to detect any sound devices. Some sound system specific GStreamer packages may be missing.<br />
<br />
Which plugins are needed depends on the hardware. Most people should be fine with {{Pkg|gstreamer0.10-base-plugins}} which can be [[pacman|installed]] from [[Official repositories]].<br />
<br />
If the xfce4-mixer panel item was already running before one of the plugins packages was installed, logout and login to see if it worked, or just remove the mixer plugin from the panel and add it again. If that does not work, you might need more or different gstreamer plugins. Try to [[pacman|install]] package {{pkg|gstreamer0.10-good-plugins}} or {{pkg|gstreamer0.10-bad-plugins}}.<br />
<br />
If you had to change the soundcard in the audio mixer, then you should log out and back in to hear sound.<br />
<br />
For further details, for example how to set the default sound card, see [[Advanced Linux Sound Architecture]]. Alternatively you can use [[PulseAudio]] together with {{Pkg|pavucontrol}}.<br />
<br />
==== Xfce4-mixer and OSS4 ====<br />
<br />
If you tried the above section to get {{Pkg|xfce4-mixer}} to work and it does not work at all, then you may have to compile {{pkg|gstreamer0.10-good-plugins}} yourself. Download the PKGBUILD and other files needed from ABS or [https://projects.archlinux.org/svntogit/packages.git/tree/gstreamer0.10-good/repos here], edit the PKGBUILD, add --enable-oss.<br />
<br />
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \<br />
'''--enable-oss \'''<br />
--disable-static --enable-experimental \<br />
--disable-schemas-install \<br />
--disable-hal \<br />
--with-package-name="GStreamer Good Plugins (Archlinux)" \<br />
--with-package-origin="https://www.archlinux.org/"<br />
<br />
and then run makepkg -i.<br />
<br />
makepkg -i<br />
<br />
Other LINKS: [http://www.4front-tech.com/forum/ OSS forum]<br />
<br />
==== Keyboard Volume Buttons ====<br />
<br />
Go to<br />
Settings --> Keyboard<br />
Click the "Application Shortcuts" tab and add click the "Add" button. Add the following by entering the command, then pressing the corresponding button at the next window:<br />
<br />
===== ALSA =====<br />
<br />
For the raise volume button:<br />
amixer set Master 5%+<br />
For the lower volume button:<br />
amixer set Master 5%-<br />
For the mute button:<br />
amixer set Master toggle<br />
<br />
You can also run these commands to set the above commands to the standard XF86Audio keys:<br />
xfconf-query -c xfce4-keyboard-shortcuts -p /commands/custom/XF86AudioRaiseVolume -n -t string -s "amixer set Master 5%+ unmute"<br />
xfconf-query -c xfce4-keyboard-shortcuts -p /commands/custom/XF86AudioLowerVolume -n -t string -s "amixer set Master 5%- unmute"<br />
xfconf-query -c xfce4-keyboard-shortcuts -p /commands/custom/XF86AudioMute -n -t string -s "amixer set Master toggle"<br />
<br />
If {{ic|amixer set Master toggle}} does not work, try the PCM channel ({{ic|amixer set PCM toggle}}) instead.<br />
<br />
The channel must have a "mute" option for the toggle command to work. To check whether or not your Master channel supports toggling mute, run {{ic|alsamixer}} in a terminal and look for the double M's (MM) under the Master channel. If they are not present, then it does not support the mute option. If, for example, you had to change the toggle button to use the PCM channel, make sure to also set the PCM channel as the Mixer Track under Xfce Mixer properties.<br />
<br />
===== OSS =====<br />
<br />
Use one of these scripts: http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Using_multimedia_keys_with_OSS<br />
<br />
If using ossvol (recommended), add:<br />
ossvol -i 1<br />
for the volume up button<br />
ossvol -d 1<br />
for the volume down button<br />
ossvol -t<br />
for the mute/unmute button<br />
<br />
===== PulseAudio =====<br />
<br />
For the raise volume button:<br />
sh -c "pactl set-sink-mute 0 false ; pactl set-sink-volume 0 +5%"<br />
For the lower volume button:<br />
sh -c "pactl set-sink-mute 0 false ; pactl -- set-sink-volume 0 -5%"<br />
For the mute button:<br />
pactl set-sink-mute 0 toggle<br />
<br />
These settings assume the device you want to control has index 0.<br />
Use {{ic|pactl list sinks short}} to list sinks.<br />
<br />
===== Xfce4-volumed =====<br />
<br />
{{AUR|xfce4-volumed}} daemon from the [[AUR]] automatically maps volume keys of your keyboard to Xfce-mixer. Additionally you get OSD through Xfce4-notifyd when changing volume. Xfce4-volumed does not need any configuration and is started automatically with Xfce.<br />
<br />
If you use pulseaudio and xfce4-volumed unmute does not work then change the keyboard commands to the pactl commands for pulseaudio as shown above in the pulseaudio section.<br />
<br />
{{Tip|Users of PulseAudio can also install the fork from Xubuntu using the package {{AUR|xfce4-volumed-pulse}}.}}<br />
<br />
===== Volumeicon =====<br />
<br />
{{pkg|volumeicon}} is an alternative to xfce4-volumed in the community repo also handling keybindings and notifications through {{pkg|xfce4-notifyd}}.<br />
<br />
{{Note|Volumeicon can only handle ALSA keybindings. If you are using Pulseaudio and Volumeicon is handling the media keys you may notice issues such as not being able to unmute the volume using the multimedia keys.}}<br />
<br />
===== Extra keyboard keys =====<br />
<br />
If you are coming from another distro, you may be interested in enabling extra keys on your keyboard, see [[Extra Keyboard Keys]].<br />
<br />
==== Adding startup/boot sound ====<br />
<br />
Arch does not have a built-in startup sound configuration tool, but there is a workaround by adding the following command to your Application Autostart settings:<br />
<br />
aplay /boot/startupsound.wav<br />
<br />
The file location and filename can be whatever you want, but naming it descriptively and putting it in /boot keeps things tidy.<br />
<br />
=== Polkit Authentication Agent ===<br />
<br />
XFCE does not include a [[Polkit]] authentication agent. See [[Polkit#Authentication agents]].<br />
<br />
== Tips & Tricks ==<br />
<br />
=== xdg-open integration (Preferred Applications) ===<br />
<br />
Most applications rely on [[xdg-open]] for opening a preferred application for a given file or URL.<br />
<br />
In order for xdg-open and xdg-settings to detect and integrate with the XFCE desktop environment correctly, you need to [[pacman|install]] the {{Pkg|xorg-xprop}} package.<br />
<br />
If you do not do that, your preferred applications preferences (set by exo-preferred-applications) will not be obeyed.<br />
Installing the package and allowing ''xdg-open'' to detect that you are running XFCE makes it forward all calls to ''exo-open'' instead, which correctly uses all your preferred applications preferences.<br />
<br />
To make sure xdg-open integration is working correctly, ask ''xdg-settings'' for the default web browser and see what the result is:<br />
<br />
# xdg-settings get default-web-browser<br />
<br />
If it replies with:<br />
<br />
xdg-settings: unknown desktop environment<br />
<br />
it means that it has failed to detect XFCE as your desktop environment, which is likely due to a missing {{Pkg|xorg-xprop}} package.<br />
<br />
=== Screenshots ===<br />
<br />
XFCE has its own screenshot tool, {{pkg|xfce4-screenshooter}}. It is part of the {{grp|xfce4-goodies}} group.<br />
<br />
==== Print Screen key ====<br />
<br />
Go to:<br />
<br />
XFCE Menu --> Settings --> Keyboard >>> Application Shortcuts.<br />
<br />
Add the "xfce4-screenshooter -f" command to use the "PrintScreen" key in order to take fullscreen screenshots. See screenshooter's man page for other optional arguments.<br />
<br />
Alternatively, an independent screenshot program like [[Taking a screenshot#scrot|scrot]] can be used.<br />
<br />
=== Disable Terminal F1 and F11 shortcut ===<br />
<br />
The xfce terminal binds F1 and F11 to help and fullscreen, respectively, which can make using programs like htop difficult. To disable those shortcuts, create or edit its configuration file, then log out and log back in. F10 can disabled in the Preferences menu.<br />
<br />
{{hc|~/.config/xfce4/terminal/accels.scm|<br />
(gtk_accel_path "<Actions>/terminal-window/fullscreen" "")<br />
(gtk_accel_path "<Actions>/terminal-window/contents" "")<br />
}}<br />
<br />
=== Terminal color themes or pallets ===<br />
<br />
Terminal color themes or pallets can be changed in GUI under Appearance tab in Preferences. These are the colors that are available to most console applications like [[Emacs]], [[Vi]] and so on. Their settings are stored individually for each system user in {{ic|~/.config/xfce4/terminal/terminalrc}} file. There are also so many other themes to choose from. Check forum thread [https://bbs.archlinux.org/viewtopic.php?id=51818 Terminal Colour Scheme Screenshots] for hundreds of available choices and themes.<br />
<br />
==== Changing default color theme ====<br />
<br />
XFCE's {{ic|extra/terminal}} package comes with a darker color palette. To change this, append the following in your terminalrc file for a lighter color theme, that is always visible in darker Terminal backgrounds.<br />
<br />
~/.config/xfce4/terminal/terminalrc<br />
<br />
ColorPalette5=#38d0fcaaf3a9<br />
ColorPalette4=#e013a0a1612f<br />
ColorPalette2=#d456a81b7b42<br />
ColorPalette6=#ffff7062ffff<br />
ColorPalette3=#7ffff7bd7fff<br />
ColorPalette13=#82108210ffff<br />
<br />
==== Terminal tango color theme ====<br />
<br />
To switch to tango color theme, open with your favorite editor<br />
<br />
~/.config/xfce4/terminal/terminalrc<br />
<br />
And add(replace) these lines:<br />
<br />
ColorForeground=White<br />
ColorBackground=#323232323232<br />
ColorPalette1=#2e2e34343636<br />
ColorPalette2=#cccc00000000<br />
ColorPalette3=#4e4e9a9a0606<br />
ColorPalette4=#c4c4a0a00000<br />
ColorPalette5=#34346565a4a4<br />
ColorPalette6=#757550507b7b<br />
ColorPalette7=#060698989a9a<br />
ColorPalette8=#d3d3d7d7cfcf<br />
ColorPalette9=#555557575353<br />
ColorPalette10=#efef29292929<br />
ColorPalette11=#8a8ae2e23434<br />
ColorPalette12=#fcfce9e94f4f<br />
ColorPalette13=#72729f9fcfcf<br />
ColorPalette14=#adad7f7fa8a8<br />
ColorPalette15=#3434e2e2e2e2<br />
ColorPalette16=#eeeeeeeeecec<br />
<br />
=== Colour management ===<br />
<br />
xfce4-settings-manager does not yet have any colour management / calibration settings, nor is there any specific XFCE program to characterise your monitor.<br />
<br />
There is a very good [https://encrypted.pcode.nl/blog/2013/11/24/display-color-profiling-on-linux/ article on how to do colour profiling with dispwin etc. under XFCE], below are the basics:<br />
<br />
==== Loading a profile ====<br />
<br />
If you wish to '''load an icc profile''' (that you have previously created or downloaded) to calibrate your display on startup, you can download {{AUR|xcalib}} from [[AUR]], then open the XFCE4 Settings Manager, click Session and Startup icon, the Autostart tab, and add a new entry where the command is {{ic|/usr/bin/xcalib /path/to/your/profile.icc}}. You still need to tell your applications, which display profile should be used to have the displayed images colour managed.<br />
<br />
Another option is dispwin. Dispwin not only calibrates the display, but also sets the _ICC_PROFILE atom in X so that some applications can use a "system" display profile instead of requiring the user to set the display profile manually (GIMP, Inkscape, darktable, UFRaw, etc.).<br />
<br />
See [[ICC Profiles#Loading ICC Profiles]] for more information.<br />
<br />
==== Creating a profile ====<br />
<br />
If you wish to '''create an icc profile''' for your display (ie. characterising/profiling, e.g. with the ColorHug, or some other colorimeter, or a spectrophotometer, or "by eye"), the simplest option may be to install {{Pkg|dispcalgui}} from [[AUR]].<br />
<br />
Another option is to install {{pkg|gnome-settings-daemon}} and {{pkg|gnome-color-manager}} (available in extra). In order to start the calibration from the command line, first do {{ic|/usr/lib/gnome-settings-daemon/gnome-settings-daemon &}} (note: this might change your keyboard layout and who knows what else, so probably good to do it on a throwaway account), then {{ic|colormgr get-devices}} and look for the "Device ID" line of your monitor. If this is e.g. "xrandr-Lenovo Group Limited", you start calibration with the command {{ic|gcm-calibrate --device "xrandr-Lenovo Group Limited"}}.<br />
<br />
{{Note|1=The reason you need gnome-settings-daemon running is because XFCE does not yet have a session component for colord: https://bugzilla.xfce.org/show_bug.cgi?id=8559 . A lightweight daemon, [https://github.com/agalakhov/xiccd xiccd], may (and probably should) be used instead.}}<br />
<br />
See [[ICC Profiles]] for more information.<br />
<br />
=== Multiple Monitors ===<br />
<br />
If you have configured X.org so that your display spans multiple monitors, usually when you login to an '''XFCE''' session, it will appear as if your monitors are simple clones of one another. You can use an '''xrandr''' tool to tweak your setup but if this is not called at an appropriate time in the startup sequence, some functionality may be lost with parts of your display being inaccessible to the mouse pointer.<br />
<br />
A better way is to configure XFCE to match your desired display arrangement. However, at present (xfce-settings 4.10), there is no tool available to assist with configuring multiple monitors directly.<br />
<br />
* The ''Settings -> Display'' tool does allow configuration of screen resolution, rotation and enabling individual monitors; '''warning''': ''using this tool to adjust display settings will reset or lose settings made manually for properties not explicitly offered as buttons in the tool (see below)''.<br />
* The ''Settings -> Settings Editor'' allows manipulation of all configuration items in particular the ''displays'' settings which are saved in the file '''displays.xml''' below<br />
<br />
~/.config/xfce4/xfconf/xfce-perchannel-xml<br />
<br />
* Alternatively, the ''displays.xml'' can be edited using your favourite editor.<br />
<br />
The main requirement for multiple monitors is their arrangement relative to one another. This can be controlled by setting the '''Position''' properties ('''X''' and '''Y''') to suit; an ''(x,y)'' position of ''0,0'' corresponds to the ''top, left'' position of the monitor array. This is the default position for all monitors and if several monitors are enabled they will appear as a cloned display area extending from this point.<br />
<br />
To extend the display area correctly across both monitors:<br />
<br />
* for side-by-side monitors, set the '''X''' property of the rightmost monitor to equal the width of the left-most monitor<br />
* for above-and-below monitors, set the '''Y''' property of the bottom monitor to equal the height of the upper monitor<br />
* for other arrangements, set the '''X''' and '''Y''' properties of each monitor to correspond to your layout<br />
<br />
Measurements are in ''pixels''. As an example, a pair of monitors with nominal dimensions of ''1920x1080'' which are rotated by 90 and placed side-by-side can be configured with a ''displays.xml'' like this:<br />
<br />
<channel name="displays" version="1.0"><br />
<property name="Default" type="empty"><br />
<property name="VGA-1" type="string" value="Idek Iiyama 23&quot;"><br />
<property name="Active" type="bool" value="true"/><br />
<property name="Resolution" type="string" value="1920x1080"/><br />
<property name="RefreshRate" type="double" value="60.000000"/><br />
<property name="Rotation" type="int" value="90"/><br />
<property name="Reflection" type="string" value="0"/><br />
<property name="Primary" type="bool" value="false"/><br />
<property name="Position" type="empty"><br />
<property name="X" type="int" value="0"/><br />
<property name="Y" type="int" value="0"/><br />
</property><br />
</property><br />
<property name="DVI-0" type="string" value="Digital display"><br />
<property name="Active" type="bool" value="true"/><br />
<property name="Resolution" type="string" value="1920x1080"/><br />
<property name="RefreshRate" type="double" value="60.000000"/><br />
<property name="Rotation" type="int" value="90"/><br />
<property name="Reflection" type="string" value="0"/><br />
<property name="Primary" type="bool" value="false"/><br />
<property name="Position" type="empty"><br />
<property name="X" type="int" value="1080"/><br />
<property name="Y" type="int" value="0"/><br />
</property><br />
</property><br />
</property><br />
</channel><br />
<br />
Usually, editing settings in this way requires a logout/login to action them.<br />
<br />
A new method for configuring multiple monitors will be available in the forthcoming xfce-settings 4.12 release.<br />
<br />
=== XDG User Directories ===<br />
<br />
freedesktop.org specifies the "well known" user directories like the desktop folder and the music folder. See [[Xdg user directories]] for detailed info.<br />
<br />
=== SSH Agents ===<br />
<br />
By default Xfce 4.10 will try to load gpg-agent or ssh-agent in that order during session initialization. To disable this, create an xfconf key using the following command:<br />
<br />
xfconf-query -c xfce4-session -p /startup/ssh-agent/enabled -n -t bool -s false<br />
<br />
To force using ssh-agent even if gpg-agent is installed, run the following instead:<br />
<br />
xfconf-query -c xfce4-session -p /startup/ssh-agent/type -n -t string -s ssh-agent<br />
<br />
To use [[GNOME Keyring]], simply tick the checkbox ''Launch GNOME services on startup'' in the ''Advanced'' tab of ''Session Manager'' in Xfce's settings. This will also disable gpg-agent and ssh-agent.<br />
<br />
Source: http://docs.xfce.org/xfce/xfce4-session/advanced<br />
<br />
=== Bluetooth functionality ===<br />
<br />
Users have 3 options for using Bluetooth in Xfce:<br />
<br />
* [[Blueman]] - this applet currently uses the, now unmaintained, [[Bluez4]] bluetooth stack however a version of Blueman compatible with Bluez5 is in development.<br />
<br />
* [[Bluetooth#GNOME Bluetooth|GNOME Bluetooth]] - this applet is compatible with Bluez5.<br />
<br />
* You can use command line tools to access Bluetooth functionality. [[Bluetooth#Using Obex for sending and receiving files|Obex]] can be used for sending and receiving files and [[Bluetooth#Bluetoothctl|bluetoothctl]] can be used for device pairings. See the [[Bluetooth]] article for more infomrmation.<br />
<br />
=== Scroll a background window without shifting focus on it ===<br />
<br />
Go to<br />
Main Menu -> Settings -> Window Manager Tweaks -> Accessibility tab<br />
Uncheck {{ic|Raise windows when any mouse button is pressed}}<br />
<br />
== Troubleshooting ==<br />
<br />
=== Action Buttons/Missing Icons ===<br />
<br />
This happens if icons for some actions (Suspend, Hibernate) are missing from the icon theme, or do not have the expected names. First, find out the currently used icon theme in the Settings Manager (→Appearance→Icons). Match this with a subdirectory of {{ic|/usr/share/icons}}. For example, if the icon theme is GNOME, make a note of the directory name {{ic|/usr/share/icons/gnome}}.<br />
<br />
icontheme=/usr/share/icons/gnome<br />
<br />
Install an icon theme which has the necessary icons already added; see [[Icons]].<br />
<br />
{{Pkg|xfce4-power-manager}} also contains the needed icons. Create symbolic links from the current icon theme into the {{ic|hicolor}} icon theme.<br />
<br />
ln -s /usr/share/icons/hicolor/16x16/actions/xfpm-suspend.png ${icontheme}/16x16/actions/system-suspend.png<br />
ln -s /usr/share/icons/hicolor/16x16/actions/xfpm-hibernate.png ${icontheme}/16x16/actions/system-hibernate.png<br />
ln -s /usr/share/icons/hicolor/22x22/actions/xfpm-suspend.png ${icontheme}/22x22/actions/system-suspend.png<br />
ln -s /usr/share/icons/hicolor/22x22/actions/xfpm-hibernate.png ${icontheme}/22x22/actions/system-hibernate.png<br />
ln -s /usr/share/icons/hicolor/24x24/actions/xfpm-suspend.png ${icontheme}/24x24/actions/system-suspend.png<br />
ln -s /usr/share/icons/hicolor/24x24/actions/xfpm-hibernate.png ${icontheme}/24x24/actions/system-hibernate.png<br />
ln -s /usr/share/icons/hicolor/48x48/actions/xfpm-suspend.png ${icontheme}/48x48/actions/system-suspend.png<br />
ln -s /usr/share/icons/hicolor/48x48/actions/xfpm-hibernate.png ${icontheme}/48x48/actions/system-hibernate.png<br />
<br />
Log out and in again, and you should see icons for all actions.<br />
<br />
=== Desktop icons rearrange themselves ===<br />
<br />
At certain events (such as opening the panel settings dialog) icons on the desktop rearrange themselves. This is because icon positions are determined by files in the {{ic|~/.config/xfce4/desktop/}} directory. Each time a change is made to the desktop (icons are added or removed or change position) a new file is generated in this directory and these files can conflict.<br />
<br />
To solve the problem, navigate to the directory and delete all the files other than the one which correctly defines the icon positions. You can determine which file defines the correct icon positions by opening it and examining the locations of the icons. The topmost row is defined as {{ic|row 0}} and the leftmost column is defined by {{ic|col 0}}. Therefore an entry of:<br />
<br />
[Firefox]<br />
row=3<br />
col=0<br />
<br />
means that the Firefox icon will be located on the 4th row of the leftmost column.<br />
<br />
=== GTK themes not working with multiple monitors ===<br />
<br />
Some configuration tools may corrupt displays.xml, which results in GTK themes under Applications Menu -> Settings -> Appearance ceasing to work. To fix the issue, delete {{ic|~/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml}} and reconfigure your screens.<br />
<br />
=== HTML files not opened correctly in Firefox ===<br />
<br />
When opening HTML files with blank spaces, and Firefox set as default browser in {{ic|exo-preferred-applications}}, each word is opened as a separate URL.[https://bugzilla.xfce.org/show_bug.cgi?id=10731] Open the file directly with {{ic|firefox.desktop}} (''Firefox'') instead of {{ic|exo-web-browser.desktop}} (''Web Browser''), or in {{ic|/usr/share/xfce4/helpers/firefox.desktop}} change:<br />
<br />
X-XFCE-CommandsWithParameter=%B -remote "openURL(%s)";%B %s;<br />
<br />
to (adding quotes to {{ic|%s}})<br />
<br />
X-XFCE-CommandsWithParameter=%B -remote "openURL(%s)";%B "%s";<br />
<br />
=== Icons do not appear in right-click menus ===<br />
<br />
Users may find that icons do not appear when right-clicking options within some applications, including those made with [[Qt]]. This problem only appears to happen within Xfce. Run these two commands:<br />
<br />
$ gconftool-2 --type boolean --set /desktop/gnome/interface/buttons_have_icons true<br />
$ gconftool-2 --type boolean --set /desktop/gnome/interface/menus_have_icons true<br />
<br />
=== Keyboard settings are not saved in xkb-plugin ===<br />
<br />
There is a bug in {{Pkg|xfce4-xkb-plugin}} ''0.5.4.1-1'' which causes it to lose keyboard, layout switching and compose key settings. As a workaround, enable ''Use system defaults'' in {{ic|xfce4-keyboard-settings}}, then reconfigure ''xfce4-xkb-plugin''.<br />
<br />
=== Locales ignored with GDM ===<br />
<br />
Add your [[locale]] to {{ic|/var/lib/AccountsService/users/$USER}}:<br />
<br />
[User]<br />
Language=''your_locale''<br />
XSession=xfce<br />
<br />
To do so with {{ic|sed}}:<br />
<br />
# sed -i 's/Language=.*/Language=hu_HU'''\'''.UTF-8/' /var/lib/AccountsService/users/$USER<br />
<br />
Restart GDM to take effect.<br />
<br />
=== Missing menu entries for WINE ===<br />
<br />
[[WINE]] applications may not be listed in {{ic|/usr/share/applications}}. See the “Other” category in {{ic|~/.local/share/applications/wine/}}.<br />
<br />
=== Multiple suspend events ===<br />
<br />
If using {{Pkg|xfce4-power-manager}} to control ACPI events, and not systemd, edit {{ic|/etc/systemd/logind.conf}}:<br />
<br />
{{bc|<nowiki><br />
HandlePowerKey=ignore<br />
HandleSuspendKey=ignore<br />
HandleHibernateKey=ignore<br />
HandleLidSwitch=ignore</nowiki><br />
}}<br />
<br />
=== Non ASCII characters when mounting USB sticks ===<br />
<br />
{{Merge|Mount}}<br />
<br />
A common problem when automounting USB sticks formatted with fat filesystem is the inability to properly show characters as umlauts, ñ, ß, etc. This may be solved by changing the default iocharset to UTF-8, which is easily done adding a line to {{ic|/etc/xdg/xfce4/mount.rc}}:<br />
<br />
[vfat]<br />
uid=<auto><br />
shortname=winnt<br />
'''utf8=true'''<br />
# FreeBSD specific option<br />
longnames=true<br />
flush=true<br />
<br />
Note that when using utf-8, the system will distinct between upper- and lowercases, potentially corrupting your files, so be careful.<br />
<br />
It is possible to mount vfat devices with ''flush'' option, so that when copying to USB sticks data flushes more often, thus making thunar's progress bar to stays up until finished. Adding ''async'' instead will speed up write ops, but make sure to use ''Eject'' option in Thunar to unmount the stick. Globally, mount options for storage devices present at boot can be set in [[fstab]], and for other devices in [[udev]] rules.<br />
<br />
=== NVIDIA and xfce4-sensors-plugin ===<br />
<br />
To detect and use sensors of nvidia gpu you need to install {{Pkg|libxnvctrl}} and then rebuild {{Pkg|xfce4-sensors-plugin}} with [[ABS]].<br />
<br />
=== Persistent display blanking ===<br />
<br />
Xfce4 (as of 4.12) does not respect monitor power settings in {{ic|xfce4-power-manager}}. It instead attempts to run the screensaver every 10 minutes. This can be verified with {{ic|$ xset q}}. Run {{ic|$ xset s noblank}} to prevent this behaviour; see [[DPMS]].<br />
<br />
Alternatively, add the following to {{ic|/etc/X11/xorg.conf.d/}}:<br />
<br />
{{hc|20-blank.conf|<nowiki><br />
Section "ServerFlags"<br />
Option "BlankTime" "0"<br />
EndSection<br />
</nowiki>|bc}}<br />
<br />
=== Preferred Applications preferences have no effect ===<br />
<br />
If you have set preferred applications with ''exo-preferred-applications'', but they are not taken into consideration, see [[#xdg-open integration (Preferred Applications)]].<br />
<br />
=== Redundant context menu entry on desktop ===<br />
<br />
{{note|It has been tested that Xfce 4.10 (with Thunar 1.63, xfdesktop 4.10.2) has this bug. Not sure if this bug is related to xfdesktop.}}<br />
<br />
When creating a new empty (text) file on the desktop, right clicking it will show a redundant {{ic|Set as wallpaper}} entry. To disable this, [[Arch Build System|rebuild]] Thunar with the {{ic|--disable-wallpaper-plugin}} flag.<br />
<br />
=== Restore default settings ===<br />
<br />
If for any reason you need to revert back: to the default settings, rename {{ic|~/.config/xfce4-session/}} and {{ic|~/.config/xfce4/}}<br />
<br />
$ mv ~/.config/xfce4-session/ ~/.config/xfce4-session-bak<br />
$ mv ~/.config/xfce4/ ~/.config/xfce4-bak<br />
<br />
Relogin for changes to take effect. If you get "Unable to load a failsafe session" upon login, see the [[#Session failure]].<br />
<br />
=== Session failure ===<br />
<br />
Symptoms include:<br />
<br />
* The mouse is an X and/or does not appear at all;<br />
* window decorations have disappeared and windows cannot be closed;<br />
* ({{ic|xfwm4-settings}}) will not start, reporting {{ic|These settings cannot work with your current window manager (unknown)}};<br />
* errors reported by a [[display manager]] such as {{ic|No window manager registered on screen 0}}.<br />
<br />
Restarting xfce or rebooting your system may solve the problem, but a corrupt session is the likely cause. Delete the session folder:<br />
<br />
$ rm -r ~/.cache/sessions/<br />
<br />
== See also ==<br />
<br />
* [http://www.xfce.org/about/ Xfce - About]<br />
* http://docs.xfce.org/ - The complete documentation.<br />
* [http://www.xfce-look.org/ Xfce-Look] - Themes, wallpapers, and more.<br />
* [http://xfce.wikia.com/wiki/Frequently_Asked_Questions Xfce Wikia] - How to edit the auto generated menu with the menu editor<br />
* [http://wiki.xfce.org Xfce Wiki]</div>Cornholiohttps://wiki.archlinux.org/index.php?title=I3&diff=277481I32013-10-03T21:38:52Z<p>Cornholio: Added information for using xfce4-panel with i3 instead of i3bar.</p>
<hr />
<div>{{DISPLAYTITLE:i3}}<br />
[[Category:Tiling WMs]]<br />
[[Category:Dynamic WMs]]<br />
[[ko:i3]]<br />
[[ru:i3]]<br />
[[zh-CN:i3]]<br />
[http://i3wm.org/ i3] is a dynamic [[Wikipedia:Tiling window manager|tiling window manager]] inspired by [[wmii]] that is primarily targeted at developers and advanced users.<br />
<br />
Clients (windows) are organized in a tree data structure within containers. The tree branches via horizontal or vertical splits, and containers can also be set to tabbed or stacked layouts. Floating windows are available for corner cases that don't mix well with tiling, and remain on a separate layer above the tiled windows.<br />
<br />
== Installation ==<br />
Install the {{Grp|i3}} [[Pacman#Installing package groups|package group]] from the [[official repositories]], which includes: {{Pkg|i3-wm}}, the window manager; {{Pkg|i3status}}, a package to write a status line to i3bar through [[Wikipedia:Standard streams#Standard output (stdout)|stdout]]; and {{Pkg|i3lock}}, an improved screenlocker.<br />
<br />
Additional packages are available in the [[Arch User Repository]]. Install {{AUR|i3-git}} for the development version.<br />
<br />
Install {{AUR|i3-gnome}} to add [[GNOME]] and X-sessions with {{Pkg|i3}} running as the window manager. An Xsession starting just the window manager is included in {{Pkg|i3}}.<br />
<br />
== Configuration ==<br />
<br />
Edit your {{ic|~/.xinitrc}} and add:<br />
exec i3<br />
If you want i3 to log its output (useful for debugging), add this line to {{ic|~/.xinitrc}}:<br />
exec i3 -V >> ~/.i3/i3log 2>&1<br />
If you use the Nvidia binary driver '''<302.17''' you need to add the {{ic|--force-xinerama}} flag to {{ic|~/.xinitrc}}. A detailed explanation can be found at [http://i3wm.org/docs/multi-monitor.html i3wm.org].<br />
exec i3 --force-xinerama<br />
<br />
=== Status bar ===<br />
The internal status bar, i3-''ws''bar, was deprecated and replaced by i3bar in i3 v4.0.<br />
<br />
==== New method: i3bar ====<br />
Unlike i3-wsbar, which requires dzen2, i3bar does not have any dependencies other than {{Pkg|i3-wm}}. It can be used to view information generated by [[conky]] or i3status. For example (as of version 4.1):<br />
{{hc|~/.i3/config|<nowiki><br />
bar {<br />
output LVDS1<br />
status_command i3status<br />
position top<br />
mode hide<br />
workspace_buttons yes<br />
tray_output none<br />
<br />
font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1<br />
<br />
colors {<br />
background #000000<br />
statusline #ffffff<br />
<br />
focused_workspace #ffffff #285577<br />
active_workspace #ffffff #333333<br />
inactive_workspace #888888 #222222<br />
urgent_workspace #ffffff #900000<br />
}<br />
}<br />
</nowiki>}}<br />
<br />
For further information see the [http://i3wm.org/docs/userguide.html#_configuring_i3bar Configuring i3bar] section of the official User Guide.<br />
<br />
==== Alternatives to i3status ====<br />
* [https://github.com/HarveyHunt/i3situation i3situation] – a pure python 3 replacement with features provided by multithreaded plugins.<br />
* [https://github.com/enkore/i3pystatus i3pystatus] - extensible i3status replacement with many modules and very flexible configuration. Multi-threaded and lock-up free. (AUR: {{AUR|i3pystatus-git}})<br />
* [https://github.com/ultrabug/py3status py3status] – an extensible i3status wrapper written in python<br />
* [[dzen]] – often used with [[conky]] to create completely custom status bars<br />
* [http://j4status.j4tools.org/ j4status] - j4status provides a status line using several plugin to retrieve information from your computer. j4status is a part of the [http://www.j4tools.org/ j4tools] - tools set to use with i3.<br />
<br />
==== Panel Alternatives to Status Bar ====<br />
Some users may prefer panels such as those provided by conventional [[Desktop_Environment|Desktop Environments]]. This can be achieved within i3 by launching the panel application of choice during startup.<br />
<br />
For the [[Xfce#Panel|XFCE panel]], add the following line to {{ic|~/.i3/config}}:<br />
{{bc|exec --no-startup-id xfce4-panel}}<br />
{{Note|Panel features that are specific to the [[Desktop_Environment|Desktop Environment]] (e.g., widgets for managing workspaces and sessions) will not work, though the normal i3 functionality will be unaffected.}}<br />
Disabling i3bar is as simple as commenting out the {{ic|bar{ &#125;}} section of {{ic|~/.i3/config}}.<br />
<br />
=== Quickly jumping to open window ===<br />
* [https://github.com/proxypoke/quickswitch-for-i3 quickswitch-for-i3] – A Python utility to quickly change to and locate windows in i3<br />
* [https://github.com/yiuin/i3-wm-scripts i3-wm-scripts] – search for and jump to windows with particular names matching regexp<br />
* [https://github.com/ziberna/i3-py/tree/master/examples#winmenupy winmenupy] launches dmenu with a list of clients, sorted after workspaces. Selecting a client jumps to that window.<br />
<br />
=== i3statusbar ===<br />
<br />
First we need to copy over the default configuration files that we will be working with to our home directory.<br />
<br />
cp /etc/i3/config ~/.i3/config<br />
cp /etc/i3status.conf ~/.i3status.conf<br />
<br />
==== Network Interface Status ====<br />
<br />
Now we can fix the status bar (i3status) at the bottom of the screen. If you recently installed Arch Linux then you will be using the new systemd/udev [http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/ Predictable Network Interface Naming scheme]. As a result we need to change the references for eth0 (ethernet) and wlan0 (wireless) to match your system. To view your available network interfaces use the command {{ic|ip link}}<br />
<br />
Here is an example output of what you will see:<br />
<br />
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT<br />
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00<br />
2: enp6s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT qlen 1000<br />
link/ether aa:bb:cc:dd:ee:ff brd ff:ff:ff:ff:ff:ff<br />
3: wlp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DORMANT qlen 1000<br />
link/ether aa:bb:cc:dd:ee:ff brd ff:ff:ff:ff:ff:ff<br />
<br />
From the example we can see that ethernet interface is labelled enp6s0 and the wireless interface is wilp3s0. Your interface names may vary. Edit the file {{ic|~/.i3status.conf}}<br />
<br />
Replace the lines:<br />
<br />
order += "wireless wlan0"<br />
order += "ethernet eth0"<br />
wireless wlan0 {<br />
wireless eth0 {<br />
<br />
To match your corresponding network interface names:<br />
<br />
order += "wireless wlp3s0"<br />
order += "ethernet enp6s0"<br />
wireless wlp3s0 {<br />
ethernet enp6s0 {<br />
<br />
{{Note|wlp3s0 and enp6s0 are only used as examples. Enter your own network interface names here. If you are using eth0 and wlan0 then you do not need to change them.}}<br />
<br />
==== Temperature Status ====<br />
<br />
If you would like to add your CPU temperature to the i3status bar simply add these lines to {{ic|~/.i3status.conf}}<br />
<br />
order += "cpu_temperature 0"<br />
cpu_temperature 0 {<br />
format = "T: %degrees °C"<br />
max_threshold = 65<br />
path = "/sys/devices/platform/coretemp.0/temp1_input"<br />
}<br />
<br />
If the temperature column complains that it cannot get the temperature value then change the path line to:<br />
<br />
path = "/sys/class/thermal/thermal_zone0/temp"<br />
<br />
=== Volume Manager ===<br />
<br />
To enable easy management of your system volume, you can install a volume manager applet such as {{AUR|pa-applet-git}} from the [[AUR]]. This should also allow you to use your keyboards volume up, volume down, and mute keys as well as using the applet directly to manage your volume. Once it is installed add the following line to your {{ic|~/.i3/config}} to auto start the applet:<br />
<br />
exec /usr/bin/pa-applet<br />
<br />
=== Network Manager ===<br />
<br />
If you would like to use {{Pkg|network-manager-applet}} to manage your network connections, follow the instructions in [[NetworkManager]].<br />
<br />
Then add the the following line to your {{ic|~/.i3/config}} to automatically start the Network Manager applet in your system tray<br />
<br />
exec /usr/bin/nm-applet<br />
<br />
=== Workspace Names ===<br />
<br />
Although it is not required, many people prefer naming frequently used workspaces. First you need to determine which monitor you want the workspace to open to. Simply type {{ic|xrandr}} into a terminal and it will show you the available display ports. Some common ones are LVDS1 for laptops or VGA1, HDMI1, HDMI2, etc for external monitors. If you are using [[Multihead#Xinerama|Xinerama]] instead use the outputs xinerama-0, xinerama-1, etc. Add your workspace names to {{ic|~/.i3/config}} You also need to modify the corresponding lines to switch to your workspaces as well as moving focused containers to those workspaces.<br />
<br />
# Workspace names<br />
workspace "1:Web" output LVDS1<br />
workspace "2:Mail" output LVDS1<br />
workspace "3:Irc" output LVDS1<br />
workspace "4:Shell" output LVDS1<br />
<br />
# switch to workspace<br />
bindsym $mod+1 workspace 1:Web<br />
bindsym $mod+2 workspace 2:Mail<br />
bindsym $mod+3 workspace 3:Irc<br />
bindsym $mod+4 workspace 4:Shell<br />
<br />
# move focused container to workspace<br />
bindsym $mod+Shift+1 move container to workspace 1:Web<br />
bindsym $mod+Shift+2 move container to workspace 2:Mail<br />
bindsym $mod+Shift+3 move container to workspace 3:Irc<br />
bindsym $mod+Shift+4 move container to workspace 4:Shell<br />
<br />
=== Launching programs on specific workspaces ===<br />
<br />
To maximize efficiency you can setup certain programs to automatically launch to a specific workspace. This can be accomplished one of two ways. You could use the {{ic|assign}} command so when you manually launch a program it is directed to a the workspace you assigned. An example would be:<br />
<br />
# Assign URxvt terminals to workspace 2<br />
assign [class="URxvt"] 2<br />
<br />
Or if you have renamed the workspaces like the above examples then you must set the new workspace name instead of the number:<br />
<br />
# Assign URxvt terminals to workspace 4:Shell<br />
assign [class="URxvt"] 4:Shell<br />
<br />
{{Note|To be able to determine the class, title, instance, etc of an open window you can use the tool {{ic|xprop}} by installing the package {{Pkg|xorg-xprop}} from the Extra repository.}}<br />
<br />
Alternatively you can change to your target workspace with {{ic|i3-msg}} then have your frequently used programs start automatically with the {{ic|exec}} command:<br />
<br />
exec --no-startup-id i3-msg 'workspace 1:Web; exec /usr/bin/firefox' <br />
exec --no-startup-id i3-msg 'workspace 2:Mail; exec urxvt -name Mail -e /usr/bin/mutt'<br />
exec --no-startup-id i3-msg 'workspace 3:Irc; exec /usr/bin/urxvt -name irssi -e /usr/bin/irssi'<br />
exec --no-startup-id i3-msg 'workspace 4:Shell; exec /usr/bin/urxvt'<br />
<br />
=== Desktop Wallpaper ===<br />
<br />
To be able to manage the desktop wallpaper, you need a lightweight image viewer like [[Feh]] or [[Nitrogen]]. Install feh with the command {{ic|# pacman -S feh}}. Then you can set your wallpaper with the following command:<br />
<br />
$ feh --bg-scale /path/to/image.file<br />
<br />
To have feh set your image to the Desktop Wallpaper add the following line to your {{ic|~/.i3/config}}<br />
<br />
exec --no-startup-id sh ~/.fehbg<br />
<br />
=== Terminal Emulator ===<br />
<br />
By default when you press $mod+Return it launches the i3-sensible-terminal which is a script that invokes a terminal. It attempts to start one of these terminals in the following order: $TERMINAL urxvt rxvt terminator Eterm aterm xterm gnome-terminal roxterm xfce4-terminal. You can force it to launch your terminal of choice by modifying the line {{ic|bindsym $mod+Return exec i3-sensible-terminal}}<br />
<br />
=== Scratchpad ===<br />
<br />
Having a scratchpad to jot down or paste notes quickly is very handy! i3 has a feature that allows you to move a window to a scratchpad workspace. Basically it will be hidden from view until you recall it with the {{ic|scratchpad show}} command. To send a focused window to the scratchpad with $mod+Shift+minus or to recall it with $mod+minus enter these lines into your {{ic|~/.i3/config}}<br />
<br />
# Make the currently focused window a scratchpad<br />
bindsym $mod+Shift+minus move scratchpad<br />
<br />
# Show the first scratchpad window<br />
bindsym $mod+minus scratchpad show<br />
<br />
You can start your favorite editor (ie Gedit, vim, nano, etc) on startup and have it automatically moved to the scratchpad workspace to quickly recall it when needed. The following example when placed in {{ic|~/.i3/config}} shows how you can start the urxvt terminal, have it launch the nano editor, and then move it to the scratchpad:<br />
<br />
# starting a specially named term automatically <br />
exec --no-startup-id urxvt -name scratchpad -e /usr/bin/nano<br />
# move this to scratchpad, if active<br />
for_window [class="URxvt" instance="scratchpad"] move scratchpad<br />
<br />
=== Shutdown, Reboot, Lock Screen ===<br />
As there are no Shutdown, Reboot, or Lock Screen buttons, we can add some hotkey combinations to help us out. First we need to create this script and save it as {{ic|i3exit}}. Remember to make it executable with {{ic|chmod +x}} and to place it somewhere in your $PATH.<br />
<br />
#!/bin/sh<br />
lock() {<br />
i3lock<br />
}<br />
<br />
case "$1" in<br />
lock)<br />
lock<br />
;;<br />
logout)<br />
i3-msg exit<br />
;;<br />
suspend)<br />
lock && systemctl suspend<br />
;;<br />
hibernate)<br />
lock && systemctl hibernate<br />
;;<br />
reboot)<br />
systemctl reboot<br />
;;<br />
shutdown)<br />
systemctl poweroff<br />
;;<br />
*)<br />
echo "Usage: $0 {lock|logout|suspend|hibernate|reboot|shutdown}"<br />
exit 2<br />
esac<br />
<br />
exit 0<br />
<br />
Now add the following lines to your {{ic|~/.i3/config}} Once completed you will be presented with a prompt whenever you press $mod+pause.<br />
<br />
set $mode_system System (l) lock, (e) logout, (s) suspend, (h) hibernate, (r) reboot, (Shift+s) shutdown<br />
mode "$mode_system" {<br />
bindsym l exec --no-startup-id i3exit lock, mode "default"<br />
bindsym e exec --no-startup-id i3exit logout, mode "default"<br />
bindsym s exec --no-startup-id i3exit suspend, mode "default"<br />
bindsym h exec --no-startup-id i3exit hibernate, mode "default"<br />
bindsym r exec --no-startup-id i3exit reboot, mode "default"<br />
bindsym Shift+s exec --no-startup-id i3exit shutdown, mode "default" <br />
<br />
# back to normal: Enter or Escape<br />
bindsym Return mode "default"<br />
bindsym Escape mode "default"<br />
}<br />
bindsym $mod+Pause mode "$mode_system"<br />
<br />
=== Screensaver and Power Management ===<br />
<br />
You can use [[Display_Power_Management_Signaling|DPMS]] to blank your screen or to suspend/poweroff your monitor. Adding the following line to your {{ic|~/.i3/config}} will suspend your monitor after 10 minutes.<br />
<br />
exec --no-startup-id xset dpms 600<br />
<br />
== Suspending with i3lock ==<br />
=== xss-lock (has also autolock) ===<br />
{{aur|xss-lock}} manages a screen locker for the current x-session. It reacts to suspend, hibernate, lock-session events and the [[Display Power Management Signaling#xset screen-saver control|X screensaver]]. You need to run it in your desktop autostart like this:<br />
<br />
{{bc|xss-lock -- i3lock -i /path/to/background.image &}}<br />
<br />
=== Systemd unit file ===<br />
If you don't care about automatic locking and only want to lock your screen on suspend, then you can create a systemd unit file instead of running an additional piece of software. You need to add unit file below and enable it with {{ic|# systemctl enable suspend@<user>.service}}. See [[systemd#Basic systemctl usage]] for details.<br />
<br />
{{hc|/etc/systemd/system/suspend@.service|2=<nowiki><br />
[Unit]<br />
Description=Starts i3lock at suspend time<br />
Before=sleep.target<br />
<br />
[Service]<br />
User=%I<br />
Type=forking<br />
Environment=DISPLAY=:0<br />
ExecStartPre= <br />
ExecStart=/usr/bin/i3lock<br />
<br />
[Install]<br />
WantedBy=sleep.target</nowiki>}}<br />
<br />
== Usage ==<br />
{{Box BLUE||See the [http://i3wm.org/docs official documentation] on this subject for more information: [http://i3wm.org/docs/userguide.html i3 User’s Guide]}}<br />
<br />
=== Application launcher ===<br />
<br />
i3 currently uses [[dmenu]] as a application launcher, which is bound by default to {{ic|Mod1+d}}.<br />
<br />
By default i3-dmenu-desktop is used as a wrapper for dmenu. i3-dmenu-desktop creates a list of all installed applications via their .desktop files. There is a rewrite of this perl script called {{AUR|j4-dmenu-desktop-git}}, which is a near-drop-in replacement for the script shipped with i3, but much faster.<br />
<br />
=== Clipboard (copy & paste issues) ===<br />
<br />
By default, when you close a window, the buffer with the clipboard info will disappear. You have to use a clipboard manager like {{Pkg|clipit}} to avoid that.<br />
<br />
== See also ==<br />
* [[Comparison of Tiling Window Managers]]<br />
* [http://i3wm.org Official website]<br />
* [http://code.stapelberg.de/git/i3 Source code]<br />
* [https://github.com/ashinkarov/i3-extras Collection of scripts and patches]<br />
'''Arch Linux Forums'''<br />
* [https://bbs.archlinux.org/viewtopic.php?id=99064 ''The i3 thread''] - A general discussion about i3<br />
* [https://bbs.archlinux.org/viewtopic.php?id=103369 ''i3 desktop screenshots and config sharing'']</div>Cornholiohttps://wiki.archlinux.org/index.php?title=Tor&diff=259520Tor2013-05-29T20:21:05Z<p>Cornholio: Added code and instructions for running Tor in a chroot</p>
<hr />
<div>[[Category:Internet Applications]]<br />
[[Category:Proxy servers]]<br />
[[es:Tor]]<br />
[[ru:Tor]]<br />
[[zh-CN:Tor]]<br />
{{Article summary start}}<br />
{{Article summary text|This article will explain how to install and configure Tor alongside HTTP proxies like [[Privoxy]] and [[Polipo]].}}<br />
{{Article summary heading|Required software}}<br />
{{Article summary link|Tor|https://www.torproject.org}}<br />
{{Article summary link|Privoxy|http://privoxy.org/}}<br />
{{Article summary link|Polipo|http://www.pps.jussieu.fr/~jch/software/polipo/}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Gnunet}}<br />
{{Article summary wiki|I2P}}<br />
{{Article summary wiki|Freenet}}<br />
{{Article summary end}}<br />
<br />
'''Tor''' is an open source implementation of 2nd generation [[Wikipedia:Onion routing|onion routing]] that provides free access to an anonymous proxy network. Its primary goal is to enable [[Wikipedia:internet anonymity|online anonymity]] by protecting against [[Wikipedia:Traffic analysis|traffic analysis]] attacks.<br />
<br />
==Introduction==<br />
Users of the Tor network run an onion proxy on their machine. This software connects out to Tor, periodically negotiating a virtual circuit through the Tor network. Tor employs cryptography in a layered manner (hence the 'onion' analogy), ensuring perfect forward secrecy between routers. At the same time, the onion proxy software presents a SOCKS interface to its clients. SOCKS-aware applications may be pointed at Tor, which then multiplexes the traffic through a Tor virtual circuit.<br />
<br />
{{Warning|Tor by itself is ''not'' all you need to maintain your anonymity. There are several major pitfalls to watch out for (see: [https://www.torproject.org/download/download.html#warning Want Tor to really work?]).}}<br />
<br />
Through this process the onion proxy manages networking traffic for end-user anonymity. It keeps a user anonymous by encrypting traffic, sending it through other nodes of the Tor network, and decrypting it at the last node to receive your traffic before forwarding it to the server you specified. One trade off that has to be made for the anonymity Tor provides is that it can be considerably slower than a regular direct connection, due to the large amount of traffic re-routing. Additionally, although Tor provides protection against traffic analysis it cannot prevent traffic confirmation at the boundaries of the Tor network (i.e. the traffic entering and exiting the network).<br />
<br />
{{Wikipedia|Tor (anonymity network)}}<br />
<br />
==Installation==<br />
[[pacman|Install]] {{Pkg|tor}}, available in the [[official repositories]]. <br />
<br />
Additionally, there is a [[Qt]] frontend for Tor in package {{Pkg|vidalia}}. In addition to controlling the Tor process, Vidalia allows you to view and configure the status of Tor, monitor bandwidth usage, and view, filter, and search log messages.<br />
<br />
==Configuration==<br />
To get a better understanding of Tor review the {{ic|/etc/tor/torrc}} configuration file. The configuration options are explained in {{Ic|man tor}} and the [https://torproject.org/docs/tor-manual.html.en Tor website]. The default configuration should work fine for most Tor users.<br />
<br />
You can set custom [[Wikipedia:File descriptor|file descriptor]] ulimits for Tor in {{ic|/etc/conf.d/tor}} using the {{Ic|TOR_MAX_FD}} variable. This sets a limit on the maximum number of open files.<br />
<br />
By default Tor logs to [[Wikipedia:Stdout#Standard output (stdout)|stdout]] with a log-level of "notice". If system logging is enabled in the {{ic|torrc}} configuration file, it will default to {{Ic|/usr/local/var/log/tor/}}.<br />
<br />
==Running Tor in a Chroot==<br />
For security purposes, it may be desirable to run Tor in a [[chroot]]. The following script will create an appropriate chroot in /opt/torchroot:<br />
{{hc|~/torchroot-setup.sh<br />
|2=<nowiki><br />
#!/bin/bash<br />
export TORCHROOT=/opt/torchroot<br />
<br />
mkdir -p $TORCHROOT<br />
mkdir -p $TORCHROOT/etc/tor<br />
mkdir -p $TORCHROOT/dev<br />
mkdir -p $TORCHROOT/usr/bin<br />
mkdir -p $TORCHROOT/usr/lib<br />
mkdir -p $TORCHROOT/var/lib<br />
<br />
ln -s /usr/lib $TORCHROOT/lib<br />
cp /etc/hosts $TORCHROOT/etc/<br />
cp /etc/host.conf $TORCHROOT/etc/<br />
cp /etc/localtime $TORCHROOT/etc/<br />
cp /etc/nsswitch.conf $TORCHROOT/etc/<br />
cp /etc/resolv.conf $TORCHROOT/etc/<br />
cp /etc/tor/torrc $TORCHROOT/etc/tor/<br />
<br />
cp /usr/bin/tor $TORCHROOT/usr/bin/<br />
cp /lib/libnss* /lib/libnsl* /lib/ld-linux.so* /lib/libresolv* /lib/libgcc_s.so* $TORCHROOT/usr/lib/<br />
cp `ldd /usr/bin/tor | awk '{print $3}'|grep "^/"` $TORCHROOT/usr/lib/<br />
cp -r /var/lib/tor $TORCHROOT/var/lib/<br />
chown -R tor:tor $TORCHROOT/var/lib/tor<br />
<br />
sh -c "grep ^tor /etc/passwd > $TORCHROOT/etc/passwd"<br />
sh -c "grep ^tor /etc/group > $TORCHROOT/etc/group"<br />
<br />
mknod -m 644 $TORCHROOT/dev/random c 1 8<br />
mknod -m 644 $TORCHROOT/dev/urandom c 1 9<br />
mknod -m 666 $TORCHROOT/dev/null c 1 3<br />
</nowiki>}}<br />
<br />
After running the script as root, Tor can be launched in the [[chroot]] with the command: {{ic|# chroot /opt/torchroot /usr/bin/tor}}<br />
<br />
==Usage==<br />
<br />
Tor runs as a [[daemon]]. To launch it, use:<br />
<br />
'''SysV'''<br />
/etc/rc.d/tor start<br />
(add it to the {{ic|DAEMONS}} array to have it launch at startup)<br />
<br />
'''systemd'''<br />
systemctl start tor<br />
(use ''systemctl enable tor'' to have it launch at startup)<br />
<br />
Alternatively, you can launch it from the vidalia interface.<br />
<br />
To use a program over tor, configure it to use 127.0.0.1 or localhost as a SOCKS5 proxy, with port 9050 (plain tor with standard settings) or port 9051 (configuration with '''vidalia''', standard settings).<br />
To check if Tor is functioning properly visit the [https://check.torproject.org/ Tor], [http://serifos.eecs.harvard.edu/cgi-bin/ipaddr.pl?tor=1 Harvard] or [https://torcheck.xenobite.eu/ Xenobite.eu] websites.<br />
<br />
==Web browsing==<br />
Tor primarily supports [[Firefox]], but can also be used with [[Chromium]] and other browsers.<br />
<br />
===Firefox===<br />
In ''Preferences > Advanced > Network tab > Settings'' manually set Firefox to use the SOCKS proxy {{ic|localhost}} with port {{ic|9050}}. Then you must type {{ic|about:config}} into the address bar and ''void your warranty''. Change {{ic|network.proxy.socks_remote_dns}} to {{ic|true}} and restart the browser. This channels all DNS requests through TOR's socks proxy.<br />
<br />
Alternatively, install the Tor Browser Bundle ({{aur|tor-browser-en}}) from the AUR. This will allow you to toggle very easily between Tor navigation and normal navigation instead of changing the preferences.<br />
<br />
===Chromium===<br />
You can simply run:<br />
$ chromium --proxy-server="socks://localhost:9050"<br />
<br />
As for Firefox you can setup a fast switch for example through [https://chrome.google.com/webstore/detail/dpplabbmogkhghncfbfdeeokoefdjegm Proxy SwitchySharp].<br />
<br />
Once installed enter in its configuration page. Under the tab ''Proxy Profiles'' add a new profile ''Tor'', if ticked untick the option ''Use the same proxy server for all protocols'', then add ''localhost'' as SOCKS Host, ''9050'' to the respective port and select ''SOCKS v5''.<br />
<br />
Optionally you can enable the quick switch under the ''General'' tab to be able to switch beetween normal navigation and Tor network just by left-clicking on the Proxy SwitchySharp's icon.<br />
<br />
===Luakit===<br />
You can simply run:<br />
$ torify luakit<br />
<br />
==HTTP Proxy==<br />
Tor can be used with an HTTP proxy like [[Polipo]] or [[Privoxy]], however the Tor dev team recommends using the SOCKS5 library since browsers directly support it.<br />
<br />
===Firefox===<br />
The [https://addons.mozilla.org/en-us/firefox/addon/foxyproxy-standard/ FoxyProxy] add-on allows you to specify multiple proxies for different URLs or for all your browsing. After restarting Firefox manually set Firefox to port {{ic|8118}} on {{ic|localhost}}, which is where [[Polipo]] or [[Privoxy]] are running. These settings can be access under ''Add > Standard proxy type''. Select a proxy label (e.g Tor) and enter the port and host into the ''HTTP Proxy'' and ''SSL Proxy'' fields. To check if Tor is functioning properly visit the [https://check.torproject.org/ Tor Check] website and toggle Tor.<br />
<br />
===Polipo===<br />
The Tor Project has created a custom [https://gitweb.torproject.org/torbrowser.git/blob_plain/HEAD:/build-scripts/config/polipo.conf Polipo configuration file] to prevent potential problems with Polipo as well to provide better anonymity.<br />
<br />
Keep in mind that Polipo is not required if you can use a SOCKS 5 proxy, which Tor starts automatically on port 9050. If you want to use [[Chromium]] with Tor, you do not need the Polipo package (see: [[#Chromium]]).<br />
<br />
===Privoxy===<br />
You can also use this setup in other applications like messaging (e.g. Jabber, IRC). Applications that support HTTP proxies you can connect to Privoxy (i.e. {{ic|127.0.0.1:8118}}). To use SOCKS proxy directly, you can point your application at Tor (i.e. {{ic|127.0.0.1:9050}}). A problem with this method though is that applications doing DNS resolves by themselves may leak information. Consider using Socks4A (e.g. with Privoxy) instead.<br />
<br />
==Instant Messaging==<br />
In order to use an IM client with tor, we do not need an http proxy like [[polipo]]/[[privoxy]]. We will be using tor's daemon directly which listens to port 9050 by default. <br />
<br />
===Pidgin===<br />
You can set up Pidgin to use Tor globally, or per account. To use Tor globally, go to Tools -> Preferences -> Proxy. To use Tor for specific accounts, go to Accounts -> Manage Accounts, select the desired account, click Modify, then go to the Proxy tab. The proxy settings are as follows:<br />
<br />
Proxy type SOCKS5<br />
Host 127.0.0.1<br />
Port 9150<br />
<br />
Note that [https://trac.torproject.org/projects/tor/ticket/8135 some time in 2013] the Port has changed from 9050 to 9150 if you use the Tor Browser Bundle. Try the other value if you receive a "Connection refused" message.<br />
<br />
==Irssi==<br />
Freenode does not recommend that you use Privoxy with [[Irssi]]. Instead they recommend using the {{Ic|mapaddress}} approach and running {{Ic|torify irssi}} to start it up. Therefore, add the following to {{ic|/etc/tor/torrc}}:<br />
mapaddress 10.40.40.40 p4fsi4ockecnea7l.onion<br />
<br />
Freenode requires charybdis and ircd-seven's SASL mechanism for identifying to nickserv during<br />
connection. Download {{ic|cap_sasl.pl}}, which enables SASL in Irssi, from the Freenode website (i.e. http://www.freenode.net/sasl/cap_sasl.pl) and save it to {{Ic|~/.irssi/scripts/cap_sasl.pl}}<br />
<br />
Then install {{Pkg|perl-crypt-openssl-bignum}}, {{Pkg|perl-crypt-blowfish}} and then {{AUR|perl-crypt-dh}} from the [[AUR]].<br />
<br />
Alternatively, you can install the modules using perl:<br />
$ perl -MCPAN -e 'install Crypt::OpenSSL::Bignum Crypt::DH Crypt::Blowfish'<br />
<br />
Start irssi <br />
$ torify irssi<br />
<br />
Load the script that will employ the SASL mechanism.<br />
/script load cap_sasl.pl<br />
<br />
Set your identification to nickserv, which will be read when connecting. Supported mechanisms are PLAIN and DH-BLOWFISH. <br />
/sasl set <network> <username> <password> <mechanism><br />
<br />
Connect to Freenode:<br />
/connect -network <network> 10.40.40.40<br />
<br />
For more information check [http://freenode.net/irc_servers.shtml#tor Accessing freenode Via Tor] and the [http://freenode.net/sasl/README.txt SASL README] at freenode.net or the [https://trac.torproject.org/projects/tor/wiki/doc/TorifyHOWTO/IrcSilc IRC/SILC Wiki article] at torproject.org.<br />
<br />
If you are receiving errors check the ''[https://bbs.archlinux.org/viewtopic.php?pid=956467 Cannot Connect to Freenode IRC using Irssi & Tor]'' thread on the Arch Linux forums.<br />
<br />
==Pacman==<br />
Pacman download operations (repository DBs, packages, and public keys) can be done using the Tor network. Though relatively extreme, this measure is useful to prevent an adversary (most likely at one's LAN or the mirror) from knowing a subset of the packages you have installed, at the cost of longer latency, lower throughput, possible suspicion, and possible failure (if Tor is being filtered via the current connection).<br />
<br />
{{Warning|It would be arguably simpler for an adversary, specifically one who desires to indiscriminately disseminate malware, to perform his/her activity by deploying malicious Tor exit node(s). Always use signed packages and verify new public keys by out-of-band means.}}<br />
<br />
{{hc|/etc/pacman.conf|<br />
...<br />
<nowiki>XferCommand = /usr/bin/curl --socks5-hostname localhost:9050 -C - -f %u > %o</nowiki><br />
...}}<br />
<br />
==Running a Tor Server==<br />
<br />
The Tor network is reliant on people contributing bandwidth. There are several ways to contribute to the network.<br />
<br />
===Running a Tor bridge===<br />
<br />
This involves making your machine an 'entry node' for people who are having trouble connecting to Tor through traditional methods.<br />
<br />
====Configuration====<br />
According to https://www.torproject.org/docs/bridges , make your torrc be just these four lines:<br />
<br />
SocksPort 0<br />
ORPort 443<br />
BridgeRelay 1<br />
Exitpolicy reject *:*<br />
<br />
====Troubleshooting====<br />
If you get "Could not bind to 0.0.0.0:443: Permission denied" errors on startup, you'll need to pick a higher ORPort (e.g. 8080), or perhaps [http://www.portforward.com/ forward the port] in your router.<br />
<br />
===Running a "Middleman" relay===<br />
<br />
This means that your machine will contribute bandwidth to the 'internal' part of the network, acting as neither an entry nor exit point, merely forwarding bits to and from other Tor nodes/relays.<br />
<br />
====Configuration====<br />
You should at least share 20KiB/s:<br />
Nickname <tornickname><br />
ORPort 9001<br />
BandwidthRate 20 KB # Throttle traffic to 20KB/s<br />
BandwidthBurst 50 KB # But allow bursts up to 50KB/s<br />
<br />
Run Tor as middleman ( a relay):<br />
ExitPolicy reject *:*<br />
<br />
===Running a Tor Exit Node===<br />
<br />
Any requests from a Tor user to the regular internet obviously need to exit the network somewhere, and exit nodes provide this vital service. To the accessed host, the request will appear as having originated from your machine. This means that running an exit node is generally considered more legally onerous than running other forms of Tor relays. Before becoming an exit relay, you may want to read [https://blog.torproject.org/running-exit-node Tips for Running an Exit Node With Minimal Harrasment].<br />
<br />
====Configuration====<br />
<br />
Using the torrc, you can configure which services you wish to allow through your exit node.<br />
Allow all traffic:<br />
ExitPolicy accept *:*<br />
<br />
Allow only irc ports 6660-6667 to exit from node:<br />
ExitPolicy accept *:6660-6667,reject *:* # Allow irc ports but no more<br />
<br />
By default, Tor will block certain ports. You can use the torrc to overide this.<br />
ExitPolicy accept *:119 # Accept nntp as well as default exit policy<br />
<br />
==TorDNS==<br />
The Tor 0.2.x series provides a built-in DNS forwarder. To enable it add the following lines to the Tor configuration file and restart the daemon:<br />
{{hc|/etc/tor/torrc|<br />
DNSPort 9053<br />
AutomapHostsOnResolve 1<br />
AutomapHostsSuffixes .exit,.onion<br />
}}<br />
<br />
This will allow Tor to accept DNS requests (listening on port 9053 in this example) like a regular DNS server, and resolve the domain via the Tor network. A downside is that it's only able to resolve DNS queries for A-records; MX and NS queries are never answered. For more information see this [https://techstdout.boum.org/TorDns/ Debian-based introduction].<br />
<br />
DNS queries can also be performed through a command line interface by using {{Ic|<nowiki>tor-resolve</nowiki>}}. For example:<br />
{{bc|<br />
$ tor-resolve archlinux.org<br />
66.211.214.131<br />
}}<br />
<br />
===Using TorDNS for all DNS queries===<br />
<br />
It is possible to configure your system, if so desired, to use TorDNS for ''all'' queries your system makes, regardless of whether or not you eventually use Tor to connect to your final destination. To do this, configure your system to use 127.0.0.1 as its DNS server and edit the 'DNSPort' line in {{ic|/etc/tor/torrc}} to show:<br />
DNSPort 53<br />
Alternatively, you can use a local caching DNS server, such as [[dnsmasq]] or [[pdnsd]], which will also compensate for TorDNS being a little slower than traditional DNS servers. The following instructions will show how to set up ''dnsmasq'' for this purpose.<br />
<br />
Change the tor setting to listen for the DNS request in port 9053 and install dnsmasq (available in the [extra] respository):<br />
# pacman -S dnsmasq<br />
Modify its configuration file so that it contains:<br />
{{hc|/etc/dnsmasq.conf|<br />
no-resolv<br />
server&#61;127.0.0.1#9053<br />
listen-address&#61;127.0.0.1<br />
}}<br />
These configurations set dnsmasq to listen only for requests from the local computer, and to use TorDNS at its sole upstream provider. It is now neccessary to edit {{ic|/etc/resolv.conf}} so that your system will query only the dnsmasq server.<br />
{{hc|/etc/resolv.conf|<br />
nameserver 127.0.0.1<br />
}}<br />
Start the dns server with<br />
======SysV======<br />
# rc.d start dnsmasq<br />
======systemd======<br />
# systemctl start dnsmasq<br />
<br />
Finally if you use ''dhcpd'' you would need to change its settings to that it does not alter the resolv configuration file. Just add this line in the configuration file:<br />
{{hc|/etc/dhcpcd.conf|<br />
nohook resolv.conf<br />
}}<br />
If you already have an ''nohook'' line, just add '''resolv.conf''' separated with a comma.<br />
<br />
==Torify==<br />
'''torify''' will allow you use an application via the Tor network without the need to make configuration changes to the application involved. From the man page:<br />
<br />
''torify is a simple wrapper that calls tsocks with a tor specific configuration file. tsocks itself is a wrapper between the tsocks library and the application that you would like to run socksified''<br />
<br />
Usage example:<br />
{{bc|<nowiki><br />
$ torify elinks checkip.dyndns.org<br />
$ torify wget -qO- https://check.torproject.org/ | grep -i congratulations<br />
</nowiki>}}<br />
<br />
Torify ''will not'', however, perform DNS lookups through the Tor network. A workaround is to use it in conjunction with {{Ic|<nowiki>tor-resolve</nowiki>}} (described above). In this case, the procedure for the first of the above examples would look like this:<br />
{{bc|<br />
$ tor-resolve checkip.dyndns.org<br />
208.78.69.70<br />
$ torify elinks 208.78.69.70<br />
}}<br />
<br />
==Troubleshooting==<br />
===Problem with User value===<br />
If the '''tor''' daemon failed to start, then run the following command as root (or use sudo)<br />
<br />
# tor<br />
<br />
If you get the following error<br />
<br />
May 23 00:27:24.624 [warn] Error setting groups to gid 43: "Operation not permitted".<br />
May 23 00:27:24.624 [warn] If you set the "User" option, you must start Tor as root.<br />
May 23 00:27:24.624 [warn] Failed to parse/validate config: Problem with User value. See logs for details.<br />
May 23 00:27:24.624 [err] Reading config failed--see warnings above.<br />
<br />
Then it means that the problem is with the User value, which likely means that one or more files or directories in your {{ic|/var/lib/tor}} directory is not owned by tor. This can be determined by using the following find command:<br />
<br />
find /var/lib/tor/ ! -user tor<br />
<br />
Any files or directories listed in the output from this command needs to have its ownership changed. This can be done individually for each file like so:<br />
<br />
chown tor:tor /var/lib/tor/filename<br />
<br />
Or to change everything listed by the above find example, modify the command to this:<br />
<br />
find /var/lib/tor/ ! -user tor -exec chown tor:tor {} \;<br />
<br />
Tor should now start up correctly.<br />
<br />
===Daemon fails on restart===<br />
<br />
If after issuing {{Ic|/etc/rc.d/tor restart}} you have log entries similar to<br />
<br />
Interrupt: we have stopped accepting new connections, and will shut down in 30 seconds. Interrupt again to exit now<br />
<br />
and the daemon fails to start back up, a simple workaround is to open {{Ic|/etc/rc.d/tor}} in your favourite editor and increase the time waited between the shutting down and starting up again of the daemon. For example:<br />
<br />
{{hc|/etc/rc.d/tor| ;;<br />
restart)<br />
$0 stop<br />
sleep 35<br />
$0 start<br />
;;}}<br />
<br />
This will allow Tor to shutdown cleanly, and restart after a safe period of time. Remember that this file may be overwritten by upgrades.<br />
<br />
==See Also==<br />
* [https://www.torproject.org/docs/tor-doc-unix.html.en Running the Tor client on Linux/BSD/Unix]<br />
* [https://trac.torproject.org/projects/tor/wiki#Unixish Unix-based Tor Articles]<br />
* [https://trac.torproject.org/projects/tor/wiki/doc/SupportPrograms Software commonly integrated with Tor]<br />
* [https://www.torproject.org/docs/tor-hidden-service.html.en How to set up a Tor ''Hidden Service'']</div>Cornholiohttps://wiki.archlinux.org/index.php?title=Easy-RSA&diff=258651Easy-RSA2013-05-24T19:10:04Z<p>Cornholio: Added sample command to generate encrypted .p12 certificate files</p>
<hr />
<div>[[Category:Virtual Private Network]]<br />
<br />
The first step when setting up OpenVPN is to create a [[Wikipedia:Public key infrastructure|Public Key Infrastructure (PKI)]]. The PKI consists of:<br />
<br />
* A public master [[Wikipedia:Certificate Authority|Certificate Authority (CA)]] certificate and a private key.<br />
* A separate public certificate and private key pair (hereafter referred to as a certificate) for each server and each client.<br />
<br />
To facilitate the certificate creation process, OpenVPN comes with a collection of [[Wikipedia:RSA (algorithm)|RSA]] key manangement scripts (based on the openssl command line tool) known as easy-rsa.<br />
<br />
{{Note| Only .key files need to be kept secret, .crt and .csr files can be sent over insecure channels such as plaintext email.}}<br />
<br />
In this article the needed certificates are created by root in root's home directory. This ensures that the generated files have the right ownership and permissions, and are safe from other users.<br />
<br />
{{Note|The certificates can be created on any machine. For the highest security, generate the certificates on a physically secure machine disconnected from any network, and make sure that the generated ca.key private key is backed up and never accessible to anyone.}}<br />
<br />
{{Warning|Make sure that the generated files are backed up, especially the ca.key and ca.crt files, since if lost you will not be able to create any new, nor revoke any comprised certificates, thus requiring the generation of a new [[Wikipedia:Certificate Authority|Certificate Authority (CA)]] certificate, invalidating the entire PKI infrastructure.}}<br />
<br />
===Installing the easy-rsa scripts===<br />
<br />
Install the scripts by doing the following:<br />
<br />
{{bc|# cp -r /usr/share/openvpn/easy-rsa /root}}<br />
<br />
===Creating certificates===<br />
<br />
Change to the directory where you installed the scripts.<br />
<br />
{{bc|# cd /root/easy-rsa}}<br />
<br />
To ensure the consistent use of values when generating the PKI, set default values to be used by the PKI generating scripts. Edit /root/easy-rsa/vars and at a minimum set the KEY_COUNTRY, KEY_PROVINCE, KEY_CITY, KEY_ORG, and KEY_EMAIL parameters (do not leave any of these parameters blank). Change the KEY_SIZE parameter to 2048 for the SSL/TLS to use 2048bit RSA keys for authentication.<br />
<br />
{{hc|/root/easy-rsa/vars|<nowiki><br />
# easy-rsa parameter settings<br />
<br />
# NOTE: If you installed from an RPM,<br />
# do not edit this file in place in<br />
# /usr/share/openvpn/easy-rsa --<br />
# instead, you should copy the whole<br />
# easy-rsa directory to another location<br />
# (such as /etc/openvpn) so that your<br />
# edits will not be wiped out by a future<br />
# OpenVPN package upgrade.<br />
<br />
# This variable should point to<br />
# the top level of the easy-rsa<br />
# tree.<br />
export EASY_RSA="`pwd`"<br />
<br />
#<br />
# This variable should point to<br />
# the requested executables<br />
#<br />
export OPENSSL="openssl"<br />
export PKCS11TOOL="pkcs11-tool"<br />
export GREP="grep"<br />
<br />
# This variable should point to<br />
# the openssl.cnf file included<br />
# with easy-rsa.<br />
export KEY_CONFIG=`$EASY_RSA/whichopensslcnf $EASY_RSA`<br />
<br />
# Edit this variable to point to<br />
# your soon-to-be-created key<br />
# directory.<br />
#<br />
# WARNING: clean-all will do<br />
# a rm -rf on this directory<br />
# so make sure you define<br />
# it correctly!<br />
export KEY_DIR="$EASY_RSA/keys"<br />
<br />
# Issue rm -rf warning<br />
echo NOTE: If you run ./clean-all, I will be doing a rm -rf on $KEY_DIR<br />
<br />
# PKCS11 fixes<br />
export PKCS11_MODULE_PATH="dummy"<br />
export PKCS11_PIN="dummy"<br />
<br />
# Increase this to 2048 if you<br />
# are paranoid. This will slow<br />
# down TLS negotiation performance<br />
# as well as the one-time DH parms<br />
# generation process.<br />
</nowiki>'''export KEY_SIZE&#61;2048'''<nowiki><br />
<br />
# In how many days should the root CA key expire?<br />
export CA_EXPIRE=3650<br />
<br />
# In how many days should certificates expire?<br />
export KEY_EXPIRE=3650<br />
<br />
# These are the default values for fields<br />
# which will be placed in the certificate.<br />
# Do not leave any of these fields blank.<br />
<br />
</nowiki><br />
'''export KEY_COUNTRY&#61;"US"'''<br />
'''export KEY_PROVINCE&#61;"CA"'''<br />
'''export KEY_CITY&#61;"Acme Acres"'''<br />
'''export KEY_ORG&#61;"Acme"'''<br />
'''export KEY_EMAIL&#61;"roadrunner@acmecorp.org"'''<br />
'''#export KEY_EMAIL&#61;mail@host.domain'''<br />
'''export KEY_CN&#61;Acme-CA'''<br />
'''export KEY_NAME&#61;Acme-CA'''<br />
'''export KEY_OU&#61;""'''<nowiki><br />
export PKCS11_MODULE_PATH=changeme<br />
export PKCS11_PIN=1234<br />
</nowiki>}}<br />
<br />
Export the environment variables.<br />
<br />
{{bc|# source ./vars}}<br />
<br />
Delete any previously created certificates.<br />
<br />
{{bc|# ./clean-all}}<br />
<br />
{{Note| Entering a . (dot) when prompted for a value, blanks out the parameter.}}<br />
<br />
The build-ca script generates the [[Wikipedia:Certificate Authority|Certificate Authority (CA)]] certificate.<br />
<br />
{{hc|# ./build-ca|<nowiki><br />
Generating a 2048 bit RSA private key<br />
..............++++++<br />
...++++++<br />
writing new private key to 'ca.key'<br />
-----<br />
You are about to be asked to enter information that will be incorporated<br />
into your certificate request.<br />
What you are about to enter is what is called a Distinguished Name or a DN.<br />
There are quite a few fields but you can leave some blank<br />
For some fields there will be a default value,<br />
If you enter '.', the field will be left blank.<br />
-----<br />
Country Name (2 letter code) [US]:<br />
State or Province Name (full name) [CA]:<br />
Locality Name (eg, city) [Acme Acres]:<br />
Organization Name (eg, company) [Acme]:<br />
Organizational Unit Name (eg, section) []:<br />
Common Name (eg, your name or your server's hostname) [Acme-CA]:<br />
Name [Acme-CA]:<br />
Email Address [roadrunner@acmecorp.org]:<br />
</nowiki>}}<br />
<br />
The build-key-server script {{ic|# ./build-key-server <server name>}} generates a server certificate. Make sure that the server name (Common Name when running the script) is unique.<br />
<br />
{{Note|Do not enter a challenge password or company name when the script prompts you for one.}}<br />
<br />
{{hc|# ./build-key-server elmer|<nowiki><br />
Generating a 2048 bit RSA private key<br />
.....................++++++<br />
.......................................................++++++<br />
writing new private key to 'elmer.key'<br />
-----<br />
You are about to be asked to enter information that will be incorporated<br />
into your certificate request.<br />
What you are about to enter is what is called a Distinguished Name or a DN.<br />
There are quite a few fields but you can leave some blank<br />
For some fields there will be a default value,<br />
If you enter '.', the field will be left blank.<br />
-----<br />
Country Name (2 letter code) [US]:<br />
State or Province Name (full name) [CA]:<br />
Locality Name (eg, city) [Acme Acres]:<br />
Organization Name (eg, company) [Acme]:<br />
Organizational Unit Name (eg, section) []:<br />
Common Name (eg, your name or your server's hostname) [elmer]:<br />
Name [Acme-CA]:<br />
Email Address [roadrunner@acmecorp.org]:<br />
<br />
Please enter the following 'extra' attributes<br />
to be sent with your certificate request<br />
A challenge password []:<br />
An optional company name []:<br />
Using configuration from /root/easy-rsa/openssl-1.0.0.cnf<br />
Check that the request matches the signature<br />
Signature ok<br />
The Subject's Distinguished Name is as follows<br />
countryName :PRINTABLE:'US'<br />
stateOrProvinceName :PRINTABLE:'CA'<br />
localityName :PRINTABLE:'Acme Acres'<br />
organizationName :PRINTABLE:'Acme'<br />
commonName :PRINTABLE:'elmer'<br />
name :PRINTABLE:'Acme-CA'<br />
emailAddress :IA5STRING:'roadrunner@acmecorp.org'<br />
Certificate is to be certified until Dec 27 19:11:59 2021 GMT (3650 days)<br />
Sign the certificate? [y/n]:y<br />
<br />
1 out of 1 certificate requests certified, commit? [y/n]y<br />
Write out database with 1 new entries<br />
Data Base Updated<br />
</nowiki>}}<br />
<br />
The build-dh script generates the [http://www.rsa.com/rsalabs/node.asp?id=2248 Diffie-Hellman parameters] .pem file needed by the server.<br />
<br />
{{Note|It would be better to generate a new one for each server, but you can use the same one if you want to.}}<br />
<br />
{{hc|# ./build-dh|<br />
Generating DH parameters, 2048 bit long safe prime, generator 2<br />
This is going to take a long time<br />
..+.............................................................................<br />
.<br />
.<br />
.<br />
............+...............+...................................................<br />
..................................................................++*++*}}<br />
<br />
The build-key script {{ic|# ./build-key <client name>}} generates a client certificate. Make sure that the client name (Common Name when running the script) is unique.<br />
<br />
{{Note|Do not enter a challenge password or company name when the script prompts you for one.}}<br />
<br />
{{hc|# ./build-key bugs|<nowiki><br />
Generating a 2048 bit RSA private key<br />
....++++++<br />
.............................................................++++++<br />
writing new private key to 'bugs.key'<br />
-----<br />
You are about to be asked to enter information that will be incorporated<br />
into your certificate request.<br />
What you are about to enter is what is called a Distinguished Name or a DN.<br />
There are quite a few fields but you can leave some blank<br />
For some fields there will be a default value,<br />
If you enter '.', the field will be left blank.<br />
-----<br />
Country Name (2 letter code) [US]:<br />
State or Province Name (full name) [CA]:<br />
Locality Name (eg, city) [Acme Acres]:<br />
Organization Name (eg, company) [Acme]:<br />
Organizational Unit Name (eg, section) []:<br />
Common Name (eg, your name or your server's hostname) [bugs]:<br />
Name [Acme-CA]:<br />
Email Address [roadrunner@acmecorp.org]:<br />
<br />
Please enter the following 'extra' attributes<br />
to be sent with your certificate request<br />
A challenge password []:<br />
An optional company name []:<br />
Using configuration from /root/easy-rsa/openssl-1.0.0.cnf<br />
Check that the request matches the signature<br />
Signature ok<br />
The Subject's Distinguished Name is as follows<br />
countryName :PRINTABLE:'US'<br />
stateOrProvinceName :PRINTABLE:'CA'<br />
localityName :PRINTABLE:'Acme Acres'<br />
organizationName :PRINTABLE:'Acme'<br />
commonName :PRINTABLE:'bugs'<br />
name :PRINTABLE:'Acme-CA'<br />
emailAddress :IA5STRING:'roadrunner@acmecorp.org'<br />
Certificate is to be certified until Dec 27 19:18:27 2021 GMT (3650 days)<br />
Sign the certificate? [y/n]:y<br />
<br />
1 out of 1 certificate requests certified, commit? [y/n]y<br />
Write out database with 1 new entries<br />
Data Base Updated<br />
</nowiki>}}<br />
<br />
Generate a secret [[Wikipedia:HMAC|Hash-based Message Authentication Code (HMAC)]] by running:<br />
{{ic|# openvpn --genkey --secret /root/easy-rsa/keys/ta.key}}<br />
<br />
This will be used to add an additional HMAC signature to all SSL/TLS handshake packets. In addition any UDP packet not having the correct HMAC signature will be immidiately dropped, protecting against:<br />
<br />
* Portscanning.<br />
* DOS attacks on the OpenVPN UDP port.<br />
* SSL/TLS handshake initiations from unauthorized machines.<br />
* Any eventual buffer overflow vulnerabilities in the SSL/TLS implementation.<br />
<br />
All the created keys and certificates have been stored in /root/easy-rsa/keys. If you make a mistake, you can start over by running the clean-all script again.<br />
<br />
{{Warning|This will delete any previously generated certificates stored in /root/easy-rsa/keys, including the [[Wikipedia:Certificate Authority|Certificate Authority (CA)]] certificate.}}<br />
<br />
===Converting certificates to encrypted .p12 format===<br />
<br />
Some software (such as Android) will only read VPN certificates that are stored in a password-encrypted .p12 file. These can be generated with the following command:<br />
{{bc|# openssl pkcs12 -export -inkey keys/bugs.key -in keys/bugs.crt -certfile keys/ca.crt -out keys/bugs.p12}}</div>Cornholiohttps://wiki.archlinux.org/index.php?title=Privoxy&diff=243795Privoxy2013-01-14T00:54:03Z<p>Cornholio: Block embedded Facebook, Twitter, and Google+ elements with Privoxy</p>
<hr />
<div>[[Category:Proxy servers]]<br />
[[it:Privoxy]]<br />
{{Article summary start}}<br />
{{Article summary text|This article explains how to install and configure Privoxy alongside the [[Tor]] network.}}<br />
{{Article summary heading|Required software}}<br />
{{Article summary link|Tor|https://www.torproject.org/download/download.html.en}}<br />
{{Article summary link|Privoxy|http://www.privoxy.org/}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Tor}}<br />
{{Article summary wiki|Polipo}}<br />
{{Article summary end}}<br />
<br />
[http://www.privoxy.org/ Privoxy] is a filtering proxy for the HTTP protocol, frequently used in combination with [[Tor]]. Privoxy is a web proxy with advanced filtering capabilities for protecting privacy, filtering web page content, managing cookies, controlling access, and removing ads, banners, pop-ups, etc. It supports both stand-alone systems and multi-user networks.<br />
<br />
Using Privoxy is necessary when they use a [[Wikipedia:SOCKS|SOCKS]] proxy directly because browsers leak your DNS requests, which reduces your anonymity.<br />
<br />
==Installation and setup==<br />
As root install the {{Ic|privoxy}} package from {{Ic|[community]}}.<br />
# pacman -S privoxy<br />
<br />
When Privoxy is used in conjunction with [[Tor]] the two applications need to exchange information through a chain, which requires the specification of forwarding rules.<br />
<br />
{{warning|If you do not want to use Tor or another proxy there is no need to edit {{ic|/etc/privoxy/config}}. In fact, chaining to an invalid target will prevent your browser from opening any website.}}<br />
<br />
Edit your {{ic|/etc/privoxy/config}} file and add this line at the end (be sure to include the . at the end and preserve the file owner and group permissions as {{Ic|privoxy}}):<br />
forward-socks5 / localhost:9050 .<br />
<br />
This example uses the default port used by Tor. If you changed the port number modify the example accordingly. The same basic example is valid for other targets. If you plan on chaining to another proxy specify the method (here [[Wikipedia:SOCKS#SOCKS5|SOCKS5]]) and the port to suit your needs. Refer to section 5 of the manual inside {{ic|/etc/privoxy/config}} for a complete list of options and examples.<br />
<br />
Additionally, make sure your {{ic|/etc/hosts}} file is correctly set up by comparing the hostname listed in {{ic|/etc/hosts}} with {{ic|/etc/rc.conf}}, which the hostname is set. For further information see: [[HOSTNAME#Set the hostname|Set the hostname]].<br />
<br />
The above will forward all browser traffic through Tor. To only forward .onion sites through Tor, use this instead:<br />
forward-socks4a .onion localhost:9050 .<br />
<br />
To forward .i2p sites through the [[I2P]] router, add the following to {{ic|/etc/privoxy/config}}:<br />
forward .i2p localhost:4444<br />
<br />
Finally, if you plan to make Privoxy available to other computers in your network, just add:<br />
listen-address [SERVER-IP]:[PORT]<br />
<br />
For example:<br />
listen-address 192.168.1.1:8118<br />
<br />
==Ad Blocking with Privoxy==<br />
Using an ad blocking extension in a web browser can increase page load time. Additionally, extensions like AdBlock Plus are not supported by all browsers. A useful alternative is to install system-wide ad blocking by setting a proxy address in your preferred browser.<br />
<br />
Once Privoxy has been installed download and install an AdBlock Plus easylist importer from [[AUR]] (i.e. [https://aur.archlinux.org/packages.php?ID=43861 privoxy-blocklist]). You can optionally use an [[AUR Helper]] to do so.<br />
<br />
To block tracking via embedded Facebook "Like" button, Twitter "follow", and Google Plus "+1", edit {{ic|/etc/privoxy/user.action}} and add these lines to the end:<br />
{+block-as-image{Facebook "like" and similar tracking URLs.}}<br />
www.facebook.com/(extern|plugins)/(login_status|like(box)?|activity|fan)\.php<br />
platform.twitter.com/widgets/follow_button?<br />
plusone.google.com<br />
<br />
==Usage==<br />
Start the Privoxy service:<br />
# rc.d start privoxy<br />
<br />
Add privoxy to your {{Ic|DAEMONS}} array in {{ic|/etc/rc.conf}}<br />
DAEMONS=(... privoxy ...)<br />
<br />
Configure your program to use Privoxy. The default address is:<br />
localhost:8118<br />
<br />
For Firefox, go to:<br />
Preferences > Advanced > Network > Settings<br />
<br />
For Chromium you can use:<br />
<br />
$ chromium --proxy-server="localhost:8118"<br />
<br />
==Troubleshooting==<br />
If errors appear when accessing {{ic|/var/log/privoxy/}}, user can add the following after {{Ic|/bin/bash}} in {{ic|/etc/rc.d/privoxy}} and then restart privoxy.<br />
if [ ! -d /var/log/privoxy ] then<br />
mkdir /var/log/privoxy<br />
touch /var/log/privoxy/errorfile<br />
touch /var/log/privoxy/logfile<br />
chown -R privoxy:adm /var/log/privoxy<br />
fi<br />
<br />
==External Links==<br />
* [http://www.privoxy.org/ Official Website]<br />
* [http://thestegemans.com/archives/2011/06/03/blocking_ads_on_arch_linux_with_privoxy/ Blocking ads with Privoxy] by Mike Stegeman</div>Cornholiohttps://wiki.archlinux.org/index.php?title=Privoxy&diff=243361Privoxy2013-01-10T05:49:06Z<p>Cornholio: Added config line to forward only .onion sites through Tor, and line for forwarding .i2p sites through I2P</p>
<hr />
<div>[[Category:Proxy servers]]<br />
[[it:Privoxy]]<br />
{{Article summary start}}<br />
{{Article summary text|This article explains how to install and configure Privoxy alongside the [[Tor]] network.}}<br />
{{Article summary heading|Required software}}<br />
{{Article summary link|Tor|https://www.torproject.org/download/download.html.en}}<br />
{{Article summary link|Privoxy|http://www.privoxy.org/}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Tor}}<br />
{{Article summary wiki|Polipo}}<br />
{{Article summary end}}<br />
<br />
[http://www.privoxy.org/ Privoxy] is a filtering proxy for the HTTP protocol, frequently used in combination with [[Tor]]. Privoxy is a web proxy with advanced filtering capabilities for protecting privacy, filtering web page content, managing cookies, controlling access, and removing ads, banners, pop-ups, etc. It supports both stand-alone systems and multi-user networks.<br />
<br />
Using Privoxy is necessary when they use a [[Wikipedia:SOCKS|SOCKS]] proxy directly because browsers leak your DNS requests, which reduces your anonymity.<br />
<br />
==Installation and setup==<br />
As root install the {{Ic|privoxy}} package from {{Ic|[community]}}.<br />
# pacman -S privoxy<br />
<br />
When Privoxy is used in conjunction with [[Tor]] the two applications need to exchange information through a chain, which requires the specification of forwarding rules.<br />
<br />
{{warning|If you do not want to use Tor or another proxy there is no need to edit {{ic|/etc/privoxy/config}}. In fact, chaining to an invalid target will prevent your browser from opening any website.}}<br />
<br />
Edit your {{ic|/etc/privoxy/config}} file and add this line at the end (be sure to include the . at the end and preserve the file owner and group permissions as {{Ic|privoxy}}):<br />
forward-socks5 / localhost:9050 .<br />
<br />
This example uses the default port used by Tor. If you changed the port number modify the example accordingly. The same basic example is valid for other targets. If you plan on chaining to another proxy specify the method (here [[Wikipedia:SOCKS#SOCKS5|SOCKS5]]) and the port to suit your needs. Refer to section 5 of the manual inside {{ic|/etc/privoxy/config}} for a complete list of options and examples.<br />
<br />
Additionally, make sure your {{ic|/etc/hosts}} file is correctly set up by comparing the hostname listed in {{ic|/etc/hosts}} with {{ic|/etc/rc.conf}}, which the hostname is set. For further information see: [[HOSTNAME#Set the hostname|Set the hostname]].<br />
<br />
The above will forward all browser traffic through Tor. To only forward .onion sites through Tor, use this instead:<br />
forward-socks4a .onion localhost:9050 .<br />
<br />
To forward .i2p sites through the [[I2P]] router, add the following to {{ic|/etc/privoxy/config}}:<br />
forward .i2p localhost:4444<br />
<br />
Finally, if you plan to make Privoxy available to other computers in your network, just add:<br />
listen-address [SERVER-IP]:[PORT]<br />
<br />
For example:<br />
listen-address 192.168.1.1:8118<br />
<br />
==Ad Blocking with Privoxy==<br />
Using an ad blocking extension in a web browser can increase page load time. Additionally, extensions like AdBlock Plus are not supported by all browsers. A useful alternative is to install system-wide ad blocking by setting a proxy address in your preferred browser.<br />
<br />
Once Privoxy has been installed download and install an AdBlock Plus easylist importer from [[AUR]] (i.e. [https://aur.archlinux.org/packages.php?ID=43861 privoxy-blocklist]). You can optionally use an [[AUR Helper]] to do so.<br />
<br />
==Usage==<br />
Start the Privoxy service:<br />
# rc.d start privoxy<br />
<br />
Add privoxy to your {{Ic|DAEMONS}} array in {{ic|/etc/rc.conf}}<br />
DAEMONS=(... privoxy ...)<br />
<br />
Configure your program to use Privoxy. The default address is:<br />
localhost:8118<br />
<br />
For Firefox, go to:<br />
Preferences > Advanced > Network > Settings<br />
<br />
For Chromium you can use:<br />
<br />
$ chromium --proxy-server="localhost:8118"<br />
<br />
==Troubleshooting==<br />
If errors appear when accessing {{ic|/var/log/privoxy/}}, user can add the following after {{Ic|/bin/bash}} in {{ic|/etc/rc.d/privoxy}} and then restart privoxy.<br />
if [ ! -d /var/log/privoxy ] then<br />
mkdir /var/log/privoxy<br />
touch /var/log/privoxy/errorfile<br />
touch /var/log/privoxy/logfile<br />
chown -R privoxy:adm /var/log/privoxy<br />
fi<br />
<br />
==External Links==<br />
* [http://www.privoxy.org/ Official Website]<br />
* [http://thestegemans.com/archives/2011/06/03/blocking_ads_on_arch_linux_with_privoxy/ Blocking ads with Privoxy] by Mike Stegeman</div>Cornholio