https://wiki.archlinux.org/api.php?action=feedcontributions&user=Ddreamer&feedformat=atomArchWiki - User contributions [en]2024-03-28T22:03:48ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Gcin_(%E6%AD%A3%E9%AB%94%E4%B8%AD%E6%96%87)&diff=321169Gcin (正體中文)2014-06-22T11:26:42Z<p>Ddreamer: /* 範例 */</p>
<hr />
<div>[[Category:正體中文]]<br />
[[Category:Internationalization (正體中文)]]<br />
[[en:Gcin]]<br />
{{Related articles start (正體中文)}}<br />
{{Related|Arch Linux Localization (正體中文)}}<br />
{{Related articles end}}<br />
Gcin 是由 Edward Liu 所開發的新一代中文輸入程式,支持各種不同的輸入法,可在大部分的類 Unix 系統下運作,是最受歡迎的中文輸入法之一。剛開始是設計為使用大五碼字集輸入繁體中文的輸入法。它使用 GTK 作為 UI。在台灣Linux界是一個非常普及的,專注在繁體中文的輸入法。它的輸入法字碼表格式幾乎與 xcin 一樣,且附帶一個方便的程式協助 xcin 使用者轉換他們的設定。Gcin 有一個圖形介面的設定工具,可調整一些 gcin 的設定,像是最愛的輸入法和鍵盤設定等等。並且可以讓使用者很直覺地加入其他 gcin 本來沒有包括的或者是其他輸入程式,像是 scim,的輸入法表格。<br />
<br />
== 安裝 ==<br />
只要用 pacman 可以簡單地安裝好 gcin。<br />
pacman -S gcin<br />
<br />
=== 安裝其他輸入法表格 ===<br />
待續<br />
<br />
== 設定 ==<br />
=== 自動啟動 ===<br />
設定 {{ic|~/.xprofile}} 或者 {{ic|/etc/xprofile}} (詳:[[xprofile]])或 {{ic|~/.xinitrc}} (詳:[[xinitrc]]),來讓 gcin 可以自動執行:<br />
export LC_CTYPE=zh_TW.UTF-8<br />
export XMODIFIERS=@im=gcin<br />
gcin &<br />
<br />
== 使用方法 ==<br />
<br />
=== 對於 GNOME/GTK+ 2 應用程式 ===<br />
gcin 提供 gtk 輸入模組。因此,所有 gtk2 的應用程式都可直接獲得支持,不需要再做多餘的設定。(gcin 不是 XIM,且會自動啟動)<br />
<br />
=== 對於其他的應用程式 ===<br />
==== 範例 ====<br />
以下是一個簡單的範例,附加在 {{ic|~/.xinitrc}} 或者 {{ic|~/.xprofile}} 檔案內皆可,用以啟動正體中文環境的 xfce4 及 gcin,可根據你的需要來修改這個範例。<br />
export LANG="zh_TW.UTF-8"<br />
export LC_CTYPE="zh_TW.UTF-8"<br />
export XMODIFIERS=@im=gcin<br />
export GTK_IM_MODULE="gcin"<br />
export QT_IM_MODULE="gcin"<br />
gcin &<br />
exec startxfce4<br />
<br />
==== 設定流程 ====<br />
1. 設定環境變數,將 locale 設定為 utf8,例如:<br />
export LC_CTYPE=zh_TW.UTF-8<br />
{{注意|必須要設定 LC_CTYPE 變數,即使 LC_CTYPE 和 LANG 是相同的,否則在非 gtk2 而使用 X 輸入法的應用程式中會無法啟動。}}<br />
<br />
2. 設定 XMODIFIERS:<br />
一般情形下,使用以下的設定即可。<br />
export XMODIFIERS=@im=gcin<br />
gcin 預設使用 "gcin" 這個名字。如果有需要,可以用 GCIN_XIM 這個變數來修改,這樣就可以開啟多個 gcin 程式。例如:<br />
export GCIN_XIM=gcin_zh<br />
export XMODIFIERS=@im=gcin_zh<br />
記住,gtk2 應用程式在沒有 gcin 時會自動開啟 gcin 程式。<br />
<br />
3. 啟動 gcin:<br />
gcin &<br />
<br />
4. 執行你的應用程式。如果 gcin 被中止 (killed) 了,有可能會造成其他應用程式的崩潰。<br />
<br />
=== Additional notes for Wine/Crossover Office ===<br />
1. If you run wine or Crossover Office, it's better to use Windows 2000 emulation instead of Windows 98, and you have to start gcin and wine/cxoffice with at least LC_CTYPE=zh_TW.utf8, otherwise wine will not be able to show Chinese correctly.<br />
<br />
2. In wine+IE6 with Windows 98 emulation, LC_CTYPE is not enough if you want to input Chinese on the web-pages - you have to set either LANG or LC_ALL to zh_TW.utf8, which slows down wine a lot. However, you can always type Chinese in the location bar or other places and paste it.<br />
<br />
== OpenOffice.org and GCIN ==<br />
如果你使用的不是GNOME的桌面系統,那麼有很高的機會你將無法在OpenOffice.org當中切換gcin的輸入模式。<br />
藉由簡單的更改OpenOffice.org的執行指令,在執行命令之前加入'''OOO_FORCE_DESKTOP=gnome'''就可以排除這個問題。<br />
<br />
例如:將'''$ oowrite''' 更改為'''$ OOO_FORCE_DESKTOP=gnome ooffice'''<br />
<br />
修改選單中程式執行的命令也能夠達成相同的效果。<br />
<br />
[[Fluxbox]]或類似視窗管理的軟體,可以將'''OOO_FORCE_DESKTOP=gnome'''加入{{ic|.xinitrc}}當中。<br />
<br />
<hr><br />
<br />
[http://hyperrate.com/dir.php?eid=67 Project Homepage]</div>Ddreamerhttps://wiki.archlinux.org/index.php?title=Gcin_(%E6%AD%A3%E9%AB%94%E4%B8%AD%E6%96%87)&diff=321168Gcin (正體中文)2014-06-22T11:24:02Z<p>Ddreamer: /* 自動啟動 */</p>
<hr />
<div>[[Category:正體中文]]<br />
[[Category:Internationalization (正體中文)]]<br />
[[en:Gcin]]<br />
{{Related articles start (正體中文)}}<br />
{{Related|Arch Linux Localization (正體中文)}}<br />
{{Related articles end}}<br />
Gcin 是由 Edward Liu 所開發的新一代中文輸入程式,支持各種不同的輸入法,可在大部分的類 Unix 系統下運作,是最受歡迎的中文輸入法之一。剛開始是設計為使用大五碼字集輸入繁體中文的輸入法。它使用 GTK 作為 UI。在台灣Linux界是一個非常普及的,專注在繁體中文的輸入法。它的輸入法字碼表格式幾乎與 xcin 一樣,且附帶一個方便的程式協助 xcin 使用者轉換他們的設定。Gcin 有一個圖形介面的設定工具,可調整一些 gcin 的設定,像是最愛的輸入法和鍵盤設定等等。並且可以讓使用者很直覺地加入其他 gcin 本來沒有包括的或者是其他輸入程式,像是 scim,的輸入法表格。<br />
<br />
== 安裝 ==<br />
只要用 pacman 可以簡單地安裝好 gcin。<br />
pacman -S gcin<br />
<br />
=== 安裝其他輸入法表格 ===<br />
待續<br />
<br />
== 設定 ==<br />
=== 自動啟動 ===<br />
設定 {{ic|~/.xprofile}} 或者 {{ic|/etc/xprofile}} (詳:[[xprofile]])或 {{ic|~/.xinitrc}} (詳:[[xinitrc]]),來讓 gcin 可以自動執行:<br />
export LC_CTYPE=zh_TW.UTF-8<br />
export XMODIFIERS=@im=gcin<br />
gcin &<br />
<br />
== 使用方法 ==<br />
<br />
=== 對於 GNOME/GTK+ 2 應用程式 ===<br />
gcin 提供 gtk 輸入模組。因此,所有 gtk2 的應用程式都可直接獲得支持,不需要再做多餘的設定。(gcin 不是 XIM,且會自動啟動)<br />
<br />
=== 對於其他的應用程式 ===<br />
==== 範例 ====<br />
以下是一個簡單的 {{ic|~/.xprofile}} 範例,啟動正體中文環境的 xfce4 及 gcin,可根據你的需要來修改這個範例。<br />
export LANG="zh_TW.UTF-8"<br />
export LC_CTYPE="zh_TW.UTF-8"<br />
export XMODIFIERS=@im=gcin<br />
export GTK_IM_MODULE="gcin"<br />
export QT_IM_MODULE="gcin"<br />
gcin &<br />
exec startxfce4<br />
<br />
==== 設定流程 ====<br />
1. 設定環境變數,將 locale 設定為 utf8,例如:<br />
export LC_CTYPE=zh_TW.UTF-8<br />
{{注意|必須要設定 LC_CTYPE 變數,即使 LC_CTYPE 和 LANG 是相同的,否則在非 gtk2 而使用 X 輸入法的應用程式中會無法啟動。}}<br />
<br />
2. 設定 XMODIFIERS:<br />
一般情形下,使用以下的設定即可。<br />
export XMODIFIERS=@im=gcin<br />
gcin 預設使用 "gcin" 這個名字。如果有需要,可以用 GCIN_XIM 這個變數來修改,這樣就可以開啟多個 gcin 程式。例如:<br />
export GCIN_XIM=gcin_zh<br />
export XMODIFIERS=@im=gcin_zh<br />
記住,gtk2 應用程式在沒有 gcin 時會自動開啟 gcin 程式。<br />
<br />
3. 啟動 gcin:<br />
gcin &<br />
<br />
4. 執行你的應用程式。如果 gcin 被中止 (killed) 了,有可能會造成其他應用程式的崩潰。<br />
<br />
=== Additional notes for Wine/Crossover Office ===<br />
1. If you run wine or Crossover Office, it's better to use Windows 2000 emulation instead of Windows 98, and you have to start gcin and wine/cxoffice with at least LC_CTYPE=zh_TW.utf8, otherwise wine will not be able to show Chinese correctly.<br />
<br />
2. In wine+IE6 with Windows 98 emulation, LC_CTYPE is not enough if you want to input Chinese on the web-pages - you have to set either LANG or LC_ALL to zh_TW.utf8, which slows down wine a lot. However, you can always type Chinese in the location bar or other places and paste it.<br />
<br />
== OpenOffice.org and GCIN ==<br />
如果你使用的不是GNOME的桌面系統,那麼有很高的機會你將無法在OpenOffice.org當中切換gcin的輸入模式。<br />
藉由簡單的更改OpenOffice.org的執行指令,在執行命令之前加入'''OOO_FORCE_DESKTOP=gnome'''就可以排除這個問題。<br />
<br />
例如:將'''$ oowrite''' 更改為'''$ OOO_FORCE_DESKTOP=gnome ooffice'''<br />
<br />
修改選單中程式執行的命令也能夠達成相同的效果。<br />
<br />
[[Fluxbox]]或類似視窗管理的軟體,可以將'''OOO_FORCE_DESKTOP=gnome'''加入{{ic|.xinitrc}}當中。<br />
<br />
<hr><br />
<br />
[http://hyperrate.com/dir.php?eid=67 Project Homepage]</div>Ddreamerhttps://wiki.archlinux.org/index.php?title=Xfce&diff=294923Xfce2014-01-29T17:11:30Z<p>Ddreamer: /* Tips & Tricks */ Add a tip "Scroll a background window without shifting focus on it" that I thought very useful</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 />
From [http://www.xfce.org/about/ Xfce - About]:<br />
<br />
:''Xfce embodies the traditional UNIX philosophy of modularity and re-usability. It consists of a number of components that provide the full functionality one can expect of a modern desktop environment. They are packaged separately and you can pick among the available packages to create the optimal personal working environment.''<br />
<br />
Xfce is a lightweight and modular [[Desktop Environment]] currently based upon GTK+ 2 though in the future it may be ported to GTK+ 3. Xfce contains a suite of applications such as a window manager, a file manager, and a panel to provide a complete user experience. Xfce is popular with many users, partly because it is lightweight but also because a large amount of settings are exposed in a GUI. This is in sharp contrast to desktops such as GNOME Shell which hide many settings from the user.<br />
<br />
==Installation==<br />
Xfce can be installed from the {{Grp|xfce4}} group which is available in the official repositories. It is highly recommended that you install the {{Grp|xfce4-goodies}} group as well which includes extra plugins and a number of useful utilities such as the {{Pkg|mousepad}} editor.<br />
<br />
== Starting Xfce ==<br />
=== Graphical login ===<br />
Simply choose ''Xfce Session'' from the menu in you favourite [[display manager]].<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|You can have Xfce started automatically at login by following [[Start X at Login]].}}<br />
<br />
== Configuration ==<br />
===Xfconf settings===<br />
Xfconf is XFCE's system for storing configuration options, and most XFCE configuration is done by editing settings in Xfconf (one way or another). There are several ways to modify these settings:<br />
* The most obvious and easiest way is to go to "Settings" in the main menu and select the category you want to customize. However, not all customization options are available this way. <br />
* A less user-friendly but more general way is to go to {{bc|Main menu -> Settings -> Settings Editor}} where you can see and modify all the customization options. Any settings modified here will take effect immediately. The Settings Editor can also be launched from the command line by invoking {{ic|xfce4-settings-editor}}.<br />
* Customization can be done completely from the command line using the program {{ic|xfconf-query}}. See [http://docs.xfce.org/xfce/xfconf/xfconf-query the XFCE online documentation] for more information and examples and the rest of this wiki page for more examples. Settings changed here will take effect immediately.<br />
* The 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 />
* For more information: [http://docs.xfce.org/xfce/xfconf/start Xfconf documentation]<br />
<br />
==== Graphical Settings Manager Commands ====<br />
There is no official documentation for the commands executed. One must look at {{ic|.desktop}} files {{ic|/usr/share/applications/}} folder. For the people who like to know exactly what is happening, here is a handy list to save the effort:<br />
<br />
xfce4-accessibility-settings<br />
xfce4-power-manager-settings<br />
xfce4-settings-editor<br />
xfdesktop-settings<br />
xfce4-display-settings<br />
xfce4-keyboard-settings<br />
xfce4-mouse-settings<br />
xfce4-session-settings<br />
xfce4-settings-manager<br />
xfce4-appearance-settings<br />
xfwm4-settings<br />
xfwm4-tweaks-settings<br />
xfwm4-workspace-settings<br />
orage -p<br />
<br />
To review all the available setting manager commands run the following in a terminal:<br />
<br />
$ grep '^Exec=' /usr/share/applications/xfce*settings* | sed -e 's_^.*=_ _'<br />
<br />
===Menu===<br />
==== Menu applet replacement ====<br />
[http://gottcode.org/xfce4-whiskermenu-plugin/ Whisker Menu] is a full-featured replacement for the default Xfce menu applet. Add it to your panel and optionally remove the built-in default menu.<br />
<br />
It is available in the [[Arch User Repository|AUR]] as the {{AUR|xfce4-whiskermenu-plugin}} package.<br />
<br />
==== Removing entries from the System menu====<br />
===== Method 1 =====<br />
With the built-in menu editor, you cannot remove menu entries from the System menu. Here’s how to hide them:<br />
# Open Terminal (Xfce menu > System > Terminal) and go to the {{ic|/usr/share/applications}} folder: {{bc|$ cd /usr/share/applications}}<br />
# This folder should be full of {{ic|.desktop}} files. To see a list type: {{bc|$ ls}}<br />
# Add {{ic|1=NoDisplay=true}} to the {{ic|.desktop}} file. For example, if you want to hide Firefox, type in the terminal: {{bc|1=# echo "NoDisplay=true" >> firefox.desktop}} This command appends the text {{ic|1=NoDisplay=true}} to the end of the {{ic|.desktop}} file.<br />
<br />
===== Method 2 =====<br />
Another method is to copy the entire contents of the global applications directory over to your local applications directory, and then proceed to modify and/or disable unwanted .desktop entries. This will survive application updates that overwrite changes under {{ic|/usr/share/applications/}}.<br />
# In a terminal, copy everything from {{ic|/usr/share/applications}} to {{ic|~/.local/share/applications/}}: {{bc|$ cp /usr/share/applications/* ~/.local/share/applications/}}<br />
# For any entry you wish to hide from the menu, add the {{ic|1=NoDisplay=true}} option: {{bc|1=$ echo "NoDisplay=true" >> ~/.local/share/applications/foo.desktop}}<br />
<br />
You can also edit the application's category by editing the {{ic|.desktop}} file with a text editor and modifying the {{ic|1=Categories=}} line.<br />
<br />
===== Method 3 =====<br />
The third method is the '''cleanest''' and recommended in the [http://wiki.xfce.org/howto/customize-menu Xfce wiki].<br />
<br />
Create the file {{ic|~/.config/menus/xfce-applications.menu}} and copy the following in it:<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 />
<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 />
<br />
<Filename>xfce4-about.desktop</Filename><br />
<Filename>xfhelp4.desktop</Filename><br />
</Exclude><br />
<br />
<Layout><br />
<Merge type="all"/><br />
<Separator/><br />
<br />
<Menuname>Settings</Menuname><br />
<Separator/><br />
<br />
<Filename>xfce4-session-logout.desktop</Filename><br />
</Layout><br />
<br />
</Menu><br />
<br />
The {{ic|<MergeFile>}} tag includes the default Xfce menu in our file. This is important.<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 aforementioned Xfce wiki page.<br />
<br />
===== Method 4 =====<br />
Alternatively a tool called [http://www.redsquirrel87.com/XAME.html xame] can be used. XAME is a GUI tool written in Gambas designed specifically for editing menu entires in Xfce, it will NOT work in other DEs. XAME is available in the {{AUR|xame}} package from the [[AUR]]. An alternative to XAME that works quite well with Xfce is {{AUR|menulibre}}.<br />
<br />
==== Missing applications ====<br />
When some applications are installed (for example via [[WINE]]), they may not be listed in {{ic|/usr/share/applications}}. Shortcuts ''might'' be found in the category “Other” in this directory:<br />
{{ic|~/.local/share/applications/wine/}}.<br />
<br />
=== Desktop ===<br />
<br />
==== Transparent Background for Icon Titles ====<br />
To change the default white background of desktop icon titles to something more suitable, create or edit the GTK config file:<br />
<br />
{{hc|~/.gtkrc-2.0|<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 />
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 />
Would show all partitions with the exception of sda1 and sda2 on your desktop. Notice, if you are using udisk2 the above will not work, due to the UDISKS_PRESENTATION_HIDE no longer being supported, instead you must use 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 ====<br />
xfconf-query -c xfce4-desktop -v --create -p /desktop-icons/style -t int -s 0<br />
<br />
==== Kill Window Shortcut ====<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 />
==== Manage Keyboard Shortcuts ====<br />
<br />
Keyboard shortcuts can be managed with the Xfce Settings Manager application, which is available through the {{Pkg|xfce4-settings}} [[Pacman#Installing_specific_packages|package]] and the {{Grp|xfce4}} [[Pacman#Installing_package_groups|group]]. The Settings Manager can be started from the application menu (click Settings -> Keyboard) or command line (run {{ic|xfce4-keyboard-settings}}). The Xfce Docs include [http://docs.xfce.org/xfce/xfce4-settings/keyboard#application_shortcuts detailed instructions] for using the Settings Manager.<br />
<br />
=== Window Manager ===<br />
The default window manager for Xfce is [[Xfwm]].<br />
<br />
==== Enabling the Compositor ====<br />
Xfwm has a builtin compositor adding the option for fancy window effects, shadows and transparency and so on. It can be enabled in the Window Manager Tweaks and works on the fly. No additional settings are needed in your {{ic|/etc/xorg.conf}}. To enable and adjust settings, go to:<br />
<br />
Menu --> Settings --> Window Manager Tweaks<br />
<br />
{{Tip|The built-in compositor for Xfwm (the Xfce window manager) often causes video tearing in applications. If you wish for a lightweight compositor with some minimal effects, consider using [[Compton]].}}<br />
<br />
==== Window roll-up ====<br />
Double clicking on the titlebar or clicking on the window menu and choosing 'role window up' will cause the window's contents to disappear leaving only the titlebar. If you would like to disable this functionality you can do so graphically using the xconf editor or through the command line, as shown below, which achieves the same result.<br />
<br />
{{ic|xfconf-query -c xfwm4 -p /general/mousewheel_rollup -s false}}<br />
<br />
==== Toggle Automatic Tiling of Windows at Edge of Screen ====<br />
XFWM4 has the ability to "tile" a window automatically when it is moved to the edge of the screen by resizing it to fill the top half of the screen. (The official XFCE website says this feature is disabled by default in XFCE 4.10, but it seems to be enabled by default on Arch Linux.) This behavior can be enabled or disabled in {{ic|Window Manager Tweaks --> Accessibility --> Automatically tile windows when moving toward the screen edge}}, or:<br />
<br />
xfconf-query -c xfwm4 -p /general/tile_on_move -s false # To disable<br />
xfconf-query -c xfwm4 -p /general/tile_on_move -s true # To enable<br />
<br />
==== Replacing the native window manager ====<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 />
*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}} and {{ic|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 />
{{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 />
===== Re-enabling Compositing effects =====<br />
If you replace xfwm4 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 />
====Custom Startup Applications====<br />
<br />
=====Via the Settings Menu=====<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 />
=====Startup Script=====<br />
<br />
Alternatively you can use this method, to run 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 somehwere in the middle:<br />
source $HOME/.bashrc<br />
# start rxvt-unicode server<br />
urxvtd -q -o -f<br />
<br />
====Lock the screen====<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 />
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 />
==== Manually Modifying XML settings ====<br />
It may be useful, especially when upgrading, to manually edit .xml files in the {{ic|~/.config/xfce4/xfconf/}} folder. For application keyboard shortcuts for example, the file is {{ic|~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml}}.<br />
<br />
===Look and Feel===<br />
====Add themes to XFCE====<br />
1. Go to [http://www.xfce-look.org www.xfce-look.org] and click "Themes" in the left navbar. Look around for a theme you want and click "Download".<br />
<br />
2. Go to the directory where you downloaded the tarball/file and extract it using an archive manager such as {{Pkg|file-roller}}<br />
<br />
3. Move the extracted folder to {{ic|/usr/share/themes}} (for all users) or {{ic|~/.themes}} (for just you). Inside {{ic|/usr/share/themes/abc}}, there is a folder that you create called xfwm4 that will contain whatever files that is included with that theme.<br />
<br />
4. Selecting the theme.<br />
<br />
*The GTK+ theme can be changed from:<br />
Menu --> Settings --> Appearance<br />
<br />
*The xfwm4 theme can be changed from:<br />
Menu --> Settings --> Window Manager<br />
<br />
====Application theme consistency====<br />
Applications do not always have a consistent look. There are two possible reasons for this:<br />
<br />
1. The application is based upon a toolkit that the current theme does not support. Applications based upon the GTK+ 2 toolkit will need a GTK+ 2 theme whilst applications based upon the GTK+ 3 toolkit will need a GTK+ 3 theme.<br />
<br />
2. The theme is out of date.<br />
<br />
To achieve a uniform look for all applications it is advisable to use an up to date GTK+ 3 theme such as Adwaita as GTK+ 3 themes have inbuilt support for GKT+ 2 applications. Adwaita can be installed from the {{Pkg|gnome-themes-standard}} package. Applications based upon the Qt toolkit can mimic the current GTK+ theme using the {{ic|qtconfig-qt4}} dialogue. <br />
<br />
For information please consult these wiki pages: [[GTK+#GTK+ 3.x]] for gtk3 and [[Uniform Look for Qt and GTK Applications]] for qt.<br />
<br />
==== Cursors ====<br />
Main article: [[X11 Cursors]]<br />
<br />
If you have alternative X cursor themes installed, Xfce can find them with:<br />
Menu --> Settings --> Mouse --> Theme<br />
<br />
==== Icons ====<br />
# First find and download your desired icon pack. Recommended places to download icons from are [http://www.customize.org Customize.org], [http://opendesktop.org Opendesktop.org] and [http://xfce-look.org/ Xfce-look.org]; the [[AUR]] provides several PKGBUILDs for icon packs.<br />
# Go to the directory where you downloaded the icon pack and extract it. Example {{ic|tar -xzf /home/user/downloads/icon-pack.tar.gz}}.<br />
# Move the extracted folder containing the icons to {{ic|~/.icons}} (if only you want to use the icons) or to {{ic|/usr/share/icons}} (if you want all users on the system to make use of the icons), and in the lattter case consider creating a [[PKGBUILD]] for that.<br />
# Optional: run {{ic|gtk-update-icon-cache -f -t ~/.icons/<theme_name>}} to update icon cache<br />
# Switch your icons by going to:<br />
Menu --> Settings --> Appearance --> Icons<br />
<br />
When you have icon theme problems, it is also recommended to install the {{Pkg|hicolor-icon-theme}} package if it was not already installed.<br />
<br />
==== Fonts ====<br />
If you find the standard fonts rather thick and or slightly out of focus open Settings>Appearance click on the Fonts tab and under Hinting: change to Full<br />
<br />
You could also try using a custom DPI setting.<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 />
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 />
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 />
For the raise volume button:<br />
sh -c "pactl set-sink-mute 0 false ; pactl set-sink-volume 0 +1%"<br />
For the lower volume button:<br />
sh -c "pactl set-sink-mute 0 false ; pactl -- set-sink-volume 0 -1%"<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 />
===== 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 />
===== Extra keyboard keys =====<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 />
==Tips & Tricks==<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 />
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 />
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 forums post [[https://bbs.archlinux.org/viewtopic.php?pid=1194644|Terminal Colour Scheme Screenshots]] for hundreds of available choices and themes.<br />
<br />
====Changing default color theme====<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 />
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 />
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 />
==== Loading a profile ====<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 />
{{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 />
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 />
~/.config/xfce4/xfconf/xfce-perchannel-xml<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 />
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 />
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 />
Currently there is no bluetooth applet for Xfce that is compatible with {{pkg|bluez}} version 5. Users have 3 options for using bluetooth in Xfce:<br />
<br />
* You can install {{AUR|bluez4}} and {{AUR|blueman-bzr}} from the [[AUR]]. The [[Blueman]] applet integrates well with the Xfce desktop but '''it should be remembered that [[Bluez4]] (the stack that [[Blueman]] relies upon) has been abandoned upstream and is no longer supported'''.<br />
<br />
* You can install {{pkg|gnome-bluetooth}} and {{AUR|gnome-bluetooth-applet-git}}. The latter package provides the applet for non GNOME Shell desktops as the applet code was dropped in GNOME 3.8. See the [[Bluetooth#GNOME_Bluetooth|GNOME Bluetooth section]] in the Bluetooth article for more information.<br />
<br />
* You can access bluetooth functionality using command line tools. Please see the [[Bluetooth]] article for more information.<br />
<br />
=== Scroll a background window without shifting focus on it ===<br />
Go to<br />
Main Menu -> Settings -> Window Manager Tweaks -> Acessibility tab<br />
Uncheck {{ic|Raise windows when any mouse button is pressed}}<br />
<br />
== Troubleshooting ==<br />
=== Getting "Not Authorized" when attempting to mount drives with a file manager ===<br />
A polkit Authentication Agent is required for this (alongside [[polkit]] and [[gvfs]]), but not included with Xfce. Make sure one is installed and autostarted on login, as explained in [[polkit#Authentication agents]].<br />
<br />
=== xfce4-power-manager ===<br />
Power-related [[Wikipedia:Advanced Configuration and Power Interface|ACPI]] events can be configured using [[systemd]] via options from {{ic|/etc/systemd/logind.conf}} to give control to xfce4-power-manager.<br />
<br />
{{hc|/etc/systemd/logind.conf|2=<br />
HandlePowerKey=ignore<br />
HandleSuspendKey=ignore<br />
HandleHibernateKey=ignore<br />
HandleLidSwitch=ignore}}<br />
<br />
This also solves the problem when the computer registers multiple suspend events.<br />
<br />
=== xfce4 keeps blanking display===<br />
Xfce4 (as of 4.12) does not seem to respect monitor power settings in {{ic|xfce4-power-manager}}. It attempts to run the screensaver every 10 minutes. You can check this by reading out the output of {{ic|$ xset q}}. Run {{ic|$ xset s noblank}} to stop it. Alternatively add the following configuration file to {{ic|/etc/X11/xorg.conf.d/}} ( I would save it as {{ic|20-noblank.conf}}).<br />
{{bc|<nowiki><br />
Section "ServerFlags"<br />
Option "BlankTime" "0"<br />
EndSection<br />
</nowiki>|bc}}<br />
<br />
=== xfce4-xkb-plugin ===<br />
There is a bug in version {{Pkg|xfce4-xkb-plugin}} ''0.5.4.1-1'' which causes xfce4-xkb-plugin to ''lose keyboard, layout switching and compose key'' settings. As a workaround you may enable ''Use system defaults'' option in keyboard settings. To do so run<br />
xfce4-keyboard-settings<br />
Go to ''Layout'' tab and set the ''Use system defaults'' flag, then reconfigure xfce4-xkb-plugin.<br />
<br />
=== Locales ignored with GDM ===<br />
Add your locale to {{ic|/var/lib/AccountsService/users/$USER}} (replace {{ic|hu_HU.UTF-8}} with your own locale):<br />
[User]<br />
Language=hu_HU.UTF-8<br />
XSession=xfce<br />
You may also do it with sed. Note the backslash before .UTF-8:<br />
# sed -i 's/Language=.*/Language=hu_HU\.UTF-8/' /var/lib/AccountsService/users/$USER<br />
Restart GDM to take effect.<br />
<br />
=== Restore default settings ===<br />
If for any reason you need to revert back to the default settings, try renaming {{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 />
Logout and login for changes to take effect. If upon logging in you get an error window with the heading "Unable to load a failsafe session," see the [[#Session failure|Session Failure]] section on this page.<br />
<br />
=== NVIDIA and xfce4-sensors-plugin ===<br />
To detect and use sensors of nvidia gpu you need to install {{AUR|libxnvctrl}} and then recompile {{Pkg|xfce4-sensors-plugin}} package.<br />
<br />
=== Session failure ===<br />
If the window manager does not load correctly, you maybe got a session error. Typical symptoms of this can 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 />
* "Window Manager" settings tool ({{ic|xfwm4-settings}}) will not start, reporting <br />
These settings cannot work with your current window manager (unknown)<br />
* errors being reported by {{ic|slim}} or your login manager like<br />
No window manager registered on screen 0<br />
<br />
Restarting xfce or rebooting your system may resolve the problem but more likely the problem is a corrupt session. Delete the session folder below the {{ic|.cache}} folder:<br />
$ rm -r ~/.cache/sessions/<br />
<br />
=== Preferred Applications preferences have no effect ===<br />
If you have set your preferred applications with ''exo-preferred-applications'', but they do not seem to be taken into consideration, see [[#xdg-open integration (Preferred Applications)]]<br />
<br />
=== Action Buttons/Missing Icons ===<br />
This happens if icons for some actions (Suspend, Hibernate) are missing from the icon theme, or at least 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 />
Make sure that the {{Pkg|xfce4-power-manager}} is installed as this contains the needed icons. Now 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 />
=== Enable cedilla ç/Ç instead of ć/Ć ===<br />
When you select the keyboard layout "U.S., alternative international" in Settings --> Keyboard --> Layout to enable accents, the typical combination for the cedilla ' + c results in ć instead of ç.To change this suffice edit files gtk.immodules for gtk-2.0 and immodules.cache for gtk-3.0 in line that contains "cedilla" adding both "en" in the list "az:ca:co:fr:gv:oc:pt:sq:tr:wa" but in alphabetical order, staying that way in /etc/gtk-2.0/gtk.immodules<br />
<br />
"/usr/lib/gtk-2.0/2.10.0/immodules/im-cedilla.so" <br />
"cedilla" "Cedilla" "gtk20" "/usr/share/locale" "az:ca:co:en:fr:gv:oc:pt:sq:tr:wa"<br />
<br />
and this in /usr/lib/gtk-3.0/3.0.0/immodules.cache<br />
<br />
"/usr/lib/gtk-3.0/3.0.0/immodules/im-cedilla.so" <br />
"cedilla" "Cedilla" "gtk30" "/usr/share/locale" "az:ca:co:en:fr:gv:oc:pt:sq:tr:wa"<br />
<br />
Then, do<br />
# echo "export GTK_IM_MODULE=cedilla" >> /etc/environment<br />
<br />
Done. Simply just close and reopen the gtk programs like gedit.<br />
<br />
=== Non ASCII characters when mounting USB sticks ===<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 />
=== Video tearing when Xfwm compositing is enabled ===<br />
This is a known problem. Consider using a standalone compositor like [[Compton]] or [[Xcompmgr]]. Alternatively, you could replace your window manager with something like [[Compiz]] or Kwin ({{aur|kwin-standalone-git}}) which provide their own compositors.<br />
<br />
=== GTK themes not working with multiple monitors ===<br />
Some configuration tools might 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 />
==See also==<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>Ddreamerhttps://wiki.archlinux.org/index.php?title=Wicd&diff=266232Wicd2013-07-14T14:48:13Z<p>Ddreamer: /* Running Wicd */</p>
<hr />
<div>[[de:Wicd]]<br />
[[es:Wicd]]<br />
[[fr:Wicd]]<br />
[[it:Wicd]]<br />
[[tr:Wicd]]<br />
[[zh-CN:Wicd]]<br />
[[Category:Networking]]<br />
[[Category:Wireless Networking]]<br />
{{Article summary start}}<br />
{{Article summary text|Covers installation and configuration of Wicd &ndash; an open source wired and wireless network manager for Linux which aims to provide a simple interface to connect to networks with a wide variety of settings.}}<br />
{{Article summary heading|Overview}}<br />
{{Article summary text|{{Networking overview}}}}<br />
{{Article summary end}}<br />
<br />
[http://www.wicd.net/ Wicd] is a network connection manager that can manage wireless and wired interfaces, similar and an alternative to [[NetworkManager]]. Wicd is written in [[Python]] and [[GTK+]], requiring fewer dependencies than other network managers. Alternatively, a version of Wicd for [[KDE]], written in [[Qt]], is available from the [[Arch User Repository]]. Wicd can also run from the terminal in a curses interface, requiring no X server session or task panel (see [[#Running Wicd]]).<br />
<br />
== Installation ==<br />
<br />
=== Base package ===<br />
<br />
[[pacman|Install]] {{Pkg|wicd}}, available in the [[official repositories]]. It includes everything needed to run the wicd daemon and the {{ic|wicd-cli}} and {{ic|wicd-curses}} interfaces.<br />
<br />
=== GTK+ client ===<br />
<br />
For a GTK+ front-end, install {{Pkg|wicd-gtk}}, available in the official repositories. It includes everything needed to run the GTK interface of wicd and the autostart file for the client to appear in the system tray.<br />
<br />
=== KDE client ===<br />
<br />
For a KDE front-end, install {{AUR|wicd-kde}}, available in the [[AUR]]. <br />
<br />
=== Notifications ===<br />
<br />
To enable visual notifications about network status, you need to install the {{Pkg|notification-daemon}}.<br />
<br />
If you are not using [[GNOME]], you will want to install {{Pkg|xfce4-notifyd}} instead of the notification-daemon, because it pulls a lot of unnecessary GNOME packages.<br />
<br />
=== Alternative ===<br />
<br />
The {{AUR|wicd-bzr}} buildscript is available in the [[AUR]], which should build the latest development branch.<br />
If you need an alternative version or you just want to roll your own package, you can easily build it using [[ABS]].<br />
<br />
== Getting started ==<br />
<br />
=== Initial setup ===<br />
<br />
Wicd provides a daemon that must be started. <br />
<br />
{{Warning | Running multiple network managers ''will'' cause problems, so it is important to ''disable all other network management daemons''.}}<br />
<br />
First, stop all previously running network daemons (like netctl, netcfg, dhcpcd, NetworkManager).<br />
<br />
Disable any existing network management services, including {{ic|netctl}}, {{ic|netcfg}}, {{ic|dhcpcd}}, and {{ic|networkmanager}}. Refer to [[Systemd#Using_units]].<br />
<br />
{{Note|You might need to stop and disable the '''network''' daemon instead of '''netctl''', which is a current replacement for '''network''' service. If unsure, try disabling both.}}<br />
<br />
Start the '''wicd''' [[systemd ]] [[daemon]] and enable it at system start up.<br />
<br />
Add your account to '''users''' group:<br />
<br />
# gpasswd -a USERNAME users<br />
<br />
{{Note|The Unix group that dbus allows to access '''wicd''' is subject to change, and may be different than ''users''. Check which policy group is specified in {{ic|/etc/dbus-1/system.d/wicd.conf}}, and add your user to that group.}}<br />
<br />
If you added your user to a new group, log out and then log in.<br />
<br />
=== Running Wicd in Desktop Environment===<br />
<br />
If you have installed the {{pkg|wicd-gtk}} and entered the desktop environment. Open a virtual terminal to run one of the following commands.<br />
<br />
* To start Wicd as system service, run:<br />
<br />
$ systemctl start wicd.service<br />
<br />
* To load Wicd, run:<br />
<br />
$ wicd-client<br />
<br />
* To force it to start minimized in the notification area, run:<br />
<br />
$ wicd-client --tray<br />
<br />
* If your desktop environment does not have a notification area, or if you don't want wicd to show tray icon, run:<br />
<br />
$ wicd-client -n<br />
<br />
=== Running Wicd in Text Mode===<br />
<br />
If you did not install {{pkg|wicd-gtk}} then use wicd-cli or wicd-curses:<br />
<br />
$ wicd-curses<br />
<br />
{{Note | Wicd does not prompt you for a passkey. To use encrypted connections (WPA/WEP), expand the network you want to connect to, click '''Advanced''' and enter the needed info.}}<br />
<br />
=== Autostart ===<br />
<br />
The {{Pkg|wicd-gtk}} package puts a file in {{ic|/etc/xdg/autostart/wicd-tray.desktop}}, which will autostart {{ic|wicd-client}} upon login to your DE/WM. If so, enabling the wicd system service is enough:<br />
<br />
$ systemctl enable wicd.service<br />
<br />
If {{ic|/etc/xdg/autostart/wicd-tray.desktop}} does not exist, you can add '''wicd-client''' to your DE/WM startup to have the application start when you log in.<br />
<br />
{{Note|If '''wicd-client''' is added to DE/WM startup when {{ic|/etc/xdg/autostart/wicd-tray.desktop}} exists, you will have an issue of two {{ic|wicd-client}} instances running.}}<br />
<br />
=== Scripts ===<br />
<br />
Wicd has the ability to run scripts during all stages of the connection process (post/pre connect/disconnect).<br />
Simply place a script inside the relevant stage folder within {{ic|/etc/wicd/scripts/}} and make it executable.<br />
<br />
The scripts are able to receive three parameters, these being: <br />
$1 - the connection type (wireless/wired).<br />
$2 - the ESSID (network name).<br />
$3 - the BSSID (gateway MAC).<br />
<br />
==== Stop ARP spoofing attacks ====<br />
<br />
The script below can be used to set a static ARP, to stop ARP spoofing attacks.<br />
Simply change the values within the case statement to match those of the networks you want to set static ARP entries for. Launch it as root:<br />
<br />
#!/bin/bash<br />
#Set the parameters passed to this script to meaningful variable names.<br />
connection_type="$1"<br />
essid="$2"<br />
bssid="$3"<br />
<br />
if [ "${connection_type}" == "wireless" ]; then<br />
<br />
#Change below to match your networks.<br />
case "$essid" in<br />
YOUR-NETWORK-NAME-ESSID)<br />
arp -s 192.168.0.1 00:11:22:33:44:55<br />
;;<br />
Netgear01923)<br />
arp -s 192.168.0.1 10:11:20:33:40:50<br />
;;<br />
ANOTHER-ESSID)<br />
arp -s 192.168.0.1 11:33:55:77:99:00<br />
;;<br />
*)<br />
echo "Static ARP not set. No network defined."<br />
;;<br />
esac<br />
fi<br />
<br />
==== Change MAC using macchanger ====<br />
<br />
See the [[MAC_Address_Spoofing#Systemd_unit_using_random_address|relative article]].<br />
<br />
The script below can be used to change the MAC address of your network interfaces.<br />
<br />
To change the MAC whenever you connect to a network, place this script under {{ic|/etc/wicd/scripts/preconnect/}}.<br />
<br />
Take a look at {{ic|macchanger --help}} to adjust the macchanger command to your liking.<br />
<br />
{{bc|<nowiki><br />
#!/usr/bin/env bash<br />
<br />
connection_type="$1"<br />
<br />
if [[ "${connection_type}" == "wireless" ]]; then<br />
ip link set wlp2s0 down<br />
macchanger -A wlp2s0<br />
ip link set wlp2s0 up<br />
elif [[ "${connection_type}" == "wired" ]]; then<br />
ip link set enp1s0 down<br />
macchanger -A enp1s0<br />
ip link set enp1s0 up<br />
fi<br />
</nowiki>}}<br />
<br />
== Troubleshooting ==<br />
<br />
=== Failed to get IP address ===<br />
<br />
If wicd repeatedly fails to get an IP address using the default dhcpcd client, try installing and using {{Pkg|dhclient}} instead. Do not forget to select dhclient as the primary dhcp client in wicd options afterwards!<br />
<br />
If wicd can get an IP address for a wired interface and is unable to get an IP address for a wireless interface, try disabling the wireless card's powersaving features:<br />
# iwconfig wlp2s0 power off<br />
<br />
=== Random disconnecting ===<br />
<br />
==== Cause #1 ====<br />
<br />
If dmesg says {{ic|1=wlp2s0: deauthenticating from MAC by local choice (reason=3)}} and you lose your Wi-Fi connection, it is likely that you have a bit too aggressive power-saving on your Wi-Fi card[http://us.generation-nt.com/answer/gentoo-user-wireless-deauthenticating-by-local-choice-help-204640041.html]. Try disabling the wireless card's power-saving features:<br />
# iwconfig wlp2s0 power off<br />
<br />
If you have the package {{Pkg|pm-utils}} installed, it may be the reason power-saving is on in your system[http://uselessuseofcat.com/?p=67]. You can put:<br />
<br />
{{bc|<br />
#!/bin/sh<br />
/usr/bin/iwconfig wlp2s0 power off<br />
}}<br />
<br />
into the file {{ic|/etc/pm/power.d/wireless}} (create it if it does not exist and make it executable) and see if things get better.<br />
<br />
If your card does not support {{ic|# iwconfig wlp2s0 power off}}, check the '''BIOS''' for power management options. Disabling PCI-Express power management in the BIOS of a Lenovo W520 resolved this issue.<br />
<br />
==== Cause #2 ====<br />
<br />
If you are experiencing frequent disconnections with wireless and dmesg shows messages such as <br />
<br />
{{ic|1=ieee80211 phy0: wlp2s0: No probe response from AP xx:xx:xx:xx:xx:xx after 500ms, disconnecting}}<br />
<br />
try changing the channel bandwidth to {{ic|20MHz}} through your router's settings page.<br />
<br />
=== Importing pynotify failed, notifications disabled ===<br />
<br />
In case the {{pkg|python2-notify}} package did not get installed automatically. You can [[pacman|install]] it from [[Official Repositories]].<br />
<br />
=== Dbus connection error message ===<br />
<br />
If wicd suddenly stopped working and it complains about dbus, it is quite likely that you just need to remove wicd fully, including and all its configuration files, and re-install it from scratch:<br />
# pacman -R wicd<br />
# rm -rf /etc/wicd /var/log/wicd /etc/dbus-1/system.d/wicd*<br />
# pacman -S wicd<br />
Check this link for more details: https://bbs.archlinux.org/viewtopic.php?pid=577141#p577141<br />
<br />
Wicd-client also throws a dbus connection error message ("Could not connect to wicd's D-Bus interface.") when wicd is not running due to a problem with a config file. It seems that sometimes an empty account gets added to /etc/wicd/wired-settings.conf in which case you simply have to remove the<br />
[] <br />
and restart wicd.<br />
<br />
=== Problems after package update ===<br />
<br />
Sometimes the wicd client fails to load after a package update due to D-Bus errors. <br />
<br />
A solution is to remove the config files in the {{ic|/etc/wicd/}} directory. <br />
# systemctl stop wicd<br />
# rm /etc/wicd/*.conf<br />
# systemctl start wicd<br />
<br />
=== Note about graphical sudo programs ===<br />
<br />
If you are receiving an error about wicd failing to find a graphical sudo program, install one of {{Pkg|gksu}}, {{AUR|ktsuss}}, or {{Pkg|kdebase-runtime}}, then use the relative command:<br />
<br />
$ ktsuss wicd-client -n<br />
<br />
$ gksudo wicd-client -n<br />
<br />
$ kdesu wicd-client -n<br />
<br />
=== Making eduroam work with wicd ===<br />
<br />
{{Note|You may try the AUR package {{AUR|wicd-eduroam}} first. It will appear in wicd as "eduroam". If it does not work for you, try the following.}}<br />
<br />
This profile will only work for eduroam institutions which use TTLS and will not work for PEAP (you can find a PEAP profile here: [http://csclub.uwaterloo.ca/~mtahmed/article/eduroam_wicd Eduroam wicd]).<br />
<br />
Save the following as {{ic|/etc/wicd/encryption/templates/ttls-80211}}<br />
{{hc|/etc/wicd/encryption/templates/ttls-80211|<nowiki><br />
name = TTLS for Wireless<br />
author = Alexander Clouter<br />
version = 1<br />
require anon_identity *Anonymous_Username identity *Identity password *Password <br />
protected password *Password<br />
optional ca_cert *Path_to_CA_Cert cert_subject *Certificate_Subject<br />
-----<br />
ctrl_interface=/var/run/wpa_supplicant<br />
network={<br />
ssid="$_ESSID"<br />
scan_ssid=$_SCAN<br />
<br />
key_mgmt=WPA-EAP<br />
eap=TTLS<br />
<br />
ca_cert="$_CA_CERT"<br />
subject_match="$_CERT_SUBJECT"<br />
<br />
phase2="auth=MSCHAPv2 auth=PAP"<br />
<br />
anonymous_identity="$_ANON_IDENTITY"<br />
identity="$_IDENTITY"<br />
password="$_PASSWORD"<br />
}<br />
</nowiki>}}<br />
<br />
Open a terminal<br />
<br />
# echo ttls-80211 >> /etc/wicd/encryption/templates/active<br />
<br />
Open wicd, choose TTLS for Wireless in the properties of eduroam, and enter the appropriate settings for your institution. The format of the subject match should be something like "/CN=server.example.com".<br />
<br />
NB. This only works in my institution by commenting {{ic|subject_match}}, which is not secure, but at least it connects.<br />
<br />
=== Two instances of wicd-client (and possibly two icons in tray) ===<br />
<br />
See the note in [[Wicd#Running_Wicd]] about the autostart file in {{ic|/etc/xdg/autostart}} and the forum post and bug report provided in [[Wicd#External_Links]]. Essentially, if {{ic|/etc/xdg/autostart/wicd-tray.desktop}} exists, remove it. You only need the {{ic|wicd}} service enabled in systemd.<br />
<br />
=== Bad password using PEAP with TKIP/MSCHAPV2 ===<br />
<br />
The connection template PEAP with TKIP/MSCHAPV2 requires the user to enter the path to a CA certificate besides entering username and password. However this can cause troubles resulting in a error message of a bad password [https://bbs.archlinux.org/viewtopic.php?pid=990385 *]. A possible solution is the usage of PEAP with GTC instead of TKIP/MSCHAPV2 which does not require to enter the path of the CA cert.<br />
<br />
=== Wicd skips obtaining IP address on wlp ===<br />
<br />
This can be caused by dhcpcd running alongside wicd as systemd service. A solution would be to stop/disable '''dhcpcd'''.<br />
<br />
== See also ==<br />
<br />
* [http://www.wicd.net/download.php Note on interfaces at the official site]<br />
* [https://bbs.archlinux.org/viewtopic.php?id=114803 Forum post] about two instances of wicd-client and {{ic|/etc/xdg/autostart}}<br />
* [https://bugs.archlinux.org/task/22423 Bug report mentioning /etc/xdg/autostart and wicd-client behavior]</div>Ddreamerhttps://wiki.archlinux.org/index.php?title=Autostarting&diff=265612Autostarting2013-07-09T20:00:06Z<p>Ddreamer: /* Graphical */</p>
<hr />
<div>[[Category:Boot process]]<br />
[[es:Autostarting]]<br />
This article links to various methods to launch scripts or applications automatically when some particular event is taking place, like system startup or shutdown, shell login or logout and so on.<br />
<br />
== Daemons ==<br />
You can easily start your scripts or applications as daemons, see [[Daemon]].<br />
<br />
=== Systemd ===<br />
''systemd'' is the default init framework, replacing initscripts. The services which are started by ''systemd'' can be found in the subfolders of {{ic|/etc/systemd/system/}}. Services can be enabled using the {{ic|systemctl}} command. For more information about ''systemd'' and how to write autostart scripts for it, see at [[systemd]].<br />
<br />
=== Runit ===<br />
''runit'' is a mature init system which offers process supervision, parallel startup, per-user service trees, granular cgroup manipulation, flexible dependency system, and boot times that don't incur the penalty of dbus. The root-level services are symlinks in {{ic|/service}} with the actual service directories in {{ic|/etc/sv}}. See the [[Runit]] page for more information.<br />
<br />
== Shell: BASH ==<br />
<br />
To autostart programs in console or upon longin, you can use shell startup files/directories. Read the documentation for your shell, or its ArchWiki article, e.g. [[Bash]] or [[Zsh]]. Complete startup sequence for bash is explained in the "INVOCATION" section of [http://linux.die.net/man/1/bash "man 1 bash"]. When an interactive shell that is not a login shell is started, bash reads and executes commands from {{ic|~/.bashrc}}<br />
<br />
=== /etc/profile ===<br />
<br />
{{ic|/etc/profile}} is sourced by all Bourne-compatible shells upon login: it sets up an environment upon login and application-specific ({{ic|/etc/profile.d/*.sh}}) settings. <br />
<br />
Each time {{ic|/etc/profile}} is executed, it sources {{ic|/etc/profile.d/*.sh}} and {{ic|/etc/bash.bashrc}} if they are readable. After reading {{ic|/etc/profile}}, it looks for {{ic|~/.bash_profile}}, {{ic|~/.bash_login}}, and {{ic|~/.profile}}, in that order, and reads and executes commands from the first one that exists and is readable. When a login shell exits, bash reads and executes commands from the files {{ic|~/.bash_logout}} and {{ic|/etc/bash.bash_logout}}, if the files exists.<br />
<br />
=== /etc/bash.bashrc ===<br />
<br />
If not running interactively, it just returns. Or {{ic|/usr/share/bash-completion/bash_completion}} is sourced.<br />
<br />
=== ~/.bash_profile ===<br />
<br />
{{ic|~/.bashrc}} is sourced<br />
<br />
== Other Shells ==<br />
*{{ic|STARTUP/SHUTDOWN FILES}} section of {{ic|man zsh}}<br />
*[[Wikipedia:Unix_shell#Configuration files for shells]]<br />
<br />
== Graphical ==<br />
You can autostart programs automatically when you login into your [[Window Manager]] or [[Desktop Environment]].<br />
<br />
=== X session startup ===<br />
<br />
See [[xinitrc|~/.xinitrc]] and [[xprofile|~/.xprofile and /etc/xprofile]].<br />
<br />
=== X Desktop Group ===<br />
<br />
* {{ic|/etc/xdg/autostart}}: The folder contains {{ic|*.desktop}} files, which will be executed everytime an X session starts.<br />
* {{ic|$XDG_CONFIG_HOME/autostart/}}: In this folder are {{ic|.desktop}} files. These files determine which programs are loaded for which desktop environment. For an explanation of the desktop file standard refer to [http://standards.freedesktop.org/desktop-entry-spec/latest/ Desktop Entry Specification].<br />
<br />
=== GNOME, KDE, Xfce ===<br />
<br />
[[GNOME]], [[KDE]] and [[Xfce]] all have a dedicated GUI for autostart settings, see the respective articles.<br />
<br />
You can also directly put [[Creating desktop entries and menus|.desktop]] files in {{ic|~/.config/autostart/}}<br />
<br />
==== KDE (Legacy) ====<br />
<br />
KDE also has a specific folder: {{ic|~/.kde/Autostart}} or {{ic|~/.kde4/Autostart}}<br />
<br />
=== LXDE ===<br />
<br />
If your LXDE is installed according to ArchWiki's guide, Openbox is the default window manager for LXDE. The autostart files specified in the {{ic|Openbox}} will be executed therefore.<br />
* {{ic|/etc/xdg/lxsession/LXDE/autostart}}: global autostart file<br />
* {{ic|~/.config/autostart}}: {{ic|*.desktop}} files or make a symlink to *.desktop files in {{ic|/usr/share/applications/}}<br />
* {{ic|~/.config/lxsession/LXDE/autostart}}: not a shell script. Every line is a program to execute.<br />
See [[LXDE#Autostart_Programs]].<br />
<br />
=== Fluxbox ===<br />
<br />
See [[Fluxbox#Autostarting Applications]].<br />
<br />
=== Openbox ===<br />
<br />
* {{ic|/etc/xdg/openbox/autostart}}: system-wide<br />
* {{ic|~/.config/openbox/autostart}}: user-specific<br />
See [[Openbox#Startup programs]].<br />
<br />
== Network ==<br />
<br />
== Hibernation & Resume ==</div>Ddreamerhttps://wiki.archlinux.org/index.php?title=Autostarting&diff=265596Autostarting2013-07-09T19:11:25Z<p>Ddreamer: /* Shells */</p>
<hr />
<div>[[Category:Boot process]]<br />
[[es:Autostarting]]<br />
This article links to various methods to launch scripts or applications automatically when some particular event is taking place, like system startup or shutdown, shell login or logout and so on.<br />
<br />
== Daemons ==<br />
You can easily start your scripts or applications as daemons, see [[Daemon]].<br />
<br />
=== Systemd ===<br />
''systemd'' is the default init framework, replacing initscripts. The services which are started by ''systemd'' can be found in the subfolders of {{ic|/etc/systemd/system/}}. Services can be enabled using the {{ic|systemctl}} command. For more information about ''systemd'' and how to write autostart scripts for it, see at [[systemd]].<br />
<br />
=== Runit ===<br />
''runit'' is a mature init system which offers process supervision, parallel startup, per-user service trees, granular cgroup manipulation, flexible dependency system, and boot times that don't incur the penalty of dbus. The root-level services are symlinks in {{ic|/service}} with the actual service directories in {{ic|/etc/sv}}. See the [[Runit]] page for more information.<br />
<br />
== Shell: BASH ==<br />
<br />
To autostart programs in console or upon longin, you can use shell startup files/directories. Read the documentation for your shell, or its ArchWiki article, e.g. [[Bash]] or [[Zsh]]. Complete startup sequence for bash is explained in the "INVOCATION" section of [http://linux.die.net/man/1/bash "man 1 bash"]. When an interactive shell that is not a login shell is started, bash reads and executes commands from {{ic|~/.bashrc}}<br />
<br />
=== /etc/profile ===<br />
<br />
{{ic|/etc/profile}} is sourced by all Bourne-compatible shells upon login: it sets up an environment upon login and application-specific ({{ic|/etc/profile.d/*.sh}}) settings. <br />
<br />
Each time {{ic|/etc/profile}} is executed, it sources {{ic|/etc/profile.d/*.sh}} and {{ic|/etc/bash.bashrc}} if they are readable. After reading {{ic|/etc/profile}}, it looks for {{ic|~/.bash_profile}}, {{ic|~/.bash_login}}, and {{ic|~/.profile}}, in that order, and reads and executes commands from the first one that exists and is readable. When a login shell exits, bash reads and executes commands from the files {{ic|~/.bash_logout}} and {{ic|/etc/bash.bash_logout}}, if the files exists.<br />
<br />
=== /etc/bash.bashrc ===<br />
<br />
If not running interactively, it just returns. Or {{ic|/usr/share/bash-completion/bash_completion}} is sourced.<br />
<br />
=== ~/.bash_profile ===<br />
<br />
{{ic|~/.bashrc}} is sourced<br />
<br />
== Other Shells ==<br />
*{{ic|STARTUP/SHUTDOWN FILES}} section of {{ic|man zsh}}<br />
*[[Wikipedia:Unix_shell#Configuration files for shells]]<br />
<br />
== Graphical ==<br />
You can autostart programs automatically when you login into your [[Window Manager]] or [[Desktop Environment]].<br />
<br />
=== X session startup ===<br />
<br />
See [[xinitrc]] and [[xprofile]].<br />
<br />
=== X Desktop Group ===<br />
<br />
{{ic|$XDG_CONFIG_DIRS/autostart/}}: In this folder are {{ic|.desktop}} files. These files determine which programs are loaded for which desktop environment. For an explanation of the desktop file standard refer to [http://standards.freedesktop.org/desktop-entry-spec/latest/ Desktop Entry Specification].<br />
<br />
=== GNOME, KDE, Xfce ===<br />
<br />
[[GNOME]], [[KDE]] and [[Xfce]] all have a dedicated GUI for autostart settings, see the respective articles.<br />
<br />
You can also directly put [[Creating desktop entries and menus|.desktop]] files in {{ic|~/.config/autostart/}}<br />
<br />
==== KDE (Legacy) ====<br />
<br />
KDE also has a specific folder: {{ic|~/.kde/Autostart}} or {{ic|~/.kde4/Autostart}}<br />
<br />
=== LXDE ===<br />
<br />
See [[LXDE#Autostart_Programs]].<br />
<br />
=== Fluxbox ===<br />
<br />
See [[Fluxbox#Autostarting Applications]].<br />
<br />
=== Openbox ===<br />
<br />
See [[Openbox#Startup programs]].</div>Ddreamerhttps://wiki.archlinux.org/index.php?title=UEFI_Bootloaders&diff=265386UEFI Bootloaders2013-07-07T18:11:50Z<p>Ddreamer: /* Sync EFISTUB Kernel */</p>
<hr />
<div>[[Category:Boot loaders]]<br />
[[zh-CN:UEFI Bootloaders]]<br />
This page contains info about various [[UEFI]] Bootloaders capable of booting Linux kernel. It is recommended to read the [[UEFI]] and [[GPT]] pages before reading this page. The following [[Boot Loader|bootloaders]] are explained here:<br />
<br />
== Linux Kernel EFISTUB ==<br />
{{Warning|1=A bug has been noticed where booting EFISTUB can fail depending on kernel version and motherboard model. See [https://bbs.archlinux.org/viewtopic.php?id=156670&p=1] for more information.}}<br />
<br />
Linux (Kernel >= 3.3) supports {{ic|EFISTUB (EFI BOOT STUB)}} booting. It is enabled by default on Arch Linux kernels or can be activated by setting {{ic|CONFIG_EFI_STUB&#61;y}} in the Kernel configuration (see [https://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob_plain;f=Documentation/x86/efi-stub.txt;hb=HEAD The EFI Boot Stub] for more information).<br />
<br />
A single EFISTUB kernel is not capable of launching other kernels, hence each EFISTUB Kernel + Initramfs pair requires a separate boot menu entry. It is recommended to use a UEFI Boot Manager to manage multiple kernels.<br />
<br />
=== Setting up EFISTUB ===<br />
<br />
#[https://wiki.archlinux.org/index.php/Unified_Extensible_Firmware_Interface#EFI_System_Partition Create a FAT32 UEFI System Partition]<br />
# Mount the UEFI System Partition at {{ic|/boot/efi}} with {{ic|# mount <UEFI Partition> /boot/efi}} if you're going to be using GRUB2, or at {{ic|/boot}} with {{ic|# mount <UEFI Partition> /boot}} if you're going to be using Gummiboot or rEFInd. Gummiboot cannot boot across partitions, and will never have such capability due to its nature, so it's paramount that you mount the UEFI System Partition at /boot for use with Gummiboot so that the kernel and initramfs lie on the same partition as the bootmanager. {{note| On some machines, when using rEFInd, it works fine when mounting the UEFI partition in {{ic|/boot/efi}}}}<br />
# Create {{ic|/boot/efi/EFI/arch/}} directory with {{ic|# mkdir /boot/efi/EFI/arch/}}<br />
# Copy the following files from source to destination<br />
{| border="1"<br />
!Boot File Source!!UEFI Destination<br />
|-<br />
| /boot/vmlinuz-linux || /boot/efi/EFI/arch/vmlinuz-arch.efi<br />
|-<br />
| /boot/initramfs-linux.img || /boot/efi/EFI/arch/initramfs-arch.img<br />
|-<br />
| /boot/initramfs-linux-fallback.img || /boot/efi/EFI/arch/initramfs-arch-fallback.img<br />
|}<br />
{{note| As of {{Pkg|refind-efi}} 0.2.7, you don't need to copy these files, since refind will automatically detect them}}<br />
<br />
=== Sync EFISTUB Kernel ===<br />
{{Warning|The EFISTUB Kernel must be updated each time the kernel is updated (follow step 4 in [https://wiki.archlinux.org/index.php/UEFI_Bootloaders#Setting_up_EFISTUB Setting up EFISTUB]. Failure to do so will result in failure to boot. Alternatively one can automatically update the EFISTUB kernel using one of the following methods:}}<br />
<br />
{{Note| As of [https://www.archlinux.org/packages/extra/any/refind-efi/ refind-efi 0.2.7], refind automatically detects kernels in {{ic|/boot}}. They do not have to be renamed to have a {{ic|.efi}} extension either. Hence, the following sync scripts aren't needed if using [https://wiki.archlinux.org/index.php/UEFI_Bootloaders#Using_rEFInd refind]. You do need to install an EFI driver to read the Linux filesystem on which the kernel is stored, though. See [http://www.rodsbooks.com/refind/drivers.html]. Briefly, if the /boot is within an ext4 filesystem and the kernel is x64 architecture, you may run "mkdir -p /boot/efi/EFI/refind/drivers; cp /usr/lib/refind/drivers_x64/ext4_x64.efi /boot/efi/EFI/refind/drivers" to install ext4 filesystem driver for 64 bit kernel so that the kernel can be located by the rEFInd.}}<br />
<br />
==== Systemd ====<br />
[[Systemd]] features event triggered tasks. In this particular case, the ability to detect a change in path is used to sync the EFISTUB kernel and initramfs files when they are updated in {{ic|boot}}.<br />
<br />
<br />
{{Warning|Since mkinitcpio takes time to build the kernel stub and the initramfs. It is possible for the following systemd services to copy older kernel stubs and initramfs instead of the new ones. To reduce the chance of this error, it is better to bind the efistub copying service to check if the initramfs-linux-fallback.img was changed (since it is the last thing built by mkinitcpio).}}<br />
{{Tip|Save the following script as {{ic|/usr/lib/systemd/system/efistub-update.path}}}}<br />
{{bc|<nowiki><br />
[Unit]<br />
Description=Copy EFISTUB Kernel to UEFISYS Partition<br />
<br />
[Path]<br />
PathChanged=/boot/initramfs-linux-fallback.img<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
{{Tip|Save the following script as {{ic|/usr/lib/systemd/system/efistub-update.service}}}}<br />
{{bc|<nowiki><br />
[Unit]<br />
Description=Copy EFISTUB Kernel to UEFISYS Partition<br />
<br />
[Service]<br />
Type=oneshot<br />
ExecStart=/usr/bin/cp -f /boot/vmlinuz-linux /boot/efi/EFI/arch/vmlinuz-arch.efi<br />
ExecStart=/usr/bin/cp -f /boot/initramfs-linux.img /boot/efi/EFI/arch/initramfs-arch.img<br />
ExecStart=/usr/bin/cp -f /boot/initramfs-linux-fallback.img /boot/efi/EFI/arch/initramfs-arch-fallback.img<br />
</nowiki>}}<br />
<br />
{{Tip|Enable these services with<br />
{{bc|<nowiki><br />
# systemctl enable efistub-update.path<br />
</nowiki>}}}}<br />
<br />
==== Incron ====<br />
{{Pkg|incron}} can run a script to sync the EFISTUB Kernel after updates<br />
<br />
{{Tip|Save the following script as {{ic|/usr/local/bin/efistub-update.sh}}}}<br />
{{bc|<nowiki><br />
#!/usr/bin/env bash<br />
/usr/bin/cp -f /boot/vmlinuz-linux /boot/efi/EFI/arch/vmlinuz-arch.efi<br />
/usr/bin/cp -f /boot/initramfs-linux.img /boot/efi/EFI/arch/initramfs-arch.img<br />
/usr/bin/cp -f /boot/initramfs-linux-fallback.img /boot/efi/EFI/arch/initramfs-arch-fallback.img<br />
</nowiki>}}<br />
<br />
{{Tip|Save the following script as {{ic|/etc/incron.d/efistub-update.conf}}}}<br />
{{Note|The first parameter {{ic|/boot/initramfs-linux-fallback.img}} is the file to watch. The second parameter {{ic|IN_CLOSE_WRITE}} is the action to watch for. The third parameter {{ic|/usr/local/bin/efistub-update.sh}} is the script to execute.}}<br />
{{bc|<nowiki><br />
/boot/initramfs-linux-fallback.img IN_CLOSE_WRITE /usr/local/bin/efistub-update.sh<br />
</nowiki>}}<br />
<br />
{{Tip|In order to use this method, incron must be activated, if it is not run<br />
{{bc|<nowiki><br />
# systemctl enable incrond.service<br />
</nowiki>}}}}<br />
<br />
==== Mkinitcpio hook ====<br />
Mkinitcpio can generate a hook that does not need a system level daemon to function. It spawns a background process which waits for the generation of {{ic|vm-linuz}}, {{ic|initramfs-linux.img}}, and {{ic|initramfs-linux-fallback.img}}; then follows step 4 in [https://wiki.archlinux.org/index.php/UEFI_Bootloaders#Setting_up_EFISTUB Setting up EFISTUB]<br />
<br />
{{Tip|Save the following script as {{ic|/usr/lib/initcpio/install/efistub-update}}}}<br />
{{bc|<nowiki><br />
#!/usr/bin/env bash<br />
<br />
build() {<br />
/root/watch.sh &<br />
}<br />
<br />
help() {<br />
cat <<HELPEOF<br />
This hook waits for mkinitcpio to finish and copies the finished ramdisk and kernel to the ESP<br />
HELPEOF<br />
}<br />
</nowiki>}}<br />
<br />
{{Tip|Save the following script as {{ic|/root/watch.sh}} and make it executable}}<br />
{{bc|<nowiki><br />
#!/usr/bin/env bash<br />
<br />
while [[ -d "/proc/$PPID" ]]; do<br />
sleep 1<br />
done<br />
<br />
/usr/bin/cp -f /boot/vmlinuz-linux /boot/efi/EFI/arch/vmlinuz-arch.efi<br />
/usr/bin/cp -f /boot/initramfs-linux.img /boot/efi/EFI/arch/initramfs-arch.img<br />
/usr/bin/cp -f /boot/initramfs-linux-fallback.img /boot/efi/EFI/arch/initramfs-arch-fallback.img<br />
<br />
echo "Synced kernel with ESP"<br />
</nowiki>}}<br />
<br />
{{Tip|Add {{ic|efistub-update}} to the list of hooks in {{ic|/etc/mkinitcpio.conf}}}}<br />
<br />
{{Note| As of [https://www.archlinux.org/packages/extra/any/refind-efi/ refind-efi 0.2.7], refind automatically detects kernels in {{ic|/boot}}. They do not have to be renamed to have a {{ic|.efi}} extension either. Hence, the following sync scripts aren't needed if using [https://wiki.archlinux.org/index.php/UEFI_Bootloaders#Using_rEFInd refind]. You do need to isntall an EFI driver to read the Linux filesystem on which the kernel is stored, though.}}<br />
<br />
=== Booting EFISTUB ===<br />
<br />
{{Warning|Linux Kernel EFISTUB booting uses {{ic|\}} instead of {{ic|/}} and should be relative to the UEFI System Partition's root. For example, if the initramfs is located in {{ic|/boot/efi/EFI/arch/initramfs-linux.img}}, the corresponding UEFI formatted line would be {{ic|\EFI\arch\initramfs-linux.img}}. Failure to convert the options will lead to a system hang without any error message from the firmware or kernel.<br />
{{Note| Support of initrd path name with {{ic|/}} in EFISTUB booting has been added in [https://patchwork.kernel.org/patch/1899361/ mainline 3.9-rc1] and [http://lwn.net/Articles/541002/ stable 3.8.2]. Leading {{ic|/}} can be ignored but the path still has to be full path. Example: {{ic|initrd&#61;EFI/arch/initramfs-linux.img}} }}<br />
}}<br />
<br />
<br />
<br />
One can boot the EFISTUB kernel using one of the following ways :<br />
<br />
==== Using rEFInd ====<br />
<br />
rEFInd is a fork of rEFIt Boot Manager (used in Intel Macs) by Rod Smith (author of GPT-fdisk). rEFInd fixes many issues in rEFIt with respect to non-Mac UEFI booting and also has support for booting EFISTUB kernels and contains some features specific to them.<br />
{{Tip|If you're new to EFISTUB and/or rEFInd, you need to read [http://www.rodsbooks.com/refind/linux.html The rEFInd Boot Manager: Methods of Booting Linux] before going any further. This section illustrates only one possible use-case which is not suitable for all configurations.}}<br />
# Install {{Pkg|refind-efi}} package with {{ic|# pacman -S refind-efi}}<br />
# Copy the following files from their source directory to their destination<br />
{{Note|1=<arch> is the bit architecture of the system. Run {{ic|$ uname -m}} to get the architecture. Replace <arch> with "ia32" for 32 bit systems, and <arch> with "x64" for 64 bit systems.}}<br />
{| border="1"<br />
!rEFInd File Source!!UEFI Destination<br />
|-<br />
| /usr/lib/refind/refind_<arch>.efi || /boot/efi/EFI/refind/refind_<arch>.efi<br />
|-<br />
| /usr/lib/refind/config/refind.conf || /boot/efi/EFI/refind/refind.conf<br />
|-<br />
| /usr/share/refind/icons || /boot/efi/EFI/refind/icons<br />
|-<br />
| /usr/lib/refind/drivers_<arch> || /boot/efi/EFI/refind/drivers<br />
|}<br />
<br />
{{Tip|Refind's configuration file is located in {{ic|/boot/efi/EFI/refind/refind.conf}}. The file is well commented.}}<br />
<br />
As of {{Pkg|refind-efi}} 0.2.7, refind can auto-detect kernels in {{ic|/boot}}, if there are UEFI drivers for the filesystem used by /boot partition (or / partition if no separate /boot is used) in the ESP, and are loaded by rEFInd. This is enabled in the default configuration in {{ic|refind.conf}} (you may need to include the PATH to the drivers folders in the ESP). Copy your {{ic|/usr/lib/refind/config/refind_linux.conf}} to {{ic|/boot/refind_linux.conf}}. You may pass kernel specific commands in this file. <br />
<br />
Edit the {{ic|refind_linux.conf}} configuration file to be similar to the template below. Replace the string after PARTUUID with your root's PARTUUID<br />
<br />
{{Note|1=Please notice the [https://bbs.archlinux.org/viewtopic.php?pid=1286972 difference] between the standard UUID and the PARTUUID shown by {{ic|$ ls -l /dev/disk/by-partuuid/}}}}<br />
{{hc|refind_linux.conf|<nowiki><br />
"Boot with defaults" "root=PARTUUID=3518bb68-d01e-45c9-b973-0b5d918aae96 ro rootfstype=ext4 add_efi_memmap systemd.unit=graphical.target"<br />
"Boot to Terminal" "root=PARTUUID=3518bb68-d01e-45c9-b973-0b5d918aae96 ro rootfstype=ext4 add_efi_memmap systemd.unit=multi-user.target"</nowiki>}}<br />
<br />
{{Tip|Each line of {{ic|refind_linux.conf}} is displayed as a submenu by rEFInd. Access the submenu with "+" or "insert" keys.}}<br />
<br />
{{Tip|In non-Mac systems, create an entry for rEFInd using [[UEFI#efibootmgr|efibootmgr]] where sdX is the UEFI disk, and Y is the UEFI partition number. Run :<br />
{{bc|<nowiki><br />
# modprobe efivars<br />
# efibootmgr -c -w -d /dev/sdX -p Y -l /EFI/refind/refind_<arch>.efi -L "rEFInd" <br />
</nowiki>}}}}<br />
<br />
===== Systemd Automation =====<br />
<br />
{{Tip|To automate the process of copying refind files and updating the nvram (if needed) use the following script}}<br />
<br />
{{Note|Save this script as {{ic|/usr/lib/systemd/scripts/refind_name_patchv2}}}}<br />
{{Tip|If you want to change the directory that refind is installed in the UEFISYS partition, just change the value of $refind_dir in the script}}<br />
{{bc|<nowiki><br />
#!/usr/bin/env bash<br />
## COPYRIGHT 2013 : MARK E. LEE (BLUERIDER) : mlee24@binghamton.edu; mark@markelee.com<br />
<br />
## LOG<br />
## 1/17/2013 : Version 2 of refind_name_patch is released<br />
## : Supports long subdirectory location for refind<br />
## : Updates nvram when needed<br />
## : 10% speed boost<br />
<br />
function main () { ## main insertion function<br />
declare -r refind_dir="/boot/efi/EFI/refind"; ## set the refind directory<br />
declare -r arch=$(uname -m | awk -F'_' '{if ($1 == "x86"){print $2}}') && ## get bit architecture<br />
update-efi-dir; ## updates or creates the refind directory<br />
update-efi-nvram; ## updates nvram if needed<br />
}<br />
<br />
function update-efi-dir () { ## setup the refind directory<br />
if [ ! -d $refind_dir ]; then ## check if refind directory exists<br />
echo "Couldn't find $refind_dir";<br />
mkdir $refind_dir && ## make the refind directory if needed<br />
echo "Made $refind_dir";<br />
fi;<br />
if [ "$arch" ]; then ## check if anything was stored in $arch<br />
cp -r /usr/{share/refind/*,lib/refind/refind_x*$arch*.efi} $refind_dir/ && ## update bin and dirs<br />
echo "Updated binaries and directory files for refind at $refind_dir";<br />
else<br />
echo "Failed to detect an x86 architecture";<br />
exit;<br />
fi;<br />
}<br />
<br />
function update-efi-nvram () { ## update the nvram with efibootmgr<br />
declare -r ref_bin=${refind_dir/\/boot\/efi}/$(ls /usr/lib | grep $arch*.efi); ## get path of refind binary (without /boot/efi)<br />
declare -r ref_bin_escape=${ref_bin//\//\\\\}; ## insert escape characters into $ref_bin<br />
modprobe efivars && ## grab the efi variables for efibootmgr<br />
efibootmgr -v | grep $ref_bin_escape && ( ## check if boot entry is in nvram<br />
echo "Found boot entry, no need to update nvram";<br />
) || ( ## if boot entry is not in nvram; add it<br />
declare -r esp=$(mount -l | awk '/ESP/ {print $1}') && ## get ESP partition<br />
efibootmgr -c -w -d ${esp:0:8} -p ${esp:8} -L "rEFInd" -l $ref_bin_escape && ## update nvram<br />
echo "<br />
Updated nvram with entry rEFInd to boot $ref_bin<br />
Did not copy configuration files, please move refind.conf to $refind_dir/";<br />
)<br />
}<br />
<br />
main; ## run the main insertion function<br />
</nowiki>}}<br />
<br />
{{Note| As of [https://www.archlinux.org/packages/extra/any/refind-efi/ refind-efi 0.2.7], refind automatically detects kernels in {{ic|/boot}}. They do not have to be renamed to have a {{ic|.efi}} extension either. Hence, the following sync scripts aren't needed if using [https://wiki.archlinux.org/index.php/UEFI_Bootloaders#Using_rEFInd refind]. You do need to isntall an EFI driver to read the Linux filesystem on which the kernel is stored, though.}}<br />
<br />
{{Note|Save the following service file as {{ic|/usr/lib/systemd/system/refind_update.path}}}}<br />
{{bc|<nowiki><br />
[Unit]<br />
Description=Update rEFInd bootloader files<br />
<br />
[Path]<br />
PathChanged=/usr/lib/refind/refind_<arch>.efi<br />
Unit=refind_update.service<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
{{Note|Save the following service file as {{ic|/usr/lib/systemd/system/refind_update.service}}}}<br />
{{bc|<nowiki><br />
[Unit]<br />
Description=Update rEFInd directories, binaries, and nvram<br />
<br />
[Service]<br />
Type=oneshot<br />
ExecStart=/usr/bin/bash /usr/lib/systemd/scripts/refind_name_patchv2<br />
RemainAfterExit=no<br />
</nowiki>}}<br />
<br />
{{Tip|Enable the systemd path unit by running :<br />
{{bc|<nowiki><br />
# systemctl enable refind_update.path<br />
</nowiki>}}}}<br />
<br />
===== Apple Macs =====<br />
<br />
In case of Apple Macs, try {{AUR|mactel-boot}} for an experimental "bless" utility for Linux. If that does not work, use "bless" form within OSX to set rEFInd as default bootloader. Assuming UEFISYS partition is mounted at {{ic|/mnt/efi}} within OSX, do<br />
<br />
$ sudo bless --setBoot --folder /mnt/efi/EFI/refind --file /mnt/efi/EFI/refind/refind_x64.efi<br />
<br />
===== VirtualBox =====<br />
<br />
In case of VirtualBox, see [[VirtualBox#Using_Arch_under_Virtualbox_EFI_mode]].<br />
<br />
==== Using gummiboot ====<br />
<br />
[[Gummiboot]] is a UEFI Boot Manager which provides a nice menu for EFISTUB Kernels. It is available in [extra] as {{Pkg|gummiboot}}. See https://wiki.archlinux.org/index.php/Gummiboot for more info.<br />
<br />
==== Using UEFI Shell ====<br />
<br />
It is possible to launch EFISTUB kernel form UEFI Shell as if it is a normal UEFI application. In this case the kernel parameters are passed as normal parameters to the launched EFISTUB kernel file.<br />
<br />
> fs0:<br />
> cd \EFI\arch<br />
> vmlinuz-arch.efi root=PARTUUID=3518bb68-d01e-45c9-b973-0b5d918aae96 ro rootfstype=ext4 add_efi_memmap initrd=EFI/arch/initramfs-arch.img<br />
<br />
You can also write a simple {{ic|archlinux.nsh}} file with your boot parameters and put it in your UEFI System Partition, then run it with:<br />
<br />
fs0:<br />
archlinux<br />
<br />
Example Script:<br />
<br />
echo -on<br />
\EFI\arch\vmlinuz-arch.efi root=PARTUUID=3518bb68-d01e-45c9-b973-0b5d918aae96 rootfstype=ext4 add_efi_memmap initrd=EFI/arch/initramfs-arch.img<br />
<br />
This way you can specify UUID's without needing to remember the name or type out 20-30 characters.<br />
<br />
==== Using efibootmgr entry ====<br />
<br />
{{Warning|1=Some kernel and efibootmgr combinations do not work [https://bugs.archlinux.org/task/34641]. You will be able to delete but not create boot entries.}}<br />
<br />
{{Note|Some UEFI firmwares may not support embedding command line parameters to uefi applications in the boot entries.}}<br />
<br />
It is possible to directly embed the kernel parameters within the boot entry created by efibootmgr. This means that in your BIOS/UEFI you will be able to select Arch Linux directly in the default boot order, and on startup it will boot into Arch directly without any kind of boot selection GUI.<br />
<br />
# modprobe efivars<br />
# efibootmgr -c -w -d /dev/sdX -p Y -l /EFI/arch/vmlinuz-arch.efi -L "Arch Linux (EFISTUB)" -u "$(cat /proc/cmdline)"<br />
<br />
It is a good idea to run<br />
<br />
# efibootmgr -v<br />
<br />
to verify that the resulting entry is correct. You should also consider reordering the boot options ({{ic|efibootmgr -o}}) to place the Arch entry last, which could make the system easier to recover if it fails.<br />
<br />
More info about efibootmgr at [[UEFI#efibootmgr]]. Forum post https://bbs.archlinux.org/viewtopic.php?pid=1090040#p1090040 .<br />
<br />
== GRUB 2.xx ==<br />
<br />
GRUB 2.x contains its own filesystem drivers and does not rely on the firmware to access the files. It can directly read files from {{ic|/boot}} and does not require the kernel and initramfs files to be in the UEFISYS partition. Detailed information at [[GRUB#UEFI_systems_2]]. For bzr development version try AUR package - {{AUR|grub-bzr}}.<br />
<br />
== SYSLINUX 6.xx ==<br />
<br />
Install {{Pkg|syslinux}} (from [testing]) or {{AUR|syslinux-firmware-git}} AUR package and copy {{ic|/usr/lib/syslinux/efi64/*}} to {{ic|$esp/EFI/syslinux/}} ({{ic|$esp}} is the mountpoint of UEFISYS partition) ({{ic|efi64}} is for x86_64 UEFI firmwares, replace with {{ic|efi32}} for ia32 UEFI firmwares), and then create a boot entry using efibootmgr in the firmware boot manager.<br />
<br />
== ELILO ==<br />
<br />
ELILO is the UEFI version of LILO Boot Loader. It was originally created for Intel Itanium systems which supported only EFI (precursor to UEFI). It is the oldest UEFI bootloader for Linux. It is still in development but happens at a very slow pace. Upstream provided compiled binaries are available at http://sourceforge.net/projects/elilo/ . Elilo config file {{ic|elilo.conf}} is similar to [[LILO]]'s config file. AUR package - {{AUR|elilo-efi}}.<br />
<br />
== EFILINUX ==<br />
<br />
EFILINUX is the precursor to Kernel EFISTUB support. It can be used to boot kernel that do not support EFISTUB (mainly LTS kernels). It is not necessary to use efilinux if the kernel supports EFISTUB. <br />
<br />
It is available in the [extra] as {{Pkg|efilinux-efi}}. Upstream sources are at https://git.kernel.org/cgit/boot/efilinux/efilinux.git/ and the usage instructions are at http://thread.gmane.org/gmane.linux.kernel/1172645 and http://article.gmane.org/gmane.linux.kernel/1175060 .<br />
<br />
== See also ==<br />
<br />
* [http://www.rodsbooks.com/efi-bootloaders/ Rod Smith - Managing EFI Boot Loaders for Linux]<br />
* [http://www.rodsbooks.com/refind/ Rod Smith - rEFInd, a fork or rEFIt]<br />
* [https://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob_plain;f=Documentation/x86/efi-stub.txt;hb=HEAD Linux Kernel Documentation on EFISTUB]<br />
* [http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=291f36325f9f252bd76ef5f603995f37e453fc60;hp=55839d515495e766605d7aaabd9c2758370a8d27 Linux Kernel EFISTUB Git Commit]<br />
* [http://www.rodsbooks.com/efi-bootloaders/efistub.html Rod Smith's page on EFISTUB]<br />
* [http://www.rodsbooks.com/refind/linux.html rEFInd Documentation for booting EFISTUB Kernels]</div>Ddreamerhttps://wiki.archlinux.org/index.php?title=UEFI_Bootloaders&diff=265385UEFI Bootloaders2013-07-07T18:10:00Z<p>Ddreamer: /* Sync EFISTUB Kernel */</p>
<hr />
<div>[[Category:Boot loaders]]<br />
[[zh-CN:UEFI Bootloaders]]<br />
This page contains info about various [[UEFI]] Bootloaders capable of booting Linux kernel. It is recommended to read the [[UEFI]] and [[GPT]] pages before reading this page. The following [[Boot Loader|bootloaders]] are explained here:<br />
<br />
== Linux Kernel EFISTUB ==<br />
{{Warning|1=A bug has been noticed where booting EFISTUB can fail depending on kernel version and motherboard model. See [https://bbs.archlinux.org/viewtopic.php?id=156670&p=1] for more information.}}<br />
<br />
Linux (Kernel >= 3.3) supports {{ic|EFISTUB (EFI BOOT STUB)}} booting. It is enabled by default on Arch Linux kernels or can be activated by setting {{ic|CONFIG_EFI_STUB&#61;y}} in the Kernel configuration (see [https://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob_plain;f=Documentation/x86/efi-stub.txt;hb=HEAD The EFI Boot Stub] for more information).<br />
<br />
A single EFISTUB kernel is not capable of launching other kernels, hence each EFISTUB Kernel + Initramfs pair requires a separate boot menu entry. It is recommended to use a UEFI Boot Manager to manage multiple kernels.<br />
<br />
=== Setting up EFISTUB ===<br />
<br />
#[https://wiki.archlinux.org/index.php/Unified_Extensible_Firmware_Interface#EFI_System_Partition Create a FAT32 UEFI System Partition]<br />
# Mount the UEFI System Partition at {{ic|/boot/efi}} with {{ic|# mount <UEFI Partition> /boot/efi}} if you're going to be using GRUB2, or at {{ic|/boot}} with {{ic|# mount <UEFI Partition> /boot}} if you're going to be using Gummiboot or rEFInd. Gummiboot cannot boot across partitions, and will never have such capability due to its nature, so it's paramount that you mount the UEFI System Partition at /boot for use with Gummiboot so that the kernel and initramfs lie on the same partition as the bootmanager. {{note| On some machines, when using rEFInd, it works fine when mounting the UEFI partition in {{ic|/boot/efi}}}}<br />
# Create {{ic|/boot/efi/EFI/arch/}} directory with {{ic|# mkdir /boot/efi/EFI/arch/}}<br />
# Copy the following files from source to destination<br />
{| border="1"<br />
!Boot File Source!!UEFI Destination<br />
|-<br />
| /boot/vmlinuz-linux || /boot/efi/EFI/arch/vmlinuz-arch.efi<br />
|-<br />
| /boot/initramfs-linux.img || /boot/efi/EFI/arch/initramfs-arch.img<br />
|-<br />
| /boot/initramfs-linux-fallback.img || /boot/efi/EFI/arch/initramfs-arch-fallback.img<br />
|}<br />
{{note| As of {{Pkg|refind-efi}} 0.2.7, you don't need to copy these files, since refind will automatically detect them}}<br />
<br />
=== Sync EFISTUB Kernel ===<br />
{{Warning|The EFISTUB Kernel must be updated each time the kernel is updated (follow step 4 in [https://wiki.archlinux.org/index.php/UEFI_Bootloaders#Setting_up_EFISTUB Setting up EFISTUB]. Failure to do so will result in failure to boot. Alternatively one can automatically update the EFISTUB kernel using one of the following methods:}}<br />
<br />
{{Note| As of [https://www.archlinux.org/packages/extra/any/refind-efi/ refind-efi 0.2.7], refind automatically detects kernels in {{ic|/boot}}. They do not have to be renamed to have a {{ic|.efi}} extension either. Hence, the following sync scripts aren't needed if using [https://wiki.archlinux.org/index.php/UEFI_Bootloaders#Using_rEFInd refind]. You do need to install an EFI driver to read the Linux filesystem on which the kernel is stored, though. See [www.rodsbooks.com/refind/drivers.html]. Briefly, if the /boot is within an ext4 filesystem and the kernel is x64 architecture, you may run "mkdir -p /boot/efi/EFI/refind/drivers; cp /usr/lib/refind/drivers_x64/ext4_x64.efi /boot/efi/EFI/refind/drivers" to install ext4 filesystem driver for 64 bit kernel so that the kernel can be located by the rEFInd.}}<br />
<br />
==== Systemd ====<br />
[[Systemd]] features event triggered tasks. In this particular case, the ability to detect a change in path is used to sync the EFISTUB kernel and initramfs files when they are updated in {{ic|boot}}.<br />
<br />
<br />
{{Warning|Since mkinitcpio takes time to build the kernel stub and the initramfs. It is possible for the following systemd services to copy older kernel stubs and initramfs instead of the new ones. To reduce the chance of this error, it is better to bind the efistub copying service to check if the initramfs-linux-fallback.img was changed (since it is the last thing built by mkinitcpio).}}<br />
{{Tip|Save the following script as {{ic|/usr/lib/systemd/system/efistub-update.path}}}}<br />
{{bc|<nowiki><br />
[Unit]<br />
Description=Copy EFISTUB Kernel to UEFISYS Partition<br />
<br />
[Path]<br />
PathChanged=/boot/initramfs-linux-fallback.img<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
{{Tip|Save the following script as {{ic|/usr/lib/systemd/system/efistub-update.service}}}}<br />
{{bc|<nowiki><br />
[Unit]<br />
Description=Copy EFISTUB Kernel to UEFISYS Partition<br />
<br />
[Service]<br />
Type=oneshot<br />
ExecStart=/usr/bin/cp -f /boot/vmlinuz-linux /boot/efi/EFI/arch/vmlinuz-arch.efi<br />
ExecStart=/usr/bin/cp -f /boot/initramfs-linux.img /boot/efi/EFI/arch/initramfs-arch.img<br />
ExecStart=/usr/bin/cp -f /boot/initramfs-linux-fallback.img /boot/efi/EFI/arch/initramfs-arch-fallback.img<br />
</nowiki>}}<br />
<br />
{{Tip|Enable these services with<br />
{{bc|<nowiki><br />
# systemctl enable efistub-update.path<br />
</nowiki>}}}}<br />
<br />
==== Incron ====<br />
{{Pkg|incron}} can run a script to sync the EFISTUB Kernel after updates<br />
<br />
{{Tip|Save the following script as {{ic|/usr/local/bin/efistub-update.sh}}}}<br />
{{bc|<nowiki><br />
#!/usr/bin/env bash<br />
/usr/bin/cp -f /boot/vmlinuz-linux /boot/efi/EFI/arch/vmlinuz-arch.efi<br />
/usr/bin/cp -f /boot/initramfs-linux.img /boot/efi/EFI/arch/initramfs-arch.img<br />
/usr/bin/cp -f /boot/initramfs-linux-fallback.img /boot/efi/EFI/arch/initramfs-arch-fallback.img<br />
</nowiki>}}<br />
<br />
{{Tip|Save the following script as {{ic|/etc/incron.d/efistub-update.conf}}}}<br />
{{Note|The first parameter {{ic|/boot/initramfs-linux-fallback.img}} is the file to watch. The second parameter {{ic|IN_CLOSE_WRITE}} is the action to watch for. The third parameter {{ic|/usr/local/bin/efistub-update.sh}} is the script to execute.}}<br />
{{bc|<nowiki><br />
/boot/initramfs-linux-fallback.img IN_CLOSE_WRITE /usr/local/bin/efistub-update.sh<br />
</nowiki>}}<br />
<br />
{{Tip|In order to use this method, incron must be activated, if it is not run<br />
{{bc|<nowiki><br />
# systemctl enable incrond.service<br />
</nowiki>}}}}<br />
<br />
==== Mkinitcpio hook ====<br />
Mkinitcpio can generate a hook that does not need a system level daemon to function. It spawns a background process which waits for the generation of {{ic|vm-linuz}}, {{ic|initramfs-linux.img}}, and {{ic|initramfs-linux-fallback.img}}; then follows step 4 in [https://wiki.archlinux.org/index.php/UEFI_Bootloaders#Setting_up_EFISTUB Setting up EFISTUB]<br />
<br />
{{Tip|Save the following script as {{ic|/usr/lib/initcpio/install/efistub-update}}}}<br />
{{bc|<nowiki><br />
#!/usr/bin/env bash<br />
<br />
build() {<br />
/root/watch.sh &<br />
}<br />
<br />
help() {<br />
cat <<HELPEOF<br />
This hook waits for mkinitcpio to finish and copies the finished ramdisk and kernel to the ESP<br />
HELPEOF<br />
}<br />
</nowiki>}}<br />
<br />
{{Tip|Save the following script as {{ic|/root/watch.sh}} and make it executable}}<br />
{{bc|<nowiki><br />
#!/usr/bin/env bash<br />
<br />
while [[ -d "/proc/$PPID" ]]; do<br />
sleep 1<br />
done<br />
<br />
/usr/bin/cp -f /boot/vmlinuz-linux /boot/efi/EFI/arch/vmlinuz-arch.efi<br />
/usr/bin/cp -f /boot/initramfs-linux.img /boot/efi/EFI/arch/initramfs-arch.img<br />
/usr/bin/cp -f /boot/initramfs-linux-fallback.img /boot/efi/EFI/arch/initramfs-arch-fallback.img<br />
<br />
echo "Synced kernel with ESP"<br />
</nowiki>}}<br />
<br />
{{Tip|Add {{ic|efistub-update}} to the list of hooks in {{ic|/etc/mkinitcpio.conf}}}}<br />
<br />
{{Note| As of [https://www.archlinux.org/packages/extra/any/refind-efi/ refind-efi 0.2.7], refind automatically detects kernels in {{ic|/boot}}. They do not have to be renamed to have a {{ic|.efi}} extension either. Hence, the following sync scripts aren't needed if using [https://wiki.archlinux.org/index.php/UEFI_Bootloaders#Using_rEFInd refind]. You do need to isntall an EFI driver to read the Linux filesystem on which the kernel is stored, though.}}<br />
<br />
=== Booting EFISTUB ===<br />
<br />
{{Warning|Linux Kernel EFISTUB booting uses {{ic|\}} instead of {{ic|/}} and should be relative to the UEFI System Partition's root. For example, if the initramfs is located in {{ic|/boot/efi/EFI/arch/initramfs-linux.img}}, the corresponding UEFI formatted line would be {{ic|\EFI\arch\initramfs-linux.img}}. Failure to convert the options will lead to a system hang without any error message from the firmware or kernel.<br />
{{Note| Support of initrd path name with {{ic|/}} in EFISTUB booting has been added in [https://patchwork.kernel.org/patch/1899361/ mainline 3.9-rc1] and [http://lwn.net/Articles/541002/ stable 3.8.2]. Leading {{ic|/}} can be ignored but the path still has to be full path. Example: {{ic|initrd&#61;EFI/arch/initramfs-linux.img}} }}<br />
}}<br />
<br />
<br />
<br />
One can boot the EFISTUB kernel using one of the following ways :<br />
<br />
==== Using rEFInd ====<br />
<br />
rEFInd is a fork of rEFIt Boot Manager (used in Intel Macs) by Rod Smith (author of GPT-fdisk). rEFInd fixes many issues in rEFIt with respect to non-Mac UEFI booting and also has support for booting EFISTUB kernels and contains some features specific to them.<br />
{{Tip|If you're new to EFISTUB and/or rEFInd, you need to read [http://www.rodsbooks.com/refind/linux.html The rEFInd Boot Manager: Methods of Booting Linux] before going any further. This section illustrates only one possible use-case which is not suitable for all configurations.}}<br />
# Install {{Pkg|refind-efi}} package with {{ic|# pacman -S refind-efi}}<br />
# Copy the following files from their source directory to their destination<br />
{{Note|1=<arch> is the bit architecture of the system. Run {{ic|$ uname -m}} to get the architecture. Replace <arch> with "ia32" for 32 bit systems, and <arch> with "x64" for 64 bit systems.}}<br />
{| border="1"<br />
!rEFInd File Source!!UEFI Destination<br />
|-<br />
| /usr/lib/refind/refind_<arch>.efi || /boot/efi/EFI/refind/refind_<arch>.efi<br />
|-<br />
| /usr/lib/refind/config/refind.conf || /boot/efi/EFI/refind/refind.conf<br />
|-<br />
| /usr/share/refind/icons || /boot/efi/EFI/refind/icons<br />
|-<br />
| /usr/lib/refind/drivers_<arch> || /boot/efi/EFI/refind/drivers<br />
|}<br />
<br />
{{Tip|Refind's configuration file is located in {{ic|/boot/efi/EFI/refind/refind.conf}}. The file is well commented.}}<br />
<br />
As of {{Pkg|refind-efi}} 0.2.7, refind can auto-detect kernels in {{ic|/boot}}, if there are UEFI drivers for the filesystem used by /boot partition (or / partition if no separate /boot is used) in the ESP, and are loaded by rEFInd. This is enabled in the default configuration in {{ic|refind.conf}} (you may need to include the PATH to the drivers folders in the ESP). Copy your {{ic|/usr/lib/refind/config/refind_linux.conf}} to {{ic|/boot/refind_linux.conf}}. You may pass kernel specific commands in this file. <br />
<br />
Edit the {{ic|refind_linux.conf}} configuration file to be similar to the template below. Replace the string after PARTUUID with your root's PARTUUID<br />
<br />
{{Note|1=Please notice the [https://bbs.archlinux.org/viewtopic.php?pid=1286972 difference] between the standard UUID and the PARTUUID shown by {{ic|$ ls -l /dev/disk/by-partuuid/}}}}<br />
{{hc|refind_linux.conf|<nowiki><br />
"Boot with defaults" "root=PARTUUID=3518bb68-d01e-45c9-b973-0b5d918aae96 ro rootfstype=ext4 add_efi_memmap systemd.unit=graphical.target"<br />
"Boot to Terminal" "root=PARTUUID=3518bb68-d01e-45c9-b973-0b5d918aae96 ro rootfstype=ext4 add_efi_memmap systemd.unit=multi-user.target"</nowiki>}}<br />
<br />
{{Tip|Each line of {{ic|refind_linux.conf}} is displayed as a submenu by rEFInd. Access the submenu with "+" or "insert" keys.}}<br />
<br />
{{Tip|In non-Mac systems, create an entry for rEFInd using [[UEFI#efibootmgr|efibootmgr]] where sdX is the UEFI disk, and Y is the UEFI partition number. Run :<br />
{{bc|<nowiki><br />
# modprobe efivars<br />
# efibootmgr -c -w -d /dev/sdX -p Y -l /EFI/refind/refind_<arch>.efi -L "rEFInd" <br />
</nowiki>}}}}<br />
<br />
===== Systemd Automation =====<br />
<br />
{{Tip|To automate the process of copying refind files and updating the nvram (if needed) use the following script}}<br />
<br />
{{Note|Save this script as {{ic|/usr/lib/systemd/scripts/refind_name_patchv2}}}}<br />
{{Tip|If you want to change the directory that refind is installed in the UEFISYS partition, just change the value of $refind_dir in the script}}<br />
{{bc|<nowiki><br />
#!/usr/bin/env bash<br />
## COPYRIGHT 2013 : MARK E. LEE (BLUERIDER) : mlee24@binghamton.edu; mark@markelee.com<br />
<br />
## LOG<br />
## 1/17/2013 : Version 2 of refind_name_patch is released<br />
## : Supports long subdirectory location for refind<br />
## : Updates nvram when needed<br />
## : 10% speed boost<br />
<br />
function main () { ## main insertion function<br />
declare -r refind_dir="/boot/efi/EFI/refind"; ## set the refind directory<br />
declare -r arch=$(uname -m | awk -F'_' '{if ($1 == "x86"){print $2}}') && ## get bit architecture<br />
update-efi-dir; ## updates or creates the refind directory<br />
update-efi-nvram; ## updates nvram if needed<br />
}<br />
<br />
function update-efi-dir () { ## setup the refind directory<br />
if [ ! -d $refind_dir ]; then ## check if refind directory exists<br />
echo "Couldn't find $refind_dir";<br />
mkdir $refind_dir && ## make the refind directory if needed<br />
echo "Made $refind_dir";<br />
fi;<br />
if [ "$arch" ]; then ## check if anything was stored in $arch<br />
cp -r /usr/{share/refind/*,lib/refind/refind_x*$arch*.efi} $refind_dir/ && ## update bin and dirs<br />
echo "Updated binaries and directory files for refind at $refind_dir";<br />
else<br />
echo "Failed to detect an x86 architecture";<br />
exit;<br />
fi;<br />
}<br />
<br />
function update-efi-nvram () { ## update the nvram with efibootmgr<br />
declare -r ref_bin=${refind_dir/\/boot\/efi}/$(ls /usr/lib | grep $arch*.efi); ## get path of refind binary (without /boot/efi)<br />
declare -r ref_bin_escape=${ref_bin//\//\\\\}; ## insert escape characters into $ref_bin<br />
modprobe efivars && ## grab the efi variables for efibootmgr<br />
efibootmgr -v | grep $ref_bin_escape && ( ## check if boot entry is in nvram<br />
echo "Found boot entry, no need to update nvram";<br />
) || ( ## if boot entry is not in nvram; add it<br />
declare -r esp=$(mount -l | awk '/ESP/ {print $1}') && ## get ESP partition<br />
efibootmgr -c -w -d ${esp:0:8} -p ${esp:8} -L "rEFInd" -l $ref_bin_escape && ## update nvram<br />
echo "<br />
Updated nvram with entry rEFInd to boot $ref_bin<br />
Did not copy configuration files, please move refind.conf to $refind_dir/";<br />
)<br />
}<br />
<br />
main; ## run the main insertion function<br />
</nowiki>}}<br />
<br />
{{Note| As of [https://www.archlinux.org/packages/extra/any/refind-efi/ refind-efi 0.2.7], refind automatically detects kernels in {{ic|/boot}}. They do not have to be renamed to have a {{ic|.efi}} extension either. Hence, the following sync scripts aren't needed if using [https://wiki.archlinux.org/index.php/UEFI_Bootloaders#Using_rEFInd refind]. You do need to isntall an EFI driver to read the Linux filesystem on which the kernel is stored, though.}}<br />
<br />
{{Note|Save the following service file as {{ic|/usr/lib/systemd/system/refind_update.path}}}}<br />
{{bc|<nowiki><br />
[Unit]<br />
Description=Update rEFInd bootloader files<br />
<br />
[Path]<br />
PathChanged=/usr/lib/refind/refind_<arch>.efi<br />
Unit=refind_update.service<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
{{Note|Save the following service file as {{ic|/usr/lib/systemd/system/refind_update.service}}}}<br />
{{bc|<nowiki><br />
[Unit]<br />
Description=Update rEFInd directories, binaries, and nvram<br />
<br />
[Service]<br />
Type=oneshot<br />
ExecStart=/usr/bin/bash /usr/lib/systemd/scripts/refind_name_patchv2<br />
RemainAfterExit=no<br />
</nowiki>}}<br />
<br />
{{Tip|Enable the systemd path unit by running :<br />
{{bc|<nowiki><br />
# systemctl enable refind_update.path<br />
</nowiki>}}}}<br />
<br />
===== Apple Macs =====<br />
<br />
In case of Apple Macs, try {{AUR|mactel-boot}} for an experimental "bless" utility for Linux. If that does not work, use "bless" form within OSX to set rEFInd as default bootloader. Assuming UEFISYS partition is mounted at {{ic|/mnt/efi}} within OSX, do<br />
<br />
$ sudo bless --setBoot --folder /mnt/efi/EFI/refind --file /mnt/efi/EFI/refind/refind_x64.efi<br />
<br />
===== VirtualBox =====<br />
<br />
In case of VirtualBox, see [[VirtualBox#Using_Arch_under_Virtualbox_EFI_mode]].<br />
<br />
==== Using gummiboot ====<br />
<br />
[[Gummiboot]] is a UEFI Boot Manager which provides a nice menu for EFISTUB Kernels. It is available in [extra] as {{Pkg|gummiboot}}. See https://wiki.archlinux.org/index.php/Gummiboot for more info.<br />
<br />
==== Using UEFI Shell ====<br />
<br />
It is possible to launch EFISTUB kernel form UEFI Shell as if it is a normal UEFI application. In this case the kernel parameters are passed as normal parameters to the launched EFISTUB kernel file.<br />
<br />
> fs0:<br />
> cd \EFI\arch<br />
> vmlinuz-arch.efi root=PARTUUID=3518bb68-d01e-45c9-b973-0b5d918aae96 ro rootfstype=ext4 add_efi_memmap initrd=EFI/arch/initramfs-arch.img<br />
<br />
You can also write a simple {{ic|archlinux.nsh}} file with your boot parameters and put it in your UEFI System Partition, then run it with:<br />
<br />
fs0:<br />
archlinux<br />
<br />
Example Script:<br />
<br />
echo -on<br />
\EFI\arch\vmlinuz-arch.efi root=PARTUUID=3518bb68-d01e-45c9-b973-0b5d918aae96 rootfstype=ext4 add_efi_memmap initrd=EFI/arch/initramfs-arch.img<br />
<br />
This way you can specify UUID's without needing to remember the name or type out 20-30 characters.<br />
<br />
==== Using efibootmgr entry ====<br />
<br />
{{Warning|1=Some kernel and efibootmgr combinations do not work [https://bugs.archlinux.org/task/34641]. You will be able to delete but not create boot entries.}}<br />
<br />
{{Note|Some UEFI firmwares may not support embedding command line parameters to uefi applications in the boot entries.}}<br />
<br />
It is possible to directly embed the kernel parameters within the boot entry created by efibootmgr. This means that in your BIOS/UEFI you will be able to select Arch Linux directly in the default boot order, and on startup it will boot into Arch directly without any kind of boot selection GUI.<br />
<br />
# modprobe efivars<br />
# efibootmgr -c -w -d /dev/sdX -p Y -l /EFI/arch/vmlinuz-arch.efi -L "Arch Linux (EFISTUB)" -u "$(cat /proc/cmdline)"<br />
<br />
It is a good idea to run<br />
<br />
# efibootmgr -v<br />
<br />
to verify that the resulting entry is correct. You should also consider reordering the boot options ({{ic|efibootmgr -o}}) to place the Arch entry last, which could make the system easier to recover if it fails.<br />
<br />
More info about efibootmgr at [[UEFI#efibootmgr]]. Forum post https://bbs.archlinux.org/viewtopic.php?pid=1090040#p1090040 .<br />
<br />
== GRUB 2.xx ==<br />
<br />
GRUB 2.x contains its own filesystem drivers and does not rely on the firmware to access the files. It can directly read files from {{ic|/boot}} and does not require the kernel and initramfs files to be in the UEFISYS partition. Detailed information at [[GRUB#UEFI_systems_2]]. For bzr development version try AUR package - {{AUR|grub-bzr}}.<br />
<br />
== SYSLINUX 6.xx ==<br />
<br />
Install {{Pkg|syslinux}} (from [testing]) or {{AUR|syslinux-firmware-git}} AUR package and copy {{ic|/usr/lib/syslinux/efi64/*}} to {{ic|$esp/EFI/syslinux/}} ({{ic|$esp}} is the mountpoint of UEFISYS partition) ({{ic|efi64}} is for x86_64 UEFI firmwares, replace with {{ic|efi32}} for ia32 UEFI firmwares), and then create a boot entry using efibootmgr in the firmware boot manager.<br />
<br />
== ELILO ==<br />
<br />
ELILO is the UEFI version of LILO Boot Loader. It was originally created for Intel Itanium systems which supported only EFI (precursor to UEFI). It is the oldest UEFI bootloader for Linux. It is still in development but happens at a very slow pace. Upstream provided compiled binaries are available at http://sourceforge.net/projects/elilo/ . Elilo config file {{ic|elilo.conf}} is similar to [[LILO]]'s config file. AUR package - {{AUR|elilo-efi}}.<br />
<br />
== EFILINUX ==<br />
<br />
EFILINUX is the precursor to Kernel EFISTUB support. It can be used to boot kernel that do not support EFISTUB (mainly LTS kernels). It is not necessary to use efilinux if the kernel supports EFISTUB. <br />
<br />
It is available in the [extra] as {{Pkg|efilinux-efi}}. Upstream sources are at https://git.kernel.org/cgit/boot/efilinux/efilinux.git/ and the usage instructions are at http://thread.gmane.org/gmane.linux.kernel/1172645 and http://article.gmane.org/gmane.linux.kernel/1175060 .<br />
<br />
== See also ==<br />
<br />
* [http://www.rodsbooks.com/efi-bootloaders/ Rod Smith - Managing EFI Boot Loaders for Linux]<br />
* [http://www.rodsbooks.com/refind/ Rod Smith - rEFInd, a fork or rEFIt]<br />
* [https://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob_plain;f=Documentation/x86/efi-stub.txt;hb=HEAD Linux Kernel Documentation on EFISTUB]<br />
* [http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=291f36325f9f252bd76ef5f603995f37e453fc60;hp=55839d515495e766605d7aaabd9c2758370a8d27 Linux Kernel EFISTUB Git Commit]<br />
* [http://www.rodsbooks.com/efi-bootloaders/efistub.html Rod Smith's page on EFISTUB]<br />
* [http://www.rodsbooks.com/refind/linux.html rEFInd Documentation for booting EFISTUB Kernels]</div>Ddreamerhttps://wiki.archlinux.org/index.php?title=Autostarting&diff=264771Autostarting2013-06-30T16:12:07Z<p>Ddreamer: </p>
<hr />
<div>[[Category:Boot process]]<br />
[[es:Autostarting]]<br />
{{Note: The following informatin is not complete.}}<br />
This article links to various methods to launch scripts or applications automatically when some particular event is taking place, like system startup or shutdown, shell login or logout and so on. Programs can be started at differnt levels (time points):<br />
# System startup -- [[Daemons]], [[Systemd]], [[Runit]]<br />
# Bash Shell-- [[Shell]]<br />
** Login: (1){{ic|/etc/profile}} (2){{ic|~/.bash_profile}} OR {{ic|~/.bash_login}} OR {{ic|~/.profile}}<br />
** Non-login shell: {{ic|~/.bashrc}}<br />
# X window system<br />
** System wide: /etc/xdg/autostart<br />
** User specific: ~/.config/autostart<br />
# Graphical environment<br />
** Openbox: ~/.config/openbox/autostart<br />
** LXDE (openbox included): [[LXDE#Autostart_Programs]]<br />
# Others<br />
** Network<br />
** Hibernation & Resume<br />
<br />
== Daemons ==<br />
You can easily start your scripts or applications as daemons, see [[Daemon]].<br />
<br />
=== Systemd ===<br />
''systemd'' is the default init framework, replacing initscripts. The services which are started by ''systemd'' can be found in the subfolders of {{ic|/etc/systemd/system/}}. Services can be enabled using the {{ic|systemctl}} command. For more information about ''systemd'' and how to write autostart scripts for it, see at [[systemd]].<br />
<br />
=== Runit ===<br />
''runit'' is a mature init system which offers process supervision, parallel startup, per-user service trees, granular cgroup manipulation, flexible dependency system, and boot times that don't incur the penalty of dbus. The root-level services are symlinks in {{ic|/service}} with the actual service directories in {{ic|/etc/sv}}. See the [[Runit]] page for more information.<br />
<br />
== Shells ==<br />
To autostart programs in console you can use shell startup files/directories. Read the documentation for your shell, or its ArchWiki article, e.g. [[Bash]] or [[Zsh]].<br />
<br />
=== /etc/profile ===<br />
<br />
{{ic|/etc/profile}} is sourced by all Bourne-compatible shells upon login: it sets up an environment upon login and application-specific ({{ic|/etc/profile.d/*.sh}}) settings. <br />
<br />
Each time {{ic|/etc/profile}} is executed, it sources the following scripts if they exist:<br />
* {{ic|/etc/profile.d/*.sh}}<br />
* {{ic|/etc/bash.bashrc}} (if shell is bash)<br />
* {{ic|/etc/bash_completion}}<br />
<br />
===See also===<br />
*{{ic|INVOCATION}} section of {{ic|man bash}}<br />
*{{ic|STARTUP/SHUTDOWN FILES}} section of {{ic|man zsh}}<br />
*[[Wikipedia:Unix_shell#Configuration files for shells]]<br />
<br />
== Graphical ==<br />
You can autostart programs automatically when you login into your [[Window Manager]] or [[Desktop Environment]].<br />
<br />
=== X session startup ===<br />
<br />
See [[xinitrc]] and [[xprofile]].<br />
<br />
=== X Desktop Group ===<br />
<br />
{{ic|$XDG_CONFIG_DIRS/autostart/}}: In this folder are {{ic|.desktop}} files. These files determine which programs are loaded for which desktop environment. For an explanation of the desktop file standard refer to [http://standards.freedesktop.org/desktop-entry-spec/latest/ Desktop Entry Specification].<br />
<br />
=== GNOME, KDE, Xfce ===<br />
<br />
[[GNOME]], [[KDE]] and [[Xfce]] all have a dedicated GUI for autostart settings, see the respective articles.<br />
<br />
You can also directly put [[Creating desktop entries and menus|.desktop]] files in {{ic|~/.config/autostart/}}<br />
<br />
==== KDE (Legacy) ====<br />
<br />
KDE also has a specific folder: {{ic|~/.kde/Autostart}} or {{ic|~/.kde4/Autostart}}<br />
<br />
=== LXDE ===<br />
<br />
See [[LXDE#Autostart_Programs]].<br />
<br />
=== Fluxbox ===<br />
<br />
See [[Fluxbox#Autostarting Applications]].<br />
<br />
=== Openbox ===<br />
<br />
See [[Openbox#Startup programs]].</div>Ddreamerhttps://wiki.archlinux.org/index.php?title=LXDE&diff=264570LXDE2013-06-28T09:39:17Z<p>Ddreamer: /* Autostart Programs */</p>
<hr />
<div>[[cs:LXDE]]<br />
[[es:LXDE]]<br />
[[fr:LXDE]]<br />
[[it:LXDE]]<br />
[[ja:LXDE]]<br />
[[pl:LXDE]]<br />
[[ru:LXDE]]<br />
[[sr:LXDE]]<br />
[[tr:LXDE_Masaüstü_Ortamı]]<br />
[[uk:LXDE]]<br />
[[zh-CN:LXDE]]<br />
[[zh-TW:LXDE]]<br />
[[Category:Desktop environments]]<br />
{{Article summary start}}<br />
{{Article summary text|LXDE is a GPL-licensed open source desktop environment for Unix and other POSIX-compliant platforms, such as Linux. This article covers its installation, configuration, and troubleshooting.}}<br />
{{Article summary text|LXDE uses the [[GTK+]] toolkit.}}<br />
{{Article summary heading|Overview}}<br />
{{Article summary text|{{Graphical user interface overview}}}}<br />
{{Article summary end}}<br />
<br />
From [http://lxde.org/ LXDE.org | Lightweight X11 Desktop Environment]:<br />
<br />
:''The "Lightweight X11 Desktop Environment" is an extremely fast-performing and energy-saving desktop environment. Maintained by an international community of developers, it comes with a beautiful interface, multi-language support, standard keyboard short cuts and additional features like tabbed file browsing. LXDE uses less CPU and less RAM than other environments. It is especially designed for cloud computers with low hardware specifications, such as, netbooks, mobile devices (e.g. MIDs) or older computers.''<br />
<br />
== Installation ==<br />
<br />
LXDE is considered modular, meaning that choosing a specific package for a task is usually accomplishable; the minimal required packages which you have to install to run LXDE are {{Pkg|lxde-common}}, {{Pkg|lxsession}}, {{Pkg|desktop-file-utils}}, and a window manager.<br />
<br />
The complete LXDE suite can be installed with the group {{grp|lxde}}, available in the [[official repositories]]. It contains the following packages:<br />
<br />
* {{Pkg|gpicview}}: A lightweight image viewer<br />
* {{Pkg|libfm}}: A library for file management<br />
* {{Pkg|lxappearance}}: A utility to configure themes, icons and fonts for GTK+ applications<br />
* {{Pkg|lxappearance-obconf}}: A plugin for LXAppearance to configure Openbox<br />
* {{Pkg|lxde-common}}: The default settings for integrating different LXDE components<br />
* {{Pkg|lxde-icon-theme}}: An icon theme for LXDE<br />
* {{Pkg|lxdm}}: A lightweight display manager<br />
* {{Pkg|lxinput}}: A small program to configure keyboard and mouse for LXDE<br />
* {{Pkg|lxlauncher}}: An application launcher mainly for netbooks<br />
* {{Pkg|lxmenu-data}}: A collection of files intended to adapt freedesktop.org menu specification<br />
* {{Pkg|lxmusic}}: A lightweight XMMS2 client<br />
* {{Pkg|lxpanel}}: A desktop panel for LXDE<br />
* {{Pkg|lxrandr}}: A screen manager<br />
* {{Pkg|lxsession}}: A standard-compliant X11 session manager with shutdown, reboot and suspend support<br />
* {{Pkg|lxshortcut}}: A small program used to edit application shortcuts<br />
* {{Pkg|lxtask}}: A lightweight task manager<br />
* {{Pkg|lxterminal}}: A lightweight terminal emulator<br />
* {{Pkg|menu-cache}}: A daemon which automatically generates the menu for LXDE<br />
* {{Pkg|openbox}}: A lightweight, standard-compliant and highly-configurable window manager typically used with LXDE<br />
* {{Pkg|pcmanfm}}: The default lightweight file manager for LXDE which also provides desktop integration<br />
<br />
After the installation finishes, copy three files to the local configuration directory as instructed by pacman:<br />
<br />
mkdir -p ~/.config/openbox<br />
cp /etc/xdg/openbox/{menu.xml,rc.xml,autostart} ~/.config/openbox<br />
<br />
You will also need to install [[gamin]] (a file and directory monitoring tool) with the package {{pkg|gamin}}.<br />
<br />
{{pkg|leafpad}}, {{pkg|obconf}} and {{pkg|epdfview}} are some lightweight applications that are typically used with LXDE and are also available in the official repositories.<br />
<br />
== Starting the Desktop ==<br />
There are lots of ways to start a LXDE desktop.<br />
=== Display Managers ===<br />
If you are using a [[Display Manager|display manager]] like [[GDM]], [[KDM]], or [[SLiM]], switch the session to LXDE. Please consult the display manager's wiki page for instructions.<br />
<br />
Instructions for using [[LXDM]], an experimental display manager provided by the LXDE project, are included in [[LXDM]] page.<br />
<br />
If you are not using a display manager you might want to add<br />
<br />
export DESKTOP_SESSION=LXDE<br />
<br />
to your ~/.bash_profile in order for xdg-open to function properly.<br />
<br />
=== Console ===<br />
<br />
To be able to start the desktop from the console, several other options exist.<br />
<br />
To use '''startx''', you will need to define LXDE in your {{ic|~/.xinitrc}} file:<br />
<br />
exec startlxde<br />
<br />
If you want to run '''startx''' at boot automatically, take a look at the [[Start X at Boot#Starting X as preferred user without logging in |Starting X at boot]] guide.<br />
<br />
For other tasks you'll want to be sure that dbus is running as a daemon.<br />
<br />
See [[xinitrc]] for details, such as preserving the logind (and/or consolekit) session.<br />
<br />
== Tips and tricks ==<br />
=== Application Menu Editing ===<br />
The application menu works by resolving the {{ic|.desktop}} files located in {{ic|/usr/share/applications}}. Many desktop environments run programs that supersede these settings to allow customization of the menu. LXDE has yet to create an application menu editor but you can manually build them yourself if you are so inclined. Third party menu editor can be found in [[AUR]] - {{aur|lxmed}}<br />
<br />
To add or edit a menu item, create or link to the {{ic|.desktop}} file in {{ic|/usr/share/applications}}, {{ic|/usr/local/share/applications}}, or {{ic|~/.local/share/applications}}. (The latter two have the advantage of putting your application outside of directories governed by {{ic|pacman}}.) Consult [http://standards.freedesktop.org/desktop-entry-spec/latest/ the desktop entry specification] on freedesktop.org for structures of {{ic|.desktop}} files.<br />
<br />
To remove items from the menu, instead of deleting the {{ic|.desktop}} files, you can edit the file and add the following line in the file:<br />
NoDisplay=true.<br />
To expedite the process for a good number of files you can put it in a loop. For example:<br />
cd /usr/share/applications<br />
for i in program1.desktop program2.desktop ...; do cp /usr/share/applications/$i \<br />
/home/user/.local/share/applications/; echo "NoDisplay=true" >> \<br />
/home/user/.local/share/applications/$i; done<br />
This will work for all applications except KDE applications. For these, the only way to remove them from the menu is to log into KDE itself and use it's menu editor. For every item that you do not want displayed, check the 'Show only in KDE' option. If adding NoDisplay=True won't work, you can add ShowOnlyIn=XFCE.<br />
<br />
=== Auto Mount ===<br />
[[PCManFM#Volume_handling]]<br />
<br />
=== Autostart Programs ===<br />
{{Note|more methods to autostart programs can be found in [[Autostarting]]}}<br />
; .desktop files<br />
<br />
First you can link a program's {{ic|.desktop}} in {{ic|/usr/share/applications/}} file to {{ic|~/.config/autostart/}}. For example, to execute lxterminal automatically at startup:<br />
$ ln -s /usr/share/applications/lxterminal.desktop ~/.config/autostart/<br />
Once {{ic|.desktop}} files have been added you can manipulate them with the GUI configuration tool {{AUR|lxsession-edit}}.<br />
<br />
; autostart file<br />
The second method is to use a {{ic|~/.config/lxsession/LXDE/autostart}} file. This file is not a shell script, but each line represents a command to be executed, if a line begins with a @ symbol, the command following the @ will be automatically re-executed if it crashes. For example, to execute lxterminal and leafpad automatically at startup:<br />
{{hc|~/.config/lxsession/LXDE/autostart|<br />
@lxterminal<br />
@leafpad<br />
}}<br />
{{Note|The commands do '''not''' end with a & symbol.}}<br />
There is also a global autostart file at {{ic|/etc/xdg/lxsession/LXDE/autostart}}. If both files are present, all entries in both files will be executed.<br />
<br />
=== Bindings ===<br />
Mouse and key bindings (i.e. keyboard shortcuts) are implemented with Openbox and are described in detail [http://openbox.org/wiki/Help:Bindings here]. LXDE users should follow these instructions to edit the file ~/.config/openbox/lxde-rc.xml<br />
<br />
An optional GUI for editing the key bindings is {{AUR|obkey}} available in the AUR. The default edit for obkey is rc.xml, but you can direct it to the LXDE configuration as follows:<br />
<br />
$ obkey ~/.config/openbox/lxde-rc.xml<br />
<br />
More information on obkey is [http://code.google.com/p/obkey/ here].<br />
<br />
=== Cursors ===<br />
Main article: [[X11 Cursors]].<br />
<br />
The latest {{AUR|lxappearance2-git}} in [[AUR]] provides functionality to change cursor themes. If you do not want to install newer, experimental lxappearance2, you'll have to define your cursor in your {{ic|~/.Xdefaults}} file. See [[X11_Cursors#Choosing_and_Configuring_Cursor_Themes|Configuring Cursor Themes]].<br />
<br />
A basic way is to add the cursor to the default theme. First you will need to make the directory:<br />
# mkdir /usr/share/icons/default<br />
Then you can specify to add to the icon theme the cursor. This will use the {{Pkg|xcursor-bluecurve}} pointer theme:<br />
{{hc|/usr/share/icons/default/index.theme|2=<br />
[icon theme]<br />
Inherits=Bluecurve<br />
}}<br />
<br />
==== Custom folder icons in $HOME ====<br />
<br />
Currently it looks like PCmanFM doesn't support this:<br />
<br />
https://bbs.archlinux.org/viewtopic.php?pid=851397#p851397<br />
<br />
=== Digital clock applet time ===<br />
<br />
You can right click on the digital clock applet on the panel and set how it displays the current time. For example, to display standard time instead of military time in the format of HH:MM:SS:<br />
<br />
%I:%M<br />
<br />
And in YYYY/MM/DD HH:MM:SS format:<br />
<br />
%Y/%m/%d %H:%M:%S<br />
<br />
If you wish to display standard time with and AM/PM:<br />
<br />
%I:%M %p<br />
<br />
See the man page on {{Ic|strftime (3)}} for more options.<br />
<br />
=== Font Settings ===<br />
Most users of LXDE usually try to use GTK+ programs because GTK+ is the backend for LXDE. To set the fonts, you can use {{Pkg|lxappearance}} and set the main font. For other fonts you will need to use the '''Openbox configuration tool''' ObConf:<br />
# pacman -S obconf<br />
<br />
=== Keyboard layout ===<br />
====Using udev====<br />
<br />
When you use [[udev]], the default input configuration is written to {{ic|/etc/X11/xorg.conf.d/10-evdev.conf}} under {{ic|Section "InputClass"}}. You can edit it or create a new file {{ic|/etc/X11/xorg.conf.d/10-keyboard.conf}} following the example below, using a generic ''swiss'' keyboard, with a ''french'' variant.<br />
Section "InputClass"<br />
Identifier "evdev keyboard catchall"<br />
MatchIsKeyboard "on"<br />
MatchDevicePath "/dev/input/event*"<br />
Driver "evdev"<br />
Option "XkbModel" "pc104"<br />
Option "XkbLayout" "fr"<br />
Option "XknVariant" "ch"<br />
EndSection<br />
You can find a list of all layout and variant options in {{ic|/usr/share/X11/xkb/rules/base.lst}}.<br />
<br />
====Other way====<br />
<br />
1 way:<br />
Add in /etc/xdg/lxsession/LXDE/autostart following line before @lxpanel --profile LXDE:<br />
@setxkbmap -option grp:switch,grp:alt_shift_toggle,grp_led:scroll us,ru<br />
or ~/.config/lxsession/LXDE/autostart (for separate user):<br />
setxkbmap -option grp:switch,grp:alt_shift_toggle,grp_led:scroll us,ru<br />
2 way:<br />
Create /etc/xdg/autostart/setxkmap.desktop as following:<br />
[Desktop Entry]<br />
Version=1.0<br />
Encoding=UTF-8<br />
Name=Fix keyboard settings<br />
Exec=setxkbmap -rules xorg -layout "us,ru" -variant ",winkeys" -option "grp:alt_shift_toggle"<br />
Terminal=false<br />
Type=Application<br />
3 way:<br />
Edit ~/.Xkbmap for current user or /etc/X11/Xkbmap for all system add following line:<br />
-option grp:alt_shift_toggle,grp_led:scroll us,ru<br />
4 way:<br />
Add folowing line in /etc/X11/xinit/xinitrc or ~/.xinitrc:<br />
setxkbmap -option grp:alt_shift_toggle,grp_led:scroll us,ru<br />
5 way:<br />
Install [http://fbxkb.sourceforge.net/ fbxkb] from [[AUR]]<br />
<br />
6 way:<br />
[[Xorg#Switching_Between_Keyboard_Layouts]]<br />
<br />
==== Add the “Keyboard Layout Switcher” to our taskbar ====<br />
<br />
# Right-click on your taskbar<br />
# Choose “Add / Remove Panel Items”<br />
# Choose “Add”<br />
# Choose “Keyboard Layout Switcher”<br />
<br />
=== Gnome-screensaver with LXDE ===<br />
<br />
Install the needed packages:<br />
pacman -S gnome-screensaver gnome-session<br />
<br />
Create a simple launcher for gnome-session to allow the screensaver to work in {{ic|~/.config/autostart/gnome-session.desktop}}<br />
<br />
[Desktop Entry]<br />
Exec=/usr/bin/gnome-session<br />
<br />
Now logout and log back in to enjoy gnome-screensaver.<br />
<br />
=== Disabling screen blanking without installing GUI screensaver ===<br />
If you do not want to install GUI screensaver, to disable screen blanking add these lines below to {{ic|~/.xinitrc}} before exec command.<br />
xset s off &<br />
xset -dpms &<br />
<br />
=== lxpanel Icons ===<br />
Default icons used by lxpanel are stored in {{ic|/usr/share/pixmaps}} and any custom icons you want lxpanel to use need to be saved there as well.<br />
<br />
You can change default icons for applications by taking the following steps:<br />
# Save the new icon to /usr/share/pixmaps<br />
# Use a text editor to open the {{ic|.desktop}} file of the program whose icon you want to change in {{ic|/usr/share/applications}}.<br />
# Change<br />
Icon=/default/icon/.png<br />
to<br />
Icon=/name/of/new/icon/added/to/pixmaps/.png<br />
<br />
=== LXNM ===<br />
{{Note|LXNM is no longer under active development. It's [http://wiki.lxde.org/en/LXNM suggested] to use NetworkManager and nm-applet.}}<br />
LXNM is a program based on scripts that attempts to manage the network connections. It is script-based and strives to make networking configuration as automatic as possible. It is not a full blown networking system like [[NetworkManager]]. If you want greater control, [[Wicd]] and Gnome's verions of [[NetworkManager]] works well with LXDE. You can install LXNM from [community] repository:<br />
# pacman -S lxnm<br />
The main script will need to be run as root. If you plan on consistently using it, put it in your {{ic|/etc/rc.conf}}. LXNM works with the network status monitor applet in lxpanel. LXNM works well most of the time, though at times it can take a while to get a connection.<br />
<br />
=== [[PCManFM]] ===<br />
<br />
If you want to be able to access the Trash, mount volumes, and folder/file tracking you'll want gvfs support:<br />
<br />
pacman -S polkit-gnome gvfs<br />
<br />
polkit-gnome provides an authentication and will need to be started on login:<br />
<br />
mkdir -p ~/.config/autostart<br />
cp /etc/xdg/autostart/polkit-gnome-authentication-agent-1.desktop ~/.config/autostart<br />
<br />
Arch's polkit-gnome-authentication-agent-1.desktop currently doesn't exempt certain desktops. If you have trouble launching it remove the line:<br />
<br />
OnlyShowIn=GNOME;XFCE;<br />
<br />
[http://wiki.lxde.org/en/LXDE:PCManFM_build_and_setup_guide#Setup_Runtime_Environment_Correctly PCManFM @ LXDE wiki]<br />
<br />
To read/write NTFS file system don't forget to install {{pkg|ntfs-3g}} from the [[Official Repositories]].<br />
<br />
=== Replacing Window Managers ===<br />
[[Openbox]], the default window manager of LXDE, can be easily replaced by other window managers, such as fvwm, icewm, dwm, metacity, xfwm4, compiz, etc.<br />
<br />
LXDE will attempt to use window manager from the user lxsession configuration file {{ic|~/.config/lxsession/LXDE/desktop.conf}}. If it does not exist, it will then attempt to use the global configuration file {{ic|/etc/xdg/lxsession/LXDE/desktop.conf}}.<br />
<br />
Replace the openbox-lxde command with the window manager of your choice:<br />
[Session]<br />
window_manager=openbox-lxde<br />
For metacity:<br />
window_manager=metacity<br />
For compiz:<br />
window_manager=compiz ccp --indirect-rendering<br />
<br />
=== Shutdown, Reboot, Suspend and Hibernate Options ( LXSession-logout) ===<br />
To have all Shutdown, Reboot, Suspend and Hibernate Options working you need to have dbus running. You also need to have upower installed.<br />
<br />
# pacman -S upower<br />
<br />
See [[xinitrc#Preserving the session]] for details on avoiding breaking the logind/consolekit session.<br />
<br />
== Troubleshooting ==<br />
=== SSH Key Management ===<br />
A very lightweight solution to ssh key management can be found by using keychain. See the [https://wiki.archlinux.org/index.php/Using_SSH_Keys#Keychain using keychain] article for details.<br />
<br />
=== NTFS with Chinese Characters ===<br />
For a storage device with an NTFS filesystem, you will need to install the [[NTFS-3G]] package. Generally, PCManFM works well with NTFS filesystems, however there is one bug affecting NTFS users that if you have files or directories on an NTFS filesystem, the names of which contain non-latin characters (e.g. Chinese characters) may disappear when opening (or auto-mounting) the NTFS volume. This happens because the lxsession mount-helper is not correctly parsing the policies and locale options. There is a workaround for this:<br />
<br />
Remove the {{ic|/sbin/mount.ntfs-3g}} which is a symbolic link.<br />
# rm /sbin/mount.ntfs-3g<br />
Create a new {{ic|/sbin/mount.ntfs-3g}} with a new bash script containing:<br />
#!/bin/bash<br />
/bin/ntfs-3g $1 $2 -o locale=en_US.UTF-8<br />
And then make it executable:<br />
# chmod +x /sbin/mount.ntfs-3g<br />
Add or edit the following line to {{ic|/etc/pacman.conf}} under the [options] tag to prevent modification of this file in case of upgrading:<br />
NoUpgrade = sbin/mount.ntfs-3g<br />
<br />
=== KDM and LXDE Session ===<br />
As of KDE 4.3.3, KDM will not recognize the LXDE desktop session. To fix it:<br />
# cp /usr/share/xsessions/LXDE.desktop /usr/share/apps/kdm/sessions/<br />
<br />
=== GTK+ Warnings with lxsession 0.4.1 ===<br />
When starting GTK+2 programs you get the following message:<br />
GTK+ icon them is not properly set<br />
<br />
This usually means you do not have an XSETTINGS manager running. Desktop environment like GNOME or XFCE automatically execute their XSETTING managers like gnome-settings-daemon or xfce-mcs-manager. This is caused by the migration of lxde-settings-daemon config files into lxsession. If you made customizations to these config files, you are in need of merging those config files:<br />
* /usr/share/lxde/config<br />
* ~/.config/lxde/config<br />
into<br />
* etc/xdg/lxsession/LXDE/desktop.conf<br />
* ~/.config/lxsession/LXDE/desktop.conf<br />
Alternatively, you can use lxappearance from the community repository to fix this.<br />
<br />
== Resources ==<br />
* [http://wiki.lxde.org/en/ArchLinux LXDE wiki entry related to Arch Linux]<br />
* [http://lxde.sourceforge.net LXDE Project (Sourceforge)]<br />
* [http://forum.lxde.org LXDE Forum]<br />
* [https://sourceforge.net/project/showfiles.php?group_id=180858 The Latest lx* Packages]<br />
* [https://sourceforge.net/project/showfiles.php?group_id=156956 PCMan File Manager]</div>Ddreamerhttps://wiki.archlinux.org/index.php?title=Bluetooth&diff=264569Bluetooth2013-06-28T09:26:24Z<p>Ddreamer: /* Blueman */</p>
<hr />
<div>[[Category:Bluetooth]]<br />
[[cs:Bluetooth]]<br />
[[de:Bluetooth]]<br />
[[es:Bluetooth]]<br />
[[fr:Bluetooth]]<br />
[[it:Bluetooth]]<br />
[[ru:Bluetooth]]<br />
[[zh-CN:Bluetooth]]<br />
{{Article summary start}}<br />
{{Article summary text|Covers the installation and use of Bluetooth on Arch Linux.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Bluetooth mouse configuration}}<br />
{{Article summary end}}<br />
<br />
{{Out of date|Several generations of various deprecated tools are mentioned. bluez4 and bluez are confused. This article needs cleanup from someone who knows what commands belong in which packages.}}<br />
<br />
[http://www.bluetooth.org/ Bluetooth] is a standard for the short-range wireless interconnection of cellular phones, computers, and other electronic devices. In Linux, the canonical implementation of the Bluetooth protocol stack is [http://www.bluez.org/ BlueZ].<br />
<br />
== Installation ==<br />
To use Bluetooth, [[pacman|install]] {{Pkg|bluez}}, available in the [[Official Repositories]]. The {{ic|dbus}} daemon(start automatically by systemd) is used to read settings and for PIN pairing, while the {{ic|bluetooth}} daemon is required for the Bluetooth protocol.<br />
<br />
Start the bluetooth service:<br />
# systemctl start bluetooth.service<br />
<br />
Enable the bluetooth service at system boot up:<br />
# systemctl enable bluetooth.service<br />
<br />
== Graphical front-ends ==<br />
<br />
The following packages allow for a graphical interface to customize Bluetooth.<br />
<br />
=== Blueman ===<br />
<br />
[http://blueman-project.org Blueman] is a full featured Bluetooth manager written in [[GTK+]] and, as such, is recommended for [[GNOME]],[[Xfce]], or [[LXDE]]. You can install Blueman with the package {{Pkg|blueman}}, available in the [[Official Repositories]].<br />
<br />
Be sure that {{ic|bluetooth}} daemon is running as described above, and the local bluetooth device is availabe by running {{ic|hcitool dev}}. If only {{ic|Devices:}} is dumped, the local bluetooth device is unavailable. You may run {{ic|systemctl restart bluetooth.service}} or toggle the wifi/bluetooth switch of your laptop {{ic|Ex. Fn+F3 in Acer Aspire}} or reboot to activat the local bluetooth device. If you run {{ic|blueman-applet}} without available local bluetooth device, the {{ic|Blueman tray icon}} won't appear.<br />
<br />
Then execute {{ic|blueman-applet}}, and the Blueman tray icon will show up. {{ic|/etc/xdg/autostart/blueman.desktop}} may have been created to autostart {{ic|Blueman}} when loggin into X in a system-wide manner. If not, to make the applet run after login into a graphical environment automatically, add {{ic|blueman-applet}} either under ''System -> Preferences -> Startup Applications'' (GNOME) or ''Xfce Menu -> Settings -> Session and Startup'' (Xfce). Various ways to autosrtart a program are listed in [[Autostarting]].<br />
<br />
In order for a user to add and manage Bluetooth devices using Blueman, the user must be added to the 'lp' group. See /etc/dbus-1/system.d/bluetooth.conf for the section that enables users of the 'lp' group to communicate with the Bluetooth daemon.<br />
<br />
{{Note|If you are running Blueman outside GNOME/GDM (e.g., in Xfce using the {{ic|startx}} command) you should add {{ic|. /etc/X11/xinit/xinitrc.d/*}} on top of your {{ic|~/.xinitrc}} to make Nautilus capable to browse your devices.}}<br />
<br />
To receive files don't forget to right click on the ''Blueman tray icon -> Local Services -> Transfer -> File Receiving" and tick the square box next to "Enabled".<br />
<br />
==== Script for Thunar ====<br />
If you are not using Nautilus (for example Thunar) you may find the following script useful:<br />
{{hc|obex_thunar.sh|<br />
#!/bin/bash<br />
fusermount -u ~/bluetooth<br />
obexfs -b $1 ~/bluetooth<br />
thunar ~/bluetooth<br />
}}<br />
Now you will need to move the script to an appropriate location (e.g., {{ic|/usr/bin}}). After that, mark it as executable:<br />
{{bc|chmod +x /usr/bin/obex_thunar.sh}}<br />
The last step is to change the line in ''Blueman tray icon -> Local Services -> Transfer -> Advanced'' to {{ic|obex_thunar.sh %d}}.<br />
<br />
=== GNOME Bluetooth ===<br />
<br />
[http://live.gnome.org/GnomeBluetooth GNOME Bluetooth] is a fork of the old ''bluez-gnome'' and is focused on integration with the [[GNOME]] desktop environment. GNOME Bluetooth is required by {{Pkg|gnome-shell}}, so you should already have it installed if you are running GNOME 3. Otherwise, it can be installed with the package {{Pkg|gnome-bluetooth}}.<br />
<br />
Run {{ic|bluetooth-applet}} for a nice Bluetooth applet. You should now be able to setup devices and send files by right-clicking the Bluetooth icon. To make the applet run on login, add it to ''System -> Preferences -> Startup Applications''.<br />
<br />
To add a Bluetooth entry to the ''SendTo'' menu in Thunar's file properties menu, see instructions [http://thunar.xfce.org/pwiki/documentation/sendto_menu here].<br />
<br />
=== BlueDevil ===<br />
<br />
The Bluetooth tool for [[KDE]] is [https://projects.kde.org/projects/extragear/base/bluedevil BlueDevil]. It can be installed with the package {{Pkg|bluedevil}}, available in the [[Official Repositories]].<br />
<br />
Make sure {{ic|bluetooth}} daemon is running, as described above. You should get a Bluetooth icon both in Dolphin and in the system tray, from which you can configure BlueDevil and detect Bluetooth devices by clicking the icon. You can also configure BlueDevil from the KDE System Settings<br />
<br />
=== Fluxbox, Openbox, other WM ===<br />
Of course you can still use the preceding applications even if GNOME, Xfce or KDE are not your desktop manager. This list should help you figuring out which application does what:<br />
* bluetooth-applet -- tray icon with access to settings, pairing wizard, management of known devices<br />
* /usr/lib/gnome-user-share/gnome-user-share -- needs to be running if you're about to receive files via obexBT from a paired/bonded device<br />
<br />
if you're receiving an error during transmission and/or there's no file received add this into<br />
<br />
{{ic|/etc/dbus-1/system.d/bluetooth.conf}}<br />
<policy user="your_user_id"><br />
<allow own="org.bluez"/><br />
<allow send_destination="org.bluez"/><br />
<allow send_interface="org.bluez.Agent"/><br />
</policy><br />
<br />
* bluetooth-wizard -- for new devices to be paired<br />
* bluetooth-properties -- accessible also via bluetooth-applet icon<br />
* gnome-file-share-properties -- permissions on receiving files via bluetooth<br />
* bluez-sendto -- gui for sending files to a remote device<br />
<br />
== Bluez Utils ==<br />
<br />
The package {{Pkg|bluez-utils}} contains various commands,<br />
which are useful to configure and troubleshoot Bluetooth<br />
from the command line.<br />
<br />
=== hciconfig ===<br />
<br />
Prints name and basic information about all the Bluetooth devices installed in the system.<br />
<br />
To activate a device, use:<br />
# hciconfig <device-name> up<br />
<br />
=== hcitool ===<br />
<br />
To scan for remote devices:<br />
$ hcitool scan<br />
<br />
== Pairing ==<br />
Many bluetooth devices require [http://en.wikipedia.org/wiki/Bluetooth#Pairing pairing].<br />
The exact procedure depends on the devices involved and their input functionality.<br />
<br />
The procedure on a mobile may be as follows:<br />
* The computer sends a connect request to the mobile. <br />
* A pin, determined by the computer, is prompted for at the mobile<br />
* The same key must be re-entered at the computer.<br />
<br />
To pair with a device without using the gnome-bluez package, the ''bluez-simple-agent'' utility that comes with the bluez package can be used. This utility depends on three packages from [extra]:<br />
<br />
# pacman -S python2-dbus python2-gobject dbus-glib<br />
<br />
First, scan for external devices:<br />
$ hcitool scan<br />
<br />
Run the script as root:<br />
<br />
# bluez-simple-agent<br />
<br />
The message "Agent registered" should be returned, press control-c to quit. <br />
<br />
Below is a basic example of pairing with a specific device. The script will ask for the passcode, enter the code and confirm with enter.<br />
<br />
# bluez-simple-agent hci0 00:11:22:33:AA:BB<br />
<br />
{{note|bluez-simple-agent is only needed once for pairing a device, not every time you want to connect.}}<br />
<br />
See the Examples section below for pairing examples with various devices.<br />
<br />
== Using Obex for sending and receiving files ==<br />
Another option, rather than using KDE or Gnome Bluetooth packages, is Obexfs which allows you to mount your phone and treat it as part of your filesystem. Note that to use Obexfs, you need a device that provides an Obex FTP service.<br />
<br />
To install;<br />
# pacman -S obexfs<br />
<br />
and then your phone can then be mounted running as root <br />
# obexfs -b <devices mac address> /mountpoint<br />
<br />
For more mounting options see http://dev.zuckschwerdt.org/openobex/wiki/ObexFs<br />
<br />
For devices don't support Obex FTP service, check if Obex Object Push is supported.<br />
<br />
# sdptool browse XX:XX:XX:XX:XX:XX<br />
<br />
Read the output, look for Obex Object Push, remember the channel for this service. If supported, you can use ussp-push to send files to this device:<br />
<br />
# ussp-push XX:XX:XX:XX:XX:XX@CHANNEL file wanted_file_name_on_phone<br />
<br />
== Examples ==<br />
<br />
=== Siemens S55 ===<br />
<br />
This is what I did to connect to my S55. (I have not figured out how to initiate the connection from the phone)<br />
* The steps under installation<br />
* <br />
$> hcitool scan<br />
Scanning ...<br />
XX:XX:XX:XX:XX:XX NAME<br />
$> B=XX:XX:XX:XX:XX:XX<br />
Start the simple-agent in a second terminal<br />
$> su -c bluez-simple-agent <br />
Password: <br />
Agent registered<br />
Back to the first console <br />
$> obexftp -b $B -l "Address book"<br />
# Phone ask for pin, I enter it and answer yes when asked if I want to save the device<br />
...<br />
<file name="5F07.adr" size="78712" modified="20030101T001858" user-perm="WD" group-perm="" /><br />
...<br />
$> obexftp -b 00:01:E3:6B:FF:D7 -g "Address book/5F07.adr"<br />
Browsing 00:01:E3:6B:FF:D7 ...<br />
Channel: 5<br />
Connecting...done<br />
Receiving "Address book/5F07.adr"... Sending "Address book"... done<br />
Disconnecting...done<br />
$> obexftp -b 00:01:E3:6B:FF:D7 -p a <br />
...<br />
Sending "a"... done<br />
Disconnecting...done<br />
<br />
=== Logitech Mouse MX Laser / M555b ===<br />
<br />
To quickly test the connection:<br />
<br />
$> hidd --connect XX:XX:XX:XX:XX:XX<br />
<br />
For automated reconnection, use your desktop wizard to configure the bluetooth mouse.<br />
If your desktop environment doesn't includes support for this task, see the [[Bluetooth mouse manual configuration]] guide.<br />
<br />
=== Motorola V900 ===<br />
<br />
After installing blueman and running blueman-applet, click "find me" under connections -> bluetooth in motorla device. In blueman-applet, scan devices, find the motorola, click "add" in blueman-applet. Click "bond" in blueman-applet, enter some pin, enter the same pin in motorola when it asks. In terminal:<br />
<br />
cd ~/<br />
mkdir bluetooth-temp<br />
obexfs -n xx:yy:zz:... ~/bluetooth-temp<br />
cd ~/bluetooth-temp<br />
<br />
and browse... Only audio, video, and pictures are available when you do this.<br />
<br />
=== Motorola RAZ ===<br />
<br />
> pacman -S obextool obexfs obexftp openobex bluez<br />
<br />
> lsusb<br />
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 002 Device 002: ID 03f0:171d Hewlett-Packard Wireless (Bluetooth + WLAN) Interface [Integrated Module]<br />
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<br />
<br />
> hciconfig hci0 up<br />
<br />
> hciconfig<br />
hci0: Type: BR/EDR Bus: USB<br />
BD Address: 00:16:41:97:BA:5E ACL MTU: 1017:8 SCO MTU: 64:8<br />
UP RUNNING<br />
RX bytes:348 acl:0 sco:0 events:11 errors:0<br />
TX bytes:38 acl:0 sco:0 commands:11 errors:0<br />
<br />
> hcitool dev<br />
Devices:<br />
hci0 00:16:41:97:BA:5E<br />
<br />
'''Attention: make sure that bluetooth on your phone is enabled and your phone is visible! <br />
'''<br />
<br />
> hcitool scan<br />
Scanning ...<br />
00:1A:1B:82:9B:6D [quirxi]<br />
<br />
> hcitool inq<br />
Inquiring ...<br />
00:1A:1B:82:9B:6D clock offset: 0x1ee4 class: 0x522204<br />
<br />
> l2ping 00:1A:1B:82:9B:6D<br />
Ping: 00:1A:1B:82:9B:6D from 00:16:41:97:BA:5E (data size 44) ...<br />
44 bytes from 00:1A:1B:82:9B:6D id 0 time 23.94ms<br />
44 bytes from 00:1A:1B:82:9B:6D id 1 time 18.85ms<br />
44 bytes from 00:1A:1B:82:9B:6D id 2 time 30.88ms<br />
44 bytes from 00:1A:1B:82:9B:6D id 3 time 18.88ms<br />
44 bytes from 00:1A:1B:82:9B:6D id 4 time 17.88ms<br />
44 bytes from 00:1A:1B:82:9B:6D id 5 time 17.88ms<br />
6 sent, 6 received, 0% loss<br />
<br />
> hcitool name 00:1A:1B:82:9B:6D<br />
[quirxi]<br />
<br />
# hciconfig -a hci0<br />
hci0: Type: BR/EDR Bus: USB<br />
BD Address: 00:16:41:97:BA:5E ACL MTU: 1017:8 SCO MTU: 64:8<br />
UP RUNNING<br />
RX bytes:9740 acl:122 sco:0 events:170 errors:0<br />
TX bytes:2920 acl:125 sco:0 commands:53 errors:0<br />
Features: 0xff 0xff 0x8d 0xfe 0x9b 0xf9 0x00 0x80<br />
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3<br />
Link policy:<br />
Link mode: SLAVE ACCEPT<br />
Name: 'BCM2045'<br />
Class: 0x000000<br />
Service Classes: Unspecified<br />
Device Class: Miscellaneous,<br />
HCI Version: 2.0 (0x3) Revision: 0x204a<br />
LMP Version: 2.0 (0x3) Subversion: 0x4176<br />
Manufacturer: Broadcoml / Corporation (15)<br />
<br />
> hcitool info 00:1A:1B:82:9B:6D<br />
Requesting information ...<br />
BD Address: 00:1A:1B:82:9B:6D<br />
Device Name: [quirxi]<br />
LMP Version: 1.2 (0x2) LMP Subversion: 0x309<br />
Manufacturer: Broadcom Corporation (15)<br />
Features: 0xff 0xfe 0x0d 0x00 0x08 0x08 0x00 0x00<br />
<3-slot packets> <5-slot packets> <encryption> <slot offset><br />
<timing accuracy> <role switch> <hold mode> <sniff mode><br />
<RSSI> <channel quality> <SCO link> <HV2 packets><br />
<HV3 packets> <A-law log> <CVSD> <power control><br />
<transparent SCO> <AFH cap. slave> <AFH cap. master><br />
<br />
'''Edit your main.conf and enter the proper class for your phone ( Class = 0x100100 ):'''<br />
> vim /etc/bluetooth/main.conf<br />
<br />
# Default device class. Only the major and minor device class bits are<br />
# considered.<br />
#Class = 0x000100<br />
Class = 0x100100<br />
<br />
> /etc/rc.d/dbus start<br />
:: Starting D-BUS system messagebus <br />
[DONE]<br />
<br />
> /etc/rc.d/bluetooth start<br />
:: Stopping bluetooth subsystem: pand dund rfcomm hidd bluetoothd<br />
[DONE]<br />
:: Starting bluetooth subsystem: bluetoothd<br />
<br />
'''Pairing with bluez-simple-agent only has to be done once. On your motorola-phone give 0000 in as your pin when phone asks for it !!'''<br />
> /usr/bin/bluez-simple-agent hci0 00:1A:1B:82:9B:6D<br />
RequestPinCode (/org/bluez/10768/hci0/dev_00_1A_1B_82_9B_6D)<br />
Enter PIN Code: 0000<br />
Release<br />
New device (/org/bluez/10768/hci0/dev_00_1A_1B_82_9B_6D)<br />
<br />
'''Now you can browse the filesystem of your phone with obexftp:'''<br />
> obexftp -v -b 00:1A:1B:82:9B:6D -B 9 -l<br />
Connecting..\done<br />
Tried to connect for 448ms<br />
Receiving "(null)"...-<?xml version="1.0" ?><br />
<!DOCTYPE folder-listing SYSTEM "obex-folder-listing.dtd"><br />
<folder-listing><br />
<parent-folder /><br />
<folder name="audio" size="0" type="folder" modified="20101010T132323Z" user-perm="RW" /><br />
<folder name="video" size="0" type="folder" modified="20101010T132323Z" user-perm="RW" /><br />
<folder name="picture" size="0" type="folder" modified="20101010T132323Z" user-perm="RW" /><br />
</folder-listing><br />
done<br />
Disconnecting..\done<br />
<br />
'''Or you can mount your phone into a directory on your computer and treat it like a normal file system:'''<br />
<br />
> groupadd bluetooth<br />
> mkdir /mnt/bluetooth<br />
> chown root:bluetooth /mnt/bluetooth<br />
> chmod 775 /mnt/bluetooth<br />
> usermod -a -G bluetooth arno<br />
<br />
> obexfs -b 00:1A:1B:82:9B:6D /mnt/bluetooth/<br />
> l /mnt/bluetooth/<br />
total 6<br />
drwxr-xr-x 1 root root 0 10. Okt 13:25 .<br />
drwxr-xr-x 5 root root 4096 10. Okt 10:08 ..<br />
drwxr-xr-x 1 root root 0 10. Okt 2010 audio<br />
drwxr-xr-x 1 root root 0 10. Okt 2010 picture<br />
drwxr-xr-x 1 root root 0 10. Okt 2010 video<br />
<br />
=== Pairing with an iPhone using bluez-simple-agent ===<br />
<br />
Assuming a bluetooth device called hci0 and an iPhone that showed up in a hcitool scan as '00:00:DE:AD:BE:EF':<br />
<br />
# bluez-simple-agent hci0 00:00:DE:AD:BE:EF<br />
Passcode:<br />
<br />
=== Headset and Alsa Devices ===<br />
==== by referencing the bluetooth device in asound.conf ====<br />
1. First if you have not already, install bluez<br />
# pacman -S bluez<br />
2. Scan for your device<br />
$ hcitool (-i <optional hci#>***) scan<br />
3. Pair your headset with your device<br />
$ bluez-simple-agent (optional hci# ***) XX:XX:XX:XX:XX:XX<br />
and put in your pin (0000 or 1234, etc)<br />
4. Add this to your/etc/asound.conf file<br />
#/etc/asound.conf<br />
<br />
pcm.btheadset {<br />
type plug<br />
slave {<br />
pcm {<br />
type bluetooth<br />
device XX:XX:XX:XX:XX:XX <br />
profile "auto"<br />
} <br />
} <br />
hint {<br />
show on<br />
description "BT Headset"<br />
} <br />
}<br />
ctl.btheadset {<br />
type bluetooth<br />
} <br />
<br />
5. Check to see if it has been added to alsa devices<br />
$ aplay -L<br />
<br />
6. Now play with aplay:<br />
$ aplay -D btheadset /path/to/audio/file<br />
<br />
or Mplayer:<br />
$ mplayer -ao alsa:device=btheadset /path/to/audio/or/video/file<br />
<br />
*** To find hci# for a usb dongle, type in <br />
$ hcitool dev<br />
<br />
==== by using bluez-tools from the AUR ====<br />
You can use {{aur|bluez-tools}} from the [[AUR]] with pulseaudio to stream audio to a bluetooth headset. <br />
Find the MAC of the headset:<br />
$ hcitool scan<br />
Connect to the headset:<br />
$ bt-audio -c XX:XX:XX:XX:XX:XX<br />
Open pulseaudio volume control:<br />
$ pavucontrol<br />
The headset should show up in the Configuration tab.<br />
<br />
=== Microsoft Bluetooth Mobile Keyboard 6000 ===<br />
<br />
1. Scan for your device<br />
$ hcitool (-i <optional hci#>***) scan<br />
Scanning ...<br />
00:11:22:33:44:55 Microsoft Bluetooth Mobile Keyboard 6000<br />
<br />
<br />
2. On second console run as root (do not terminate):<br />
# bluez-simple-agent<br />
Agent registered<br />
<br />
3. Back on first console run:<br />
$ bluez-simple-agent hci0 00:11:22:33:44:55<br />
Enter PIN Code: 1234<br />
(now enter that pin on the keyboard and press enter)<br />
Release<br />
New device (/org/bluez/5373/hci0/dev_00_11_22_33_44_55)<br />
<br />
4.<br />
$ bluez-test-device trusted 00:11:22:33:44:55<br />
<br />
5.<br />
$ bluez-test-input connect 00:11:22:33:44:55<br />
<br />
No your keyboard should work. You can terminate bluez-simple-agent on second console with Ctrl-C<br />
<br />
== Troubleshooting ==<br />
<br />
=== Segfaults in Bluez 4.95 ===<br />
If bluetoothd stops working after enabling or disabling your bluetooth device via rfkill or gnome-bluetooth applet, look at your dmesg output. If it looks like:<br />
<br />
bluetoothd[2330]: segfault at 1 ip 00007fcef2327b75 sp 00007fff9f769cb0 error 4 in libglib-2.0.so.0.2800.8[7fcef22ca000+e9000]<br />
<br />
then you should consider downgrading to 4.94 (just grab the PKGBUILD/etc from arch and change version to 4.94 and correct the md5sum for bluez) or wait for an update of bluez. [https://bugs.archlinux.org/task/25088?project=1&openedfrom=-1+week Here] is a (arch) bug report about it.<br />
<br />
=== passkey-agent ===<br />
$> passkey-agent --default 1234<br />
Can't register passkey agent<br />
The name org.bluez was not provided by any .service files<br />
You probably started {{ic|/etc/rc.d/bluetooth}} before {{ic|/etc/rc.d/dbus}}<br />
$> hciconfig dev<br />
# (no listing)<br />
Try running {{ic|hciconfig hc0 up}}<br />
<br />
=== Blueman ===<br />
If blueman-applet fails to start, try removing the entire ''/var/lib/bluetooth'' directory and restarting the machine (or just the hal, dbus, and bluetooth services).<br />
# rm -rf /var/lib/bluetooth<br />
# reboot<br />
<br />
If you see a notification saying '''Incoming file over Bluetooth''' then this means that the device isn't marked as trusted. Mark it as trusted and try again (looking at the code, it looks like some buttons should be displayed in the notification, but I don't see them).<br />
<br />
=== gnome-bluetooth ===<br />
If you see this when trying to enable receiving files in bluetooth-properties:<br />
Bluetooth OBEX start failed: Invalid path<br />
Bluetooth FTP start failed: Invalid path<br />
Then run:<br />
# pacman -S xdg-user-dirs<br />
$ xdg-user-dirs-update<br />
You can edit the paths using:<br />
$ vi ~/.config/user-dirs.dirs<br />
<br />
=== Bluetooth USB Dongle ===<br />
If you are using a USB dongle, you should check that your Bluetooth dongle is recognized. You can do that by inspecting {{ic|/var/log/messages.log}} when plugging in the USB dongle (or running {{ic|journalctl -f}} with systemd). It should look something like the following (look out for hci):<br />
<br />
# tail -f /var/log/messages.log<br />
Feb 20 15:00:24 hostname kernel: [ 2661.349823] usb 4-1: new full-speed USB device number 3 using uhci_hcd<br />
Feb 20 15:00:24 hostname bluetoothd[4568]: HCI dev 0 registered<br />
Feb 20 15:00:24 hostname bluetoothd[4568]: Listening for HCI events on hci0<br />
Feb 20 15:00:25 hostname bluetoothd[4568]: HCI dev 0 up<br />
Feb 20 15:00:25 hostname bluetoothd[4568]: Adapter /org/bluez/4568/hci0 has been enabled<br />
<br />
For a list of supported hardware please refer to the [[Bluetooth#Resources|resources]] section on this page.<br />
<br />
If you only get the first two lines, you may see that it found the device but you need to bring it up.<br />
Example:<br />
<br />
hciconfig -a hci0<br />
hci0: Type: USB<br />
BD Address: 00:00:00:00:00:00 ACL MTU: 0:0 SCO MTU: 0:0<br />
DOWN <br />
RX bytes:0 acl:0 sco:0 events:0 errors:0<br />
TX bytes:0 acl:0 sco:0 commands:0 errors:<br />
sudo hciconfig hci0 up<br />
hciconfig -a hci0<br />
hci0: Type: USB<br />
BD Address: 00:02:72:C4:7C:06 ACL MTU: 377:10 SCO MTU: 64:8<br />
UP RUNNING <br />
RX bytes:348 acl:0 sco:0 events:11 errors:0<br />
TX bytes:38 acl:0 sco:0 commands:11 errors:0<br />
<br />
If this fails with an error like:<br />
Operation not possible due to RF-kill<br />
it could be due either to the {{ic|rfkill}} utility, in which case it should be resolved with<br />
# rfkill unblock all<br />
or, it could simply be the hardware switch of the computer. The hardware bluetooth switch (at least sometimes) controls access to USB bluetooth dongles also. Flip/press this switch and try bringing the device up again.<br />
<br />
To verify that the device was detected you can use {{ic|hcitool}} which is part of the {{ic|bluez-utils}}. You can get a list of available devices and their identifiers and their MAC address by issuing:<br />
<br />
$ hcitool dev<br />
Devices:<br />
hci0 00:1B:DC:0F:DB:40<br />
<br />
More detailed informations about the device can be retrieved by using {{ic|hciconfig}}.<br />
<br />
$ hciconfig -a hci0<br />
hci0: Type: USB<br />
BD Address: 00:1B:DC:0F:DB:40 ACL MTU: 310:10 SCO MTU: 64:8<br />
UP RUNNING PSCAN ISCAN <br />
RX bytes:1226 acl:0 sco:0 events:27 errors:0<br />
TX bytes:351 acl:0 sco:0 commands:26 errors:0<br />
Features: 0xff 0xff 0x8f 0xfe 0x9b 0xf9 0x00 0x80<br />
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 <br />
Link policy: RSWITCH HOLD SNIFF PARK <br />
Link mode: SLAVE ACCEPT <br />
Name: 'BlueZ (0)'<br />
Class: 0x000100<br />
Service Classes: Unspecified<br />
Device Class: Computer, Uncategorized<br />
HCI Ver: 2.0 (0x3) HCI Rev: 0xc5c LMP Ver: 2.0 (0x3) LMP Subver: 0xc5c<br />
Manufacturer: Cambridge Silicon Radio (10)<br />
<br />
=== Logitech Bluetooth USB Dongle ===<br />
There are Logitech dongles (ex. Logitech MX5000) that can work in two modes Embedded and HCI. In embedded mode dongle emulates a USB device so it seems to your PC that your using a normal USB mouse/keyoard.<br />
<br />
If you hold the little red Button on the USB BT mini-receiver it will enable the other mode. Hold the red button on the BT dongle and plug it into the computer, and after 3-5 seconds of holding the button, the Bluetooth icon will appear in the system tray. [http://ubuntuforums.org/showthread.php?t=1332197 Discussion]<br />
<br />
=== hcitool scan: Device not found ===<br />
* On some Dell laptops (e.g. Studio 15) you have to switch the Bluetooth mode from HID to HCI using<br />
# hid2hci<br />
<br />
{{Note|hid2hci is no longer in the $PATH, it is under /lib/udev/hid2hci, but udev should run it automatically for you.}}<br />
<br />
* If the device won't show up and you have a Windows operating system on your machine, try booting it and enable the bluetooth adapter from windows.<br />
<br />
* Sometimes also this simple command helps:<br />
# hciconfig hci0 up<br />
<br />
=== My computer isn't visible ===<br />
Can't discover computer from your phone? Enable PSCAN and ISCAN:<br />
# enable PSCAN and ISCAN<br />
$ hciconfig hci0 piscan <br />
# check it worked<br />
$ hciconfig <br />
hci0: Type: USB<br />
BD Address: 00:12:34:56:78:9A ACL MTU: 192:8 SCO MTU: 64:8<br />
'''UP RUNNING PSCAN ISCAN'''<br />
RX bytes:20425 acl:115 sco:0 events:526 errors:0<br />
TX bytes:5543 acl:84 sco:0 commands:340 errors:0<br />
<br />
{{Note | Check DiscoverableTimeout and PairableTimeout in /etc/bluetooth/main.conf}}<br />
<br />
Try changing device class in /etc/bluetooth/main.conf as following<br />
# Default device class. Only the major and minor device class bits are<br />
# considered.<br />
#Class = 0x000100 (from default config)<br />
Class = 0x100100<br />
<br />
This was the only solution to make my computer visible for my phone. <br />
<br />
=== Nautilus cannot browse files ===<br />
If nautilus doesn't open and show this error:<br />
Nautilus cannot handle obex: locations. Couldn't display "obex://[XX:XX:XX:XX:XX:XX]/".<br />
Install gvfs-obexftp package:<br />
# pacman -S gvfs-obexftp<br />
<br />
=== Bluetooth is disabled when starting GNOME ===<br />
If you have {{ic|dbus}} and {{ic|bluetooth}} backgrounded (@) in your {{ic|DAEMONS}} array in {{ic|/etc/rc.conf}}, it might happen that {{ic|bluetooth}} will be disabled when starting up GNOME. To solve this, make sure {{ic|dbus}} is not backgrounded.<br />
<br />
=== Sennheiser MM400 Headset connection problems ===<br />
If your {{ic|Sennheiser MM400 Headset}} immediately disconnects after connecting as {{ic|Headset Service}} with Blueman, try to connect it as {{ic|Audio Sink}}. Afterwards you can change the headset's {{ic|Audio Profile}} to {{ic|Telephony Duplex}} with a right click in Blueman.<br />
With this option headset functionality will be available although the headset was only connected as {{ic|Audio Sink}} in first place and no disconnection will happen (tested with bluez 4.96-3, pulseaudio 1.1-1 and blueman 1.23-2).<br />
<br />
=== My device is paired but no sound is played from it ===<br />
Try to first inspect '''/var/log/messages.log'''<br />
{{bc|# tail /var/log/messages.log<br />
Jan 12 20:08:58 localhost pulseaudio[1584]: [pulseaudio] module-bluetooth-device.c: Service not connected<br />
Jan 12 20:08:58 localhost pulseaudio[1584]: [pulseaudio] module-bluetooth-device.c: Bluetooth audio service not available}}<br />
<br />
If you see such messages, try first:<br />
{{bc|# pactl load-module module-bluetooth-device}}<br />
<br />
If the module fails to work, do this workaround:<br />
Open '''/etc/bluetooth/audio.conf''' and add after '''[General]''' (on a new line)<br />
{{bc|Enable&#61;Socket}}<br />
Then restart the bluetooth daemon with {{ic|/etc/rc.d/bluetooth restart}}.<br />
Pair again your device, and you should find it in the pulseaudio settings (advanced settings for the sound)<br />
<br />
[http://wiki.gentoo.org/index.php?title=Bluetooth_Headset&redirect=no More information on Gentoo Wiki]<br />
<br />
If after fixing this you still can't get sound, try using blueman (this is the only one that works for me), make sure that notify-osd is installed or it might show you weird error messages like this one: "Stream setup failed"<br />
<br />
fail (/usr/lib/python2.7/site-packages/blueman/gui/manager/ManagerDeviceMenu.py:134)<br />
fail (DBusException(dbus.String(u'Stream setup failed'),),)<br />
<br />
== See also ==<br />
*[http://www.gentoo.org/doc/en/bluetooth-guide.xml Gentoo Linux Bluetooth Guide]<br />
*[http://en.opensuse.org/HCL:Bluetooth openSUSE Bluetooth Hardware Compatibility List]<br />
*[http://linuxgazette.net/109/oregan3.html Accessing a Bluetooth phone (Linux Gazette)]<br />
*[http://www.adamish.com/blog/#a000361 Bluetooth computer visibility]<br />
*[http://www.elstel.org/MobilePhone.html Bluetooth for Your Mobile Phone: Bluetooth Pairing, Data Synchronization, Photo Download, Internet Dial-Up (Tethering)]</div>Ddreamerhttps://wiki.archlinux.org/index.php?title=CUPS&diff=264377CUPS2013-06-26T18:37:41Z<p>Ddreamer: /* hp-setup asks to specify the PPD file for the discovered printer */</p>
<hr />
<div>[[Category:Printers]]<br />
[[cs:CUPS]]<br />
[[es:CUPS]]<br />
[[fr:CUPS]]<br />
[[it:CUPS]]<br />
[[pl:CUPS]]<br />
[[ru:CUPS]]<br />
[[th:CUPS]]<br />
[[tr:CUPS]]<br />
[[zh-CN:CUPS]]<br />
[[zh-TW:CUPS]]<br />
{{Article summary start|Summary}}<br />
{{Article summary text|Installing and configuring CUPS}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|CUPS printer sharing}}<br />
{{Article summary wiki|CUPS printer-specific problems}}<br />
{{Article summary wiki|Samba}}<br />
{{Article summary end}}<br />
<br />
From [http://www.cups.org/index.php CUPS' site]:<br />
:"''[[Wikipedia:CUPS|CUPS]] is the standards-based, open source printing system developed by Apple Inc. for OS® X and other UNIX®-like operating systems''".<br />
<br />
Although there are other printing packages such as LPRNG, the Common Unix Printing System is the most popular choice because of its relative ease of use.<br />
<br />
== CUPS Linux printing workflow ==<br />
As of {{Pkg|cups}} version 1.5.3-3, Arch Linux makes use of the new full pdf-based printing workflow. For<br />
further reading check [http://www.linuxfoundation.org/collaborate/workgroups/openprinting/pdfasstandardprintjobformat PDF standard printing job format] and an old [https://wiki.linuxfoundation.org/en/OpenPrinting/Database/CUPS-Filter-Chart CUPS filtering chart] for history and fun.<br />
A good starting point for general Linux printing questions is [http://www.linuxfoundation.org/collaborate/workgroups/openprinting here].<br />
<br />
There are two ways to setup a printer.<br />
* If there's a CUPS server running in your network and sharing a printer you only need to install the client package.<br />
* If the printer is connected directly to your system or you have access to an IPP network printer then setup a local CUPS server.<br />
<br />
== Installing the client package ==<br />
<br />
The package {{Pkg|libcups}} is the only required package. [[pacman|Install]] it from the [[official repositories]].<br />
<br />
Then add your CUPS server's IP address or hostname into {{ic|/etc/cups/client.conf}}. That is all you need. Every application should quickly find the printer(s) shared by that CUPS server.<br />
<br />
=== Optional advanced network setup ===<br />
<br />
It is also possible to run a entire cupsd+cups-browsed instance on your client with Avahi browsing enabled to discover unknown shared printers in your network. This can be useful in large setups where the server is unknown.<br />
{{Note|This behavior did not change with cups 1.6.x - the difference is that until 1.5.x cupsd was able to do printer browsing alone and now it can only browse its own shared printers.<br />
To get the local cupsd recognise other shared printers offered by a remote cupsd server you need a running local cups-browserd (supported since cups-filters 1.0.26) instance using Avahi to discover unknown printers. <br />
There is [https://bbs.archlinux.org/viewtopic.php?id&#61;161440 good news] in April 2013 (still has to be incorporated above).}}<br />
<br />
=== Installing CUPS a 32 bit chroot environment ===<br />
<br />
If you have a 64 bit base installation with a [[Install_bundled_32-bit_system_in_Arch64|32 bit chroot environment]], explicit installation of CUPS is not necessary in the 32 bit environment. To access installed CUPS printers from the chroot environment, one needs to bind the {{ic|/var/run/cups}} directory to the same relative location in the chroot environment. Simply create the directory in the chroot (it probably doesn't exist), mount (with {{ic|-o bind}} passed to the command}}, and printers should be available from 32 bit chroot applications immediately.<br />
<br />
{{bc|# mkdir /path/to/chroot/var/run/cups<br />
# Example: # mkdir /opt/arch32/var/run/cups<br />
<br />
# mount -o bind /var/run/cups /path/to/chroot/var/run/cups}}<br />
<br />
== Installing the server packages ==<br />
<br />
The following packages and some printer drivers are needed. [[pacman|Install]] them from the [[official repositories]].<br />
<br />
* {{Pkg|cups}} - the actual CUPS daemon<br />
* {{Pkg|cups-filters}} - essential filters<br />
* {{Pkg|ghostscript}} - (optional) PostScript interpreter<br />
* {{Pkg|gsfonts}} - GhostScript standard Type1 fonts<br />
<br />
If you want to enable printer browsing through your network, also install {{Pkg|avahi}}. Make sure '''avahi-daemon''' is started before '''cupsd'''.<br />
<br />
If the system is connected to a networked printer using the [[Samba]] protocol or if the system is to be a print server for Windows clients, also install {{Pkg|samba}}.<br />
<br />
=== Printer driver ===<br />
<br />
Here are some of the driver packages. Choosing the right driver depends on the printer:<br />
<br />
* '''{{Pkg|gutenprint}}''' - A collection of high quality drivers for Canon, Epson, Lexmark, Sony, Olympus, and PCL printers for use with GhostScript, CUPS, Foomatic, and the [[GIMP]]<br />
* '''{{Pkg|foomatic-db}}, {{Pkg|foomatic-db-engine}}, {{Pkg|foomatic-db-nonfree}}, and {{Pkg|foomatic-filters}}''' - Foomatic is a database-driven system for integrating free software printer drivers with common spoolers under Unix. Installing foomatic-filters should solve problems if the cups error_log is reporting "stopped with status 22!".<br />
* '''{{Pkg|hplip}}''' - HP drivers for DeskJet, OfficeJet, Photosmart, Business Inkjet and some LaserJet printer models, as well as a number of Brother printers.<br />
* '''{{Pkg|splix}}''' - Samsung drivers for SPL (Samsung Printer Language) printers.<br />
<br />
* '''{{AUR|foo2zjs}}''' - Drivers for ZjStream protocol printers such as the HP Laserjet 1018. More info [http://foo2zjs.rkkda.com here]. Package is available in the [[AUR]].<br />
* '''{{AUR|hpoj}}''' - If you are using an HP Officejet, you should also install this package and follow the instructions to avoid problems as in [https://answers.launchpad.net/hplip/+question/133425 this thread]. Package is available in the [[AUR]].<br />
* '''{{AUR|samsung-unified-driver}}''' - Unified Linux Driver for Samsung printers and scanners. Required for new printers such as the ML-2160. Package is available in the [[AUR]].<br />
* '''{{AUR|ufr2}}''' or '''{{AUR|cndrvcups-lb}}''' - Canon UFR2 driver with support for LBP, iR and MF series printers. Package is available in the [[AUR]].<br />
<br />
* '''{{Pkg|cups-pdf}}''' - A package that allows one to setup a virtual PDF Printer that generates a PDF out of jobs sent to it<br />
<br />
If you are not sure of what driver package to install or if the current driver is not working, it may be easiest to just install all of the drivers. Some of the package names are misleading because printers of other makes may rely on them. For example, the Brother HL-2140 needs the hplip driver installed.<br />
<br />
==== Download printer PPD ====<br />
<br />
Depending on the printer, this step is optional and may not be needed, as the standard CUPS installation already comes with quite a few PPD (Postscript Printer Description) files. Moreover, the ''foomatic-filters'', ''gimp-print'' and ''hplip'' packages already include quite a few PPD files which will automatically be detected by CUPS.<br />
<br />
Here is an explanation of what a PPD file is from the Linux Printing website:<br />
:"''For every PostScript printer the manufacturers provide a PPD file which contains all printer-specific information about the particular printer model: Basic printer capabilities as whether the printer is a color printer, fonts, PostScript level, etc., and especially the user-adjustable options, as paper size, resolution, etc.''"<br />
<br />
If the PPD for the printer is ''not'' already in CUPS, then:<br />
*check [[AUR]] to see if there are packages for the printer/manufacturer<br />
*visit the [http://www.openprinting.org/printers OpenPrinting database] and select the manufacturer and model of the printer<br />
*visit the manufacturer's site and search for GNU/Linux drivers<br />
<br />
{{Note|PPD files go in {{ic|/usr/share/cups/model/}}}}<br />
<br />
==== Another source for printer drivers ====<br />
<br />
[http://www.turboprint.de/english.html Turboprint] is a proprietary driver for many printers not yet supported by GNU/Linux (Canon i*, for example). Unlike CUPS, however, high quality prints are either marked with a watermark or are a pay-only service.<br />
<br />
== Hardware support and configuration ==<br />
<br />
=== USB printers ===<br />
<br />
{{Tip|Most USB printers should work out of the box, you can skip this section and come back if you can not get your printer to work.}}<br />
<br />
USB printers can get accessed with two methods: The usblp kernel module and libusb. The former is the classic way. It is simple: data is sent to the printer by writing it to a device file as a simple serial data stream. Reading the same device file allows bi-di access, at least for things like reading out ink levels, status, or printer capability information (PJL). It works very well for simple printers, but for multi-function devices (printer/scanner) it is not suitable and manufacturers like HP supply their own backends. Source: [http://lists.linuxfoundation.org/pipermail/printing-architecture/2012/002412.html here].<br />
<br />
==== Blacklisting usblp ====<br />
<br />
{{Warning|As of {{Pkg|cups}} version 1.6.0, you no longer need to [[Kernel modules#Blacklisting|blacklist]] the {{ic|usblp}} kernel module.<br />
<br />
If you find out this is the only way to fix a remaining issue please report this upstream to the CUPS bug tracker and maybe also get in contact with Till Kamppeter (Debian CUPS maintainer). See [http://cups.org/str.php?L4128 upstream bug] for more.}}<br />
<br />
If you have problems getting your USB printer to work, you can try blacklisting the {{ic|usblp}} [[kernel module]]:<br />
<br />
{{hc|/etc/modprobe.d/blacklistusblp.conf|<br />
blacklist usblp<br />
}}<br />
<br />
Custom kernel users may need to manually load the {{ic|usbcore}} [[kernel module]] before proceeding.<br />
<br />
Once the modules are installed, plug in the printer and check if the kernel detected it by running the following:<br />
# tail /var/log/messages.log<br />
or<br />
# dmesg<br />
<br />
If you're using {{ic|usblp}}, the output should indicate that the printer has been detected like so:<br />
Feb 19 20:17:11 kernel: printer.c: usblp0: USB Bidirectional<br />
printer dev 2 if 0 alt 0 proto 2 vid 0x04E8 pid 0x300E<br />
Feb 19 20:17:11 kernel: usb.c: usblp driver claimed interface cfef3920<br />
Feb 19 20:17:11 kernel: printer.c: v0.13: USB Printer Device Class driver<br />
<br />
If you blacklisted {{ic|usblp}}, you will see something like:<br />
usb 3-2: new full speed USB device using uhci_hcd and address 3<br />
usb 3-2: configuration #1 chosen from 1 choice<br />
<br />
=== Parallel port printers ===<br />
<br />
To use a parallel port printer, you will need to load the {{ic|lp}}, {{ic|parport}} and {{ic|parport_pc}} [[kernel modules]].<br />
<br />
Check the setup by running:<br />
# tail /var/log/messages.log<br />
It should display something like this:<br />
lp0: using parport0 (polling).<br />
<br />
If you are using a USB to parallel port adapter, CUPS will not be able to detect the printer. As a workaround, add the printer using a different connection type and then change DeviceID in {{ic|/etc/cups/printers.conf}}:<br />
DeviceID = parallel:/dev/usb/lp0<br />
<br />
=== HP Printer ===<br />
<br />
HP printers can also be installed via HP's Linux setup tool. Install it by installing {{Pkg|hplip}} from the [[official repositories]].<br />
<br />
To run with qt frontend:<br />
# hp-setup -u<br />
<br />
To run with command line:<br />
# hp-setup -i<br />
<br />
PPD files are in {{ic|/usr/share/ppd/HP/}}.<br />
<br />
For printers that require the proprietary HP plugin (like the Laserjet Pro P1102w), install the {{AUR|hplip-plugin}} package from [[AUR]].<br />
<br />
== Configuring ==<br />
<br />
Now that CUPS is installed, there are a variety of options on how to set up printing solutions. As always, the tried and true command line method is at your disposal. CUPS also embeds a full-featured web interface. Likewise, various desktop environments such as GNOME and KDE have useful programs that can help manage printers. Depending on your needs, you may choose one method or the other.<br />
<br />
If you are planning on connecting to a network printer, rather than one that is directly connected to the computer, you might want to read the [[CUPS printer sharing]] page first. Printer sharing between GNU/Linux systems is quite easy and involves very little configuration, whereas sharing between a Windows and GNU/Linux host requires a little bit more effort.<br />
<br />
=== CUPS daemon ===<br />
<br />
With the kernel modules installed, you can now start the '''cups''' and optionally, the '''cups-browsed''' [[daemons]].<br />
<br />
=== Web interface and tool-kit ===<br />
<br />
Once the daemon is running, open a browser and go to: http://localhost:631 (''The '''localhost''' string may need to be replaced with the hostname found in'' {{ic|/etc/hostname}}).<br />
<br />
From here, follow the various wizards to add the printer. A usual procedure is to start by clicking on ''Adding Printers and Classes'' and then ''Add Printer''. When prompted for a username and password, log in as root. The name assigned to the printer does not matter, the same applies for 'location' and 'description'. Next, a list of devices to select from will be presented. The actual name of the printer shows up next to the label (e.g., next to ''USB Printer #1'' for USB printers). Finally, choose the appropriate drivers and the configuration is complete.<br />
<br />
Now test the configuration by pressing the ''Maintenance'' drop-down menu then ''Print Test Page''. If it does not print and there is certainty regarding the correctness of applied settings, then the problem is most likely due to missing a proper printer driver.<br />
<br />
{{Tip|See: [[#Alternative CUPS interfaces]] for other other front-ends.}}<br />
{{Note|<br />
* When setting up a USB printer, you should see your printer listed on ''Add Printer'' page. If you can only see a "SCSI printer" option, it probably means that CUPS has failed to recognize your printer.<br />
* To enable wireless scanning on certain HP multi-function devices using the {{pkg|hplip}} package, you may need to add the printer as a Network Printer using the HTTP protocol. To determine the proper URI to use, run the {{ic|hp-makeuri}} command.}}<br />
<br />
==== CUPS administration ====<br />
<br />
A username and password will be required when administering the printer in the web interface, such as: adding or removing printers, stopping print tasks, etc. The default username is the one assigned in the ''sys'' group, or root. Other admin groups (e.g. lpadmin or printadmin) may be added to the {{ic|SystemGroup}} line in {{ic|/etc/cups/cups-files.conf}} (you might have to add this line). See [http://www.cups.org/articles.php?L237+T+Qprintadmin these instructions at cups.org]. You might also want to read [https://bbs.archlinux.org/viewtopic.php?id=35567 this post]. Create the group[s] ({{ic|man groupadd}}) and add the group[s] to users ({{ic|man usermod}}). cupsd must be restarted and the user must re-login for these changes to take affect.<br />
<br />
If the root account has been locked (i.e. when using sudo), it is not possible to log in the CUPS administration interface with the default username (root) and password. Follow the instructions above to add other users as cups administrators.<br />
<br />
==== Remote access to web interface ====<br />
<br />
By default, the CUPS web interface can only be accessed by the ''localhost''; i.e. the computer that it is installed on. To remotely access the interface, make the following changes to the {{ic|/etc/cups/cupsd.conf}} file. Replace the line:<br />
Listen localhost:631<br />
with<br />
Port 631<br />
so that CUPS listens to incoming requests.<br />
<br />
Three levels of access can be granted:<br />
<Location /> #access to the server<br />
<Location /admin> #access to the admin pages<br />
<Location /admin/conf> #access to configuration files<br />
<br />
To give remote hosts access to one of these levels, add an {{ic|Allow}} statement to that level's section. An {{ic|Allow}} statement can take one or more of the forms listed below:<br />
Allow from all<br />
Allow from host.domain.com<br />
Allow from *.domain.com<br />
Allow from ip-address<br />
Allow from ip-address/netmask<br />
<br />
Deny statements can also be used. For example, if wanting to give all hosts on the 192.168.1.0/255.255.255.0 subnet full access, file {{ic|/etc/cups/cupsd.conf}} would include this:<br />
# Restrict access to the server...<br />
# By default only localhost connections are possible<br />
<Location /><br />
Order allow,deny<br />
Allow from localhost<br />
'''Allow from 192.168.1.0/255.255.255.0'''<br />
</Location><br />
<br />
# Restrict access to the admin pages...<br />
<Location /admin><br />
# Encryption disabled by default<br />
#Encryption Required<br />
Order allow,deny<br />
Allow from localhost<br />
'''Allow from 192.168.1.0/255.255.255.0'''<br />
</Location><br />
<br />
# Restrict access to configuration files...<br />
<Location /admin/conf><br />
AuthType Basic<br />
Require user @SYSTEM<br />
Order allow,deny<br />
Allow From localhost<br />
'''Allow From 192.168.1.0/255.255.255.0'''<br />
</Location><br />
<br />
You might also need to add:<br />
<br />
DefaultEncryption Never<br />
<br />
This should avoid the error: 426 - Upgrade Required when using the CUPS web interface from a remote machine.<br />
<br />
=== Command-line configuration ===<br />
<br />
CUPS can be fully controlled from command-line with nice tools, ''i.e.'' the lp* and the cups* command families.<br />
<br />
On Arch Linux, most commands support auto-completion with common shells.<br />
Also note that command-line switches cannot be grouped.<br />
<br />
;List the devices<br />
# lpinfo -v<br />
<br />
;List the drivers<br />
# lpinfo -m<br />
<br />
;Add a new printer<br />
# lpadmin -p ''printer'' -E -v ''device'' -P ''ppd''<br />
<br />
The ''printer'' is up to you. The device can be retrieved from the 'lpinfo -i' command.<br />
Example:<br />
# lpadmin -p HP_DESKJET_940C -E -v "usb://HP/DESKJET%20940C?serial=CN16E6C364BH" -P /usr/share/ppd/HP/hp-deskjet_940c.ppd.gz<br />
<br />
In the following, the ''printer'' references the name you have used here to set up the printer.<br />
<br />
;Set the default printer<br />
$ lpoptions -d ''printer''<br />
<br />
;Check the status<br />
$ lpstat -s<br />
$ lpstat -p ''printer''<br />
<br />
;Deactivate a printer<br />
# cupsdisable ''printer''<br />
<br />
;Activate a printer<br />
# cupsenable ''printer''<br />
<br />
;Remove a printer<br />
First set it to reject all incoming entries:<br />
# cupsreject ''printer''<br />
Then disable it.<br />
# cupsdisable ''printer''<br />
Finally remove it.<br />
# lpadmin -x ''printer''<br />
<br />
;Print a file<br />
$ lpr ''file''<br />
$ lpr -# 17 ''file'' # print the file 17 times<br />
$ echo "Hello, world!" | lpr -p # print the result of a command. The -p switch adds a header.<br />
<br />
;Check the printing queue<br />
$ lpq<br />
$ lpq -a # on all printers<br />
<br />
;Clear the printing queue<br />
# lprm # remove last entry only<br />
# lprm - # remove all entries<br />
<br />
=== Alternative CUPS interfaces ===<br />
<br />
==== GNOME ====<br />
<br />
If using [[GNOME]], a possibility is to manage and configure the printer by [[pacman|installing]] {{Pkg|system-config-printer}}.<br />
<br />
For system-config-printer to work as it should, running as root may be required, or alternatively set up a "normal" user to administer CUPS (if so '''follow steps 1-3''').<br />
<br />
1. Create group, and add a user to it<br />
# groupadd lpadmin<br />
# usermod -aG lpadmin ''username''<br />
<br />
2. Add {{ic|lpadmin}} to this line in {{ic|/etc/cups/cups-files.conf}}<br />
SystemGroup sys root ''insert here''<br />
<br />
3. Restart cups, log out and in again (or restart computer)<br />
<br />
==== KDE ====<br />
<br />
[[KDE]] users can modify their printers from the Control Center. Both should refer to those desktop environments' documentation for more information on how to use the interfaces.<br />
<br />
==== Other ====<br />
<br />
There is also {{AUR|gtklp}} in the [[AUR]].<br />
<br />
== PDF virtual printer ==<br />
<br />
{{Pkg|cups-pdf}} is a nice package that allows one to setup a virtual printer that will generate a PDF from anything sent to it. This package is not necessary, but it can be quite useful.<br />
<br />
After installing the package, set it up as if it were for any other printer by using the web interface. Access the cups print manager: http://localhost:631 and select:<br />
Administration -> Add Printer<br />
Select CUPS-PDF (Virtual PDF), choose for the make and driver:<br />
Make: Generic<br />
Driver: Generic CUPS-PDF Printer<br />
<br />
Find generated PDF documents in a sub-directory located at {{ic|/var/spool/cups-pdf}}. Normally, the subdirectory is named after the user who performed the job. A little tweak helps you to find your printed PDF documents more easily. Edit {{ic|/etc/cups/cups-pdf.conf}} by changing the line<br />
#Out /var/spool/cups-pdf/${USER}<br />
<br />
to<br />
<br />
Out ${HOME}<br />
<br />
=== Print to PostScript ===<br />
<br />
The CUPS-PDF (Virtual PDF Printer) actually creates a PostScript file and then creates the PDF using the ps2pdf utility. To print to PostScript, just print as usual, in the print dialog choose "CUPS-PDF" as the printer, then select the checkbox for "print to file", hit print, enter the filename.ps and click save. This is handy for faxes, etc...<br />
<br />
== Troubleshooting ==<br />
<br />
The best way to get printing working is to set 'LogLevel' in {{ic|/etc/cups/cupsd.conf}} to:<br />
LogLevel debug<br />
<br />
And then viewing the output from {{ic|/var/log/cups/error_log}} like this:<br />
# tail -n 100 -f /var/log/cups/error_log<br />
<br />
The characters at the left of the output stand for:<br />
*D=Debug<br />
*E=Error<br />
*I=Information<br />
*And so on<br />
<br />
These files may also prove useful:<br />
*{{ic|/var/log/cups/page_log}} - Echoes a new entry each time a print is successful<br />
*{{ic|/var/log/cups/access_log}} - Lists all cupsd http1.1 server activity<br />
<br />
Of course, it is important to know how CUPS works if wanting to solve related issues:<br />
# An application sends a .ps file (PostScript, a script language that details how the page will look) to CUPS when 'print' has been selected (this is the case with most programs).<br />
# CUPS then looks at the printer's PPD file (printer description file) and figures out what filters it needs to use to convert the .ps file to a language that the printer understands (like PJL, PCL), usually GhostScript.<br />
# GhostScript takes the input and figures out which filters it should use, then applies them and converts the .ps file to a format understood by the printer.<br />
# Then it is sent to the back-end. For example, if the printer is connected to a USB port, it uses the USB back-end.<br />
<br />
Print a document and watch {{ic|error_log}} to get a more detailed and correct image of the printing process.<br />
<br />
=== Problems resulting from upgrades ===<br />
<br />
''Issues that appeared after CUPS and related program packages underwent a version increment''<br />
<br />
==== CUPS stops working ====<br />
<br />
The chances are that a new configuration file is needed for the new version to work properly. Messages such as "404 - page not found" may result from trying to manage CUPS via localhost:631, for example.<br />
<br />
To use the new configuration, copy {{ic|/etc/cups/cupsd.conf.default}} to {{ic|/etc/cups/cupsd.conf}} (backup the old configuration if needed) and restart CUPS to employ the new settings.<br />
<br />
==== All jobs are "stopped" ====<br />
<br />
If all jobs sent to the printer become "stopped", delete the printer and add it again.<br />
Using the [http://localhost:631 CUPS web interface], go to Printers > Delete Printer.<br />
<br />
To check the printer's settings go to ''Printers'', then ''Modify Printer''. Copy down the information displayed, click 'Modify Printer' to proceed to the next page(s), and so on.<br />
<br />
==== All jobs are "The printer is not responding" ====<br />
<br />
On networked printers, you should check that the name that CUPS uses as its connection URI resolves to the printer's IP via DNS, e.g.<br />
If your printer's connection looks like this:<br />
lpd://BRN_020554/BINARY_P1<br />
<br />
then the hostname 'BRN_020554' needs to resolve to the printer's IP from the server running CUPS<br />
<br />
==== The PPD version is not compatible with gutenprint ====<br />
<br />
Run:<br />
# /usr/bin/cups-genppdupdate<br />
<br />
And restart CUPS (as pointed out in gutenprint's post-install message)<br />
<br />
=== Other ===<br />
<br />
===== CUPS permission errors =====<br />
<br />
* Some users fixed 'NT_STATUS_ACCESS_DENIED' (Windows clients) errors by using a slightly different syntax:<br />
smb://workgroup/username:password@hostname/printer_name<br />
<br />
* Sometimes, the block device has wrong permissions:<br />
# ls /dev/usb/<br />
lp0<br />
# chgrp lp /dev/usb/lp0<br />
<br />
==== HPLIP printer sends "/usr/lib/cups/backend/hp failed" error ====<br />
<br />
Make sure dbus is installed and running. If the error persists, try starting avahi-daemon.<br />
<br />
Try adding the printer as a Network Printer using the http:// protocol. Generate the printer URI with {{ic|hp-makeuri}}.<br />
<br />
{{Note|There might need to set permissions issues right. Follow indications here: [[CUPS#Device node permissions]].}}<br />
<br />
==== HPLIP printer claims job is complete but printer does nothing ====<br />
<br />
This happens on HP printers when you select the (old) hpijs driver (e.g. the Deskjet D1600 series). Instead, use the hpcups driver when adding the printer.<br />
<br />
Some HP printers (e.g HP LaserJet) require their firmware to be downloaded from the computer every time the printer is switched on. If there is an issue with udev (or equivalent) and the firmware download rule is never fired, you may experience this issue.<br />
As a workaround, you can manually download the firmware to the printer. Ensure the printer is plugged in and switched on, then enter<br />
hp-firmware -n<br />
<br />
==== hp-setup asks to specify the PPD file for the discovered printer ====<br />
<br />
Install CUPS before running hp-setup.<br />
<br />
==== I have installed Qt, but hp-setup reports "Qt/PyQt 4 initialization failed" ====<br />
<br />
"hp-check -t" won't give you useful information to find the required package. You have to install all the "Dependent Packages" prefixed with "python2" in https://www.archlinux.org/packages/extra/x86_64/hplip/<br />
<br />
==== hp-setup finds the printer automatically but reports "Unable to communicate with device" when printing test page immediately afterwards ====<br />
<br />
This at least happens to hplip 3.13.5-2 for HP Officejet 6500A through local network connection. To solve the problem, specify the IP address of the HP printer for hp-setup to locate the printer.<br />
<br />
==== hp-toolbox sends an error, "Unable to communicate with device" ====<br />
<br />
If running hp-toolbox as a regular user results in:<br />
# hp-toolbox<br />
# error: Unable to communicate with device (code=12): hp:/usb/''printer id''<br />
or, "{{ic|Unable to communicate with device"}}", then it may be needed to [[Groups#Group management|add the user to the lp and sys groups]].<br />
<br />
This can also be caused by printers such as the P1102 that provide a virtual cd-rom drive for MS-Windows drivers. The lp dev appears and then disappears. In that case try the '''usb-modeswitch''' and '''usb-modeswitch-data''' packages, that lets one switch off the "Smart Drive" (udev rules included in said packages).<br />
<br />
This can also occur with network attached printers if the [[Avahi|avahi-daemon]] is not running. Another possiblility is the specification of the printer's IP address in hp-setup fails to locate the printer because the IP address of the the printer changed due to DHCP.<br />
<br />
==== CUPS returns '"foomatic-rip" not available/stopped with status 3' with a HP printer ====<br />
<br />
If receiving any of the following error messages in {{ic|/var/log/cups/error_log}} while using a HP printer, with jobs appearing to be processed while they all end up not being completed with their status set to 'stopped':<br />
Filter "foomatic-rip" for printer ''printer_name'' not available: No such file or director<br />
or:<br />
PID 5771 (/usr/lib/cups/filter/foomatic-rip) stopped with status 3!<br />
make sure {{pkg|hplip}} has been [[pacman|installed]], in addition to [[#Packages|the packages mentioned above]]. See [https://bbs.archlinux.org/viewtopic.php?id=65615 this forum post] for more information.<br />
<br />
==== Printing fails with unauthorised error ====<br />
<br />
If the user has been added to the lp group, and allowed to print (set in {{ic|cupsd.conf}}), then the problem lies in {{ic|/etc/cups/printers.conf}}. This line could be the culprit:<br />
AuthInfoRequired negotiate<br />
<br />
Comment it out and restart CUPS.<br />
<br />
==== Print button greyed-out in GNOME print dialogs ====<br />
<br />
:''<small>Source: [https://bbs.archlinux.org/viewtopic.php?id=70418 I can't print from gnome applications. - Arch Forums]</small>''<br />
<br />
Be sure the package: '''libgnomeprint''' is installed<br />
<br />
Edit {{ic|/etc/cups/cupsd.conf}} and add:<br />
# HostNameLookups Double<br />
<br />
Restart cups.service.<br />
<br />
==== Unknown supported format: application/postscript ====<br />
<br />
Comment the lines:<br />
application/octet-stream application/vnd.cups-raw 0 -<br />
from {{ic|/etc/cups/mime.convs}}, and:<br />
application/octet-stream<br />
in {{ic|/etc/cups/mime.types}}.<br />
<br />
==== Finding URIs for Windows print servers ====<br />
<br />
Sometimes Windows is a little less than forthcoming about exact device URIs (device locations). If having trouble specifying the correct device location in CUPS, run the following command to list all shares available to a certain windows username:<br />
$ smbtree -U ''windowsusername''<br />
This will list every share available to a certain Windows username on the local area network subnet, as long as Samba is set up and running properly. It should return something like this:<br />
{{bc| WORKGROUP<br />
\\REGULATOR-PC <br />
\\REGULATOR-PC\Z <br />
\\REGULATOR-PC\Public <br />
\\REGULATOR-PC\print$ Printer Drivers<br />
\\REGULATOR-PC\G <br />
\\REGULATOR-PC\EPSON Stylus CX8400 Series EPSON Stylus CX8400 Series}}<br />
What is needed here is first part of the last line, the resource matching the printer description. So to print to the EPSON Stylus printer, one would enter:<br />
smb://username.password@REGULATOR-PC/EPSON Stylus CX8400 Series<br />
as the URI into CUPS. Notice that whitespaces are allowed in URIs, whereas backslashes get replaced with forward slashes.<br />
If it won't work try '%20' instead of spaces.<br />
<br />
==== Print-Job client-error-document-format-not-supported ====<br />
<br />
Try installing the foomatic packages and use a foomatic driver.<br />
<br />
==== /usr/lib/cups/backend/hp failed ====<br />
<br />
Change:<br />
SystemGroup sys root<br />
to:<br />
SystemGroup lp root<br />
in {{ic|/etc/cups/cupsd.conf}}<br />
<br />
<br />
Following steps 1-3 in the Alternative CUPS interfaces below may be a better solution, since newer versions of cups will not allow the same group for both normal and admin operation.<br />
<br />
==== Unable to get list of printer drivers ====<br />
<br />
* Check your ServerName in /etc/cups/client.conf is written without http://<br />
ServerName localhost:631<br />
* Try to remove Foomatic drivers.<br />
<br />
==== lp: Error - Scheduler Not Responding ====<br />
<br />
If you get this error when printing a document using:<br />
<br />
$ lp document-to-print<br />
<br />
Try setting the CUPS_SERVER environment variable:<br />
<br />
$ export CUPS_SERVER=localhost<br />
<br />
If this solves your problem, make the solution permanent by adding the export line above to ~/.bash_profile.<br />
<br />
==== CUPS prints only an empty and an error-message page on HP LaserJet ====<br />
<br />
There is a bug that causes CUPS to fail when printing images on HP LaserJet (in my case 3380). The bug has been reported and fixed by [https://bugs.launchpad.net/ubuntu/+source/cups-filters/+bug/998087 Ubuntu].<br />
The first page is empty, the second page contains the following error message:<br />
ERROR:<br />
invalidaccess<br />
OFFENDING COMMAND:<br />
filter<br />
STACK:<br />
/SubFileDecode<br />
endstream<br />
...<br />
<br />
In order to fix the issue, use the following command (as superuser):<br />
lpadmin -p ''printer'' -o pdftops-renderer-default=pdftops<br />
<br />
==== "Using invalid Host" error message ====<br />
<br />
Try to add "ServerAlias *" into cupsd.conf<br />
<br />
==== Printer doesn't print with an "Filter failed" message on CUPS web interface (HP printer) ====<br />
<br />
Change the permissions of the printer USB port:<br />
<br />
Get the bus and device number from lsusb, then set the permission using:<br />
<br />
chmod 0666 /dev/bus/usb/''bus number''/''device number''<br />
<br />
To make the persistent permission change that will be triggered automatically each time the computer is rebooted, add the following line.<br />
<br />
{{hc|/etc/udev/rules.d/10-local.rules|2=<br />
SUBSYSTEM=="usb", ATTRS{idVendor}=="Printer_idVendor", ATTRS{idProduct}=="Printer_idProduct", GROUP="lp", MODE:="666"<br />
}}<br />
<br />
Obtain the right information by using {{ic|lsusb}} command, and don't forget to substitute {{ic|Printer_idVendor}} & {{ic|Printer_idProduct}} with the relevant ones.<br />
<br />
Each system may vary, so consult [[udev#List_attributes_of_a_device]] wiki page.<br />
<br />
==== Printer doesn't print with an "Filter failed" message on CUPS web interface (HP printer connected over network) ====<br />
<br />
Start, enable and restart the avahi-daemon.<br />
<br />
==== HPLIP 3.13: Plugin is installed, but HP Device Manager complains it is not ====<br />
<br />
The issue might have to do with the file permission change that had been made to {{ic|/var/lib/hp/hplip.state}}. To correct the issue, a simple {{ic|chmod 644 /var/lib/hp/hplip.state}} and {{ic|chmod 755 /var/lib/hp}} should be sufficient. For further information, please read this [https://bugs.launchpad.net/hplip/+bug/1131596 link].<br />
<br />
==== Printer is not recognized by CUPS ====<br />
<br />
If your printer is not listed in the "Add Printers" page of the CUPS web interface, nor by lpinfo -v, try the following (suggested in [https://bbs.archlinux.org/viewtopic.php?pid=1037279#p1037279 this thread]):<br />
<br />
* Remove {{ic|usblp}} from blacklist<br />
* Load {{ic|usblp}} module<br />
modprobe usblp<br />
* Stop cups<br />
* Add the following udev rule in a new rule file:<br />
{{hc|/etc/udev/rules.d/10-cups_device_link.rules|2=<br />
KERNEL=="lp[0-9]", SYMLINK+="%k", GROUP="lp"<br />
}}<br />
* Reload udev rules:<br />
# udevadm control --reload-rules<br />
* Unplug and re-plug the printer.<br />
* Wait a few seconds and then start cups again.<br />
<br />
==== Can't load /etc/samba/smb.conf ====<br />
<br />
If you're printing to a remote printer over SMB and get this error message: "Can't load /etc/samba/smb.conf - run testparm to debug it", then create an empty smb.conf:<br />
<br />
# mkdir /etc/samba<br />
# touch /etc/samba/smb.conf<br />
<br />
and restart cupsd.<br />
<br />
==== CUPS' systemd service does not start even though it's enabled ====<br />
<br />
The systemd .service file provided by CUPS uses socket activation, meaning the service is only started when an<br />
application connects to CUPS' socket. However, the systemd .socket file provided by cups only works for the local <br />
{{ic|/var/run/cups/cups.sock}} socket. <br />
<br />
In order to have cupsd start when initiating a print job over the network, create the following file:<br />
<br />
{{hc|/etc/systemd/system/cups.socket|<br />
.include /usr/lib/systemd/system/cups.socket<br />
<br />
[Socket]<br />
ListenStream&#61;0.0.0.0:631<br />
ListenDatagram&#61;0.0.0.0:631<br />
BindIPv6Only&#61;ipv6-only<br />
}}<br />
<br />
Then reload systemd:<br />
<br />
# systemctl --system daemon-reload<br />
<br />
Confirm that everything is working correctly:<br />
<br />
{{bc|<br />
# systemctl is-enabled cups.service &#124;&#124; systemctl enable cups.service<br />
# systemctl status cups.socket<br />
cups.socket - CUPS Printing Service Sockets<br />
Loaded: loaded (/etc/systemd/system/cups.socket; enabled)<br />
Active: inactive (dead)<br />
Listen: /var/run/cups/cups.sock (Stream)<br />
0.0.0.0:631 (Stream)<br />
0.0.0.0:631 (Datagram)<br />
}}<br />
<br />
CUPS should now start automatically when printing locally or over the network.<br />
<br />
== See also ==<br />
<br />
* [http://localhost:631/documentation.html Official CUPS documentation], ''locally installed''<br />
* [http://www.cups.org/ Official CUPS website]<br />
* [http://www.linuxprinting.org/ Linux Printing], ''[http://www.linuxfoundation.org The Linux Foundation]''<br />
* [http://www.gentoo.org/doc/en/printing-howto.xml Gentoo's printing guide], ''[http://www.gentoo.org/doc/en Gentoo Documentation resources]''<br />
* [https://bbs.archlinux.org/ Arch Linux user forums]<br />
* [http://wiki.gotux.net/tutorials/software/hp-printer Install HP printers easy way]</div>Ddreamerhttps://wiki.archlinux.org/index.php?title=CUPS&diff=264376CUPS2013-06-26T18:36:14Z<p>Ddreamer: /* Other */</p>
<hr />
<div>[[Category:Printers]]<br />
[[cs:CUPS]]<br />
[[es:CUPS]]<br />
[[fr:CUPS]]<br />
[[it:CUPS]]<br />
[[pl:CUPS]]<br />
[[ru:CUPS]]<br />
[[th:CUPS]]<br />
[[tr:CUPS]]<br />
[[zh-CN:CUPS]]<br />
[[zh-TW:CUPS]]<br />
{{Article summary start|Summary}}<br />
{{Article summary text|Installing and configuring CUPS}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|CUPS printer sharing}}<br />
{{Article summary wiki|CUPS printer-specific problems}}<br />
{{Article summary wiki|Samba}}<br />
{{Article summary end}}<br />
<br />
From [http://www.cups.org/index.php CUPS' site]:<br />
:"''[[Wikipedia:CUPS|CUPS]] is the standards-based, open source printing system developed by Apple Inc. for OS® X and other UNIX®-like operating systems''".<br />
<br />
Although there are other printing packages such as LPRNG, the Common Unix Printing System is the most popular choice because of its relative ease of use.<br />
<br />
== CUPS Linux printing workflow ==<br />
As of {{Pkg|cups}} version 1.5.3-3, Arch Linux makes use of the new full pdf-based printing workflow. For<br />
further reading check [http://www.linuxfoundation.org/collaborate/workgroups/openprinting/pdfasstandardprintjobformat PDF standard printing job format] and an old [https://wiki.linuxfoundation.org/en/OpenPrinting/Database/CUPS-Filter-Chart CUPS filtering chart] for history and fun.<br />
A good starting point for general Linux printing questions is [http://www.linuxfoundation.org/collaborate/workgroups/openprinting here].<br />
<br />
There are two ways to setup a printer.<br />
* If there's a CUPS server running in your network and sharing a printer you only need to install the client package.<br />
* If the printer is connected directly to your system or you have access to an IPP network printer then setup a local CUPS server.<br />
<br />
== Installing the client package ==<br />
<br />
The package {{Pkg|libcups}} is the only required package. [[pacman|Install]] it from the [[official repositories]].<br />
<br />
Then add your CUPS server's IP address or hostname into {{ic|/etc/cups/client.conf}}. That is all you need. Every application should quickly find the printer(s) shared by that CUPS server.<br />
<br />
=== Optional advanced network setup ===<br />
<br />
It is also possible to run a entire cupsd+cups-browsed instance on your client with Avahi browsing enabled to discover unknown shared printers in your network. This can be useful in large setups where the server is unknown.<br />
{{Note|This behavior did not change with cups 1.6.x - the difference is that until 1.5.x cupsd was able to do printer browsing alone and now it can only browse its own shared printers.<br />
To get the local cupsd recognise other shared printers offered by a remote cupsd server you need a running local cups-browserd (supported since cups-filters 1.0.26) instance using Avahi to discover unknown printers. <br />
There is [https://bbs.archlinux.org/viewtopic.php?id&#61;161440 good news] in April 2013 (still has to be incorporated above).}}<br />
<br />
=== Installing CUPS a 32 bit chroot environment ===<br />
<br />
If you have a 64 bit base installation with a [[Install_bundled_32-bit_system_in_Arch64|32 bit chroot environment]], explicit installation of CUPS is not necessary in the 32 bit environment. To access installed CUPS printers from the chroot environment, one needs to bind the {{ic|/var/run/cups}} directory to the same relative location in the chroot environment. Simply create the directory in the chroot (it probably doesn't exist), mount (with {{ic|-o bind}} passed to the command}}, and printers should be available from 32 bit chroot applications immediately.<br />
<br />
{{bc|# mkdir /path/to/chroot/var/run/cups<br />
# Example: # mkdir /opt/arch32/var/run/cups<br />
<br />
# mount -o bind /var/run/cups /path/to/chroot/var/run/cups}}<br />
<br />
== Installing the server packages ==<br />
<br />
The following packages and some printer drivers are needed. [[pacman|Install]] them from the [[official repositories]].<br />
<br />
* {{Pkg|cups}} - the actual CUPS daemon<br />
* {{Pkg|cups-filters}} - essential filters<br />
* {{Pkg|ghostscript}} - (optional) PostScript interpreter<br />
* {{Pkg|gsfonts}} - GhostScript standard Type1 fonts<br />
<br />
If you want to enable printer browsing through your network, also install {{Pkg|avahi}}. Make sure '''avahi-daemon''' is started before '''cupsd'''.<br />
<br />
If the system is connected to a networked printer using the [[Samba]] protocol or if the system is to be a print server for Windows clients, also install {{Pkg|samba}}.<br />
<br />
=== Printer driver ===<br />
<br />
Here are some of the driver packages. Choosing the right driver depends on the printer:<br />
<br />
* '''{{Pkg|gutenprint}}''' - A collection of high quality drivers for Canon, Epson, Lexmark, Sony, Olympus, and PCL printers for use with GhostScript, CUPS, Foomatic, and the [[GIMP]]<br />
* '''{{Pkg|foomatic-db}}, {{Pkg|foomatic-db-engine}}, {{Pkg|foomatic-db-nonfree}}, and {{Pkg|foomatic-filters}}''' - Foomatic is a database-driven system for integrating free software printer drivers with common spoolers under Unix. Installing foomatic-filters should solve problems if the cups error_log is reporting "stopped with status 22!".<br />
* '''{{Pkg|hplip}}''' - HP drivers for DeskJet, OfficeJet, Photosmart, Business Inkjet and some LaserJet printer models, as well as a number of Brother printers.<br />
* '''{{Pkg|splix}}''' - Samsung drivers for SPL (Samsung Printer Language) printers.<br />
<br />
* '''{{AUR|foo2zjs}}''' - Drivers for ZjStream protocol printers such as the HP Laserjet 1018. More info [http://foo2zjs.rkkda.com here]. Package is available in the [[AUR]].<br />
* '''{{AUR|hpoj}}''' - If you are using an HP Officejet, you should also install this package and follow the instructions to avoid problems as in [https://answers.launchpad.net/hplip/+question/133425 this thread]. Package is available in the [[AUR]].<br />
* '''{{AUR|samsung-unified-driver}}''' - Unified Linux Driver for Samsung printers and scanners. Required for new printers such as the ML-2160. Package is available in the [[AUR]].<br />
* '''{{AUR|ufr2}}''' or '''{{AUR|cndrvcups-lb}}''' - Canon UFR2 driver with support for LBP, iR and MF series printers. Package is available in the [[AUR]].<br />
<br />
* '''{{Pkg|cups-pdf}}''' - A package that allows one to setup a virtual PDF Printer that generates a PDF out of jobs sent to it<br />
<br />
If you are not sure of what driver package to install or if the current driver is not working, it may be easiest to just install all of the drivers. Some of the package names are misleading because printers of other makes may rely on them. For example, the Brother HL-2140 needs the hplip driver installed.<br />
<br />
==== Download printer PPD ====<br />
<br />
Depending on the printer, this step is optional and may not be needed, as the standard CUPS installation already comes with quite a few PPD (Postscript Printer Description) files. Moreover, the ''foomatic-filters'', ''gimp-print'' and ''hplip'' packages already include quite a few PPD files which will automatically be detected by CUPS.<br />
<br />
Here is an explanation of what a PPD file is from the Linux Printing website:<br />
:"''For every PostScript printer the manufacturers provide a PPD file which contains all printer-specific information about the particular printer model: Basic printer capabilities as whether the printer is a color printer, fonts, PostScript level, etc., and especially the user-adjustable options, as paper size, resolution, etc.''"<br />
<br />
If the PPD for the printer is ''not'' already in CUPS, then:<br />
*check [[AUR]] to see if there are packages for the printer/manufacturer<br />
*visit the [http://www.openprinting.org/printers OpenPrinting database] and select the manufacturer and model of the printer<br />
*visit the manufacturer's site and search for GNU/Linux drivers<br />
<br />
{{Note|PPD files go in {{ic|/usr/share/cups/model/}}}}<br />
<br />
==== Another source for printer drivers ====<br />
<br />
[http://www.turboprint.de/english.html Turboprint] is a proprietary driver for many printers not yet supported by GNU/Linux (Canon i*, for example). Unlike CUPS, however, high quality prints are either marked with a watermark or are a pay-only service.<br />
<br />
== Hardware support and configuration ==<br />
<br />
=== USB printers ===<br />
<br />
{{Tip|Most USB printers should work out of the box, you can skip this section and come back if you can not get your printer to work.}}<br />
<br />
USB printers can get accessed with two methods: The usblp kernel module and libusb. The former is the classic way. It is simple: data is sent to the printer by writing it to a device file as a simple serial data stream. Reading the same device file allows bi-di access, at least for things like reading out ink levels, status, or printer capability information (PJL). It works very well for simple printers, but for multi-function devices (printer/scanner) it is not suitable and manufacturers like HP supply their own backends. Source: [http://lists.linuxfoundation.org/pipermail/printing-architecture/2012/002412.html here].<br />
<br />
==== Blacklisting usblp ====<br />
<br />
{{Warning|As of {{Pkg|cups}} version 1.6.0, you no longer need to [[Kernel modules#Blacklisting|blacklist]] the {{ic|usblp}} kernel module.<br />
<br />
If you find out this is the only way to fix a remaining issue please report this upstream to the CUPS bug tracker and maybe also get in contact with Till Kamppeter (Debian CUPS maintainer). See [http://cups.org/str.php?L4128 upstream bug] for more.}}<br />
<br />
If you have problems getting your USB printer to work, you can try blacklisting the {{ic|usblp}} [[kernel module]]:<br />
<br />
{{hc|/etc/modprobe.d/blacklistusblp.conf|<br />
blacklist usblp<br />
}}<br />
<br />
Custom kernel users may need to manually load the {{ic|usbcore}} [[kernel module]] before proceeding.<br />
<br />
Once the modules are installed, plug in the printer and check if the kernel detected it by running the following:<br />
# tail /var/log/messages.log<br />
or<br />
# dmesg<br />
<br />
If you're using {{ic|usblp}}, the output should indicate that the printer has been detected like so:<br />
Feb 19 20:17:11 kernel: printer.c: usblp0: USB Bidirectional<br />
printer dev 2 if 0 alt 0 proto 2 vid 0x04E8 pid 0x300E<br />
Feb 19 20:17:11 kernel: usb.c: usblp driver claimed interface cfef3920<br />
Feb 19 20:17:11 kernel: printer.c: v0.13: USB Printer Device Class driver<br />
<br />
If you blacklisted {{ic|usblp}}, you will see something like:<br />
usb 3-2: new full speed USB device using uhci_hcd and address 3<br />
usb 3-2: configuration #1 chosen from 1 choice<br />
<br />
=== Parallel port printers ===<br />
<br />
To use a parallel port printer, you will need to load the {{ic|lp}}, {{ic|parport}} and {{ic|parport_pc}} [[kernel modules]].<br />
<br />
Check the setup by running:<br />
# tail /var/log/messages.log<br />
It should display something like this:<br />
lp0: using parport0 (polling).<br />
<br />
If you are using a USB to parallel port adapter, CUPS will not be able to detect the printer. As a workaround, add the printer using a different connection type and then change DeviceID in {{ic|/etc/cups/printers.conf}}:<br />
DeviceID = parallel:/dev/usb/lp0<br />
<br />
=== HP Printer ===<br />
<br />
HP printers can also be installed via HP's Linux setup tool. Install it by installing {{Pkg|hplip}} from the [[official repositories]].<br />
<br />
To run with qt frontend:<br />
# hp-setup -u<br />
<br />
To run with command line:<br />
# hp-setup -i<br />
<br />
PPD files are in {{ic|/usr/share/ppd/HP/}}.<br />
<br />
For printers that require the proprietary HP plugin (like the Laserjet Pro P1102w), install the {{AUR|hplip-plugin}} package from [[AUR]].<br />
<br />
== Configuring ==<br />
<br />
Now that CUPS is installed, there are a variety of options on how to set up printing solutions. As always, the tried and true command line method is at your disposal. CUPS also embeds a full-featured web interface. Likewise, various desktop environments such as GNOME and KDE have useful programs that can help manage printers. Depending on your needs, you may choose one method or the other.<br />
<br />
If you are planning on connecting to a network printer, rather than one that is directly connected to the computer, you might want to read the [[CUPS printer sharing]] page first. Printer sharing between GNU/Linux systems is quite easy and involves very little configuration, whereas sharing between a Windows and GNU/Linux host requires a little bit more effort.<br />
<br />
=== CUPS daemon ===<br />
<br />
With the kernel modules installed, you can now start the '''cups''' and optionally, the '''cups-browsed''' [[daemons]].<br />
<br />
=== Web interface and tool-kit ===<br />
<br />
Once the daemon is running, open a browser and go to: http://localhost:631 (''The '''localhost''' string may need to be replaced with the hostname found in'' {{ic|/etc/hostname}}).<br />
<br />
From here, follow the various wizards to add the printer. A usual procedure is to start by clicking on ''Adding Printers and Classes'' and then ''Add Printer''. When prompted for a username and password, log in as root. The name assigned to the printer does not matter, the same applies for 'location' and 'description'. Next, a list of devices to select from will be presented. The actual name of the printer shows up next to the label (e.g., next to ''USB Printer #1'' for USB printers). Finally, choose the appropriate drivers and the configuration is complete.<br />
<br />
Now test the configuration by pressing the ''Maintenance'' drop-down menu then ''Print Test Page''. If it does not print and there is certainty regarding the correctness of applied settings, then the problem is most likely due to missing a proper printer driver.<br />
<br />
{{Tip|See: [[#Alternative CUPS interfaces]] for other other front-ends.}}<br />
{{Note|<br />
* When setting up a USB printer, you should see your printer listed on ''Add Printer'' page. If you can only see a "SCSI printer" option, it probably means that CUPS has failed to recognize your printer.<br />
* To enable wireless scanning on certain HP multi-function devices using the {{pkg|hplip}} package, you may need to add the printer as a Network Printer using the HTTP protocol. To determine the proper URI to use, run the {{ic|hp-makeuri}} command.}}<br />
<br />
==== CUPS administration ====<br />
<br />
A username and password will be required when administering the printer in the web interface, such as: adding or removing printers, stopping print tasks, etc. The default username is the one assigned in the ''sys'' group, or root. Other admin groups (e.g. lpadmin or printadmin) may be added to the {{ic|SystemGroup}} line in {{ic|/etc/cups/cups-files.conf}} (you might have to add this line). See [http://www.cups.org/articles.php?L237+T+Qprintadmin these instructions at cups.org]. You might also want to read [https://bbs.archlinux.org/viewtopic.php?id=35567 this post]. Create the group[s] ({{ic|man groupadd}}) and add the group[s] to users ({{ic|man usermod}}). cupsd must be restarted and the user must re-login for these changes to take affect.<br />
<br />
If the root account has been locked (i.e. when using sudo), it is not possible to log in the CUPS administration interface with the default username (root) and password. Follow the instructions above to add other users as cups administrators.<br />
<br />
==== Remote access to web interface ====<br />
<br />
By default, the CUPS web interface can only be accessed by the ''localhost''; i.e. the computer that it is installed on. To remotely access the interface, make the following changes to the {{ic|/etc/cups/cupsd.conf}} file. Replace the line:<br />
Listen localhost:631<br />
with<br />
Port 631<br />
so that CUPS listens to incoming requests.<br />
<br />
Three levels of access can be granted:<br />
<Location /> #access to the server<br />
<Location /admin> #access to the admin pages<br />
<Location /admin/conf> #access to configuration files<br />
<br />
To give remote hosts access to one of these levels, add an {{ic|Allow}} statement to that level's section. An {{ic|Allow}} statement can take one or more of the forms listed below:<br />
Allow from all<br />
Allow from host.domain.com<br />
Allow from *.domain.com<br />
Allow from ip-address<br />
Allow from ip-address/netmask<br />
<br />
Deny statements can also be used. For example, if wanting to give all hosts on the 192.168.1.0/255.255.255.0 subnet full access, file {{ic|/etc/cups/cupsd.conf}} would include this:<br />
# Restrict access to the server...<br />
# By default only localhost connections are possible<br />
<Location /><br />
Order allow,deny<br />
Allow from localhost<br />
'''Allow from 192.168.1.0/255.255.255.0'''<br />
</Location><br />
<br />
# Restrict access to the admin pages...<br />
<Location /admin><br />
# Encryption disabled by default<br />
#Encryption Required<br />
Order allow,deny<br />
Allow from localhost<br />
'''Allow from 192.168.1.0/255.255.255.0'''<br />
</Location><br />
<br />
# Restrict access to configuration files...<br />
<Location /admin/conf><br />
AuthType Basic<br />
Require user @SYSTEM<br />
Order allow,deny<br />
Allow From localhost<br />
'''Allow From 192.168.1.0/255.255.255.0'''<br />
</Location><br />
<br />
You might also need to add:<br />
<br />
DefaultEncryption Never<br />
<br />
This should avoid the error: 426 - Upgrade Required when using the CUPS web interface from a remote machine.<br />
<br />
=== Command-line configuration ===<br />
<br />
CUPS can be fully controlled from command-line with nice tools, ''i.e.'' the lp* and the cups* command families.<br />
<br />
On Arch Linux, most commands support auto-completion with common shells.<br />
Also note that command-line switches cannot be grouped.<br />
<br />
;List the devices<br />
# lpinfo -v<br />
<br />
;List the drivers<br />
# lpinfo -m<br />
<br />
;Add a new printer<br />
# lpadmin -p ''printer'' -E -v ''device'' -P ''ppd''<br />
<br />
The ''printer'' is up to you. The device can be retrieved from the 'lpinfo -i' command.<br />
Example:<br />
# lpadmin -p HP_DESKJET_940C -E -v "usb://HP/DESKJET%20940C?serial=CN16E6C364BH" -P /usr/share/ppd/HP/hp-deskjet_940c.ppd.gz<br />
<br />
In the following, the ''printer'' references the name you have used here to set up the printer.<br />
<br />
;Set the default printer<br />
$ lpoptions -d ''printer''<br />
<br />
;Check the status<br />
$ lpstat -s<br />
$ lpstat -p ''printer''<br />
<br />
;Deactivate a printer<br />
# cupsdisable ''printer''<br />
<br />
;Activate a printer<br />
# cupsenable ''printer''<br />
<br />
;Remove a printer<br />
First set it to reject all incoming entries:<br />
# cupsreject ''printer''<br />
Then disable it.<br />
# cupsdisable ''printer''<br />
Finally remove it.<br />
# lpadmin -x ''printer''<br />
<br />
;Print a file<br />
$ lpr ''file''<br />
$ lpr -# 17 ''file'' # print the file 17 times<br />
$ echo "Hello, world!" | lpr -p # print the result of a command. The -p switch adds a header.<br />
<br />
;Check the printing queue<br />
$ lpq<br />
$ lpq -a # on all printers<br />
<br />
;Clear the printing queue<br />
# lprm # remove last entry only<br />
# lprm - # remove all entries<br />
<br />
=== Alternative CUPS interfaces ===<br />
<br />
==== GNOME ====<br />
<br />
If using [[GNOME]], a possibility is to manage and configure the printer by [[pacman|installing]] {{Pkg|system-config-printer}}.<br />
<br />
For system-config-printer to work as it should, running as root may be required, or alternatively set up a "normal" user to administer CUPS (if so '''follow steps 1-3''').<br />
<br />
1. Create group, and add a user to it<br />
# groupadd lpadmin<br />
# usermod -aG lpadmin ''username''<br />
<br />
2. Add {{ic|lpadmin}} to this line in {{ic|/etc/cups/cups-files.conf}}<br />
SystemGroup sys root ''insert here''<br />
<br />
3. Restart cups, log out and in again (or restart computer)<br />
<br />
==== KDE ====<br />
<br />
[[KDE]] users can modify their printers from the Control Center. Both should refer to those desktop environments' documentation for more information on how to use the interfaces.<br />
<br />
==== Other ====<br />
<br />
There is also {{AUR|gtklp}} in the [[AUR]].<br />
<br />
== PDF virtual printer ==<br />
<br />
{{Pkg|cups-pdf}} is a nice package that allows one to setup a virtual printer that will generate a PDF from anything sent to it. This package is not necessary, but it can be quite useful.<br />
<br />
After installing the package, set it up as if it were for any other printer by using the web interface. Access the cups print manager: http://localhost:631 and select:<br />
Administration -> Add Printer<br />
Select CUPS-PDF (Virtual PDF), choose for the make and driver:<br />
Make: Generic<br />
Driver: Generic CUPS-PDF Printer<br />
<br />
Find generated PDF documents in a sub-directory located at {{ic|/var/spool/cups-pdf}}. Normally, the subdirectory is named after the user who performed the job. A little tweak helps you to find your printed PDF documents more easily. Edit {{ic|/etc/cups/cups-pdf.conf}} by changing the line<br />
#Out /var/spool/cups-pdf/${USER}<br />
<br />
to<br />
<br />
Out ${HOME}<br />
<br />
=== Print to PostScript ===<br />
<br />
The CUPS-PDF (Virtual PDF Printer) actually creates a PostScript file and then creates the PDF using the ps2pdf utility. To print to PostScript, just print as usual, in the print dialog choose "CUPS-PDF" as the printer, then select the checkbox for "print to file", hit print, enter the filename.ps and click save. This is handy for faxes, etc...<br />
<br />
== Troubleshooting ==<br />
<br />
The best way to get printing working is to set 'LogLevel' in {{ic|/etc/cups/cupsd.conf}} to:<br />
LogLevel debug<br />
<br />
And then viewing the output from {{ic|/var/log/cups/error_log}} like this:<br />
# tail -n 100 -f /var/log/cups/error_log<br />
<br />
The characters at the left of the output stand for:<br />
*D=Debug<br />
*E=Error<br />
*I=Information<br />
*And so on<br />
<br />
These files may also prove useful:<br />
*{{ic|/var/log/cups/page_log}} - Echoes a new entry each time a print is successful<br />
*{{ic|/var/log/cups/access_log}} - Lists all cupsd http1.1 server activity<br />
<br />
Of course, it is important to know how CUPS works if wanting to solve related issues:<br />
# An application sends a .ps file (PostScript, a script language that details how the page will look) to CUPS when 'print' has been selected (this is the case with most programs).<br />
# CUPS then looks at the printer's PPD file (printer description file) and figures out what filters it needs to use to convert the .ps file to a language that the printer understands (like PJL, PCL), usually GhostScript.<br />
# GhostScript takes the input and figures out which filters it should use, then applies them and converts the .ps file to a format understood by the printer.<br />
# Then it is sent to the back-end. For example, if the printer is connected to a USB port, it uses the USB back-end.<br />
<br />
Print a document and watch {{ic|error_log}} to get a more detailed and correct image of the printing process.<br />
<br />
=== Problems resulting from upgrades ===<br />
<br />
''Issues that appeared after CUPS and related program packages underwent a version increment''<br />
<br />
==== CUPS stops working ====<br />
<br />
The chances are that a new configuration file is needed for the new version to work properly. Messages such as "404 - page not found" may result from trying to manage CUPS via localhost:631, for example.<br />
<br />
To use the new configuration, copy {{ic|/etc/cups/cupsd.conf.default}} to {{ic|/etc/cups/cupsd.conf}} (backup the old configuration if needed) and restart CUPS to employ the new settings.<br />
<br />
==== All jobs are "stopped" ====<br />
<br />
If all jobs sent to the printer become "stopped", delete the printer and add it again.<br />
Using the [http://localhost:631 CUPS web interface], go to Printers > Delete Printer.<br />
<br />
To check the printer's settings go to ''Printers'', then ''Modify Printer''. Copy down the information displayed, click 'Modify Printer' to proceed to the next page(s), and so on.<br />
<br />
==== All jobs are "The printer is not responding" ====<br />
<br />
On networked printers, you should check that the name that CUPS uses as its connection URI resolves to the printer's IP via DNS, e.g.<br />
If your printer's connection looks like this:<br />
lpd://BRN_020554/BINARY_P1<br />
<br />
then the hostname 'BRN_020554' needs to resolve to the printer's IP from the server running CUPS<br />
<br />
==== The PPD version is not compatible with gutenprint ====<br />
<br />
Run:<br />
# /usr/bin/cups-genppdupdate<br />
<br />
And restart CUPS (as pointed out in gutenprint's post-install message)<br />
<br />
=== Other ===<br />
<br />
===== CUPS permission errors =====<br />
<br />
* Some users fixed 'NT_STATUS_ACCESS_DENIED' (Windows clients) errors by using a slightly different syntax:<br />
smb://workgroup/username:password@hostname/printer_name<br />
<br />
* Sometimes, the block device has wrong permissions:<br />
# ls /dev/usb/<br />
lp0<br />
# chgrp lp /dev/usb/lp0<br />
<br />
==== HPLIP printer sends "/usr/lib/cups/backend/hp failed" error ====<br />
<br />
Make sure dbus is installed and running. If the error persists, try starting avahi-daemon.<br />
<br />
Try adding the printer as a Network Printer using the http:// protocol. Generate the printer URI with {{ic|hp-makeuri}}.<br />
<br />
{{Note|There might need to set permissions issues right. Follow indications here: [[CUPS#Device node permissions]].}}<br />
<br />
==== HPLIP printer claims job is complete but printer does nothing ====<br />
<br />
This happens on HP printers when you select the (old) hpijs driver (e.g. the Deskjet D1600 series). Instead, use the hpcups driver when adding the printer.<br />
<br />
Some HP printers (e.g HP LaserJet) require their firmware to be downloaded from the computer every time the printer is switched on. If there is an issue with udev (or equivalent) and the firmware download rule is never fired, you may experience this issue.<br />
As a workaround, you can manually download the firmware to the printer. Ensure the printer is plugged in and switched on, then enter<br />
hp-firmware -n<br />
<br />
==== hp-setup asks to specify the PPD file for the discovered printer ====<br />
<br />
Install CUPS before running hp-setup.<br />
<br />
==== I have installed Qt, but hp-setup reports "Qt/PyQt 4 initialization failed"<br />
<br />
"hp-check -t" won't give you useful information to find the required package. You have to install all the "Dependent Packages" prefixed with "python2" in https://www.archlinux.org/packages/extra/x86_64/hplip/<br />
<br />
==== hp-setup finds the printer automatically but reports "Unable to communicate with device" when printing test page immediately afterwards ====<br />
<br />
This at least happens to hplip 3.13.5-2 for HP Officejet 6500A through local network connection. To solve the problem, specify the IP address of the HP printer for hp-setup to locate the printer.<br />
<br />
==== hp-toolbox sends an error, "Unable to communicate with device" ====<br />
<br />
If running hp-toolbox as a regular user results in:<br />
# hp-toolbox<br />
# error: Unable to communicate with device (code=12): hp:/usb/''printer id''<br />
or, "{{ic|Unable to communicate with device"}}", then it may be needed to [[Groups#Group management|add the user to the lp and sys groups]].<br />
<br />
This can also be caused by printers such as the P1102 that provide a virtual cd-rom drive for MS-Windows drivers. The lp dev appears and then disappears. In that case try the '''usb-modeswitch''' and '''usb-modeswitch-data''' packages, that lets one switch off the "Smart Drive" (udev rules included in said packages).<br />
<br />
This can also occur with network attached printers if the [[Avahi|avahi-daemon]] is not running. Another possiblility is the specification of the printer's IP address in hp-setup fails to locate the printer because the IP address of the the printer changed due to DHCP.<br />
<br />
==== CUPS returns '"foomatic-rip" not available/stopped with status 3' with a HP printer ====<br />
<br />
If receiving any of the following error messages in {{ic|/var/log/cups/error_log}} while using a HP printer, with jobs appearing to be processed while they all end up not being completed with their status set to 'stopped':<br />
Filter "foomatic-rip" for printer ''printer_name'' not available: No such file or director<br />
or:<br />
PID 5771 (/usr/lib/cups/filter/foomatic-rip) stopped with status 3!<br />
make sure {{pkg|hplip}} has been [[pacman|installed]], in addition to [[#Packages|the packages mentioned above]]. See [https://bbs.archlinux.org/viewtopic.php?id=65615 this forum post] for more information.<br />
<br />
==== Printing fails with unauthorised error ====<br />
<br />
If the user has been added to the lp group, and allowed to print (set in {{ic|cupsd.conf}}), then the problem lies in {{ic|/etc/cups/printers.conf}}. This line could be the culprit:<br />
AuthInfoRequired negotiate<br />
<br />
Comment it out and restart CUPS.<br />
<br />
==== Print button greyed-out in GNOME print dialogs ====<br />
<br />
:''<small>Source: [https://bbs.archlinux.org/viewtopic.php?id=70418 I can't print from gnome applications. - Arch Forums]</small>''<br />
<br />
Be sure the package: '''libgnomeprint''' is installed<br />
<br />
Edit {{ic|/etc/cups/cupsd.conf}} and add:<br />
# HostNameLookups Double<br />
<br />
Restart cups.service.<br />
<br />
==== Unknown supported format: application/postscript ====<br />
<br />
Comment the lines:<br />
application/octet-stream application/vnd.cups-raw 0 -<br />
from {{ic|/etc/cups/mime.convs}}, and:<br />
application/octet-stream<br />
in {{ic|/etc/cups/mime.types}}.<br />
<br />
==== Finding URIs for Windows print servers ====<br />
<br />
Sometimes Windows is a little less than forthcoming about exact device URIs (device locations). If having trouble specifying the correct device location in CUPS, run the following command to list all shares available to a certain windows username:<br />
$ smbtree -U ''windowsusername''<br />
This will list every share available to a certain Windows username on the local area network subnet, as long as Samba is set up and running properly. It should return something like this:<br />
{{bc| WORKGROUP<br />
\\REGULATOR-PC <br />
\\REGULATOR-PC\Z <br />
\\REGULATOR-PC\Public <br />
\\REGULATOR-PC\print$ Printer Drivers<br />
\\REGULATOR-PC\G <br />
\\REGULATOR-PC\EPSON Stylus CX8400 Series EPSON Stylus CX8400 Series}}<br />
What is needed here is first part of the last line, the resource matching the printer description. So to print to the EPSON Stylus printer, one would enter:<br />
smb://username.password@REGULATOR-PC/EPSON Stylus CX8400 Series<br />
as the URI into CUPS. Notice that whitespaces are allowed in URIs, whereas backslashes get replaced with forward slashes.<br />
If it won't work try '%20' instead of spaces.<br />
<br />
==== Print-Job client-error-document-format-not-supported ====<br />
<br />
Try installing the foomatic packages and use a foomatic driver.<br />
<br />
==== /usr/lib/cups/backend/hp failed ====<br />
<br />
Change:<br />
SystemGroup sys root<br />
to:<br />
SystemGroup lp root<br />
in {{ic|/etc/cups/cupsd.conf}}<br />
<br />
<br />
Following steps 1-3 in the Alternative CUPS interfaces below may be a better solution, since newer versions of cups will not allow the same group for both normal and admin operation.<br />
<br />
==== Unable to get list of printer drivers ====<br />
<br />
* Check your ServerName in /etc/cups/client.conf is written without http://<br />
ServerName localhost:631<br />
* Try to remove Foomatic drivers.<br />
<br />
==== lp: Error - Scheduler Not Responding ====<br />
<br />
If you get this error when printing a document using:<br />
<br />
$ lp document-to-print<br />
<br />
Try setting the CUPS_SERVER environment variable:<br />
<br />
$ export CUPS_SERVER=localhost<br />
<br />
If this solves your problem, make the solution permanent by adding the export line above to ~/.bash_profile.<br />
<br />
==== CUPS prints only an empty and an error-message page on HP LaserJet ====<br />
<br />
There is a bug that causes CUPS to fail when printing images on HP LaserJet (in my case 3380). The bug has been reported and fixed by [https://bugs.launchpad.net/ubuntu/+source/cups-filters/+bug/998087 Ubuntu].<br />
The first page is empty, the second page contains the following error message:<br />
ERROR:<br />
invalidaccess<br />
OFFENDING COMMAND:<br />
filter<br />
STACK:<br />
/SubFileDecode<br />
endstream<br />
...<br />
<br />
In order to fix the issue, use the following command (as superuser):<br />
lpadmin -p ''printer'' -o pdftops-renderer-default=pdftops<br />
<br />
==== "Using invalid Host" error message ====<br />
<br />
Try to add "ServerAlias *" into cupsd.conf<br />
<br />
==== Printer doesn't print with an "Filter failed" message on CUPS web interface (HP printer) ====<br />
<br />
Change the permissions of the printer USB port:<br />
<br />
Get the bus and device number from lsusb, then set the permission using:<br />
<br />
chmod 0666 /dev/bus/usb/''bus number''/''device number''<br />
<br />
To make the persistent permission change that will be triggered automatically each time the computer is rebooted, add the following line.<br />
<br />
{{hc|/etc/udev/rules.d/10-local.rules|2=<br />
SUBSYSTEM=="usb", ATTRS{idVendor}=="Printer_idVendor", ATTRS{idProduct}=="Printer_idProduct", GROUP="lp", MODE:="666"<br />
}}<br />
<br />
Obtain the right information by using {{ic|lsusb}} command, and don't forget to substitute {{ic|Printer_idVendor}} & {{ic|Printer_idProduct}} with the relevant ones.<br />
<br />
Each system may vary, so consult [[udev#List_attributes_of_a_device]] wiki page.<br />
<br />
==== Printer doesn't print with an "Filter failed" message on CUPS web interface (HP printer connected over network) ====<br />
<br />
Start, enable and restart the avahi-daemon.<br />
<br />
==== HPLIP 3.13: Plugin is installed, but HP Device Manager complains it is not ====<br />
<br />
The issue might have to do with the file permission change that had been made to {{ic|/var/lib/hp/hplip.state}}. To correct the issue, a simple {{ic|chmod 644 /var/lib/hp/hplip.state}} and {{ic|chmod 755 /var/lib/hp}} should be sufficient. For further information, please read this [https://bugs.launchpad.net/hplip/+bug/1131596 link].<br />
<br />
==== Printer is not recognized by CUPS ====<br />
<br />
If your printer is not listed in the "Add Printers" page of the CUPS web interface, nor by lpinfo -v, try the following (suggested in [https://bbs.archlinux.org/viewtopic.php?pid=1037279#p1037279 this thread]):<br />
<br />
* Remove {{ic|usblp}} from blacklist<br />
* Load {{ic|usblp}} module<br />
modprobe usblp<br />
* Stop cups<br />
* Add the following udev rule in a new rule file:<br />
{{hc|/etc/udev/rules.d/10-cups_device_link.rules|2=<br />
KERNEL=="lp[0-9]", SYMLINK+="%k", GROUP="lp"<br />
}}<br />
* Reload udev rules:<br />
# udevadm control --reload-rules<br />
* Unplug and re-plug the printer.<br />
* Wait a few seconds and then start cups again.<br />
<br />
==== Can't load /etc/samba/smb.conf ====<br />
<br />
If you're printing to a remote printer over SMB and get this error message: "Can't load /etc/samba/smb.conf - run testparm to debug it", then create an empty smb.conf:<br />
<br />
# mkdir /etc/samba<br />
# touch /etc/samba/smb.conf<br />
<br />
and restart cupsd.<br />
<br />
==== CUPS' systemd service does not start even though it's enabled ====<br />
<br />
The systemd .service file provided by CUPS uses socket activation, meaning the service is only started when an<br />
application connects to CUPS' socket. However, the systemd .socket file provided by cups only works for the local <br />
{{ic|/var/run/cups/cups.sock}} socket. <br />
<br />
In order to have cupsd start when initiating a print job over the network, create the following file:<br />
<br />
{{hc|/etc/systemd/system/cups.socket|<br />
.include /usr/lib/systemd/system/cups.socket<br />
<br />
[Socket]<br />
ListenStream&#61;0.0.0.0:631<br />
ListenDatagram&#61;0.0.0.0:631<br />
BindIPv6Only&#61;ipv6-only<br />
}}<br />
<br />
Then reload systemd:<br />
<br />
# systemctl --system daemon-reload<br />
<br />
Confirm that everything is working correctly:<br />
<br />
{{bc|<br />
# systemctl is-enabled cups.service &#124;&#124; systemctl enable cups.service<br />
# systemctl status cups.socket<br />
cups.socket - CUPS Printing Service Sockets<br />
Loaded: loaded (/etc/systemd/system/cups.socket; enabled)<br />
Active: inactive (dead)<br />
Listen: /var/run/cups/cups.sock (Stream)<br />
0.0.0.0:631 (Stream)<br />
0.0.0.0:631 (Datagram)<br />
}}<br />
<br />
CUPS should now start automatically when printing locally or over the network.<br />
<br />
== See also ==<br />
<br />
* [http://localhost:631/documentation.html Official CUPS documentation], ''locally installed''<br />
* [http://www.cups.org/ Official CUPS website]<br />
* [http://www.linuxprinting.org/ Linux Printing], ''[http://www.linuxfoundation.org The Linux Foundation]''<br />
* [http://www.gentoo.org/doc/en/printing-howto.xml Gentoo's printing guide], ''[http://www.gentoo.org/doc/en Gentoo Documentation resources]''<br />
* [https://bbs.archlinux.org/ Arch Linux user forums]<br />
* [http://wiki.gotux.net/tutorials/software/hp-printer Install HP printers easy way]</div>Ddreamer