https://wiki.archlinux.org/api.php?action=feedcontributions&user=Meribold&feedformat=atomArchWiki - User contributions [en]2024-03-29T11:13:33ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=User:Meribold&diff=765558User:Meribold2023-01-29T07:17:01Z<p>Meribold: </p>
<hr />
<div>https://meribold.org<br />
<br />
https://mastodon.social/@meribold<br />
<br />
https://github.com/meribold</div>Meriboldhttps://wiki.archlinux.org/index.php?title=Firefox&diff=765557Firefox2023-01-29T07:10:54Z<p>Meribold: Slightly edit one sentence in new "Custom date and time format in Library window" subsection</p>
<hr />
<div>[[Category:Web browser]]<br />
[[Category:Mozilla]]<br />
[[de:Firefox]]<br />
[[es:Firefox]]<br />
[[ja:Firefox]]<br />
[[ru:Firefox]]<br />
[[zh-hans:Firefox]]<br />
[[zh-hant:Firefox]]<br />
{{Related articles start}}<br />
{{Related|Firefox/Tweaks}}<br />
{{Related|Firefox/Profile on RAM}}<br />
{{Related|Firefox/Privacy}}<br />
{{Related|Browser extensions}}<br />
{{Related|Chromium}}<br />
{{Related|Opera}}<br />
{{Related articles end}}<br />
[https://www.mozilla.org/firefox Firefox] is a popular open source graphical web browser from [https://www.mozilla.org Mozilla].<br />
<br />
{{Note|For older versions, there may be no "Settings" but "Preferences" in their menus. You can replace "Settings" in the article with "Preferences" if need.}}<br />
<br />
== Installing ==<br />
<br />
Firefox can be [[install]]ed with the {{Pkg|firefox}} package.<br />
<br />
Other alternatives include:<br />
<br />
* {{App|Firefox Developer Edition|for developers|https://www.mozilla.org/firefox/developer/|{{Pkg|firefox-developer-edition}}}}<br />
* {{App|Firefox Extended Support Release|long-term supported version|https://www.mozilla.org/firefox/organizations/|{{AUR|firefox-esr}} or {{AUR|firefox-esr-bin}}}}<br />
* {{App|Firefox Beta|cutting-edge version|https://www.mozilla.org/firefox/channel/desktop/#beta|{{AUR|firefox-beta-bin}}}}<br />
* {{App|Firefox Nightly|nightly builds for testing ([https://developer.mozilla.org/Firefox/Experimental_features experimental features])|https://www.mozilla.org/firefox/channel/desktop/#nightly|{{AUR|firefox-nightly}}}} <br />
* {{App|Firefox KDE|Version of Firefox that incorporates an OpenSUSE patch for better [[#KDE integration|KDE integration]] than is possible through simple Firefox add-ons.|https://build.opensuse.org/package/show/mozilla:Factory/MozillaFirefox|{{AUR|firefox-kde-opensuse}}, {{AUR|firefox-kde}} or {{AUR|firefox-developer-edition-kde}}}}<br />
* On top of the different Mozilla build channels, a number of forks exist with more or less special features; see [[List of applications#Gecko-based]].<br />
<br />
A number of language packs are available for Firefox, other than the standard English. Language packs are usually named as {{ic|firefox-i18n-''languagecode''}} (where {{ic|''languagecode''}} can be any language code, such as '''de''', '''ja''', '''fr''', etc.). For a list of available language packs, see [https://archlinux.org/packages/extra/any/firefox-i18n/ firefox-i18n] for {{Pkg|firefox}}, [https://archlinux.org/packages/community/any/firefox-developer-edition-i18n/ firefox-developer-edition-i18n] for {{Pkg|firefox-developer-edition}} and [https://aur.archlinux.org/packages/?K=firefox-nightly- firefox-nightly-] for {{AUR|firefox-nightly}}.<br />
<br />
{{Note|1=Language packs are disabled on ''-nightly'' and ''-developer-edition'' due to frequent string changes that may cause crashes. To force a change to the UI language, you may need to set {{ic|intl.locale.requested}} in {{ic|about:config}} [https://www.reddit.com/r/firefox/comments/lx3dp9/how_to_change_interface_language/gpovlsp/?context=8&depth=9].}}<br />
<br />
== Add-ons ==<br />
<br />
Firefox is well known for its large library of add-ons which can be used to add new features or modify the behavior of existing features. Firefox's "Add-ons Manager" is used to manage installed add-ons or find new ones. <br />
<br />
For instructions on how to install add-ons and a list of add-ons, see [[Browser extensions]].<br />
<br />
=== Adding search engines ===<br />
<br />
Search engines may be added to Firefox by creating bookmarks:<br />
<br />
* Press the star on the address bar or {{ic|Ctrl+d}}.<br />
* Right click on the bookmark you have created, then press ''Edit Bookmark...''<br />
* Complete the ''URL'' field with search URLs. Complete the place of the query with {{ic|%s}}. Complete the ''Keyword'' field with user-defined characters. Like this:<br />
<br />
URL:<br />
https://duckduckgo.com/html/?q=%s<br />
Keyword:<br />
d<br />
<br />
{{Note|Older versions use "Location" instead of "URL".}}<br />
<br />
Searches are performed by pre-pending the search term with the keyword of the specified search engine: {{ic|d archwiki}} will query DuckDuckGo using the search term {{ic|archwiki}}<br />
<br />
Search engines may also be added to Firefox through add-on extensions; see [https://addons.mozilla.org/firefox/search-tools/ this page] for a list of available search tools and engines.<br />
<br />
A very extensive list of search engines can be found at the [https://mycroftproject.com/ Mycroft Project].<br />
<br />
==== firefox-extension-arch-search ====<br />
<br />
[[Install]] the {{AUR|firefox-extension-arch-search}} package to add Arch-specific searches (AUR, wiki, forum, packages, etc) to the Firefox search toolbar.<br />
<br />
== Plugins ==<br />
<br />
Support for all plugins, including Flash Player, was removed in Firefox 85.[https://support.mozilla.org/kb/npapi-plugins][https://support.mozilla.org/kb/end-support-adobe-flash]<br />
<br />
== Configuration ==<br />
<br />
Firefox exposes a number of configuration options. To examine them, enter in the Firefox address bar:<br />
<br />
about:config<br />
<br />
Once set, these affect the user's current profile, and may be synchronized across all devices via [https://www.mozilla.org/firefox/sync/ Firefox Sync]. Please note that only a subset of the {{ic|about:config}} entries are synchronized by this method, and the exact subset may be found by searching for {{ic|services.sync.prefs}} in {{ic|about:config}}. Additional preferences and third party preferences may be synchronized by creating new boolean entries prepending the value with [https://support.mozilla.org/en-US/kb/sync-custom-preferences services.sync.prefs.sync]. To synchronize the whitelist for the extension [https://addons.mozilla.org/firefox/addon/noscript/ NoScript]:<br />
<br />
services.sync.prefs.sync.capability.policy.maonoscript.sites<br />
<br />
The boolean {{ic|noscript.sync.enabled}} must be set to {{ic|true}} to synchronize the remainder of NoScript's preferences via Firefox Sync.<br />
<br />
=== Settings storage ===<br />
<br />
Firefox stores the configuration for a profile via a {{ic|prefs.js}} in the profile folder, usually {{ic|~/.mozilla/firefox/''xxxxxxxx''.default/}}. <br />
<br />
Firefox also allows configuration for a profile via a {{ic|user.js}} file: [http://kb.mozillazine.org/User.js_file user.js] kept also in the profile folder. A {{ic|user.js}} configuration supersedes a {{ic|prefs.js}}. The {{ic|user.js}} configuration is only parsed at start-up of a profile. Hence, you can test changes via {{ic|about:config}} and modify {{ic|user.js}} at runtime accordingly. For a useful starting point, see e.g [https://github.com/pyllyukko/user.js custom user.js] which is targeted at privacy/security conscious users.<br />
<br />
One drawback of the above approach is that it is not applied system-wide. Furthermore, this is not useful as a "pre-configuration", since the profile directory is created after first launch of the browser. You can, however, let ''firefox'' create a new profile and, after closing it again, [https://support.mozilla.org/en-US/kb/back-and-restore-information-firefox-profiles#w_restoring-a-profile-backup copy the contents] of an already created profile folder into it. <br />
<br />
Sometimes, it may be desired to lock certain settings, a feature useful in widespread deployments of customized Firefox. In order to create a system-wide configuration, follow the steps outlined in [https://support.mozilla.org/en-US/kb/customizing-firefox-using-autoconfig Customizing Firefox Using AutoConfig]:<br />
<br />
1. Create {{ic|/usr/lib/firefox/defaults/pref/autoconfig.js}}:<br />
<br />
pref("general.config.filename", "firefox.cfg");<br />
pref("general.config.obscure_value", 0);<br />
<br />
2. Create {{ic|/usr/lib/firefox/firefox.cfg}} (this stores the actual configuration):<br />
<br />
//<br />
//...your settings...<br />
// e.g to disable Pocket, uncomment the following lines<br />
// lockPref("extensions.pocket.enabled", false);<br />
// lockPref("browser.newtabpage.activity-stream.feeds.section.topstories", false);<br />
<br />
Please note that the first line must contain exactly {{ic|//}}. The syntax of the file is similar to that of {{ic|user.js}}.<br />
<br />
=== Multimedia playback ===<br />
<br />
Firefox uses [[FFmpeg]] for playing multimedia inside HTML5 {{ic|<audio>}} and {{ic|<video>}} elements. Go to [https://cconcolato.github.io/media-mime-support/ video-test page] or [https://hpr.dogphilosophy.net/test/ audio-test page] to check which formats are actually supported.<br />
<br />
Firefox uses [[PulseAudio]] for audio playback and capture. If PulseAudio is not installed, Firefox uses [[ALSA]] instead.<br />
<br />
{{Tip|Firefox might not play video if audio is not configured. If you are intending to use [[PipeWire]] and [[WirePlumber]], make sure they are working properly.}}<br />
<br />
==== HTML5 DRM/Widevine ====<br />
<br />
Widevine is a digital rights management tool that Netflix, Amazon Prime Video, and others use to protect their video content. It can be enabled in ''Settings > General > Digital Rights Management (DRM) Content''. If you visit a Widevine-enabled page when this setting is disabled, Firefox will display a prompt below the address bar asking for permission to install DRM. Approve this and then wait for the "Downloading" bar to disappear; now, you are able to watch videos from Widevine protected sites. <br />
<br />
Firefox can only play 720p video (or lower) with Widevine, due to not using [https://bugzilla.mozilla.org/show_bug.cgi?id=1700815 hardware DRM playback]. It is also required that the private mode browsing is disabled, for the window and in the Settings.<br />
<br />
==== "Open With" extension ====<br />
<br />
# Install [https://addons.mozilla.org/firefox/addon/open-with/ Open With] add-on.<br />
# Go to ''Add-ons > Open With > Preferences''.<br />
# Proceed with instructions to install a file in your system and test the installation. <br />
# Click ''Add browser''.<br />
# In the dialog, write a name for this menu entry and command to start a video streaming capable player (e.g. {{ic|/usr/bin/mpv}}).<br />
## Optionally, add needed arguments to the player (e.g. you may want {{ic|--force-window --ytdl}} for [[mpv]]).<br />
# Right click on links or visit pages containing videos. Select newly created entry from Open With's menu and if the site is supported, the player will open as expected.<br />
<br />
The same procedure can be used to associate video downloaders such as ''youtube-dl''.<br />
<br />
==== Hardware video acceleration ====<br />
<br />
[[Hardware video acceleration]] via VA-API is available under [[Wayland]] [https://mastransky.wordpress.com/2020/06/03/firefox-on-fedora-finally-gets-va-api-on-wayland/] and [[Xorg]] [https://bugzilla.mozilla.org/show_bug.cgi?id=1619523] [https://www.phoronix.com/scan.php?page=news_item&px=Firefox-80-VA-API-X11].<br />
<br />
To enable VA-API in Firefox:<br />
<br />
# Ensure that your video card is correctly configured for VA-API as described in [[Hardware video acceleration]].<br />
# Ensure WebRender is enabled by navigating to {{ic|about:support}} and then ''Compositing''. It is enabled by default in GNOME and other desktop environments [https://mastransky.wordpress.com/2021/01/10/firefox-were-finally-getting-hw-acceleration-on-linux/]. <br />
#* Ensure you are not running Software WebRender as that will not work as of August 2021 [https://bugzilla.mozilla.org/show_bug.cgi?id=1723540#c1]. <br />
#* If necessary, Hardware WebRender can be force enabled by setting {{ic|gfx.webrender.all}} to {{ic|true}}.<br />
# Set {{ic|media.ffmpeg.vaapi.enabled}} to {{ic|true}} in {{ic|about:config}}<br />
# If using [[Wayland]], run Firefox with [[#Wayland|Wayland mode]] enabled.<br />
<br />
{{Note|1=<nowiki/><br />
* While NVIDIA's proprietary driver does not support VA-API, newer versions support DMA-BUF. Using {{AUR|libva-nvidia-driver}} will allow for hardware video decoding on NVIDIA using [[CUDA]]. See the [https://github.com/elFarto/nvidia-vaapi-driver/#firefox GitHub project] for documentation on necessary environment variables and about:config changes.<br />
* Since currently there is no DMA-BUF support for [[VDPAU]] nor {{Pkg|libva-vdpau-driver}}, this package will not enable hardware video acceleration in Firefox. In fact, as of Firefox 102, having this installed and {{ic|media.ffmpeg.vaapi.enabled}} set will make Firefox crash on startup.<br />
* Currently, Firefox's VA-API implementation can decode H.264/AVC, VP8 & VP9, AV1 encoded video. AV1 support requires FireFox 98+ [https://bugzilla.mozilla.org/show_bug.cgi?id=1745225].<br />
* Multi-GPU systems should automatically choose a suitable GPU for VA-API according to this [https://bugzilla.mozilla.org/show_bug.cgi?id=1588904#c36 solved issue].<br />
* [[AMDGPU]] users under {{Pkg|linux-hardened}} may need to rebuild ''linux-hardened'' with {{ic|1=CONFIG_CHECKPOINT_RESTORE=y}} due to {{Pkg|mesa}} [https://gitweb.gentoo.org/repo/gentoo.git/tree/media-libs/mesa/mesa-9999.ebuild requiring the kcmp syscall]. This may no longer be necessary due to this [https://bugzilla.mozilla.org/show_bug.cgi?id=1624743 bug being solved].<br />
}}<br />
<br />
VA-API usage can be verified by checking Firefox's VA-API logs. Run Firefox with the {{ic|1=MOZ_LOG="PlatformDecoderModule:5"}} environment variable and check in the log output that VA-API is enabled and used (search for the "VA-API" string) when playing a video for example. Pay attention to these logs as they might indicate that only one of the two possible compositors described before (WebRender or OpenGL) works with VA-API on your particular setup.<br />
<br />
{{Tip|<br />
* To allow hardware decoding in YouTube, the video codec used must be supported by the hardware. The profiles supported by your GPU can be checked with [[Hardware video acceleration#Verifying VA-API]] and the YouTube codecs used can ''sometimes'' (if offered by YouTube!) be controlled with the [https://addons.mozilla.org/firefox/addon/h264ify/ h264ify] or [https://addons.mozilla.org/firefox/addon/enhanced-h264ify/ enhanced-h264ify] extensions. Alternatively, you can install {{AUR|firefox-h264ify}}.<br />
}}<br />
<br />
=== Spell checking ===<br />
<br />
Firefox can use system-wide installed [[Hunspell]] dictionaries as well as dictionaries installed through its own extension system.<br />
<br />
To enable spell checking for a specific language, right click on any text field and check the ''Check Spelling'' box. To select a language for spell checking, you have to right click again and select your language from the ''Languages'' sub-menu.<br />
<br />
If your default language choice does not stick, see [[#Firefox does not remember default spell check language]].<br />
<br />
==== System-wide Hunspell dictionaries ====<br />
<br />
Install [[Hunspell]] and its dictionaries for the languages you require.<br />
<br />
==== Dictionaries as extensions ====<br />
<br />
To get more languages, right click on any text field, click ''Add Dictionaries...'' and select the dictionary you want to install from the [https://addons.mozilla.org/firefox/language-tools/ Dictionaries and Language Packs list].<br />
<br />
{{Tip|For Russian, the extension is packaged as {{Pkg|firefox-spell-ru}}.}}<br />
<br />
=== KDE integration ===<br />
<br />
* To bring the [[KDE]] look to GTK applications (including Firefox), install {{Pkg|breeze-gtk}} and {{Pkg|kde-gtk-config}}. Afterwards, go to System Settings and in ''Appearance > Application Style > Configure GNOME/GTK Application Style…'' choose 'Breeze'.<br />
* To use the KDE file selection and print dialogs in Firefox 64 or newer, install {{Pkg|xdg-desktop-portal}} and {{Pkg|xdg-desktop-portal-kde}}, then do one of the following:<br />
** Set {{ic|widget.use-xdg-desktop-portal.mime-handler}} to {{ic|1}} in {{ic|about:config}}. You should also change {{ic|widget.use-xdg-desktop-portal.file-picker}} from {{ic|2}} to {{ic|1}}.<br />
** Launch firefox with {{ic|1=GTK_USE_PORTAL=1}} [[environment variable]].<br />
* For integration with [[KDE]] MIME type system, proxy and file dialog, one can use {{AUR|firefox-kde-opensuse}} variant from AUR with OpenSUSE’s patches applied. Alternatively, integration with MIME types can be achieved by creating a symbolic link to the MIME database {{ic|~/.config/mimeapps.list}} from the deprecated {{ic|~/.local/share/applications/mimeapps.list}} that is used by Firefox. See [[XDG MIME Applications#mimeapps.list]].<br />
* Extensions/add-ons may provide additional integration, such as:<br />
** Browser integration in [[Plasma]]: requires {{Pkg|plasma-browser-integration}} and the [https://addons.mozilla.org/firefox/addon/plasma-integration/ Plasma Integration add-on].<br />
::{{Tip|To prevent duplicate entries in the Media Player widget or tray icon, set {{ic|media.hardwaremediakeys.enabled}} to {{ic|false}}. This disables the media entry from Firefox and only uses the one from the Plasma integration add-on.}}<br />
<br />
=== Listen (text to speech) ===<br />
<br />
Firefox can perform Text to Speech synthesis for web pages.<br />
<br />
==== Setup ====<br />
<br />
{{Merge|Speech Dispatcher|2=Speech Dispatcher is used for more than just Firefox.[https://bbs.archlinux.org/viewtopic.php?id=243537] A dedicated page might be in order.}}<br />
<br />
{{Expansion|It should be possible to write a systemd service for running Festival in the background.}}<br />
<br />
TTS must be setup for the ''Listen'' icon to appear in the Reader view. Firefox uses [https://github.com/brailcom/speechd Speech Dispatcher] ([https://htmlpreview.github.io/?https://github.com/brailcom/speechd/blob/master/doc/speech-dispatcher.html#Recommended-installation-procedure Speech Dispatcher documentation]) which requires a speech synthesis engine. The currently recommended speech synthesis engine is [[Festival]].<br />
<br />
# [[Festival#Installation|Install Festival]] then [[Festival#Configuration|configure and test it]].<br />
# Install {{AUR|festival-freebsoft-utils}} (required to use Festival with Speech Dispatcher)<br />
# Install the package {{Pkg|speech-dispatcher}} then [[textedit|edit]] {{ic|/etc/speech-dispatcher/speechd.conf}} and uncomment the line that starts with {{ic|AddModule "festival"}}<br />
# Start Festival as a server: {{ic|festival --server}}<br />
# You should now be able to test Speech Dispatcher: {{ic|spd-conf -s}}<br />
<br />
==== Usage ====<br />
<br />
See the [https://support.mozilla.org/en-US/kb/firefox-reader-view-clutter-free-web-pages illustrated steps] on Mozilla's website.<br />
<br />
The ''Listen'' icon (a headphones icon) will only appear if you have performed all the configuration above, Speech Dispatcher is working, and you have started Firefox after you started the Festival server (you cannot start Firefox then Festival).<br />
<br />
Furthermore, sometimes a Festival server process may linger after you have tried to kill it, but will terminate after you shut down Firefox.<br />
<br />
For common issues, see [[#Web Speech API has no voices]] and [[#Narrate/Listen icon missing in Reader Mode]].<br />
<br />
==== Using the festival-us voices ====<br />
<br />
The voices in the package {{Pkg|festival-us}} provide better quality audio than those in {{Pkg|festival-english}} but they do not work in Firefox. They do not appear in the list of available voices in Firefox and when you open Reader view you will see error messages like this in the terminal output from the Festival server:<br />
<br />
{{bc| SIOD: unknown voice cmu_us_awb_cg }}<br />
<br />
To fix this you need to [[textedit|edit]] the following files:<br />
<br />
* {{ic|/usr/share/festival/voices/us/cmu_us_awb_cg/festvox/cmu_us_awb_cg.scm}}<br />
* {{ic|/usr/share/festival/voices/us/cmu_us_rms_cg/festvox/cmu_us_rms_cg.scm}}<br />
* {{ic|/usr/share/festival/voices/us/cmu_us_slt_cg/festvox/cmu_us_slt_cg.scm}}<br />
<br />
For each of these files you need to add some code to the second last line of code of each file, eg for {{ic|cmu_us_awb_cg.scm}} add code before this line:<br />
{{bc|(provide 'cmu_us_awb_cg)}}<br />
<br />
The code you need to add to {{ic|cmu_us_awb_cg.scm}} is below. You will need to change the voice name, gender, dialect and description as appropriate for the other two files.<br />
{{bc|<br />
(proclaim_voice<br />
'cmu_us_awb_cg<br />
'((language english)<br />
(gender male)<br />
(dialect scottish)<br />
(description "This voice is Scottish")))<br />
}}<br />
<br />
{{Note|To avoid re-doing those changes every time {{Pkg|festival-us}} is upgraded, see [[pacman#Skip file from being upgraded]].}}<br />
<br />
== Tips and tricks ==<br />
<br />
For general enhancements, see [[Firefox/Tweaks]], and for privacy related enhancements, see [[Firefox/Privacy]].<br />
<br />
=== Dark themes ===<br />
<br />
Firefox should respect your GTK theme settings and your OS-wide dark appearance settings (as in the Appearance section of GNOME's settings or KDE system settings). If the latter does not work, make sure to have a suitable {{Pkg|xdg-desktop-portal}} package installed.<br />
<br />
Starting with Firefox 68, you can make all the Firefox interfaces and even other websites respect dark themes, irrespective of the system GTK theme and Firefox theme. To do this, set {{ic|ui.systemUsesDarkTheme}} to {{ic|1}} in {{ic|about:config}} [https://bugzilla.mozilla.org/show_bug.cgi?id=1488384#c23].<br />
<br />
As of Firefox 100, further control of the dark theme of web pages that opt-in (using the CSS media query [https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme prefers-color-scheme]) and Firefox's own in-content pages is possible with {{ic|layout.css.prefers-color-scheme.content-override}}. Setting this to {{ic|3}} will follow the browser theme, setting this to {{ic|2}} will follow the system wide dark-mode preference ({{ic|ui.systemUsesDarkTheme}} as above, which defaults to {{ic|0}} if the user has not changed the dark-mode preference or if a system does not support a system-wide dark-mode preference), while {{ic|1}} and {{ic|0}} will always force light-mode and dark-mode respectively. This setting can also be accessed through the user settings of Firefox under ''General'' > ''Language and Appearance'' > ''Website appearance''.<br />
<br />
=== Frame rate ===<br />
<br />
If Firefox is unable to automatically detect the right value, it will default to 60 fps. To manually correct this, set {{ic|layout.frame_rate}} to the refresh rate of your monitor (e.g. 144 for 144 Hz).<br />
<br />
=== Memory limit ===<br />
<br />
To prevent pages from abusing memory (and possible [[Wikipedia:Out_of_memory|OOM]]), we can use [[Firejail]] with the {{ic|rlimit-as}} option.<br />
<br />
=== New tabs position ===<br />
<br />
To control where new tabs appears (relative or absolute), use {{ic|browser.tabs.insertAfterCurrent}} and {{ic|browser.tabs.insertRelatedAfterCurrent}}. See [https://support.mozilla.org/en/questions/1229062] for more information.<br />
<br />
=== Screenshot of webpage ===<br />
<br />
You can ''Take a Screenshot'' by either using the screenshots button that can be added to the toolbar from the customize screen in the Hamburger menu at ''More tools'' > ''Customize toolbar'', by pressing {{ic|Ctrl+Shift+s}} or by right-clicking on the webpage. See [https://support.mozilla.org/en-US/kb/firefox-screenshots] for more information.<br />
<br />
As an alternative, you can use the screenshot button in the developer tools, which can be added through the developer tools ''Settings'' menu, under the ''Available Toolbox Buttons'' section. The settings for the developer tools are accessible through the three horizontal dots located at the top right of the developer tools pane.<br />
<br />
=== Wayland ===<br />
<br />
More recent versions of Firefox support opting into [[Wayland]] mode via an [[environment variable]].<br />
<br />
$ MOZ_ENABLE_WAYLAND=1 firefox<br />
<br />
To make this permanent, see [[Environment variables#Graphical environment]] and start Firefox via the desktop launcher like you normally would.<br />
<br />
To verify that it worked, look for ''Window Protocol'' in {{ic|about:support}}. It should say {{ic|wayland}}. The presence of {{ic|x11}} means you are running Firefox under [[Xorg]] display server, while {{ic|xwayland}} means your system is running Wayland but executing Firefox as legacy X11 application. <br />
<br />
If it is necessary to be regularly switching between Wayland and X.org, it may be useful to add a conditional to your shell's login [[Command-line shell#Configuration files|startup script]], e.g. {{ic|~/.bash_profile}} for [[Bash]]:<br />
<br />
{{bc|1=<br />
if [ "$XDG_SESSION_TYPE" == "wayland" ]; then<br />
export MOZ_ENABLE_WAYLAND=1<br />
fi<br />
}}<br />
<br />
=== Window manager rules ===<br />
<br />
To apply different configurations to Firefox windows, change the WM_CLASS string by using Firefox's {{ic|--class}} option, to a custom one.<br />
<br />
=== Profiles ===<br />
<br />
To start new Firefox instances, multiple profiles are required. To create a new profile:<br />
<br />
$ firefox [--new-instance] -P<br />
<br />
Class can be specified when launching Firefox with a not-in-use profile:<br />
<br />
$ firefox [--new-instance] -P ''profile_name'' --class=''class_name''<br />
<br />
[https://ffprofile.com/ Firefox Profilemaker] can be used to create a Firefox profile with the defaults you like.<br />
<br />
=== Touchscreen gestures and pixel-perfect trackpad scrolling ===<br />
<br />
{{Merge|Firefox/Tweaks#Enable touchscreen gestures|Same solution.}}<br />
<br />
To enable touch gestures (like scrolling and pinch-to-zoom) and one-to-one trackpad scrolling (as can be witnessed with GTK3 applications like Nautilus), set the {{ic|1=MOZ_USE_XINPUT2=1}} [[environment variable]] before starting Firefox. On Wayland, only {{ic|1=MOZ_ENABLE_WAYLAND=1}} needs to be set.<br />
<br />
Kinetic scrolling feels loose on Wayland due to https://bugzilla.mozilla.org/show_bug.cgi?id=1568722, and can be turned off by going to {{ic|about:config}} and turning off {{ic|apz.gtk.kinetic_scroll.enabled}}. This will make it harder to scroll to the beginning and end of long pages, however.<br />
<br />
=== Multiple home pages ===<br />
<br />
To have multiple tabs opened when starting Firefox, open a new window and then open the sites you want to have as "home tabs".<br />
<br />
Now go to ''Settings > Home'' and under ''Homepage and new windows'' click the ''Use Current Pages'' button.<br />
<br />
Alternatively, go directly to ''Settings > Home'' and now under ''Homepage and new windows'' set the first field to ''Custom URLs..'' and enter the pages you want as new home pages in the following format:<br />
<br />
<nowiki>https://url1.com|https://url2.com|https://url3.com</nowiki><br />
<br />
=== View two pages side by side in the PDF viewer ===<br />
<br />
To display two pages at once with the integrated PDF viewer, set {{ic|pdfjs.spreadModeOnLoad}} to {{ic|1}} in in {{ic|about:config}}.<br />
<br />
=== Kiosk mode ===<br />
<br />
Firefox supports kiosk mode that shows pages in full screen without browser chrome, context menus, and other features useful for typical desktop browsing. These can be seen on ATMs or information panels where users are not expected to interact with the rest of the system.<br />
<br />
To use kiosk mode, start Firefox with:<br />
<br />
$ firefox --kiosk ''url''<br />
<br />
The startup page can be configured the settings or supplied as a command-line parameter.<br />
<br />
If you need printing, you can prevent Firefox from showing paper size configuration dialogs with:<br />
<br />
$ firefox --kiosk --kiosk-printing ''url''<br />
<br />
=== Compact mode ===<br />
<br />
Starting with Firefox version 89, the compact mode density option was removed from the Customize panel [https://support.mozilla.org/en-US/kb/compact-mode-workaround-firefox], but you can still use compact density. To do this, set {{ic|browser.uidensity}} to {{ic|1}} in {{ic|about:config}}.<br />
<br />
=== GNOME search provider ===<br />
<br />
Firefox includes a search provider for GNOME Shell which exposes Firefox bookmarks and history to GNOME Shell search while Firefox is running. To enable this provider go to {{ic|about:config}} and set {{ic|browser.gnome-search-provider.enabled}} to {{ic|true}}.<br />
<br />
Then, you must install {{AUR|firefox-gnome-search-provider}} to add the required GNOME configuration file; {{Pkg|firefox}} itself currently does not include it (see {{Bug|68705}}).<br />
<br />
=== Custom date and time format in Library window ===<br />
<br />
The date and time format used in the Library window (the window showing bookmarks, history and downloads, accessible via Ctrl+Shift+O and Ctrl+Shift+H) can be customized by setting {{ic|intl.date_time.pattern_override.date_short}}, {{ic|intl.date_time.pattern_override.time_short}}, and {{ic|intl.date_time.pattern_override.connector_short}} in {{ic|user.js}} or {{ic|about:config}}. For example, to get a format similar to ISO 8601 and RFC 3339 ("2022-12-31 22:49"), set the three preferences to {{ic|yyyy-MM-dd}}, {{ic|HH:mm}}, and {{ic|{1} {0}}}, respectively.<br />
<br />
Setting the {{ic|LC_TIME}} environment variable to {{ic|en_DK.UTF-8}} only worked in old Firefox versions (perhaps 57 and earlier). There is a [https://bugzilla.mozilla.org/show_bug.cgi?id=1426907 bug report on bugzilla.mozilla.org] that contains further information.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Troubleshoot Mode ===<br />
<br />
The command line switch {{ic|-safe-mode}} starts Firefox in [https://support.mozilla.org/en-US/kb/diagnose-firefox-issues-using-troubleshoot-mode Troubleshoot Mode], which disables extensions, themes, hardware acceleration, the JIT and some other features for this session.<br />
<br />
This mode can also be enabled by pressing on the hamburger menu while Firefox is open, clicking ''Help'', selecting ''Troubleshoot Mode'' and confirming this on the modal dialog that appears. Please note this will require a browser restart.<br />
<br />
This mode was previously named Safe Mode until Firefox 88.<br />
<br />
=== Firefox refresh ===<br />
<br />
Some issues experienced by users in Firefox may be caused by profile issues, such as corruption.<br />
<br />
If you have ruled out other causes, it may be worth trying a new Firefox profile for testing purposes to see if this will resolve your issue. More information on how to create a new profile and switch between profiles can be found on the [https://support.mozilla.org/en-US/kb/profile-manager-create-remove-switch-firefox-profiles Firefox support page].<br />
<br />
If this resolves your issue, you should switch back to your original profile and consider refreshing your Firefox. <br />
<br />
Refreshing your profile will retain all browsing and download history, bookmarks, web form auto-fill data, cookies, personal dictionary and passwords, and will transfer them to a brand new profile without extensions, themes, extension data and preferences, among other data. A backup of your old profile will also be retained.<br />
<br />
To refresh your profile, navigate to {{ic|about:support}}, press ''Refresh Firefox'' and confirm this on the modal dialog that appears. {{ic|about:support}} can also be accessed by pressing the Hamburger menu, selecting ''Help'' and then clicking ''More troubleshooting information''.<br />
<br />
More information on refreshing your Firefox, including further details about what is transferred to the new profile, can be found on the [https://support.mozilla.org/en-US/kb/refresh-firefox-reset-add-ons-and-settings Firefox support page].<br />
<br />
=== Hardware video acceleration issues ===<br />
<br />
If you are having issues with hardware video acceleration in Firefox, e.g. in case of freezes or graphical corruption, start Firefox in [[#Troubleshoot Mode|Troubleshoot Mode]] for testing purposes to confirm that this is the issue. If this step resolves the issue, merely set {{ic|media.ffmpeg.vaapi.enabled}} to {{ic|false}} in {{ic|about:config}} to disable hardware video acceleration, and restart Firefox.<br />
<br />
=== Extension X does not work on some Mozilla owned domains ===<br />
<br />
By default, extensions will not affect pages designated by {{ic|extensions.webextensions.restrictedDomains}}. If this is not desired, this field can be cleared (special pages such as {{ic|about:*}} will not be affected). Then create and set {{ic|privacy.resistFingerprinting.block_mozAddonManager}} to true.<br />
<br />
=== Firefox startup takes very long ===<br />
<br />
If Firefox takes much longer to start up than other browsers, it may be due to lacking configuration of the localhost in {{ic|/etc/hosts}}. See [[Network configuration#Local network hostname resolution]] on how to set it up.<br />
<br />
Misbehaving Firefox extensions, or too many extensions, may be another source of slow startup. This can be confirmed through the use of [[#Troubleshoot Mode|Troubleshoot Mode]], which will disable extensions on restart. <br />
<br />
A further cause of slow start-up may be a profile issue, such as corruption. For more troubleshooting steps around your Firefox profile, see [[#Firefox refresh]].<br />
<br />
=== Font troubleshooting ===<br />
<br />
See [[Font configuration]].<br />
<br />
Firefox has a setting which determines how many replacements it will allow from Fontconfig. To allow it to use all your replacement rules, change {{ic|gfx.font_rendering.fontconfig.max_generic_substitutions}} to {{ic|127}} (the highest possible value).<br />
<br />
Firefox ships with the ''Twemoji Mozilla'' font. To use the system emoji font, set {{ic|font.name-list.emoji}} to {{ic|emoji}} in {{ic|about:config}}. Additionally, to prevent the Mozilla font interfering with your system emoji font, change {{ic|gfx.font_rendering.opentype_svg.enabled}} to {{ic|false}} or remove {{ic|/usr/lib/firefox/fonts/TwemojiMozilla.ttf}} (see also [[pacman#Skip files from being installed to system]]).<br />
<br />
=== Setting an email client ===<br />
<br />
Inside the browser, {{ic|mailto}} links by default are opened by a web application such as Gmail or Yahoo Mail. To set an external email program, go to ''Settings > General > Applications'' and modify the ''action'' corresponding to the {{ic|mailto}} content type; the file path will need to be designated (e.g. {{ic|/usr/bin/kmail}} for Kmail).<br />
<br />
Outside the browser, {{ic|mailto}} links are handled by the {{ic|x-scheme-handler/mailto}} mime type, which can be easily configured with [[xdg-mime]]. See [[Default applications]] for details and alternatives.<br />
<br />
=== File association ===<br />
<br />
See [[Default applications]].<br />
<br />
=== Firefox keeps creating ~/Desktop even when this is not desired ===<br />
<br />
Firefox uses {{ic|~/Desktop}} as the default place for download and upload files. To change it to another folder, set the {{ic|XDG_DESKTOP_DIR}} option as explained in [[XDG user directories]].<br />
<br />
=== Changes to userChrome.css and userContent.css are ignored ===<br />
<br />
Set {{ic|toolkit.legacyUserProfileCustomizations.stylesheets}} to {{ic|true}} in {{ic|about:config}}<br />
<br />
=== Middle-click behavior ===<br />
<br />
To use the middle mouse button to paste whatever text has been highlighted/added to the clipboard, as is common in UNIX-like operating systems, set either {{ic|middlemouse.contentLoadURL}} or {{ic|middlemouse.paste}} to {{ic|true}} in {{ic|about:config}}. Having {{ic|middlemouse.contentLoadURL}} enabled was the default behaviour prior to Firefox 57.<br />
<br />
To scroll on middle-click (default for Windows browsers), set {{ic|general.autoScroll}} to {{ic|true}}.<br />
<br />
=== Backspace does not work as the 'Back' button ===<br />
<br />
According to [http://kb.mozillazine.org/Browser.backspace_action MozillaZine], the {{ic|Backspace}} key was mapped based on which platform the browser was running on. As a compromise, this preference was created to allow the {{ic|Backspace}} key to either go back/forward, scroll up/down a page, or do nothing.<br />
<br />
To make {{ic|Backspace}} go back one page in the tab's history and {{ic|Shift+Backspace}} go forward, set {{ic|browser.backspace_action}} to {{ic|0}} in {{ic|about:config}}.<br />
<br />
To have the {{ic|Backspace}} key scroll up one page and {{ic|Shift+Backspace}} scroll down one page, set {{ic|browser.backspace_action}} to {{ic|1}}. Setting this property to any other value will leave the key unmapped (Arch Linux defaults to {{ic|2}}; in other words, it is unmapped by default).<br />
<br />
=== Firefox does not remember login information ===<br />
<br />
It may be due to a corrupted {{ic|cookies.sqlite}} file in [https://support.mozilla.org/en-US/kb/profiles-where-firefox-stores-user-data Firefox's profile] folder. In order to fix this, just rename or remove {{ic|cookie.sqlite}} while Firefox is not running.<br />
<br />
Open a terminal of choice and type the following:<br />
<br />
$ rm -f ~/.mozilla/firefox/<profile id>.default/cookies.sqlite<br />
<br />
The profile id is a random 8 character string.<br />
<br />
Restart Firefox and see if it solved the problem.<br />
<br />
If it did not work, check if there exists a {{ic|cookies.sqlite.bak}} file that you could use to manually restore the cookies.<br />
<br />
=== Cannot enter/leave fullscreen ===<br />
<br />
If Firefox detects an [https://specifications.freedesktop.org/wm-spec/wm-spec-latest.html EWMH/ICCCM] compliant window manager, it will try to send a WM_STATE message to the root window to request Firefox be made to enter (or leave) full-screen mode (as defined by the window manager). Window managers are allowed to ignore it, but if they do, Firefox will assume the request got denied and propagate it to the end user which results in nothing happening. This may result in not being able to full screen a video. A general workaround is to set the {{ic|full-screen-api.ignore-widgets}} to {{ic|true}} in {{ic|about:config}}. <br />
<br />
Related bug reports: [https://bugzilla.mozilla.org/show_bug.cgi?id=1189622 Bugzilla 1189622].<br />
<br />
=== Scrollbar is not hidden/disabled when YouTube is fullscreen ===<br />
<br />
{{Accuracy|This is not supposed to happen. Adding a uBlock Origin filter is a hacky workaround something that sounds like a bug (or perhaps another extension meddling with things).}}<br />
<br />
This can be fixed using a [https://ublockorigin.com/ uBlock Origin] filter. To add a filter, click the uBlock Origin extension icon > Three cogwheels (''Open the dashboard'') > ''My Filters''. Then, add the following to the text field:<br />
<br />
www.youtube.com##ytd-app:style(overflow: hidden !important;)<br />
<br />
After applying the changes and reloading the YouTube window, the filter will take effect. Note that you have to have cosmetic filtering enabled for this to work (the middle icon with the eye).<br />
<br />
=== JavaScript context menu does not appear on some sites ===<br />
<br />
You can try setting {{ic|dom.w3c_touch_events.enabled}} to {{ic|0}} in {{ic|about:config}}.<br />
<br />
=== Firefox does not remember default spell check language ===<br />
<br />
The default spell checking language can be set as follows:<br />
<br />
# Type {{ic|about:config}} in the address bar.<br />
# Set {{ic|spellchecker.dictionary}} to your language of choice, for instance {{ic|en_GB}}.<br />
# Notice that the for dictionaries installed as a Firefox plugin the notation is {{ic|en-GB}}, and for {{Pkg|hunspell}} dictionaries the notation is {{ic|en_GB}}.<br />
<br />
When you only have system wide dictionaries installed with {{Pkg|hunspell}}, Firefox might not remember your default dictionary language settings. This can be fixed by having at least one [https://addons.mozilla.org/firefox/language-tools/ dictionary] installed as a Firefox plugin. Notice that now you will also have a tab ''Dictionaries'' in ''Add-ons''. You may have to change the order of ''preferred language for displaying pages'' in {{ic|about:preferences#general}} to make the spell check default to the language of the addon dictionary.<br />
<br />
Related questions on the '''StackExchange''' platform: [https://stackoverflow.com/questions/26936792/change-firefox-spell-check-default-language/29446115], [https://stackoverflow.com/questions/21542515/change-default-language-on-firefox/29446353], [https://askubuntu.com/questions/184300/how-can-i-change-firefoxs-default-dictionary/576877]<br />
<br />
Related bug reports: [https://bugzilla.mozilla.org/show_bug.cgi?id=776028 Bugzilla 776028], [https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1026869 Ubuntu bug 1026869]<br />
<br />
=== Some MathML symbols are missing ===<br />
<br />
You need some Math fonts, namely Latin Modern Math and STIX (see this MDN page: [https://developer.mozilla.org/en-US/docs/Mozilla/MathML_Project/Fonts#Linux]), to display MathML correctly.<br />
<br />
In Arch Linux, these fonts are provided by {{Pkg|texlive-core}} '''and''' {{Pkg|texlive-fontsextra}}, but they are not available to fontconfig by default. See [[TeX Live#Making fonts available to Fontconfig]] for details. You can also try other [[Fonts#Math|Math fonts]]. In case you encounter this bug [https://bugzilla.mozilla.org/show_bug.cgi?id=1208776], installing {{Pkg|otf-latinmodern-math}} can help.<br />
<br />
=== Videos load but do not play ===<br />
<br />
This may be a PulseAudio issue. See the suggested fix in [[PulseAudio/Troubleshooting#Browsers load videos but do no play]].<br />
<br />
=== Tearing when scrolling ===<br />
<br />
Try disabling smooth scrolling in ''Settings > General >Browsing''.<br />
<br />
=== Firefox WebRTC module cannot detect a microphone ===<br />
<br />
WebRTC applications for instance [https://mozilla.github.io/webrtc-landing/gum_test.html Firefox WebRTC getUserMedia test page] say that microphone cannot be found. Issue is reproducible for both ALSA or PulseAudio setup. Firefox debug logs show the following error:<br />
<br />
{{hc|1=$ NSPR_LOG_MODULES=MediaManager:5,GetUserMedia:5 firefox|2=<br />
...<br />
[Unnamed thread 0x7fd7c0654340]: D/GetUserMedia VoEHardware:GetRecordingDeviceName: Failed 1<br />
}}<br />
<br />
You can try setting {{ic|media.navigator.audio.full_duplex}} property to {{ic|false}} at {{ic|about:config}} Firefox page and restart Firefox.<br />
<br />
This can also help if you are using the PulseAudio [[PulseAudio#Microphone echo/noise cancellation|module-echo-cancel]] and Firefox does not recognise the virtual echo canceling source.<br />
<br />
=== WebRTC sharing indicator displays an XML parsing error ===<br />
<br />
After agreeing to share a microphone or web camera, you may then see a window with a tan background and a red border in the top left corner on your primary window, displaying the following error message:<br />
<br />
XML Parsing Error: no root element found<br />
Location: chrome://browser/content/webrtcLegacyIndicator.xhtml<br />
Line Number: 1, Column 1:<br />
^<br />
<br />
If this is the case for you, performing the following steps should resolve the issue:<br />
<br />
# Navigate to {{ic|about:support}}.<br />
# Click on the ''Clear Startup Cache'' button and agree to restart the browser.<br />
<br />
See [https://bugzilla.mozilla.org/show_bug.cgi?id=1639821 Mozilla's bug report] for more information.<br />
<br />
=== Cannot login with my Chinese account ===<br />
<br />
Firefox provides a local service for Chinese users, with a local account totally different from the international one. Firefox installed with the {{Pkg|firefox}} package uses the international account system by default, to change into the Chinese local service, you should install the add-on manager on [http://mozilla.com.cn/thread-343905-1-1.html this page], then you can login with your Chinese account now.<br />
<br />
=== No audio on certain videos when using JACK and PulseAudio ===<br />
<br />
If you are using JACK in combination with PulseAudio and cannot hear any sound on some videos, it could be because those videos have mono audio. This happens if your JACK setup uses more than just stereo, but you use normal headphones. To fix this, you simply have to connect the {{ic|front-center}} port from the PulseAudio JACK Sink to both {{ic|playback_1}} and {{ic|playback_2}} ports of the system output.<br />
<br />
You can also do this automatically using a script:<br />
<br />
{{hc|jack-mono.sh<br />
|2=#!/bin/sh<br />
jack_connect "PulseAudio JACK Sink:front-center" "system:playback_1"<br />
jack_connect "PulseAudio JACK Sink:front-center" "system:playback_2"<br />
}}<br />
<br />
Keep in mind that the names for the sink and the ports might be different for you. You can check what your JACK setup looks like with a Patchbay like Catia from {{Pkg|cadence}}.<br />
<br />
=== Geolocation does not work ===<br />
<br />
Recently, Google limited the use of its location service with Arch Linux, which causes the following error when geolocation is enabled on a website: {{ic|Geolocation error: Unknown error acquiring position}}. Region-locked services such as [https://www.hulu.com/ Hulu] may display a similar error indicating that your location could not be determined even though you have allowed location services for the site.<br />
<br />
To avoid these problems, you can switch to use the [https://location.services.mozilla.com/ Mozilla Location Service]. In {{ic|about:config}} change the {{ic|geo.provider.network.url}} setting to:<br />
<br />
<nowiki>https://location.services.mozilla.com/v1/geolocate?key=%MOZILLA_API_KEY%</nowiki><br />
<br />
See {{Bug|65241}} for more details.<br />
<br />
=== Right mouse button instantly clicks the first option in window managers ===<br />
<br />
This problem has been observed in [[i3]], [[bspwm]] and [[xmonad]].<br />
<br />
To fix it, navigate to {{ic|about:config}} and change {{ic|ui.context_menus.after_mouseup}} to {{ic|true}}.<br />
<br />
See [https://www.reddit.com/r/i3wm/comments/88k0yt/right_mouse_btn_instantly_clicks_first_option_in/]<br />
<br />
=== Firefox window does not repaint after disabling or enabling compositing ===<br />
<br />
Unset the environment variable {{ic|MOZ_X11_EGL}}.<br />
<br />
Related bug report: [https://bugzilla.mozilla.org/show_bug.cgi?id=1711039 Bugzilla 1711039].<br />
<br />
=== Firefox continuously asks to be set as default browser upon launch ===<br />
<br />
There are a couple things you can try: if you are using a [[desktop environment]], check if Firefox is set as the default browser in your system settings. If it is not, then set it, otherwise you can run the following {{man|1|xdg-settings}} command, provided by the [[xdg-utils]] package, to query which browser is set as default on your system:<br />
<br />
$ xdg-settings get default-web-browser<br />
<br />
If no value is returned or it is not Firefox, then run this command to set it:<br />
<br />
$ xdg-settings set default-web-browser firefox.desktop<br />
<br />
If Firefox still asks to be set as the default browser, then it may be quieted if it is set to handle ''http'' and ''https'' URL schemes. To do so, run these {{man|1|xdg-mime}} commands: <br />
<br />
$ xdg-mime default firefox.desktop x-scheme-handler/http<br />
$ xdg-mime default firefox.desktop x-scheme-handler/https<br />
<br />
If those do not work either, check if you have set the environment variable {{ic|GTK_USE_PORTAL}} (all values trigger the bug), in which case, unset it. Related bug report: [https://bugzilla.mozilla.org/show_bug.cgi?id=1516290 Bugzilla 1516290]. If that does not work or you did not set it, navigate Firefox to {{ic|about:config}}, check if the variable {{ic|widget.use-xdg-desktop-portal}} is set to {{ic|true}} and, if so, set it to {{ic|false}}.<br />
<br />
If you wish to disable default browser check entirely, navigate Firefox to {{ic|about:config}} and set {{ic|browser.shell.checkDefaultBrowser}} to {{ic|false}}.<br />
<br />
=== Video stuttering ===<br />
<br />
If you experience video stuttering and you notice that Firefox is only hitting one core at 100% when watching videos (especially higher resolution videos), this might help you.<br />
<br />
Go into {{ic|about:config}} and search for {{ic|dom.ipc.processCount}} and change {{ic|dom.ipc.processCount.file}} from 1 to a higher number. An ad hoc method to find a good number is to increase it one at a time until you get good results, but 4 seems to be a good value.<br />
<br />
=== Bengali font broken in some pages ===<br />
<br />
In most cases, installing the {{Pkg|noto-fonts}} and making '''Noto Sans Bengali''' as defaults in '''Fonts and Colors''' settings solves it. However, in some social media sites, Bengali fonts may still be broken. In those cases, Mozilla provides a detailed guide on how to see all the fonts gets loaded in a page. By using [https://developer.mozilla.org/en-US/docs/Tools/Page_Inspector/How_to/Open_the_Inspector Page Inspector], find out [https://developer.mozilla.org/en-US/docs/Tools/Page_Inspector/How_to/Edit_fonts#all_fonts_on_page all the fonts] that are being loaded on that particular page. Removing fonts other than '''Noto Sans''' from the system will resolve the issue permanently.<br />
<br />
There will be some fonts that have been installed as dependency of other package. For example, {{Pkg|chromium}} installs {{Pkg|ttf-liberation}} as dependency, which loads itself in some Firefox pages automatically and breaks Bengali fonts on those pages. To solve this issue, use the following rule in your [[font configuration]]: <br />
<br />
{{hc|$XDG_CONFIG_HOME/fontconfig/fonts.conf|2=<br />
<match target="pattern"><br />
<test qual="any" name="family"><string>Liberation</string></test><br />
<edit mode="assign" name="family" binding="same"><string>Noto Sans Bengali</string></edit><br />
</match><br />
}}<br />
<br />
=== Web Speech API has no voices ===<br />
<br />
Firefox uses for text to speech (tts) speechd. You can use the command {{ic|spd-say "some test sentence"}} to test if it reads the text or {{ic|spd-say -L}} to get a list of the voices. If there are no voices, too, you can install some with the package {{Pkg|espeak-ng}}. If they do not work out of the box, you maybe have to configure them. You can use the {{ic|spd-conf}} command or edit the config file {{ic|.config/speech-dispatcher/speechd.conf}}. There should be the following lines active (without # in front of it):<br />
<br />
AddModule "espeak-ng" "sd_espeak-ng" "espeak-ng.conf"<br />
DefaultModule espeak-ng<br />
<br />
=== Narrate/Listen icon missing in Reader Mode === <br />
<br />
==== Enable Speech Synthesis ====<br />
<br />
Per https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API/Using_the_Web_Speech_API, speech synthesis must be enabled (it is enabled by default). To enable, set {{ic|media.webspeech.synth.enabled}} to {{ic|true}} in {{ic|about:config}}.<br />
<br />
==== Disable Fingerprinting Protection ====<br />
<br />
Per https://support.mozilla.org/en-US/kb/firefox-protection-against-fingerprinting,<br />
Fingerprinting Protection disables the WebSpeech API. If you enabled this option, you will need to disable it for the narrator to work. To disable fingerprinting protection, set {{ic|privacy.resistFingerprinting}} to {{ic|false}} in {{ic|about:config}}.<br />
<br />
==== Disable filter voices ====<br />
<br />
If you do not see the narrator icon, try setting {{ic|narrate.filter-voices}} to {{ic|false}} in {{ic|about:config}}.<br />
<br />
This can be used to check whether {{ic|speech-dispatcher}} works at all. If it helps, you may miss voices for the language of the article opened in reader mode (check {{ic|spd-say -L}}). If you have voices for the reader article language installed, there may be some incorrect settings or defaults related to {{ic|speech-dispatcher}} configuration.<br />
<br />
=== File dialogs do not open when downloading files ===<br />
<br />
If no file chooser is shown when downloading files, even with the option "Always ask where to save files" enabled in Firefox's preferences, then you might not have both {{Pkg|xdg-desktop-portal}} and a suitable implementation. Desktop environments usually provide an implementation, but if you are using a standalone window manager such as [[i3]], then you may need to manually install one. [[Install]] {{Pkg|xdg-desktop-portal}} and for example {{Pkg|xdg-desktop-portal-gtk}}.<br />
<br />
== See also ==<br />
<br />
* [https://www.mozilla.org/firefox/ Official website]<br />
* [https://www.mozilla.org/ Mozilla Foundation]<br />
* [[MozillaWiki:Firefox]]<br />
* [[Wikipedia:Mozilla Firefox]]<br />
* [https://addons.mozilla.org/ Firefox Add-ons]<br />
* [https://addons.mozilla.org/firefox/themes/ Firefox themes]<br />
* [https://ftp.mozilla.org/pub/firefox/releases/ Mozilla's FTP]<br />
* [http://forums.mozillazine.org/ mozillaZine] unofficial forums</div>Meriboldhttps://wiki.archlinux.org/index.php?title=Firefox&diff=765556Firefox2023-01-29T06:49:55Z<p>Meribold: Add "Custom date and time format in Library window" item to "Tips and tricks" section</p>
<hr />
<div>[[Category:Web browser]]<br />
[[Category:Mozilla]]<br />
[[de:Firefox]]<br />
[[es:Firefox]]<br />
[[ja:Firefox]]<br />
[[ru:Firefox]]<br />
[[zh-hans:Firefox]]<br />
[[zh-hant:Firefox]]<br />
{{Related articles start}}<br />
{{Related|Firefox/Tweaks}}<br />
{{Related|Firefox/Profile on RAM}}<br />
{{Related|Firefox/Privacy}}<br />
{{Related|Browser extensions}}<br />
{{Related|Chromium}}<br />
{{Related|Opera}}<br />
{{Related articles end}}<br />
[https://www.mozilla.org/firefox Firefox] is a popular open source graphical web browser from [https://www.mozilla.org Mozilla].<br />
<br />
{{Note|For older versions, there may be no "Settings" but "Preferences" in their menus. You can replace "Settings" in the article with "Preferences" if need.}}<br />
<br />
== Installing ==<br />
<br />
Firefox can be [[install]]ed with the {{Pkg|firefox}} package.<br />
<br />
Other alternatives include:<br />
<br />
* {{App|Firefox Developer Edition|for developers|https://www.mozilla.org/firefox/developer/|{{Pkg|firefox-developer-edition}}}}<br />
* {{App|Firefox Extended Support Release|long-term supported version|https://www.mozilla.org/firefox/organizations/|{{AUR|firefox-esr}} or {{AUR|firefox-esr-bin}}}}<br />
* {{App|Firefox Beta|cutting-edge version|https://www.mozilla.org/firefox/channel/desktop/#beta|{{AUR|firefox-beta-bin}}}}<br />
* {{App|Firefox Nightly|nightly builds for testing ([https://developer.mozilla.org/Firefox/Experimental_features experimental features])|https://www.mozilla.org/firefox/channel/desktop/#nightly|{{AUR|firefox-nightly}}}} <br />
* {{App|Firefox KDE|Version of Firefox that incorporates an OpenSUSE patch for better [[#KDE integration|KDE integration]] than is possible through simple Firefox add-ons.|https://build.opensuse.org/package/show/mozilla:Factory/MozillaFirefox|{{AUR|firefox-kde-opensuse}}, {{AUR|firefox-kde}} or {{AUR|firefox-developer-edition-kde}}}}<br />
* On top of the different Mozilla build channels, a number of forks exist with more or less special features; see [[List of applications#Gecko-based]].<br />
<br />
A number of language packs are available for Firefox, other than the standard English. Language packs are usually named as {{ic|firefox-i18n-''languagecode''}} (where {{ic|''languagecode''}} can be any language code, such as '''de''', '''ja''', '''fr''', etc.). For a list of available language packs, see [https://archlinux.org/packages/extra/any/firefox-i18n/ firefox-i18n] for {{Pkg|firefox}}, [https://archlinux.org/packages/community/any/firefox-developer-edition-i18n/ firefox-developer-edition-i18n] for {{Pkg|firefox-developer-edition}} and [https://aur.archlinux.org/packages/?K=firefox-nightly- firefox-nightly-] for {{AUR|firefox-nightly}}.<br />
<br />
{{Note|1=Language packs are disabled on ''-nightly'' and ''-developer-edition'' due to frequent string changes that may cause crashes. To force a change to the UI language, you may need to set {{ic|intl.locale.requested}} in {{ic|about:config}} [https://www.reddit.com/r/firefox/comments/lx3dp9/how_to_change_interface_language/gpovlsp/?context=8&depth=9].}}<br />
<br />
== Add-ons ==<br />
<br />
Firefox is well known for its large library of add-ons which can be used to add new features or modify the behavior of existing features. Firefox's "Add-ons Manager" is used to manage installed add-ons or find new ones. <br />
<br />
For instructions on how to install add-ons and a list of add-ons, see [[Browser extensions]].<br />
<br />
=== Adding search engines ===<br />
<br />
Search engines may be added to Firefox by creating bookmarks:<br />
<br />
* Press the star on the address bar or {{ic|Ctrl+d}}.<br />
* Right click on the bookmark you have created, then press ''Edit Bookmark...''<br />
* Complete the ''URL'' field with search URLs. Complete the place of the query with {{ic|%s}}. Complete the ''Keyword'' field with user-defined characters. Like this:<br />
<br />
URL:<br />
https://duckduckgo.com/html/?q=%s<br />
Keyword:<br />
d<br />
<br />
{{Note|Older versions use "Location" instead of "URL".}}<br />
<br />
Searches are performed by pre-pending the search term with the keyword of the specified search engine: {{ic|d archwiki}} will query DuckDuckGo using the search term {{ic|archwiki}}<br />
<br />
Search engines may also be added to Firefox through add-on extensions; see [https://addons.mozilla.org/firefox/search-tools/ this page] for a list of available search tools and engines.<br />
<br />
A very extensive list of search engines can be found at the [https://mycroftproject.com/ Mycroft Project].<br />
<br />
==== firefox-extension-arch-search ====<br />
<br />
[[Install]] the {{AUR|firefox-extension-arch-search}} package to add Arch-specific searches (AUR, wiki, forum, packages, etc) to the Firefox search toolbar.<br />
<br />
== Plugins ==<br />
<br />
Support for all plugins, including Flash Player, was removed in Firefox 85.[https://support.mozilla.org/kb/npapi-plugins][https://support.mozilla.org/kb/end-support-adobe-flash]<br />
<br />
== Configuration ==<br />
<br />
Firefox exposes a number of configuration options. To examine them, enter in the Firefox address bar:<br />
<br />
about:config<br />
<br />
Once set, these affect the user's current profile, and may be synchronized across all devices via [https://www.mozilla.org/firefox/sync/ Firefox Sync]. Please note that only a subset of the {{ic|about:config}} entries are synchronized by this method, and the exact subset may be found by searching for {{ic|services.sync.prefs}} in {{ic|about:config}}. Additional preferences and third party preferences may be synchronized by creating new boolean entries prepending the value with [https://support.mozilla.org/en-US/kb/sync-custom-preferences services.sync.prefs.sync]. To synchronize the whitelist for the extension [https://addons.mozilla.org/firefox/addon/noscript/ NoScript]:<br />
<br />
services.sync.prefs.sync.capability.policy.maonoscript.sites<br />
<br />
The boolean {{ic|noscript.sync.enabled}} must be set to {{ic|true}} to synchronize the remainder of NoScript's preferences via Firefox Sync.<br />
<br />
=== Settings storage ===<br />
<br />
Firefox stores the configuration for a profile via a {{ic|prefs.js}} in the profile folder, usually {{ic|~/.mozilla/firefox/''xxxxxxxx''.default/}}. <br />
<br />
Firefox also allows configuration for a profile via a {{ic|user.js}} file: [http://kb.mozillazine.org/User.js_file user.js] kept also in the profile folder. A {{ic|user.js}} configuration supersedes a {{ic|prefs.js}}. The {{ic|user.js}} configuration is only parsed at start-up of a profile. Hence, you can test changes via {{ic|about:config}} and modify {{ic|user.js}} at runtime accordingly. For a useful starting point, see e.g [https://github.com/pyllyukko/user.js custom user.js] which is targeted at privacy/security conscious users.<br />
<br />
One drawback of the above approach is that it is not applied system-wide. Furthermore, this is not useful as a "pre-configuration", since the profile directory is created after first launch of the browser. You can, however, let ''firefox'' create a new profile and, after closing it again, [https://support.mozilla.org/en-US/kb/back-and-restore-information-firefox-profiles#w_restoring-a-profile-backup copy the contents] of an already created profile folder into it. <br />
<br />
Sometimes, it may be desired to lock certain settings, a feature useful in widespread deployments of customized Firefox. In order to create a system-wide configuration, follow the steps outlined in [https://support.mozilla.org/en-US/kb/customizing-firefox-using-autoconfig Customizing Firefox Using AutoConfig]:<br />
<br />
1. Create {{ic|/usr/lib/firefox/defaults/pref/autoconfig.js}}:<br />
<br />
pref("general.config.filename", "firefox.cfg");<br />
pref("general.config.obscure_value", 0);<br />
<br />
2. Create {{ic|/usr/lib/firefox/firefox.cfg}} (this stores the actual configuration):<br />
<br />
//<br />
//...your settings...<br />
// e.g to disable Pocket, uncomment the following lines<br />
// lockPref("extensions.pocket.enabled", false);<br />
// lockPref("browser.newtabpage.activity-stream.feeds.section.topstories", false);<br />
<br />
Please note that the first line must contain exactly {{ic|//}}. The syntax of the file is similar to that of {{ic|user.js}}.<br />
<br />
=== Multimedia playback ===<br />
<br />
Firefox uses [[FFmpeg]] for playing multimedia inside HTML5 {{ic|<audio>}} and {{ic|<video>}} elements. Go to [https://cconcolato.github.io/media-mime-support/ video-test page] or [https://hpr.dogphilosophy.net/test/ audio-test page] to check which formats are actually supported.<br />
<br />
Firefox uses [[PulseAudio]] for audio playback and capture. If PulseAudio is not installed, Firefox uses [[ALSA]] instead.<br />
<br />
{{Tip|Firefox might not play video if audio is not configured. If you are intending to use [[PipeWire]] and [[WirePlumber]], make sure they are working properly.}}<br />
<br />
==== HTML5 DRM/Widevine ====<br />
<br />
Widevine is a digital rights management tool that Netflix, Amazon Prime Video, and others use to protect their video content. It can be enabled in ''Settings > General > Digital Rights Management (DRM) Content''. If you visit a Widevine-enabled page when this setting is disabled, Firefox will display a prompt below the address bar asking for permission to install DRM. Approve this and then wait for the "Downloading" bar to disappear; now, you are able to watch videos from Widevine protected sites. <br />
<br />
Firefox can only play 720p video (or lower) with Widevine, due to not using [https://bugzilla.mozilla.org/show_bug.cgi?id=1700815 hardware DRM playback]. It is also required that the private mode browsing is disabled, for the window and in the Settings.<br />
<br />
==== "Open With" extension ====<br />
<br />
# Install [https://addons.mozilla.org/firefox/addon/open-with/ Open With] add-on.<br />
# Go to ''Add-ons > Open With > Preferences''.<br />
# Proceed with instructions to install a file in your system and test the installation. <br />
# Click ''Add browser''.<br />
# In the dialog, write a name for this menu entry and command to start a video streaming capable player (e.g. {{ic|/usr/bin/mpv}}).<br />
## Optionally, add needed arguments to the player (e.g. you may want {{ic|--force-window --ytdl}} for [[mpv]]).<br />
# Right click on links or visit pages containing videos. Select newly created entry from Open With's menu and if the site is supported, the player will open as expected.<br />
<br />
The same procedure can be used to associate video downloaders such as ''youtube-dl''.<br />
<br />
==== Hardware video acceleration ====<br />
<br />
[[Hardware video acceleration]] via VA-API is available under [[Wayland]] [https://mastransky.wordpress.com/2020/06/03/firefox-on-fedora-finally-gets-va-api-on-wayland/] and [[Xorg]] [https://bugzilla.mozilla.org/show_bug.cgi?id=1619523] [https://www.phoronix.com/scan.php?page=news_item&px=Firefox-80-VA-API-X11].<br />
<br />
To enable VA-API in Firefox:<br />
<br />
# Ensure that your video card is correctly configured for VA-API as described in [[Hardware video acceleration]].<br />
# Ensure WebRender is enabled by navigating to {{ic|about:support}} and then ''Compositing''. It is enabled by default in GNOME and other desktop environments [https://mastransky.wordpress.com/2021/01/10/firefox-were-finally-getting-hw-acceleration-on-linux/]. <br />
#* Ensure you are not running Software WebRender as that will not work as of August 2021 [https://bugzilla.mozilla.org/show_bug.cgi?id=1723540#c1]. <br />
#* If necessary, Hardware WebRender can be force enabled by setting {{ic|gfx.webrender.all}} to {{ic|true}}.<br />
# Set {{ic|media.ffmpeg.vaapi.enabled}} to {{ic|true}} in {{ic|about:config}}<br />
# If using [[Wayland]], run Firefox with [[#Wayland|Wayland mode]] enabled.<br />
<br />
{{Note|1=<nowiki/><br />
* While NVIDIA's proprietary driver does not support VA-API, newer versions support DMA-BUF. Using {{AUR|libva-nvidia-driver}} will allow for hardware video decoding on NVIDIA using [[CUDA]]. See the [https://github.com/elFarto/nvidia-vaapi-driver/#firefox GitHub project] for documentation on necessary environment variables and about:config changes.<br />
* Since currently there is no DMA-BUF support for [[VDPAU]] nor {{Pkg|libva-vdpau-driver}}, this package will not enable hardware video acceleration in Firefox. In fact, as of Firefox 102, having this installed and {{ic|media.ffmpeg.vaapi.enabled}} set will make Firefox crash on startup.<br />
* Currently, Firefox's VA-API implementation can decode H.264/AVC, VP8 & VP9, AV1 encoded video. AV1 support requires FireFox 98+ [https://bugzilla.mozilla.org/show_bug.cgi?id=1745225].<br />
* Multi-GPU systems should automatically choose a suitable GPU for VA-API according to this [https://bugzilla.mozilla.org/show_bug.cgi?id=1588904#c36 solved issue].<br />
* [[AMDGPU]] users under {{Pkg|linux-hardened}} may need to rebuild ''linux-hardened'' with {{ic|1=CONFIG_CHECKPOINT_RESTORE=y}} due to {{Pkg|mesa}} [https://gitweb.gentoo.org/repo/gentoo.git/tree/media-libs/mesa/mesa-9999.ebuild requiring the kcmp syscall]. This may no longer be necessary due to this [https://bugzilla.mozilla.org/show_bug.cgi?id=1624743 bug being solved].<br />
}}<br />
<br />
VA-API usage can be verified by checking Firefox's VA-API logs. Run Firefox with the {{ic|1=MOZ_LOG="PlatformDecoderModule:5"}} environment variable and check in the log output that VA-API is enabled and used (search for the "VA-API" string) when playing a video for example. Pay attention to these logs as they might indicate that only one of the two possible compositors described before (WebRender or OpenGL) works with VA-API on your particular setup.<br />
<br />
{{Tip|<br />
* To allow hardware decoding in YouTube, the video codec used must be supported by the hardware. The profiles supported by your GPU can be checked with [[Hardware video acceleration#Verifying VA-API]] and the YouTube codecs used can ''sometimes'' (if offered by YouTube!) be controlled with the [https://addons.mozilla.org/firefox/addon/h264ify/ h264ify] or [https://addons.mozilla.org/firefox/addon/enhanced-h264ify/ enhanced-h264ify] extensions. Alternatively, you can install {{AUR|firefox-h264ify}}.<br />
}}<br />
<br />
=== Spell checking ===<br />
<br />
Firefox can use system-wide installed [[Hunspell]] dictionaries as well as dictionaries installed through its own extension system.<br />
<br />
To enable spell checking for a specific language, right click on any text field and check the ''Check Spelling'' box. To select a language for spell checking, you have to right click again and select your language from the ''Languages'' sub-menu.<br />
<br />
If your default language choice does not stick, see [[#Firefox does not remember default spell check language]].<br />
<br />
==== System-wide Hunspell dictionaries ====<br />
<br />
Install [[Hunspell]] and its dictionaries for the languages you require.<br />
<br />
==== Dictionaries as extensions ====<br />
<br />
To get more languages, right click on any text field, click ''Add Dictionaries...'' and select the dictionary you want to install from the [https://addons.mozilla.org/firefox/language-tools/ Dictionaries and Language Packs list].<br />
<br />
{{Tip|For Russian, the extension is packaged as {{Pkg|firefox-spell-ru}}.}}<br />
<br />
=== KDE integration ===<br />
<br />
* To bring the [[KDE]] look to GTK applications (including Firefox), install {{Pkg|breeze-gtk}} and {{Pkg|kde-gtk-config}}. Afterwards, go to System Settings and in ''Appearance > Application Style > Configure GNOME/GTK Application Style…'' choose 'Breeze'.<br />
* To use the KDE file selection and print dialogs in Firefox 64 or newer, install {{Pkg|xdg-desktop-portal}} and {{Pkg|xdg-desktop-portal-kde}}, then do one of the following:<br />
** Set {{ic|widget.use-xdg-desktop-portal.mime-handler}} to {{ic|1}} in {{ic|about:config}}. You should also change {{ic|widget.use-xdg-desktop-portal.file-picker}} from {{ic|2}} to {{ic|1}}.<br />
** Launch firefox with {{ic|1=GTK_USE_PORTAL=1}} [[environment variable]].<br />
* For integration with [[KDE]] MIME type system, proxy and file dialog, one can use {{AUR|firefox-kde-opensuse}} variant from AUR with OpenSUSE’s patches applied. Alternatively, integration with MIME types can be achieved by creating a symbolic link to the MIME database {{ic|~/.config/mimeapps.list}} from the deprecated {{ic|~/.local/share/applications/mimeapps.list}} that is used by Firefox. See [[XDG MIME Applications#mimeapps.list]].<br />
* Extensions/add-ons may provide additional integration, such as:<br />
** Browser integration in [[Plasma]]: requires {{Pkg|plasma-browser-integration}} and the [https://addons.mozilla.org/firefox/addon/plasma-integration/ Plasma Integration add-on].<br />
::{{Tip|To prevent duplicate entries in the Media Player widget or tray icon, set {{ic|media.hardwaremediakeys.enabled}} to {{ic|false}}. This disables the media entry from Firefox and only uses the one from the Plasma integration add-on.}}<br />
<br />
=== Listen (text to speech) ===<br />
<br />
Firefox can perform Text to Speech synthesis for web pages.<br />
<br />
==== Setup ====<br />
<br />
{{Merge|Speech Dispatcher|2=Speech Dispatcher is used for more than just Firefox.[https://bbs.archlinux.org/viewtopic.php?id=243537] A dedicated page might be in order.}}<br />
<br />
{{Expansion|It should be possible to write a systemd service for running Festival in the background.}}<br />
<br />
TTS must be setup for the ''Listen'' icon to appear in the Reader view. Firefox uses [https://github.com/brailcom/speechd Speech Dispatcher] ([https://htmlpreview.github.io/?https://github.com/brailcom/speechd/blob/master/doc/speech-dispatcher.html#Recommended-installation-procedure Speech Dispatcher documentation]) which requires a speech synthesis engine. The currently recommended speech synthesis engine is [[Festival]].<br />
<br />
# [[Festival#Installation|Install Festival]] then [[Festival#Configuration|configure and test it]].<br />
# Install {{AUR|festival-freebsoft-utils}} (required to use Festival with Speech Dispatcher)<br />
# Install the package {{Pkg|speech-dispatcher}} then [[textedit|edit]] {{ic|/etc/speech-dispatcher/speechd.conf}} and uncomment the line that starts with {{ic|AddModule "festival"}}<br />
# Start Festival as a server: {{ic|festival --server}}<br />
# You should now be able to test Speech Dispatcher: {{ic|spd-conf -s}}<br />
<br />
==== Usage ====<br />
<br />
See the [https://support.mozilla.org/en-US/kb/firefox-reader-view-clutter-free-web-pages illustrated steps] on Mozilla's website.<br />
<br />
The ''Listen'' icon (a headphones icon) will only appear if you have performed all the configuration above, Speech Dispatcher is working, and you have started Firefox after you started the Festival server (you cannot start Firefox then Festival).<br />
<br />
Furthermore, sometimes a Festival server process may linger after you have tried to kill it, but will terminate after you shut down Firefox.<br />
<br />
For common issues, see [[#Web Speech API has no voices]] and [[#Narrate/Listen icon missing in Reader Mode]].<br />
<br />
==== Using the festival-us voices ====<br />
<br />
The voices in the package {{Pkg|festival-us}} provide better quality audio than those in {{Pkg|festival-english}} but they do not work in Firefox. They do not appear in the list of available voices in Firefox and when you open Reader view you will see error messages like this in the terminal output from the Festival server:<br />
<br />
{{bc| SIOD: unknown voice cmu_us_awb_cg }}<br />
<br />
To fix this you need to [[textedit|edit]] the following files:<br />
<br />
* {{ic|/usr/share/festival/voices/us/cmu_us_awb_cg/festvox/cmu_us_awb_cg.scm}}<br />
* {{ic|/usr/share/festival/voices/us/cmu_us_rms_cg/festvox/cmu_us_rms_cg.scm}}<br />
* {{ic|/usr/share/festival/voices/us/cmu_us_slt_cg/festvox/cmu_us_slt_cg.scm}}<br />
<br />
For each of these files you need to add some code to the second last line of code of each file, eg for {{ic|cmu_us_awb_cg.scm}} add code before this line:<br />
{{bc|(provide 'cmu_us_awb_cg)}}<br />
<br />
The code you need to add to {{ic|cmu_us_awb_cg.scm}} is below. You will need to change the voice name, gender, dialect and description as appropriate for the other two files.<br />
{{bc|<br />
(proclaim_voice<br />
'cmu_us_awb_cg<br />
'((language english)<br />
(gender male)<br />
(dialect scottish)<br />
(description "This voice is Scottish")))<br />
}}<br />
<br />
{{Note|To avoid re-doing those changes every time {{Pkg|festival-us}} is upgraded, see [[pacman#Skip file from being upgraded]].}}<br />
<br />
== Tips and tricks ==<br />
<br />
For general enhancements, see [[Firefox/Tweaks]], and for privacy related enhancements, see [[Firefox/Privacy]].<br />
<br />
=== Dark themes ===<br />
<br />
Firefox should respect your GTK theme settings and your OS-wide dark appearance settings (as in the Appearance section of GNOME's settings or KDE system settings). If the latter does not work, make sure to have a suitable {{Pkg|xdg-desktop-portal}} package installed.<br />
<br />
Starting with Firefox 68, you can make all the Firefox interfaces and even other websites respect dark themes, irrespective of the system GTK theme and Firefox theme. To do this, set {{ic|ui.systemUsesDarkTheme}} to {{ic|1}} in {{ic|about:config}} [https://bugzilla.mozilla.org/show_bug.cgi?id=1488384#c23].<br />
<br />
As of Firefox 100, further control of the dark theme of web pages that opt-in (using the CSS media query [https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme prefers-color-scheme]) and Firefox's own in-content pages is possible with {{ic|layout.css.prefers-color-scheme.content-override}}. Setting this to {{ic|3}} will follow the browser theme, setting this to {{ic|2}} will follow the system wide dark-mode preference ({{ic|ui.systemUsesDarkTheme}} as above, which defaults to {{ic|0}} if the user has not changed the dark-mode preference or if a system does not support a system-wide dark-mode preference), while {{ic|1}} and {{ic|0}} will always force light-mode and dark-mode respectively. This setting can also be accessed through the user settings of Firefox under ''General'' > ''Language and Appearance'' > ''Website appearance''.<br />
<br />
=== Frame rate ===<br />
<br />
If Firefox is unable to automatically detect the right value, it will default to 60 fps. To manually correct this, set {{ic|layout.frame_rate}} to the refresh rate of your monitor (e.g. 144 for 144 Hz).<br />
<br />
=== Memory limit ===<br />
<br />
To prevent pages from abusing memory (and possible [[Wikipedia:Out_of_memory|OOM]]), we can use [[Firejail]] with the {{ic|rlimit-as}} option.<br />
<br />
=== New tabs position ===<br />
<br />
To control where new tabs appears (relative or absolute), use {{ic|browser.tabs.insertAfterCurrent}} and {{ic|browser.tabs.insertRelatedAfterCurrent}}. See [https://support.mozilla.org/en/questions/1229062] for more information.<br />
<br />
=== Screenshot of webpage ===<br />
<br />
You can ''Take a Screenshot'' by either using the screenshots button that can be added to the toolbar from the customize screen in the Hamburger menu at ''More tools'' > ''Customize toolbar'', by pressing {{ic|Ctrl+Shift+s}} or by right-clicking on the webpage. See [https://support.mozilla.org/en-US/kb/firefox-screenshots] for more information.<br />
<br />
As an alternative, you can use the screenshot button in the developer tools, which can be added through the developer tools ''Settings'' menu, under the ''Available Toolbox Buttons'' section. The settings for the developer tools are accessible through the three horizontal dots located at the top right of the developer tools pane.<br />
<br />
=== Wayland ===<br />
<br />
More recent versions of Firefox support opting into [[Wayland]] mode via an [[environment variable]].<br />
<br />
$ MOZ_ENABLE_WAYLAND=1 firefox<br />
<br />
To make this permanent, see [[Environment variables#Graphical environment]] and start Firefox via the desktop launcher like you normally would.<br />
<br />
To verify that it worked, look for ''Window Protocol'' in {{ic|about:support}}. It should say {{ic|wayland}}. The presence of {{ic|x11}} means you are running Firefox under [[Xorg]] display server, while {{ic|xwayland}} means your system is running Wayland but executing Firefox as legacy X11 application. <br />
<br />
If it is necessary to be regularly switching between Wayland and X.org, it may be useful to add a conditional to your shell's login [[Command-line shell#Configuration files|startup script]], e.g. {{ic|~/.bash_profile}} for [[Bash]]:<br />
<br />
{{bc|1=<br />
if [ "$XDG_SESSION_TYPE" == "wayland" ]; then<br />
export MOZ_ENABLE_WAYLAND=1<br />
fi<br />
}}<br />
<br />
=== Window manager rules ===<br />
<br />
To apply different configurations to Firefox windows, change the WM_CLASS string by using Firefox's {{ic|--class}} option, to a custom one.<br />
<br />
=== Profiles ===<br />
<br />
To start new Firefox instances, multiple profiles are required. To create a new profile:<br />
<br />
$ firefox [--new-instance] -P<br />
<br />
Class can be specified when launching Firefox with a not-in-use profile:<br />
<br />
$ firefox [--new-instance] -P ''profile_name'' --class=''class_name''<br />
<br />
[https://ffprofile.com/ Firefox Profilemaker] can be used to create a Firefox profile with the defaults you like.<br />
<br />
=== Touchscreen gestures and pixel-perfect trackpad scrolling ===<br />
<br />
{{Merge|Firefox/Tweaks#Enable touchscreen gestures|Same solution.}}<br />
<br />
To enable touch gestures (like scrolling and pinch-to-zoom) and one-to-one trackpad scrolling (as can be witnessed with GTK3 applications like Nautilus), set the {{ic|1=MOZ_USE_XINPUT2=1}} [[environment variable]] before starting Firefox. On Wayland, only {{ic|1=MOZ_ENABLE_WAYLAND=1}} needs to be set.<br />
<br />
Kinetic scrolling feels loose on Wayland due to https://bugzilla.mozilla.org/show_bug.cgi?id=1568722, and can be turned off by going to {{ic|about:config}} and turning off {{ic|apz.gtk.kinetic_scroll.enabled}}. This will make it harder to scroll to the beginning and end of long pages, however.<br />
<br />
=== Multiple home pages ===<br />
<br />
To have multiple tabs opened when starting Firefox, open a new window and then open the sites you want to have as "home tabs".<br />
<br />
Now go to ''Settings > Home'' and under ''Homepage and new windows'' click the ''Use Current Pages'' button.<br />
<br />
Alternatively, go directly to ''Settings > Home'' and now under ''Homepage and new windows'' set the first field to ''Custom URLs..'' and enter the pages you want as new home pages in the following format:<br />
<br />
<nowiki>https://url1.com|https://url2.com|https://url3.com</nowiki><br />
<br />
=== View two pages side by side in the PDF viewer ===<br />
<br />
To display two pages at once with the integrated PDF viewer, set {{ic|pdfjs.spreadModeOnLoad}} to {{ic|1}} in in {{ic|about:config}}.<br />
<br />
=== Kiosk mode ===<br />
<br />
Firefox supports kiosk mode that shows pages in full screen without browser chrome, context menus, and other features useful for typical desktop browsing. These can be seen on ATMs or information panels where users are not expected to interact with the rest of the system.<br />
<br />
To use kiosk mode, start Firefox with:<br />
<br />
$ firefox --kiosk ''url''<br />
<br />
The startup page can be configured the settings or supplied as a command-line parameter.<br />
<br />
If you need printing, you can prevent Firefox from showing paper size configuration dialogs with:<br />
<br />
$ firefox --kiosk --kiosk-printing ''url''<br />
<br />
=== Compact mode ===<br />
<br />
Starting with Firefox version 89, the compact mode density option was removed from the Customize panel [https://support.mozilla.org/en-US/kb/compact-mode-workaround-firefox], but you can still use compact density. To do this, set {{ic|browser.uidensity}} to {{ic|1}} in {{ic|about:config}}.<br />
<br />
=== GNOME search provider ===<br />
<br />
Firefox includes a search provider for GNOME Shell which exposes Firefox bookmarks and history to GNOME Shell search while Firefox is running. To enable this provider go to {{ic|about:config}} and set {{ic|browser.gnome-search-provider.enabled}} to {{ic|true}}.<br />
<br />
Then, you must install {{AUR|firefox-gnome-search-provider}} to add the required GNOME configuration file; {{Pkg|firefox}} itself currently does not include it (see {{Bug|68705}}).<br />
<br />
=== Custom date and time format in Library window ===<br />
<br />
The date and time format used in the Library window (the window showing bookmarks, history and downloads, accessible via Ctrl+Shift+O and Ctrl+Shift+H) can be customized by setting {{ic|intl.date_time.pattern_override.date_short}}, {{ic|intl.date_time.pattern_override.time_short}}, and {{ic|intl.date_time.pattern_override.connector_short}} in {{ic|user.js}} or {{ic|about:config}}. To get a format similar to ISO 8601 and RFC 3339 ("2022-12-31 22:49"), set the three preferences to {{ic|yyyy-MM-dd}}, {{ic|HH:mm}}, and {{ic|{1} {0}}}, respectively.<br />
<br />
Setting the {{ic|LC_TIME}} environment variable to {{ic|en_DK.UTF-8}} only worked in old Firefox versions (perhaps 57 and earlier). There is a [https://bugzilla.mozilla.org/show_bug.cgi?id=1426907 bug report on bugzilla.mozilla.org] that contains further information.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Troubleshoot Mode ===<br />
<br />
The command line switch {{ic|-safe-mode}} starts Firefox in [https://support.mozilla.org/en-US/kb/diagnose-firefox-issues-using-troubleshoot-mode Troubleshoot Mode], which disables extensions, themes, hardware acceleration, the JIT and some other features for this session.<br />
<br />
This mode can also be enabled by pressing on the hamburger menu while Firefox is open, clicking ''Help'', selecting ''Troubleshoot Mode'' and confirming this on the modal dialog that appears. Please note this will require a browser restart.<br />
<br />
This mode was previously named Safe Mode until Firefox 88.<br />
<br />
=== Firefox refresh ===<br />
<br />
Some issues experienced by users in Firefox may be caused by profile issues, such as corruption.<br />
<br />
If you have ruled out other causes, it may be worth trying a new Firefox profile for testing purposes to see if this will resolve your issue. More information on how to create a new profile and switch between profiles can be found on the [https://support.mozilla.org/en-US/kb/profile-manager-create-remove-switch-firefox-profiles Firefox support page].<br />
<br />
If this resolves your issue, you should switch back to your original profile and consider refreshing your Firefox. <br />
<br />
Refreshing your profile will retain all browsing and download history, bookmarks, web form auto-fill data, cookies, personal dictionary and passwords, and will transfer them to a brand new profile without extensions, themes, extension data and preferences, among other data. A backup of your old profile will also be retained.<br />
<br />
To refresh your profile, navigate to {{ic|about:support}}, press ''Refresh Firefox'' and confirm this on the modal dialog that appears. {{ic|about:support}} can also be accessed by pressing the Hamburger menu, selecting ''Help'' and then clicking ''More troubleshooting information''.<br />
<br />
More information on refreshing your Firefox, including further details about what is transferred to the new profile, can be found on the [https://support.mozilla.org/en-US/kb/refresh-firefox-reset-add-ons-and-settings Firefox support page].<br />
<br />
=== Hardware video acceleration issues ===<br />
<br />
If you are having issues with hardware video acceleration in Firefox, e.g. in case of freezes or graphical corruption, start Firefox in [[#Troubleshoot Mode|Troubleshoot Mode]] for testing purposes to confirm that this is the issue. If this step resolves the issue, merely set {{ic|media.ffmpeg.vaapi.enabled}} to {{ic|false}} in {{ic|about:config}} to disable hardware video acceleration, and restart Firefox.<br />
<br />
=== Extension X does not work on some Mozilla owned domains ===<br />
<br />
By default, extensions will not affect pages designated by {{ic|extensions.webextensions.restrictedDomains}}. If this is not desired, this field can be cleared (special pages such as {{ic|about:*}} will not be affected). Then create and set {{ic|privacy.resistFingerprinting.block_mozAddonManager}} to true.<br />
<br />
=== Firefox startup takes very long ===<br />
<br />
If Firefox takes much longer to start up than other browsers, it may be due to lacking configuration of the localhost in {{ic|/etc/hosts}}. See [[Network configuration#Local network hostname resolution]] on how to set it up.<br />
<br />
Misbehaving Firefox extensions, or too many extensions, may be another source of slow startup. This can be confirmed through the use of [[#Troubleshoot Mode|Troubleshoot Mode]], which will disable extensions on restart. <br />
<br />
A further cause of slow start-up may be a profile issue, such as corruption. For more troubleshooting steps around your Firefox profile, see [[#Firefox refresh]].<br />
<br />
=== Font troubleshooting ===<br />
<br />
See [[Font configuration]].<br />
<br />
Firefox has a setting which determines how many replacements it will allow from Fontconfig. To allow it to use all your replacement rules, change {{ic|gfx.font_rendering.fontconfig.max_generic_substitutions}} to {{ic|127}} (the highest possible value).<br />
<br />
Firefox ships with the ''Twemoji Mozilla'' font. To use the system emoji font, set {{ic|font.name-list.emoji}} to {{ic|emoji}} in {{ic|about:config}}. Additionally, to prevent the Mozilla font interfering with your system emoji font, change {{ic|gfx.font_rendering.opentype_svg.enabled}} to {{ic|false}} or remove {{ic|/usr/lib/firefox/fonts/TwemojiMozilla.ttf}} (see also [[pacman#Skip files from being installed to system]]).<br />
<br />
=== Setting an email client ===<br />
<br />
Inside the browser, {{ic|mailto}} links by default are opened by a web application such as Gmail or Yahoo Mail. To set an external email program, go to ''Settings > General > Applications'' and modify the ''action'' corresponding to the {{ic|mailto}} content type; the file path will need to be designated (e.g. {{ic|/usr/bin/kmail}} for Kmail).<br />
<br />
Outside the browser, {{ic|mailto}} links are handled by the {{ic|x-scheme-handler/mailto}} mime type, which can be easily configured with [[xdg-mime]]. See [[Default applications]] for details and alternatives.<br />
<br />
=== File association ===<br />
<br />
See [[Default applications]].<br />
<br />
=== Firefox keeps creating ~/Desktop even when this is not desired ===<br />
<br />
Firefox uses {{ic|~/Desktop}} as the default place for download and upload files. To change it to another folder, set the {{ic|XDG_DESKTOP_DIR}} option as explained in [[XDG user directories]].<br />
<br />
=== Changes to userChrome.css and userContent.css are ignored ===<br />
<br />
Set {{ic|toolkit.legacyUserProfileCustomizations.stylesheets}} to {{ic|true}} in {{ic|about:config}}<br />
<br />
=== Middle-click behavior ===<br />
<br />
To use the middle mouse button to paste whatever text has been highlighted/added to the clipboard, as is common in UNIX-like operating systems, set either {{ic|middlemouse.contentLoadURL}} or {{ic|middlemouse.paste}} to {{ic|true}} in {{ic|about:config}}. Having {{ic|middlemouse.contentLoadURL}} enabled was the default behaviour prior to Firefox 57.<br />
<br />
To scroll on middle-click (default for Windows browsers), set {{ic|general.autoScroll}} to {{ic|true}}.<br />
<br />
=== Backspace does not work as the 'Back' button ===<br />
<br />
According to [http://kb.mozillazine.org/Browser.backspace_action MozillaZine], the {{ic|Backspace}} key was mapped based on which platform the browser was running on. As a compromise, this preference was created to allow the {{ic|Backspace}} key to either go back/forward, scroll up/down a page, or do nothing.<br />
<br />
To make {{ic|Backspace}} go back one page in the tab's history and {{ic|Shift+Backspace}} go forward, set {{ic|browser.backspace_action}} to {{ic|0}} in {{ic|about:config}}.<br />
<br />
To have the {{ic|Backspace}} key scroll up one page and {{ic|Shift+Backspace}} scroll down one page, set {{ic|browser.backspace_action}} to {{ic|1}}. Setting this property to any other value will leave the key unmapped (Arch Linux defaults to {{ic|2}}; in other words, it is unmapped by default).<br />
<br />
=== Firefox does not remember login information ===<br />
<br />
It may be due to a corrupted {{ic|cookies.sqlite}} file in [https://support.mozilla.org/en-US/kb/profiles-where-firefox-stores-user-data Firefox's profile] folder. In order to fix this, just rename or remove {{ic|cookie.sqlite}} while Firefox is not running.<br />
<br />
Open a terminal of choice and type the following:<br />
<br />
$ rm -f ~/.mozilla/firefox/<profile id>.default/cookies.sqlite<br />
<br />
The profile id is a random 8 character string.<br />
<br />
Restart Firefox and see if it solved the problem.<br />
<br />
If it did not work, check if there exists a {{ic|cookies.sqlite.bak}} file that you could use to manually restore the cookies.<br />
<br />
=== Cannot enter/leave fullscreen ===<br />
<br />
If Firefox detects an [https://specifications.freedesktop.org/wm-spec/wm-spec-latest.html EWMH/ICCCM] compliant window manager, it will try to send a WM_STATE message to the root window to request Firefox be made to enter (or leave) full-screen mode (as defined by the window manager). Window managers are allowed to ignore it, but if they do, Firefox will assume the request got denied and propagate it to the end user which results in nothing happening. This may result in not being able to full screen a video. A general workaround is to set the {{ic|full-screen-api.ignore-widgets}} to {{ic|true}} in {{ic|about:config}}. <br />
<br />
Related bug reports: [https://bugzilla.mozilla.org/show_bug.cgi?id=1189622 Bugzilla 1189622].<br />
<br />
=== Scrollbar is not hidden/disabled when YouTube is fullscreen ===<br />
<br />
{{Accuracy|This is not supposed to happen. Adding a uBlock Origin filter is a hacky workaround something that sounds like a bug (or perhaps another extension meddling with things).}}<br />
<br />
This can be fixed using a [https://ublockorigin.com/ uBlock Origin] filter. To add a filter, click the uBlock Origin extension icon > Three cogwheels (''Open the dashboard'') > ''My Filters''. Then, add the following to the text field:<br />
<br />
www.youtube.com##ytd-app:style(overflow: hidden !important;)<br />
<br />
After applying the changes and reloading the YouTube window, the filter will take effect. Note that you have to have cosmetic filtering enabled for this to work (the middle icon with the eye).<br />
<br />
=== JavaScript context menu does not appear on some sites ===<br />
<br />
You can try setting {{ic|dom.w3c_touch_events.enabled}} to {{ic|0}} in {{ic|about:config}}.<br />
<br />
=== Firefox does not remember default spell check language ===<br />
<br />
The default spell checking language can be set as follows:<br />
<br />
# Type {{ic|about:config}} in the address bar.<br />
# Set {{ic|spellchecker.dictionary}} to your language of choice, for instance {{ic|en_GB}}.<br />
# Notice that the for dictionaries installed as a Firefox plugin the notation is {{ic|en-GB}}, and for {{Pkg|hunspell}} dictionaries the notation is {{ic|en_GB}}.<br />
<br />
When you only have system wide dictionaries installed with {{Pkg|hunspell}}, Firefox might not remember your default dictionary language settings. This can be fixed by having at least one [https://addons.mozilla.org/firefox/language-tools/ dictionary] installed as a Firefox plugin. Notice that now you will also have a tab ''Dictionaries'' in ''Add-ons''. You may have to change the order of ''preferred language for displaying pages'' in {{ic|about:preferences#general}} to make the spell check default to the language of the addon dictionary.<br />
<br />
Related questions on the '''StackExchange''' platform: [https://stackoverflow.com/questions/26936792/change-firefox-spell-check-default-language/29446115], [https://stackoverflow.com/questions/21542515/change-default-language-on-firefox/29446353], [https://askubuntu.com/questions/184300/how-can-i-change-firefoxs-default-dictionary/576877]<br />
<br />
Related bug reports: [https://bugzilla.mozilla.org/show_bug.cgi?id=776028 Bugzilla 776028], [https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1026869 Ubuntu bug 1026869]<br />
<br />
=== Some MathML symbols are missing ===<br />
<br />
You need some Math fonts, namely Latin Modern Math and STIX (see this MDN page: [https://developer.mozilla.org/en-US/docs/Mozilla/MathML_Project/Fonts#Linux]), to display MathML correctly.<br />
<br />
In Arch Linux, these fonts are provided by {{Pkg|texlive-core}} '''and''' {{Pkg|texlive-fontsextra}}, but they are not available to fontconfig by default. See [[TeX Live#Making fonts available to Fontconfig]] for details. You can also try other [[Fonts#Math|Math fonts]]. In case you encounter this bug [https://bugzilla.mozilla.org/show_bug.cgi?id=1208776], installing {{Pkg|otf-latinmodern-math}} can help.<br />
<br />
=== Videos load but do not play ===<br />
<br />
This may be a PulseAudio issue. See the suggested fix in [[PulseAudio/Troubleshooting#Browsers load videos but do no play]].<br />
<br />
=== Tearing when scrolling ===<br />
<br />
Try disabling smooth scrolling in ''Settings > General >Browsing''.<br />
<br />
=== Firefox WebRTC module cannot detect a microphone ===<br />
<br />
WebRTC applications for instance [https://mozilla.github.io/webrtc-landing/gum_test.html Firefox WebRTC getUserMedia test page] say that microphone cannot be found. Issue is reproducible for both ALSA or PulseAudio setup. Firefox debug logs show the following error:<br />
<br />
{{hc|1=$ NSPR_LOG_MODULES=MediaManager:5,GetUserMedia:5 firefox|2=<br />
...<br />
[Unnamed thread 0x7fd7c0654340]: D/GetUserMedia VoEHardware:GetRecordingDeviceName: Failed 1<br />
}}<br />
<br />
You can try setting {{ic|media.navigator.audio.full_duplex}} property to {{ic|false}} at {{ic|about:config}} Firefox page and restart Firefox.<br />
<br />
This can also help if you are using the PulseAudio [[PulseAudio#Microphone echo/noise cancellation|module-echo-cancel]] and Firefox does not recognise the virtual echo canceling source.<br />
<br />
=== WebRTC sharing indicator displays an XML parsing error ===<br />
<br />
After agreeing to share a microphone or web camera, you may then see a window with a tan background and a red border in the top left corner on your primary window, displaying the following error message:<br />
<br />
XML Parsing Error: no root element found<br />
Location: chrome://browser/content/webrtcLegacyIndicator.xhtml<br />
Line Number: 1, Column 1:<br />
^<br />
<br />
If this is the case for you, performing the following steps should resolve the issue:<br />
<br />
# Navigate to {{ic|about:support}}.<br />
# Click on the ''Clear Startup Cache'' button and agree to restart the browser.<br />
<br />
See [https://bugzilla.mozilla.org/show_bug.cgi?id=1639821 Mozilla's bug report] for more information.<br />
<br />
=== Cannot login with my Chinese account ===<br />
<br />
Firefox provides a local service for Chinese users, with a local account totally different from the international one. Firefox installed with the {{Pkg|firefox}} package uses the international account system by default, to change into the Chinese local service, you should install the add-on manager on [http://mozilla.com.cn/thread-343905-1-1.html this page], then you can login with your Chinese account now.<br />
<br />
=== No audio on certain videos when using JACK and PulseAudio ===<br />
<br />
If you are using JACK in combination with PulseAudio and cannot hear any sound on some videos, it could be because those videos have mono audio. This happens if your JACK setup uses more than just stereo, but you use normal headphones. To fix this, you simply have to connect the {{ic|front-center}} port from the PulseAudio JACK Sink to both {{ic|playback_1}} and {{ic|playback_2}} ports of the system output.<br />
<br />
You can also do this automatically using a script:<br />
<br />
{{hc|jack-mono.sh<br />
|2=#!/bin/sh<br />
jack_connect "PulseAudio JACK Sink:front-center" "system:playback_1"<br />
jack_connect "PulseAudio JACK Sink:front-center" "system:playback_2"<br />
}}<br />
<br />
Keep in mind that the names for the sink and the ports might be different for you. You can check what your JACK setup looks like with a Patchbay like Catia from {{Pkg|cadence}}.<br />
<br />
=== Geolocation does not work ===<br />
<br />
Recently, Google limited the use of its location service with Arch Linux, which causes the following error when geolocation is enabled on a website: {{ic|Geolocation error: Unknown error acquiring position}}. Region-locked services such as [https://www.hulu.com/ Hulu] may display a similar error indicating that your location could not be determined even though you have allowed location services for the site.<br />
<br />
To avoid these problems, you can switch to use the [https://location.services.mozilla.com/ Mozilla Location Service]. In {{ic|about:config}} change the {{ic|geo.provider.network.url}} setting to:<br />
<br />
<nowiki>https://location.services.mozilla.com/v1/geolocate?key=%MOZILLA_API_KEY%</nowiki><br />
<br />
See {{Bug|65241}} for more details.<br />
<br />
=== Right mouse button instantly clicks the first option in window managers ===<br />
<br />
This problem has been observed in [[i3]], [[bspwm]] and [[xmonad]].<br />
<br />
To fix it, navigate to {{ic|about:config}} and change {{ic|ui.context_menus.after_mouseup}} to {{ic|true}}.<br />
<br />
See [https://www.reddit.com/r/i3wm/comments/88k0yt/right_mouse_btn_instantly_clicks_first_option_in/]<br />
<br />
=== Firefox window does not repaint after disabling or enabling compositing ===<br />
<br />
Unset the environment variable {{ic|MOZ_X11_EGL}}.<br />
<br />
Related bug report: [https://bugzilla.mozilla.org/show_bug.cgi?id=1711039 Bugzilla 1711039].<br />
<br />
=== Firefox continuously asks to be set as default browser upon launch ===<br />
<br />
There are a couple things you can try: if you are using a [[desktop environment]], check if Firefox is set as the default browser in your system settings. If it is not, then set it, otherwise you can run the following {{man|1|xdg-settings}} command, provided by the [[xdg-utils]] package, to query which browser is set as default on your system:<br />
<br />
$ xdg-settings get default-web-browser<br />
<br />
If no value is returned or it is not Firefox, then run this command to set it:<br />
<br />
$ xdg-settings set default-web-browser firefox.desktop<br />
<br />
If Firefox still asks to be set as the default browser, then it may be quieted if it is set to handle ''http'' and ''https'' URL schemes. To do so, run these {{man|1|xdg-mime}} commands: <br />
<br />
$ xdg-mime default firefox.desktop x-scheme-handler/http<br />
$ xdg-mime default firefox.desktop x-scheme-handler/https<br />
<br />
If those do not work either, check if you have set the environment variable {{ic|GTK_USE_PORTAL}} (all values trigger the bug), in which case, unset it. Related bug report: [https://bugzilla.mozilla.org/show_bug.cgi?id=1516290 Bugzilla 1516290]. If that does not work or you did not set it, navigate Firefox to {{ic|about:config}}, check if the variable {{ic|widget.use-xdg-desktop-portal}} is set to {{ic|true}} and, if so, set it to {{ic|false}}.<br />
<br />
If you wish to disable default browser check entirely, navigate Firefox to {{ic|about:config}} and set {{ic|browser.shell.checkDefaultBrowser}} to {{ic|false}}.<br />
<br />
=== Video stuttering ===<br />
<br />
If you experience video stuttering and you notice that Firefox is only hitting one core at 100% when watching videos (especially higher resolution videos), this might help you.<br />
<br />
Go into {{ic|about:config}} and search for {{ic|dom.ipc.processCount}} and change {{ic|dom.ipc.processCount.file}} from 1 to a higher number. An ad hoc method to find a good number is to increase it one at a time until you get good results, but 4 seems to be a good value.<br />
<br />
=== Bengali font broken in some pages ===<br />
<br />
In most cases, installing the {{Pkg|noto-fonts}} and making '''Noto Sans Bengali''' as defaults in '''Fonts and Colors''' settings solves it. However, in some social media sites, Bengali fonts may still be broken. In those cases, Mozilla provides a detailed guide on how to see all the fonts gets loaded in a page. By using [https://developer.mozilla.org/en-US/docs/Tools/Page_Inspector/How_to/Open_the_Inspector Page Inspector], find out [https://developer.mozilla.org/en-US/docs/Tools/Page_Inspector/How_to/Edit_fonts#all_fonts_on_page all the fonts] that are being loaded on that particular page. Removing fonts other than '''Noto Sans''' from the system will resolve the issue permanently.<br />
<br />
There will be some fonts that have been installed as dependency of other package. For example, {{Pkg|chromium}} installs {{Pkg|ttf-liberation}} as dependency, which loads itself in some Firefox pages automatically and breaks Bengali fonts on those pages. To solve this issue, use the following rule in your [[font configuration]]: <br />
<br />
{{hc|$XDG_CONFIG_HOME/fontconfig/fonts.conf|2=<br />
<match target="pattern"><br />
<test qual="any" name="family"><string>Liberation</string></test><br />
<edit mode="assign" name="family" binding="same"><string>Noto Sans Bengali</string></edit><br />
</match><br />
}}<br />
<br />
=== Web Speech API has no voices ===<br />
<br />
Firefox uses for text to speech (tts) speechd. You can use the command {{ic|spd-say "some test sentence"}} to test if it reads the text or {{ic|spd-say -L}} to get a list of the voices. If there are no voices, too, you can install some with the package {{Pkg|espeak-ng}}. If they do not work out of the box, you maybe have to configure them. You can use the {{ic|spd-conf}} command or edit the config file {{ic|.config/speech-dispatcher/speechd.conf}}. There should be the following lines active (without # in front of it):<br />
<br />
AddModule "espeak-ng" "sd_espeak-ng" "espeak-ng.conf"<br />
DefaultModule espeak-ng<br />
<br />
=== Narrate/Listen icon missing in Reader Mode === <br />
<br />
==== Enable Speech Synthesis ====<br />
<br />
Per https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API/Using_the_Web_Speech_API, speech synthesis must be enabled (it is enabled by default). To enable, set {{ic|media.webspeech.synth.enabled}} to {{ic|true}} in {{ic|about:config}}.<br />
<br />
==== Disable Fingerprinting Protection ====<br />
<br />
Per https://support.mozilla.org/en-US/kb/firefox-protection-against-fingerprinting,<br />
Fingerprinting Protection disables the WebSpeech API. If you enabled this option, you will need to disable it for the narrator to work. To disable fingerprinting protection, set {{ic|privacy.resistFingerprinting}} to {{ic|false}} in {{ic|about:config}}.<br />
<br />
==== Disable filter voices ====<br />
<br />
If you do not see the narrator icon, try setting {{ic|narrate.filter-voices}} to {{ic|false}} in {{ic|about:config}}.<br />
<br />
This can be used to check whether {{ic|speech-dispatcher}} works at all. If it helps, you may miss voices for the language of the article opened in reader mode (check {{ic|spd-say -L}}). If you have voices for the reader article language installed, there may be some incorrect settings or defaults related to {{ic|speech-dispatcher}} configuration.<br />
<br />
=== File dialogs do not open when downloading files ===<br />
<br />
If no file chooser is shown when downloading files, even with the option "Always ask where to save files" enabled in Firefox's preferences, then you might not have both {{Pkg|xdg-desktop-portal}} and a suitable implementation. Desktop environments usually provide an implementation, but if you are using a standalone window manager such as [[i3]], then you may need to manually install one. [[Install]] {{Pkg|xdg-desktop-portal}} and for example {{Pkg|xdg-desktop-portal-gtk}}.<br />
<br />
== See also ==<br />
<br />
* [https://www.mozilla.org/firefox/ Official website]<br />
* [https://www.mozilla.org/ Mozilla Foundation]<br />
* [[MozillaWiki:Firefox]]<br />
* [[Wikipedia:Mozilla Firefox]]<br />
* [https://addons.mozilla.org/ Firefox Add-ons]<br />
* [https://addons.mozilla.org/firefox/themes/ Firefox themes]<br />
* [https://ftp.mozilla.org/pub/firefox/releases/ Mozilla's FTP]<br />
* [http://forums.mozillazine.org/ mozillaZine] unofficial forums</div>Meriboldhttps://wiki.archlinux.org/index.php?title=USB_flash_installation_medium&diff=714171USB flash installation medium2022-01-29T05:27:29Z<p>Meribold: Add pv example</p>
<hr />
<div>[[Category:Installation process]]<br />
[[de:Installation von einem USB-Stick]]<br />
[[es:USB flash installation medium]]<br />
[[fr:USB flash installation medium]]<br />
[[it:USB flash installation medium]]<br />
[[ja:USB インストールメディア]]<br />
[[pt:USB flash installation medium]]<br />
[[ru:USB flash installation medium]]<br />
[[tr:USB flash installation medium]]<br />
[[zh-hans:USB flash installation medium]]<br />
{{Related articles start}}<br />
{{Related|CD Burning}}<br />
{{Related|Archiso}}<br />
{{Related|Multiboot USB drive}}<br />
{{Related articles end}}<br />
This page discusses various multi-platform methods on how to create an Arch Linux Installer USB drive (also referred to as ''"flash drive", "USB stick", "USB key"'', etc) for booting in BIOS and UEFI systems. The result will be a [[Wikipedia:Live USB|Live USB]] ([[Wikipedia:Live CD|Live CD]]-like) system that can be used for installing Arch Linux, system maintenance or for recovery purposes, and that, because of using [[Overlayfs]] for {{ic|/}}, will discard all changes once the computer shuts down.<br />
<br />
If you would like to run a full install of Arch Linux from a USB drive (i.e. with persistent settings), see [[Install Arch Linux on a removable medium]]. If you would like to use your bootable Arch Linux USB stick as a rescue USB, see [[Change root]].<br />
<br />
== Using the ISO as is (BIOS and UEFI) ==<br />
<br />
=== In GNU/Linux ===<br />
<br />
==== Using basic command line utilities ====<br />
<br />
This method is recommended due to its simplicity and universal availability, since these tools are part of {{Pkg|coreutils}} (pulled in by the {{Pkg|base}} meta-package).<br />
<br />
{{Warning|This will irrevocably destroy all data on {{ic|/dev/'''sdx'''}}. To restore the USB drive as an empty, usable storage device after using the Arch ISO image, the ISO 9660 filesystem signature needs to be removed by running {{ic|wipefs --all /dev/'''sdx'''}} as root, before [[repartition]]ing and [[reformat]]ting the USB drive.}}<br />
<br />
{{Tip|Find out the name of your USB drive with {{ic|lsblk}}. Make sure that it is '''not''' mounted.}}<br />
<br />
Run the following command, replacing {{ic|/dev/'''sdx'''}} with your drive, e.g. {{ic|/dev/sdb}}. (Do '''not''' append a partition number, so do '''not''' use something like {{ic|/dev/sdb'''1'''}}):<br />
<br />
* using {{ic|cat}}: {{bc|# cat ''path/to/''archlinux-''version''-x86_64.iso > /dev/'''sdx'''}}<br />
* using {{ic|cp}}: {{bc|# cp ''path/to/''archlinux-''version''-x86_64.iso /dev/'''sdx'''}}<br />
* using {{ic|dd}}:{{bc|1=# dd bs=4M if=''path/to/''archlinux-''version''-x86_64.iso of=/dev/'''sdx''' conv=fsync oflag=direct status=progress}}<br />
* using {{ic|tee}}: {{bc|# tee < ''path/to/''archlinux-''version''-x86_64.iso > /dev/'''sdx'''}}<br />
* using {{ic|pv}}: {{bc|# pv ''path/to/''archlinux-''version''-x86_64.iso > /dev/'''sdx'''}}<br />
<br />
See [https://unix.stackexchange.com/questions/224277/is-it-better-to-use-cat-dd-pv-or-another-procedure-to-copy-a-cd-dvd/224314#224314] and [https://www.vidarholen.net/contents/blog/?p=479] for a comparison and perspective on the use of those tools and why ''dd'' may be the least adapted one.<br />
<br />
{{Tip|If the UEFI version of the USB's Arch ISO hangs or is unable to load, try repeating the medium creation process on the same USB drive one or more times. If this does not work, you may also try updating your motherboard's firmware.}}<br />
<br />
==== Using GNOME Disk Utility ====<br />
<br />
Linux distributions running GNOME can easily make a live CD through {{Pkg|nautilus}} and {{Pkg|gnome-disk-utility}}. Simply right-click on the ''.iso'' file, and select ''Open With Disk Image Writer''. When GNOME Disk Utility opens, specify the flash drive from the ''Destination'' drop-down menu and click ''Start Restoring''.<br />
<br />
==== Using MultiWriter ====<br />
<br />
{{pkg|gnome-multi-writer}} is a simple [[GTK]]3 based graphical tool to write an ISO file to one or multiple USB devices at once.<br />
<br />
==== Using Kindd ====<br />
<br />
[https://github.com/LinArcX/Kindd Kindd] is a Qt based graphical frontend for dd. It is available as {{AUR|kindd}}.<br />
<br />
==== Using Popsicle ====<br />
<br />
[https://github.com/pop-os/popsicle Popsicle] is a tool made for flashing ISO files to multiple USB devices in parallel by the PopOS development team. It is written in Rust and uses GTK. It is available as {{AUR|popsicle}}.<br />
<br />
==== Using SUSE Studio ImageWriter ====<br />
<br />
[https://github.com/openSUSE/imagewriter SUSE Studio ImageWriter] is a Qt based tool made by the OpenSUSE development team. It is available as {{AUR|imagewriter}}.<br />
<br />
==== Using xorriso-dd-target ====<br />
<br />
[https://dev.lovelyhq.com/libburnia/libisoburn/raw/master/xorriso-dd-target/xorriso-dd-target xorriso-dd-target] (from {{Pkg|libisoburn}}) is a shell script which attempts to reduce the risk of overwriting the wrong storage device. Its safest mode is named {{ic|-plug_test}}. For example, to use it as a regular user who can elevate to root using [[sudo]]:<br />
<br />
$ xorriso-dd-target -with_sudo -plug_test -DO_WRITE -image_file archlinux-''version''-x86_64.iso<br />
<br />
See {{man|1|xorriso-dd-target}} for details.<br />
<br />
=== In Windows ===<br />
<br />
==== Using win32diskimager ====<br />
<br />
[https://sourceforge.net/projects/win32diskimager/ win32diskimager] is another graphical USB iso writing tool for Windows. Simply select your iso image and the target USB drive letter (you may have to format it first to assign it a drive letter), and click Write.<br />
<br />
==== Using USBwriter ====<br />
<br />
This method does not require any workaround and is as straightforward as {{ic|dd}} under Linux. Just download the Arch Linux ISO, and with local administrator rights use the [https://sourceforge.net/p/usbwriter/wiki/Documentation/ USBwriter] utility to write to your USB flash memory.<br />
<br />
==== Using Rufus ====<br />
<br />
[https://rufus.ie/ Rufus] is a multi-purpose USB ISO writer. It provides a graphical user interface and does not care if the drive is properly formatted or not.<br />
<br />
Simply select the Arch Linux ISO, the USB drive you want to create the bootable Arch Linux onto and click ''START''.<br />
<br />
{{Note|If the USB drive does not boot properly using the default ISO Image mode, '''DD Image mode''' should be used instead. To switch this mode on, select ''GPT'' from the ''Partition scheme'' drop-down menu. After clicking ''START'' you will get the mode selection dialog, select ''DD Image mode''.}}<br />
<br />
{{Tip|To add [https://github.com/pbatard/rufus/issues/691 an additional partition for persistent storage] use the slider to choose the persistent partition's size. When using the persistent partition feature, make sure to select ''MBR'' in the ''Partition scheme'' drop-down menu and ''BIOS or UEFI'' in ''Target System'', otherwise the drive will not be usable for both BIOS and UEFI booting.}}<br />
<br />
==== Using Cygwin ====<br />
<br />
Make sure your [https://www.cygwin.com/ Cygwin] installation contains the {{ic|dd}} package.<br />
<br />
Place your image file in your home directory:<br />
<br />
C:\cygwin\home\John\<br />
<br />
Run cygwin as administrator (required for cygwin to access hardware). To write to your USB drive use the following command:<br />
<br />
dd if=archlinux-''version''-x86_64.iso of=\\.\'''x''': bs=4M<br />
<br />
where {{ic|archlinux-''version''-x86_64.iso}} is the path to the iso image file within the {{ic|cygwin}} directory and {{ic|\\.\'''x''':}} is your USB flash drive where {{ic|'''x'''}} is the windows designated letter, e.g. {{ic|\\.\d:}}.<br />
<br />
On Cygwin 6.0, find out the correct partition with:<br />
<br />
cat /proc/partitions<br />
<br />
and write the ISO image with the information from the output. Example:<br />
<br />
{{Warning|This will irrevocably delete all files on your USB flash drive, so make sure you do not have any important files on the flash drive before doing this.}}<br />
<br />
dd if=archlinux-''version''-x86_64.iso of=/dev/sdb bs=4M<br />
<br />
==== dd for Windows ====<br />
<br />
A GPL licensed dd version for Windows is available at http://www.chrysocome.net/dd. The advantage of this over Cygwin is a smaller download. Use it as shown in instructions for Cygwin above.<br />
<br />
To begin, download the latest version of dd for Windows. Once downloaded, extract the archive's contents into Downloads or elsewhere.<br />
<br />
Now, launch your {{ic|command prompt}} as an administrator. Next, change directory ({{ic|cd}}) into the Downloads directory.<br />
<br />
If your Arch Linux ISO is elsewhere you may need to state the full path, for convenience you may wish to put the Arch Linux ISO into the same folder as the dd executable. The basic format of the command will look like this.<br />
<br />
# dd if=''archlinux-''version''-x86_64.iso'' od=\\.\''x'': bs=4M<br />
<br />
{{Note|The Windows drive letters are linked to a partition. To allow selecting the entire disk, ''dd for Windows'' provides the {{ic|od}} parameter, which is used in the commands above. Note however that this parameter is specific to ''dd for Windows'' and cannot be found in other implementations of ''dd''.}}<br />
<br />
{{Warning|Because the {{ic|od}} is used, all partitions on the selected disk will be destroyed. Be absolutely sure that you are directing dd to the correct drive before executing.}}<br />
<br />
Simply replace the various null spots (indicated by an "x") with the correct date and correct drive letter. Here is a complete example.<br />
<br />
# dd if=ISOs\archlinux-''version''-x86_64.iso od=\\.\d: bs=4M<br />
<br />
==== Using flashnul ====<br />
<br />
[https://github.com/amarao/flashnul/blob/master/README.md flashnul] is an utility to verify the functionality and maintenance of Flash-Memory (USB-Flash, IDE-Flash, SecureDigital, MMC, MemoryStick, SmartMedia, XD, CompactFlash etc).<br />
<br />
From a command prompt, invoke flashnul with {{ic|-p}}, and determine which device index is your USB drive, e.g.:<br />
<br />
{{hc|C:\>flashnul -p|<br />
Avaible physical drives:<br />
Avaible logical disks:<br />
C:\<br />
D:\<br />
E:\<br />
}}<br />
<br />
When you have determined which device is the correct one, you can write the image to your drive, by invoking flashnul with the device index, {{ic|-L}}, and the path to your image, e.g:<br />
<br />
C:\>flashnul '''E:''' -L ''path\to\''archlinux-''version''-x86_64.iso<br />
<br />
As long as you are really sure you want to write the data, type yes, then wait a bit for it to write. If you get an access denied error, close any Explorer windows you have open.<br />
<br />
If under Vista or Win7, you should open the console as administrator, or else flashnul will fail to open the stick as a block device and will only be able to write via the drive handle windows provides<br />
<br />
{{Note|Confirmed that you need to use drive letter as opposed to number. flashnul 1rc1, Windows 7 x64.}}<br />
<br />
=== In macOS ===<br />
<br />
==== Using macOS dd ====<br />
<br />
First, you need to identify the USB device. Open {{ic|/Applications/Utilities/Terminal}} and list all storage devices with the command:<br />
<br />
$ diskutil list<br />
<br />
Your USB device will appear as something like {{ic|/dev/disk2 (external, physical)}}. Verify that this is the device you want to erase by checking its name and size and then use its identifier for the commands below instead of /dev/diskX.<br />
<br />
A USB device is normally auto-mounted in macOS, and you have to unmount (not eject) it before block-writing to it with {{ic|dd}}. In Terminal, do:<br />
<br />
$ diskutil unmountDisk /dev/diskX<br />
<br />
Now copy the ISO image file to the device. The {{ic|dd}} command is similar to its Linux counterpart, but notice the 'r' before 'disk' for raw mode which makes the transfer much faster:<br />
<br />
{{Note|BSD-derived {{ic|dd}}, which includes macOS's default {{ic|dd}}, uses lower-case {{ic|m}} suffix. This differs from GNU {{ic|dd}}, used elsewhere in this article.}}<br />
<br />
# dd if=path/to/archlinux-''version''-x86_64.iso of=/dev/'''r'''diskX bs=1m<br />
<br />
This command will run silently. To view progress, send SIGINFO by pressing {{ic|Ctrl+t}}. Note {{ic|diskX}} here should not include the {{ic|s1}} suffix, or else the USB device will only be bootable in UEFI mode and not legacy. After completion, macOS may complain that "The disk you inserted was not readable by this computer". Select 'Ignore'. The USB device will be bootable.<br />
<br />
=== In Android ===<br />
<br />
==== EtchDroid ====<br />
<br />
[https://etchdroid.depau.eu/ EtchDroid] is a OS image flasher for Android. It works without root permissions on Android 5 to Android 8. According to bug reports it does not always work on Android 9 and Android 4.4.<br />
<br />
To create an Arch Linux installer, download the ISO image file on your Android device. Plug the USB drive to your device, using a USB-OTG adapter if needed. Open EtchDroid, select "Flash raw image", select your Arch ISO, then select your USB drive. Grant the USB API permission and confirm.<br />
<br />
Keep your phone on a table while it is writing the image: a lot of USB-OTG adapters are a bit wobbly and you might unplug it by mistake.<br />
<br />
== Using manual formatting ==<br />
<br />
=== BIOS and UEFI ===<br />
<br />
==== In GNU/Linux ====<br />
<br />
This method is more complicated than writing the image directly with {{ic|dd}}, but it does keep the flash drive usable for data storage (that is, the ISO is installed in a specific partition within the already [[Partitioning|partitioned device]] without altering other partitions).<br />
<br />
{{Note|Here, we will denote the targeted partition as {{ic|/dev/sd''Xn''}}. In any of the following commands, adjust '''X''' and '''n''' according to your system.}}<br />
<br />
* If not done yet, create a [[partition table]] on {{ic|/dev/sd''X''}}.<br />
* If not done yet, create a partition on the device. The partition {{ic|/dev/sd''Xn''}} must be formatted to [[FAT32]].<br />
* Mount the FAT32 file system located in the USB flash device and [[extract]] the contents of the ISO image to it. For example:<br />
<br />
# mount /dev/sd''Xn'' /mnt<br />
# bsdtar -x -f archlinux-''version''-x86_64.iso -C /mnt<br />
<br />
Booting requires specifying the volume on which the files reside. By default the label {{ic|ARCH_''YYYYMM''}} (with the appropriate release year and month) is used. Thus, the [[Persistent block device naming#by-label|file system’s label]] has to be set accordingly. Alternatively, you can change this behaviour by altering the lines ending by {{ic|1=archisolabel=ARCH_''YYYYMM''}} in the files: <br />
* BIOS boot: {{ic|/mnt/syslinux/archiso_sys-linux.cfg}}<br />
* UEFI boot: {{ic|/mnt/loader/entries/01-archiso-x86_64-linux.conf}}, {{ic|/mnt/loader/entries/02-archiso-x86_64-speech-linux.conf}} and {{ic|/mnt/loader/entries/03-archiso-x86_64-ram-linux.conf}}<br />
To use an [[UUID]] instead, replace those portions of lines with {{ic|1=archisodevice=/dev/disk/by-uuid/'''''YOUR-UUID'''''}}.<br />
<br />
{{Note|Wrong {{ic|archisolabel}} or {{ic|archisodevice}} will prevent booting from the created medium.}}<br />
<br />
[[Syslinux]] files for BIOS systems are already copied to {{ic|/mnt/syslinux}}. [[Unmount]] the FAT file system, [[install]] the {{Pkg|syslinux}} and {{Pkg|mtools}} packages and run the following commands to make the partition bootable:<br />
<br />
# umount /mnt<br />
# syslinux --directory syslinux --install /dev/sd''Xn''<br />
# dd bs=440 count=1 conv=notrunc if=/usr/lib/syslinux/bios/mbr.bin of=/dev/sd''X''<br />
<br />
{{Note|<br />
* Replace {{ic|mbr.bin}} with {{ic|gptmbr.bin}} if {{ic|/dev/sd''X''}} has a [[GUID Partition Table]]. See [[Syslinux#Manual install]] for details.<br />
* For the [[MBR]] partition table you will need to set the "boot" flag. See [[Syslinux#MBR partition table]] for details.<br />
}}<br />
<br />
==== In Windows ====<br />
<br />
{{Note|<br />
* For manual formatting, do not use any '''Bootable USB Creator utility''' for creating the UEFI bootable USB. For manual formatting, do not use ''dd for Windows'' to dd the ISO to the USB drive either.<br />
* In the below commands, '''X:''' is assumed to be the USB flash drive in Windows.<br />
* Windows uses backward slash {{ic|\}} as path-separator, so the same is used in the below commands.<br />
* All commands should be run in Windows command prompt '''as administrator'''.<br />
* {{ic|>}} denotes the Windows command prompt.<br />
}}<br />
<br />
* Partition and format the USB drive using [https://rufus.ie/ Rufus USB partitioner]. Select partition scheme option as '''MBR for BIOS and UEFI''' and File system as '''FAT32'''. Uncheck "Create a bootable disk using ISO image" and "Create extended label and icon files" options.<br />
* Change the '''Volume Label''' of the USB flash drive {{ic|X:}} to match the LABEL mentioned in the {{ic|1=archisolabel=}} part in {{ic|<ISO>\loader\entries\archiso-x86_64.conf}}. This step is required for Official ISO ([[Archiso]]). This step can be also performed using Rufus, during the prior "partition and format" step.<br />
* Extract the ISO (similar to extracting ZIP archive) to the USB flash drive using [https://www.7-zip.org/ 7-Zip]. <br />
* Download official Syslinux 6.xx binaries (zip file) from https://www.kernel.org/pub/linux/utils/boot/syslinux/ and extract it. The version of Syslinux should be the same version used in the ISO image.<br />
<br />
* Run the following command (in Windows cmd prompt, as admin):<br />
<br />
> cd bios\<br />
> for /r %Y in (*.c32) do copy "%Y" "X:\syslinux\" /y<br />
> copy mbr\*.bin X:\syslinux\ /y<br />
<br />
* Install Syslinux to the USB by running (use {{ic|win64\syslinux64.exe}} for x64 Windows):<br />
<br />
> cd bios\<br />
> win32\syslinux.exe -d /syslinux -i -a -m X:<br />
<br />
{{Note|<br />
* The above step installs Syslinux's {{ic|ldlinux.sys}} to the VBR of the USB partition, sets the partition as "active/boot" in the MBR partition table and writes the MBR boot code to the 1st 440-byte boot code region of the USB.<br />
* The {{ic|-d}} switch expects a path with forward slash path-separator like in *unix systems.<br />
}}<br />
<br />
=== BIOS only ===<br />
<br />
==== In GNU/Linux ====<br />
<br />
===== Making a USB-ZIP drive =====<br />
<br />
For some old BIOS systems, only booting from USB-ZIP drives is supported. This method allows you to still boot from a USB-HDD drive.<br />
<br />
{{Warning|This will destroy all information on your USB flash drive!}}<br />
<br />
* Download {{Pkg|syslinux}} and {{Pkg|mtools}} from the official repositories.<br />
* Find your usb drive with {{ic|lsblk}}.<br />
* Type {{ic|mkdiskimage -4 /dev/sd'''x''' 0 64 32}} (replace x with the letter of your drive). This will take a while.<br />
<br />
From here continue with the manual formatting method. The partition will be {{ic|/dev/sd'''x'''4}} due to the way ZIP drives work.<br />
<br />
{{Note|Do not format the drive as FAT32; keep it as FAT16.}}<br />
<br />
=== UEFI only ===<br />
<br />
For UEFI-only booting, it is enough to copy the files from the ISO and either change the FAT volume's label or edit boot loader configuration files to set {{ic|archisolabel}}/{{ic|archisodevice}} accordingly.<br />
<br />
==== In GNU/Linux ====<br />
<br />
This method involves simply copies files from the ISO image to a USB flash drive and either adjusts the systemd-boot configuration or the file system's label.<br />
<br />
# If not done yet, create a [[partition table]] on {{ic|/dev/sd''X''}} and a [[partition]] ({{ic|/dev/sd''Xn''}}) on the device.<br />
# If not done yet, format the partition to [[FAT32]]: {{bc|# mkfs.fat -F 32 /dev/sd''Xn''}}<br />
# [[Mount]] the FAT32 file system: {{bc|# mount /dev/sd''Xn'' /mnt}}<br />
# Extract the ISO image to the mounted file system: {{bc|1=# bsdtar -x --exclude=syslinux/ -f archlinux-''version''-x86_64.iso -C /mnt}}<br />
# Either:<br />
#* edit {{ic|/mnt/loader/entries/archiso-x86_64-linux.conf}} and {{ic|/mnt/loader/entries/archiso-x86_64-speech-linux.conf}} and change {{ic|1=archisolabel=ARCH_''YYYYMM''}} to [[Persistent block device naming|match your device]], e.g. by replacing it with {{ic|1=archisodevice=/dev/disk/by-uuid/''YOUR-UUID''}},<br />
#* or [[unmount]] the file system and change its [[LABEL]] to match {{ic|ARCH_''YYYYMM''}}: {{bc|# fatlabel /dev/sd''Xn'' ARCH_''YYYYMM''}}<br />
# [[Unmount]] the FAT32 file system.<br />
<br />
==== In Windows ====<br />
<br />
# Partition the USB flash drive and format it to FAT32.<br />
# Right click on {{ic|archlinux-''version''-x86_64.iso}} and select ''Mount''.<br />
# Navigate to the newly created DVD drive and copy all files and folders except for {{ic|syslinux}} to the USB flash drive.<br />
# When done copying, right click on the DVD drive and select ''Eject''.<br />
# Either:<br />
#* edit {{ic|''X'':\loader\entries\archiso-x86_64-linux.conf}} and {{ic|''X:''\loader\entries\archiso-x86_64-speech-linux.conf}} with a text editor and change {{ic|1=archisolabel=ARCH_''YYYYMM''}} to [[Persistent block device naming|match your device]], e.g. by replacing it with {{ic|1=archisolabel=''YOUR-LABEL''}},<br />
#* or change the FAT32 volume label to match {{ic|ARCH_''YYYYMM''}}.<br />
# Eject the USB flash drive.<br />
<br />
== Using a multiboot USB drive ==<br />
<br />
This allows booting multiple ISOs from a single USB device, including the archiso. Updating an existing USB drive to a more recent ISO is simpler than for most other methods. See [[Multiboot USB drive]].<br />
<br />
=== Using ventoy ===<br />
<br />
[[Ventoy]] is an open source tool to create bootable USB drive for ISO/WIM/IMG/VHD(x)/EFI files. With ventoy, you do not need to format the disk over and over, you just need to copy the ISO/WIM/IMG/VHD(x)EFI files to the USB drive and boot them directly. You can copy many files at a time and ventoy will give you a boot menu to select them. It is available as {{AUR|ventoy-bin}}.<br />
<br />
=== In Windows ===<br />
<br />
==== Loading the installation medium from RAM ====<br />
<br />
{{Merge|Multiboot USB drive#Using Syslinux and memdisk|This is the same method, only Syslinux is installed from Windows. Considering that [[multiboot USB drive]] can be used to boot an installation medium and it is already linked from the Related articles box at the top, maybe this section should be merged there?}}<br />
<br />
This method uses [[Syslinux]] and a [[Ramdisk]] ([https://wiki.syslinux.org/wiki/index.php/MEMDISK MEMDISK]) to load the entire Arch Linux ISO image into RAM. Since this will be running entirely from system memory, you will need to make sure the system you will be installing this on has an adequate amount. A minimum amount of RAM between 500 MB and 1 GB should suffice for a MEMDISK based, Arch Linux install.<br />
<br />
For more information on Arch Linux system requirements as well as those for MEMDISK see the [[Installation guide]] and [http://www.etherboot.org/wiki/bootingmemdisk#preliminaries here]. For reference, here is the [https://bbs.archlinux.org/viewtopic.php?id=135266 preceding forum thread].<br />
<br />
{{Tip|Once the installer has completed loading you can simply remove the USB stick and even use it on a different machine to start the process all over again. Utilizing MEMDISK also allows booting and installing Arch Linux to and from the same USB flash drive.}}<br />
<br />
===== Preparing the USB flash drive =====<br />
<br />
Begin by formatting the USB flash drive as '''FAT32'''. Then create the following folders on the newly formatted drive.<br />
<br />
* {{ic|Boot}}<br />
** {{ic|Boot/ISOs}}<br />
** {{ic|Boot/Settings}}<br />
<br />
===== Copy the needed files to the USB flash drive =====<br />
<br />
Next copy the ISO that you would like to boot to the {{ic|Boot/ISOs}} folder. After that, extract from the following files from the latest release of {{pkg|syslinux}} from [https://www.kernel.org/pub/linux/utils/boot/syslinux/ here] and copy them into the following folders.<br />
* {{ic|./win32/syslinux.exe}} to the Desktop or Downloads folder on your system.<br />
* {{ic|./memdisk/memdisk}} to the {{ic|Settings}} folder on your USB flash drive.<br />
<br />
===== Create the configuration file =====<br />
<br />
After copying the needed files, navigate to the USB flash drive, /boot/Settings and create a {{ic|syslinux.cfg}} file.<br />
<br />
{{Note|On the {{ic|INITRD}} line, be sure to use the name of the ISO file that you copied to your {{ic|ISOs}} folder.}}<br />
<br />
{{hc|/Boot/Settings/syslinux.cfg|2=<br />
DEFAULT arch_iso<br />
<br />
LABEL arch_iso<br />
MENU LABEL Arch Setup<br />
LINUX memdisk<br />
INITRD /Boot/ISOs/archlinux-''version''-x86_64.iso<br />
APPEND iso<br />
}}<br />
<br />
For more information see the [[Syslinux]] article.<br />
<br />
===== Final steps =====<br />
<br />
Finally, create a {{ic|*.bat}} file where {{ic|syslinux.exe}} is located and run it ("Run as administrator" if you are on Vista or Windows 7):<br />
<br />
{{hc|C:\Documents and Settings\username\Desktop\install.bat|<br />
@echo off<br />
syslinux.exe -m -a -d /Boot/Settings X:<br />
}}<br />
<br />
== Inadvisable methods ==<br />
<br />
{{Warning|The following methods are discouraged.}}<br />
<br />
=== Using etcher ===<br />
<br />
etcher contains analytics and first-party advertising. See [https://github.com/balena-io/etcher/issues/2057], [https://github.com/balena-io/etcher/blob/37769efbeda0abe7993d95e2b2aea2f461edd307/lib/gui/app/pages/main/MainPage.tsx#L151] and [https://github.com/balena-io/etcher/blob/37769efbeda0abe7993d95e2b2aea2f461edd307/docs/MAINTAINERS.md#publishing].<br />
<br />
=== Using Universal USB Installer ===<br />
<br />
* The download page contains fake ''Download'' buttons that may contain malware.<br />
* Universal USB Installer does not write the ISO as-is which breaks BIOS booting due to the discrepancy in syslinux versions. See [https://bbs.archlinux.org/viewtopic.php?pid=1344629].<br />
* The Arch Linux installation image's boot loaders expect the ISO contents to reside on volume with the label {{ic|ARCH_''YYYYXX''}}. Universal USB Installer does not update the file system label, nor does it correct the boot loader configuration.<br />
<br />
=== Using UNetbootin ===<br />
<br />
* UNetbootin does not write the ISO as-is which breaks BIOS booting due to the discrepancy in syslinux versions.<br />
* The Arch Linux installation image's boot loaders expect the ISO contents to reside on volume with the label {{ic|ARCH_''YYYYXX''}}. UNetbootin does not update the file system label, nor does it correct the boot loader configuration.<br />
<br />
== Troubleshooting ==<br />
<br />
* If you get the {{ic|device did not show up after 30 seconds}} error due to {{ic|/dev/disk/by-label/ARCH_''YYYYMM''}} not mounting, try renaming your USB medium to {{ic|ARCH_''YYYYMM''}} so Arch can find it. (e.g. For {{ic|archlinux-2021.02.01-x86_64.iso}}, use {{ic|ARCH_202102}}).<br />
* If you get other errors, try using another USB device. There are case scenarios in which it solved all issues.<br />
* If you get {{ic|losetup: /run/archiso/bootmnt/arch/x86_64/airootfs.sfs: failed to set up loop devices: No such file or directory}}, try using a USB 2.0 port. (Some USB 3.0 ports through USB hubs do not work.)<br />
<br />
== See also ==<br />
<br />
* [[Gentoo:LiveUSB/Guide]]<br />
* [[Fedora:How to create and use Live USB]]<br />
* [https://en.opensuse.org/SDB:Live_USB_stick openSUSE wiki - SDB:Live USB stick]</div>Meriboldhttps://wiki.archlinux.org/index.php?title=User:Meribold&diff=640144User:Meribold2020-10-31T08:55:53Z<p>Meribold: </p>
<hr />
<div>https://meribold.org<br />
<br />
https://github.com/meribold</div>Meriboldhttps://wiki.archlinux.org/index.php?title=Creating_packages&diff=602326Creating packages2020-03-22T10:38:36Z<p>Meribold: Update internal link</p>
<hr />
<div>[[Category:About Arch]]<br />
[[Category:Package development]]<br />
[[cs:Creating packages]]<br />
[[es:Creating packages]]<br />
[[fa:ایجاد بستهها]]<br />
[[fr:Standard paquetage]]<br />
[[it:Creating packages]]<br />
[[ja:パッケージの作成]]<br />
[[pt:Creating packages]]<br />
[[ru:Creating packages]]<br />
[[zh-hans:Creating packages]]<br />
{{Related articles start}}<br />
{{Related|Arch Build System}}<br />
{{Related|Arch packaging standards}}<br />
{{Related|Arch User Repository}}<br />
{{Related|Creating packages for other distributions}}<br />
{{Related|makepkg}}<br />
{{Related|pacman}}<br />
{{Related|Patching in ABS}}<br />
{{Related|PKGBUILD}}<br />
{{Related|.SRCINFO}}<br />
{{Related|DeveloperWiki:Building in a Clean Chroot}}<br />
{{Related articles end}}<br />
<br />
This article aims to assist users creating their own packages using the Arch Linux "ports-like" [[Arch Build System|build system]], also for submission in [[AUR]]. It covers creation of a [[PKGBUILD]] &ndash; a package build description file sourced by {{ic|makepkg}} to create a binary package from source. If already in possession of a {{ic|PKGBUILD}}, see [[makepkg]]. For instructions regarding existing rules and ways to improve package quality see [[Arch packaging standards]].<br />
<br />
== Overview == <br />
<br />
Packages in Arch Linux are built using the [[makepkg]] utility and the information stored in a [[PKGBUILD]] file. When {{ic|makepkg}} runs, it searches for a {{ic|PKGBUILD}} in the current directory and follows the instructions in it to acquire the required files and/or compile them to be packed within a package file ({{ic|pkgname.pkg.tar.xz}}). The resulting package contains binary files and installation instructions ready to be installed by [[pacman]].<br />
<br />
An Arch package is no more than a tar archive, or 'tarball', compressed using {{man|1|xz}}, which contains the following files generated by makepkg:<br />
<br />
* The binary files to install.<br />
* {{ic|.PKGINFO}}: contains all the metadata needed by pacman to deal with packages, dependencies, etc.<br />
* {{ic|.BUILDINFO}}: contains information needed for reproducible builds. This file is present only if a package is built with pacman 5.1 or newer.<br />
* {{ic|.MTREE}}: contains hashes and timestamps of the files, which are included in the local database so that pacman can verify the integrity of the package.<br />
* {{ic|.INSTALL}}: an optional file used to execute commands after the install/upgrade/remove stage. (This file is present only if specified in the {{ic|PKGBUILD}}.)<br />
* {{ic|.Changelog}}: an optional file kept by the package maintainer documenting the changes of the package. (It is not present in all packages.)<br />
<br />
== Preparation ==<br />
<br />
=== Prerequisite software ===<br />
<br />
First, ensure that the necessary tools are [[install]]ed: the package group {{Grp|base-devel}} should be sufficient, it includes {{ic|make}} and additional tools needed for compiling from source.<br />
<br />
The key tool for building packages is [[makepkg]] (provided by {{Pkg|pacman}}), which does the following:<br />
<br />
# Checks if package dependencies are installed.<br />
# Downloads the source file(s) from the specified server(s).<br />
# Unpacks the source file(s).<br />
# Compiles the software and installs it under a fakeroot environment.<br />
# Strips symbols from binaries and libraries.<br />
# Generates the package meta file which is included with each package.<br />
# Compresses the fakeroot environment into a package file.<br />
# Stores the package file in the configured destination directory, which is the current working directory by default.<br />
<br />
=== Download and test the installation ===<br />
<br />
Download the source tarball of the software you want to package, extract it, and follow the author's steps to install the program. Make a note of all commands and/or steps needed to compile and install it. You will be repeating those same commands in the {{ic|PKGBUILD}} file.<br />
<br />
Most software authors stick to the 3-step build cycle:<br />
<br />
./configure<br />
make<br />
make install<br />
<br />
This is a good time to make sure the program is working correctly.<br />
<br />
== Creating a PKGBUILD ==<br />
<br />
When {{ic|makepkg}} is run, it looks for a {{ic|PKGBUILD}} file in the current working directory. If it finds one, it downloads the software's source code and compiles it according to the instructions specified in the {{ic|PKGBUILD}} file. The instructions must be fully interpretable by the [[Wikipedia:Bash_(Unix_shell)|Bash]] shell. After successful completion, the resulting binaries and metadata of the package, i.e. package version and dependencies, are packed in a {{ic|pkgname.pkg.tar.xz}} package file. The newly created package can be installed by simply using {{ic|makepkg --install}} which will call pacman in the background, or by directly using {{ic|pacman -U ''pkgname.pkg.tar.xz''}}.<br />
<br />
To start building a new package, first create a new directory for the package and change current directory into this one. Then, a {{ic|PKGBUILD}} file needs to be created: a prototype PKGBUILD found in {{ic|/usr/share/pacman/}} can be used or you can start from a {{ic|PKGBUILD}} from another package. The latter may be a good choice if a similar package already exists.<br />
<br />
=== Defining PKGBUILD variables ===<br />
<br />
Example PKGBUILDs are located in {{Ic|/usr/share/pacman/}}. An explanation of possible {{ic|PKGBUILD}} variables can be found in the [[PKGBUILD]] article.<br />
<br />
''makepkg'' defines two variables that you should use as part of the build and install process:<br />
<br />
; {{ic|srcdir}}: This points to the directory where ''makepkg'' extracts or symlinks all files in the source array.<br />
<br />
; {{ic|pkgdir}}: This points to the directory where ''makepkg'' bundles the installed package, which becomes the root directory of your built package.<br />
<br />
They contain ''absolute'' paths, which means you do not have to worry about your working directory if you use these variables properly.<br />
<br />
{{Note|''makepkg'', and thus the {{ic|build()}} and {{ic|package()}} functions, are intended to be non-interactive. Interactive utilities or scripts called in those functions may break ''makepkg'', particularly if it is invoked with build-logging enabled ({{ic|--log}}). (See {{Bug|13214}}.)}}<br />
<br />
=== PKGBUILD functions ===<br />
<br />
When building a package, {{ic|makepkg}} will invoke the following five functions if they have been defined in the PKGBUILD. Function {{ic|package()}} is required in every PKGBUILD and will always be invoked. If any of the other functions is not defined, {{ic|makepkg}} will simply skip the invocation of that function.<br />
<br />
During the build, the functions are invoked in the order in which they are listed here.<br />
<br />
==== prepare() ====<br />
<br />
With this function, commands that are used to prepare sources for building are run, such as [[Patching in ABS|patching]]. This function runs right after package extraction, before [[#pkgver()|pkgver()]] and the build function. If extraction is skipped ({{ic|makepkg --noextract}}), then {{ic|prepare()}} is not run. <br />
<br />
{{Note|(From {{man|5|PKGBUILD}}) The function is run in {{ic|bash -e}} mode, meaning any command that exits with a non-zero status will cause the function to exit.}}<br />
<br />
==== pkgver() ====<br />
<br />
{{ic|pkgver()}} runs after the sources are fetched, extracted and [[#prepare()|prepare()]] executed. So you can update the pkgver variable during a makepkg stage.<br />
<br />
This is particularly useful if you are [[VCS PKGBUILD Guidelines|making git/svn/hg/etc. packages]], where the build process may remain the same, but the source could be updated every day, even every hour. The old way of doing this was to put the date into the pkgver field which, if the software was not updated, makepkg would still rebuild it thinking the version had changed. Some useful commands for this are {{ic|git describe}}, {{ic|hg identify -ni}}, etc. Please test these before submitting a PKGBUILD, as a failure in the {{ic|pkgver()}} function can stop a build in its tracks. <br />
<br />
{{Note|pkgver cannot contain spaces or hyphens ({{ic|-}}). Using sed to correct this is common.}}<br />
<br />
==== build() ====<br />
<br />
Now you need to implement the {{ic|build()}} function in the {{ic|PKGBUILD}} file. This function uses common shell commands in [[Wikipedia:Bash_(Unix_shell)|Bash]] syntax to automatically compile software and create a directory called {{ic|pkg}} to install the software to. This allows ''makepkg'' to package files without having to sift through your file system.<br />
<br />
The first step in the {{ic|build()}} function is to change into the directory created by uncompressing the source tarball. ''makepkg'' will change the current directory to {{ic|$srcdir}} before executing the {{ic|build()}} function. Therefore, in most cases, like suggested in {{ic|/usr/share/pacman/PKGBUILD.proto}}, the first command will look like this:<br />
<br />
cd "$pkgname-$pkgver"<br />
<br />
Now, you need to list the same commands you used when you manually compiled the software. The {{ic|build()}} function in essence automates everything you did by hand and compiles the software in the fakeroot build environment. If the software you are packaging uses a configure script, it is good practice to use {{ic|1=--prefix=/usr}} when building packages for pacman. A lot of software installs files relative to the {{ic|/usr/local}} directory, which should only be done if you are manually building from source. All Arch Linux packages should use the {{ic|/usr}} directory. As seen in the {{ic|/usr/share/pacman/PKGBUILD.proto}} file, the next two lines often look like this:<br />
<br />
./configure --prefix=/usr<br />
make<br />
<br />
{{Note|If your software does not need to build anything, do not use the {{ic|build()}} function. The {{ic|build()}} function is not required, but the {{ic|package()}} function is.}}<br />
<br />
==== check() ====<br />
<br />
Place for calls to {{Ic|make check}} and similar testing routines. It is highly recommended to have {{Ic|check()}} as it helps to make sure software has been built correctly and works fine with its dependencies.<br />
<br />
Users who do not need it (and occasionally maintainers who can not fix a package for this to pass) can disable it using {{ic|1=BUILDENV+=('!check')}} in PKGBUILD/makepkg.conf or call {{ic|makepkg}} with {{ic|--nocheck}} flag.<br />
<br />
==== package() ====<br />
<br />
The final step is to put the compiled files in a directory where ''makepkg'' can retrieve them to create a package. This by default is the {{ic|pkg}} directory—a simple fakeroot environment. The {{ic|pkg}} directory replicates the hierarchy of the root file system of the software's installation paths. If you have to manually place files under the root of your filesystem, you should install them in the {{ic|pkg}} directory under the same directory structure. For example, if you want to install a file to {{ic|/usr/bin}}, it should instead be placed under {{ic|$pkgdir/usr/bin}}. Very few install procedures require the user to copy dozens of files manually. Instead, for most software, calling {{ic|make install}} will do so. The final line should look like the following in order to correctly install the software in the {{ic|pkg}} directory:<br />
<br />
make DESTDIR="$pkgdir/" install<br />
<br />
{{Note|It is sometimes the case where {{ic|DESTDIR}} is not used in the {{ic|Makefile}}; you may need to use {{ic|prefix}} instead. If the package is built with ''autoconf'' / ''automake'', use {{ic|DESTDIR}}; this is what is [https://www.gnu.org/software/automake/manual/automake.html#Install documented] in the manuals. If {{ic|DESTDIR}} does not work, try building with {{ic|1=make prefix="$pkgdir/usr/" install}}. If that does not work, you will have to look further into the install commands that are executed by "{{ic|make <...> install}}".}}<br />
<br />
{{ic|makepkg --repackage}} runs only the {{ic|package()}} function, so it creates a package without building. This may save time e.g. if you have changed just the {{ic|depends}} variable of the package.<br />
<br />
== Testing the PKGBUILD and package ==<br />
<br />
As you are writing the {{ic|build()}} function, you will want to test your changes frequently to ensure there are no bugs. You can do this using the {{ic|makepkg}} command in the directory containing the {{ic|PKGBUILD}} file. With a properly formatted {{ic|PKGBUILD}}, makepkg will create a package; with a broken or unfinished {{ic|PKGBUILD}}, it will raise an error.<br />
<br />
If makepkg finishes successfully, it will place a file named {{ic|pkgname-pkgver.pkg.tar.xz}} in your working directory. This package can be installed with the {{ic|pacman -U}} command. However, just because a package file was built does not imply that it is fully functional. It might conceivably contain only the directory and no files whatsoever if, for example, a prefix was specified improperly. You can use pacman's query functions to display a list of files contained in the package and the dependencies it requires with {{ic|pacman -Qlp [package file]}} and {{ic|pacman -Qip [package file]}} respectively.<br />
<br />
If the package looks sane, then you are done! However, if you plan on releasing the {{ic|PKGBUILD}} file, it is imperative that you check and double-check the contents of the {{ic|depends}} array. <br />
<br />
Also ensure that the package binaries actually ''run'' flawlessly! It is annoying to release a package that contains all necessary files, but crashes because of some obscure configuration option that does not quite work well with the rest of the system. If you are only going to compile packages for your own system, though, you do not need to worry too much about this quality assurance step, as you are the only person suffering from mistakes, after all.<br />
<br />
=== Checking package sanity ===<br />
<br />
After testing package functionality check it for errors using [[namcap]]:<br />
$ namcap PKGBUILD<br />
$ namcap ''<package file name>''.pkg.tar.xz<br />
<br />
Namcap will:<br />
<br />
# Check PKGBUILD contents for common errors and package file hierarchy for unnecessary/misplaced files<br />
# Scan all ELF files in package using {{ic|ldd}}, automatically reporting which packages with required shared libraries are missing from {{Ic|depends}} and which can be omitted as transitive dependencies<br />
# Heuristically search for missing and redundant dependencies<br />
<br />
and much more.<br />
<br />
Get into the habit of checking your packages with namcap to avoid having to fix the simplest mistakes after package submission.<br />
<br />
== Submitting packages to the AUR ==<br />
<br />
Please read [[Arch User Repository#Submitting packages]] for a detailed description of the submission process.<br />
<br />
== Summary ==<br />
<br />
# Download the source tarball of the software to package.<br />
# Try compiling the package and installing it into an arbitrary directory.<br />
# Copy over the prototype {{ic|/usr/share/pacman/PKGBUILD.proto}} and rename it to {{ic|PKGBUILD}} in a temporary working directory.<br />
# Edit the {{ic|PKGBUILD}} according to the needs of your package.<br />
# Run {{ic|makepkg}} and check whether the package builds correctly.<br />
# If not, repeat the previous two steps.<br />
<br />
=== Warnings ===<br />
<br />
* Before you can automate the package building process, you should have done it manually at least once unless you know ''exactly'' what you are doing ''in advance'', in which case you would not be reading this in the first place. Unfortunately, although a good bunch of program authors stick to the 3-step build cycle of "{{ic|./configure}}; {{ic|make}}; {{ic|make install}}", this is not always the case, and things can get real ugly if you have to apply patches to make everything work at all. Rule of thumb: If you cannot get the program to compile from the source tarball, and make it install itself to a defined, temporary subdirectory, you do not even need to try packaging it. There is not any magic pixie dust in {{ic|makepkg}} that makes source problems go away.<br />
* In a few cases, the packages are not even available as source and you have to use something like {{ic|sh installer.run}} to get it to work. You will have to do quite a bit of research (read READMEs, INSTALL instructions, man pages, perhaps ebuilds from Gentoo or other package installers, possibly even the MAKEFILEs or source code) to get it working. In some really bad cases, you have to edit the source files to get it to work at all. However, {{ic|makepkg}} needs to be completely autonomous, with no user input. Therefore if you need to edit the makefiles, you may have to bundle a custom patch with the {{ic|PKGBUILD}} and install it from inside the {{ic|prepare()}} function, or you might have to issue some {{ic|sed}} commands from inside the {{ic|prepare()}} function.<br />
<br />
== More detailed guidelines ==<br />
<br />
{{Package guidelines}}<br />
<br />
== PKGBUILD generators ==<br />
<br />
PKGBUILDs for some packages can be generated automatically.<br />
<br />
{{Note|Users are still responsible for ensuring that the package meets the high quality standards before submitting the generated files to the [[AUR]].}}<br />
<br />
* [[Go]]: [https://github.com/seletskiy/go-makepkg go-makepkg]<br />
* [[Haskell]]: [https://github.com/magthe/cblrepo cblrepo]<br />
* [[Node.js]]: {{AUR|nodejs-npm2arch}} [https://github.com/simon04/npm2arch npm2arch]<br />
* [[Python]]: {{AUR|pipman-git}}, {{AUR|pip2arch-git}}, {{AUR|python-pypi2pkgbuild}}<br />
* [[Ruby]]: {{AUR|gem2arch}}, {{AUR|pacgem}}<br />
* [[Rust]]: {{AUR|cargo-pkgbuild}}<br />
<br />
== See also ==<br />
<br />
* [https://bbs.archlinux.org/viewtopic.php?id=91408 How to correctly create a patch file].<br />
* [https://archwomen.org/media/project_classroom/classlogs/ Arch Linux Classroom IRC Logs of classes about creating PKGBUILDs].<br />
* [http://www.linuxfromscratch.org/hints/downloads/files/fakeroot.txt Fakeroot approach for package installation]</div>Meriboldhttps://wiki.archlinux.org/index.php?title=User:Meribold&diff=583498User:Meribold2019-09-21T06:10:09Z<p>Meribold: </p>
<hr />
<div>Yak shaver. https://meribold.org.</div>Meriboldhttps://wiki.archlinux.org/index.php?title=User:Meribold&diff=558405User:Meribold2018-12-06T07:24:35Z<p>Meribold: Remove link</p>
<hr />
<div>Yak shaver.</div>Meriboldhttps://wiki.archlinux.org/index.php?title=User_talk:Meribold&diff=531097User talk:Meribold2018-07-26T13:09:42Z<p>Meribold: Create this page</p>
<hr />
<div></div>Meriboldhttps://wiki.archlinux.org/index.php?title=User:Meribold/vector.css&diff=531096User:Meribold/vector.css2018-07-26T13:08:18Z<p>Meribold: Copy stuff from <https://en.wikipedia.org/wiki/User:Meribold/vector.css></p>
<hr />
<div>h1, h2 {<br />
font-family: 'Roboto Slab' !important;<br />
}</div>Meriboldhttps://wiki.archlinux.org/index.php?title=User:Meribold&diff=530934User:Meribold2018-07-25T10:20:31Z<p>Meribold: Fix this page</p>
<hr />
<div>[https://github.com/meribold/dotfiles Yak shaver].</div>Meriboldhttps://wiki.archlinux.org/index.php?title=User:Meribold&diff=530933User:Meribold2018-07-25T10:17:25Z<p>Meribold: Create page</p>
<hr />
<div>Yak shaver.<ref>https://github.com/meribold/dotfiles</ref></div>Meriboldhttps://wiki.archlinux.org/index.php?title=Font_configuration/Examples&diff=530931Font configuration/Examples2018-07-25T10:14:02Z<p>Meribold: Add link to the thoroughly explained configuration in my dotfiles</p>
<hr />
<div>[[Category:Fonts]]<br />
[[ja:フォント設定/サンプル]]<br />
[[ru:Font configuration/Examples]]<br />
See [[Font configuration]] for the main article. <br />
<br />
Configurations can vary to a degree. Please post Fontconfig configurations with an explanation for why they were done.<br />
<br />
== Hinted fonts ==<br />
<br />
{{hc|~/.config/fontconfig/fonts.conf|<nowiki><br />
<?xml version='1.0'?><br />
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'><br />
<fontconfig><br />
<match target="font"><br />
<edit mode="assign" name="antialias"><br />
<bool>true</bool><br />
</edit><br />
<edit mode="assign" name="embeddedbitmap"><br />
<bool>false</bool><br />
</edit><br />
<edit mode="assign" name="hinting"><br />
<bool>true</bool><br />
</edit><br />
<edit mode="assign" name="hintstyle"><br />
<const>hintslight</const><br />
</edit><br />
<edit mode="assign" name="lcdfilter"><br />
<const>lcddefault</const><br />
</edit><br />
<edit mode="assign" name="rgba"><br />
<const>rgb</const><br />
</edit><br />
</match><br />
</fontconfig><br />
</nowiki>}}<br />
<br />
== No hinting for ''italic'' or '''bold''' ==<br />
<br />
<pre><br />
<?xml version='1.0'?><br />
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'><br />
<fontconfig><br />
<match target="font" ><br />
<edit mode="assign" name="autohint"> <bool>true</bool></edit><br />
<edit mode="assign" name="hinting"> <bool>false</bool></edit><br />
<edit mode="assign" name="lcdfilter"> <const>lcddefault</const></edit><br />
<edit mode="assign" name="hintstyle"> <const>hintslight</const></edit><br />
<edit mode="assign" name="antialias"> <bool>true</bool></edit><br />
<edit mode="assign" name="rgba"> <const>rgb</const></edit><br />
</match><br />
<br />
<match target="font"><br />
<test name="pixelsize" qual="any" compare="more"><double>15</double></test><br />
<edit mode="assign" name="lcdfilter"><const>lcdlight</const></edit><br />
<edit mode="assign" name="hintstyle"><const>hintnone</const></edit><br />
</match><br />
<br />
<match target="font"><br />
<test name="weight" compare="more"><const>medium</const></test><br />
<edit mode="assign" name="hintstyle"><const>hintnone</const></edit><br />
<edit mode="assign" name="lcdfilter"><const>lcdlight</const></edit><br />
</match><br />
<br />
<match target="font"><br />
<test name="slant" compare="not_eq"><double>0</double></test><br />
<edit mode="assign" name="hintstyle"><const>hintnone</const></edit><br />
<edit mode="assign" name="lcdfilter"><const>lcdlight</const></edit><br />
</match><br />
<br />
</fontconfig><br />
</pre><br />
<br />
== Sharp fonts ==<br />
<br />
{{remove|Repeats [[Font_configuration/Examples#Hinted fonts|Hinted fonts]] where it can be included as comments.}}<br />
<br />
<!DOCTYPE fontconfig SYSTEM "fonts.dtd"><br />
<fontconfig><br />
<match target="font"><br />
<edit name="antialias" mode="assign"><bool>true</bool></edit><br />
<edit name="hinting" mode="assign"><bool>true</bool></edit><br />
<edit name="hintstyle" mode="assign"><const>hintfull</const></edit> &lt;!-- try hintmedium if it looks bad --><br />
<edit name="lcdfilter" mode="assign"><const>lcddefault</const></edit><br />
<edit name="rgba" mode="assign"><const>rgb</const></edit> &lt;!-- set to match your display --><br />
</match><br />
</fontconfig><br />
<br />
== Enable anti-aliasing only for bigger fonts ==<br />
<br />
Some users prefer the sharper rendering that anti-aliasing does not offer:<br />
<br />
{{bc|<nowiki><br />
<?xml version="1.0"?><br />
<!DOCTYPE fontconfig SYSTEM "fonts.dtd"><br />
<fontconfig><br />
<match target="font"><br />
<edit name="antialias" mode="assign"><br />
<bool>false</bool><br />
</edit><br />
</match><br />
<br />
<match target="font" ><br />
<test name="size" qual="any" compare="more"><br />
<double>12</double><br />
</test><br />
<edit name="antialias" mode="assign"><br />
<bool>true</bool><br />
</edit><br />
</match><br />
<br />
<match target="font" ><br />
<test name="pixelsize" qual="any" compare="more"><br />
<double>16</double><br />
</test><br />
<edit name="antialias" mode="assign"><br />
<bool>true</bool><br />
</edit><br />
</match><br />
</fontconfig><br />
</nowiki>}}<br />
<br />
== Disable bold font ==<br />
<br />
For when a font does not present itself well in bold and you can't disable bold fonts in the application ([[st]] for example).<br />
<br />
{{bc|<nowiki><br />
...<br />
<match target="pattern"><br />
<test qual="any" name="family"><br />
<string>Envy Code R</string><br />
</test><br />
<test name="weight" compare="more"><br />
<const>medium</const><br />
</test><br />
<edit name="weight" mode="assign" binding="same"><br />
<const>medium</const><br />
</edit><br />
</match><br />
...<br />
</nowiki>}}<br />
<br />
== Default fonts ==<br />
<br />
For font consistency, all applications should be set to use the serif, sans-serif, and monospace aliases, which are mapped to particular fonts by fontconfig. See [[Metric-compatible fonts]] for options and examples. <br />
<br />
=== Japanese ===<br />
<br />
Example fonts.conf which also specifies a default font for the Japanese locale (ja_JP) and keeps western style fonts for Latin letters.<br />
<br />
{{bc|<nowiki><br />
<?xml version='1.0'?><br />
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'><br />
<fontconfig><br />
<br />
<!-- Default font (no fc-match pattern) --><br />
<match><br />
<edit mode="prepend" name="family"><br />
<string>Noto Sans</string><br />
</edit><br />
</match><br />
<br />
<!-- Default font for the ja_JP locale (no fc-match pattern) --><br />
<match><br />
<test compare="contains" name="lang"><br />
<string>ja</string><br />
</test><br />
<edit mode="prepend" name="family"><br />
<string>Noto Sans CJK JP</string><br />
</edit><br />
</match><br />
<br />
<!-- Default sans-serif font --><br />
<match target="pattern"><br />
<test qual="any" name="family"><string>sans-serif</string></test><br />
<!--<test qual="any" name="lang"><string>ja</string></test>--><br />
<edit name="family" mode="prepend" binding="same"><string>Noto Sans</string> </edit><br />
</match><br />
<br />
<!-- Default serif fonts --><br />
<match target="pattern"><br />
<test qual="any" name="family"><string>serif</string></test><br />
<edit name="family" mode="prepend" binding="same"><string>Noto Serif</string> </edit><br />
<edit name="family" mode="append" binding="same"><string>IPAPMincho</string> </edit><br />
<edit name="family" mode="append" binding="same"><string>HanaMinA</string> </edit><br />
</match><br />
<br />
<!-- Default monospace fonts --><br />
<match target="pattern"><br />
<test qual="any" name="family"><string>monospace</string></test><br />
<edit name="family" mode="prepend" binding="same"><string>Inconsolatazi4</string></edit><br />
<edit name="family" mode="append" binding="same"><string>IPAGothic</string></edit><br />
</match><br />
<br />
<!-- Fallback fonts preference order --><br />
<alias><br />
<family>sans-serif</family><br />
<prefer><br />
<family>Noto Sans</family><br />
<family>Open Sans</family><br />
<family>Droid Sans</family><br />
<family>Ubuntu</family><br />
<family>Roboto</family><br />
<family>NotoSansCJK</family><br />
<family>Source Han Sans JP</family><br />
<family>IPAPGothic</family><br />
<family>VL PGothic</family><br />
<family>Koruri</family><br />
</prefer><br />
</alias><br />
<alias><br />
<family>serif</family><br />
<prefer><br />
<family>Noto Serif</family><br />
<family>Droid Serif</family><br />
<family>Roboto Slab</family><br />
<family>IPAPMincho</family><br />
</prefer><br />
</alias><br />
<alias><br />
<family>monospace</family><br />
<prefer><br />
<family>Inconsolatazi4</family><br />
<family>Ubuntu Mono</family><br />
<family>Droid Sans Mono</family><br />
<family>Roboto Mono</family><br />
<family>IPAGothic</family><br />
</prefer><br />
</alias><br />
<br />
<dir>~/.fonts</dir><br />
</fontconfig><br />
</nowiki>}}<br />
<br />
=== Chinese ===<br />
{{hc|~/.config/fontconfig/fonts.conf<br />
or<br />
/etc/fonts/local.conf|<nowiki><br />
<?xml version="1.0"?><br />
<!DOCTYPE fontconfig SYSTEM "fonts.dtd"><br />
<fontconfig><br />
<br />
<match target="font"><br />
<edit name="embeddedbitmap" mode="assign"><br />
<bool>false</bool><br />
</edit><br />
</match><br />
<br />
<match><br />
<test qual="any" name="family"><br />
<string>serif</string><br />
</test><br />
<edit name="family" mode="prepend" binding="strong"><br />
<string>Noto Serif</string><br />
</edit><br />
</match><br />
<match target="pattern"><br />
<test qual="any" name="family"><br />
<string>sans-serif</string><br />
</test><br />
<edit name="family" mode="prepend" binding="strong"><br />
<string>Roboto</string><br />
</edit><br />
</match><br />
<match target="pattern"><br />
<test qual="any" name="family"><br />
<string>monospace</string><br />
</test><br />
<edit name="family" mode="prepend" binding="strong"><br />
<string>DejaVu Sans Mono</string><br />
</edit><br />
</match><br />
<br />
<match><br />
<test name="lang" compare="contains"><br />
<string>zh</string><br />
</test><br />
<test name="family"><br />
<string>serif</string><br />
</test><br />
<edit name="family" mode="prepend"><br />
<string>Source Han Serif CN</string><br />
</edit><br />
</match><br />
<match><br />
<test name="lang" compare="contains"><br />
<string>zh</string><br />
</test><br />
<test name="family"><br />
<string>sans-serif</string><br />
</test><br />
<edit name="family" mode="prepend"><br />
<string>Source Han Sans CN</string><br />
</edit><br />
</match><br />
<match><br />
<test name="lang" compare="contains"><br />
<string>zh</string><br />
</test><br />
<test name="family"><br />
<string>monospace</string><br />
</test><br />
<edit name="family" mode="prepend"><br />
<string>Noto Sans Mono CJK SC</string><br />
</edit><br />
</match><br />
<br />
<!--Windows & Linux Chinese fonts. --><br />
<match target="pattern"><br />
<test qual="any" name="family"><br />
<string>WenQuanYi Zen Hei</string><br />
</test><br />
<edit name="family" mode="assign" binding="same"><br />
<string>Source Han Sans CN</string><br />
</edit><br />
</match><br />
<match target="pattern"><br />
<test qual="any" name="family"><br />
<string>WenQuanYi Micro Hei</string><br />
</test><br />
<edit name="family" mode="assign" binding="same"><br />
<string>Source Han Sans CN</string><br />
</edit><br />
</match><br />
<match target="pattern"><br />
<test qual="any" name="family"><br />
<string>WenQuanYi Micro Hei Light</string><br />
</test><br />
<edit name="family" mode="assign" binding="same"><br />
<string>Source Han Sans CN</string><br />
</edit><br />
</match><br />
<match target="pattern"><br />
<test qual="any" name="family"><br />
<string>Microsoft YaHei</string><br />
</test><br />
<edit name="family" mode="assign" binding="same"><br />
<string>Source Han Sans CN</string><br />
</edit><br />
</match><br />
<match target="pattern"><br />
<test qual="any" name="family"><br />
<string>SimHei</string><br />
</test><br />
<edit name="family" mode="assign" binding="same"><br />
<string>Source Han Sans CN</string><br />
</edit><br />
</match><br />
<match target="pattern"><br />
<test qual="any" name="family"><br />
<string>SimSun</string><br />
</test><br />
<edit name="family" mode="assign" binding="same"><br />
<string>Source Han Serif CN</string><br />
</edit><br />
</match><br />
<match target="pattern"><br />
<test qual="any" name="family"><br />
<string>SimSun-18030</string><br />
</test><br />
<edit name="family" mode="assign" binding="same"><br />
<string>Source Han Serif CN</string><br />
</edit><br />
</match><br />
</fontconfig><br />
</nowiki>}}<br />
<br />
== Patched packages ==<br />
<br />
{{Warning|AUR packages are maintained separately from applications in the [[official repositories]]. The whole graphical system can become inoperable, if the user-installed core graphical libraries become incompatible.}}<br />
<br />
{{Note|<br />
* Configuration is usually necessary.<br />
* The new font rendering will not be available until applications restart.<br />
* Applications which [[Wikipedia:Static library|statically link]] to a library will not be affected by the system library, or patches applied to it.<br />
}}<br />
<br />
* {{App|freetype2-ubuntu|Font configuration shipped with Ubuntu. [http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/wily/fontconfig/wily/files/head:/debian/patches/] [http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/wily/freetype/wily/files/head:/debian/patches-freetype/]|https://launchpad.net/ubuntu/+source/freetype|{{AUR|freetype2-ubuntu}}{{Broken package link|package not found}} {{AUR|fontconfig-ubuntu}}}}<br />
<br />
To restore the original packages, reinstall {{Pkg|freetype2}}, {{pkg|cairo}}, and {{pkg|fontconfig}} as dependencies (use the {{ic|--asdeps}} flag with pacman when reinstalling). Include {{pkg|lib32-cairo}}, {{pkg|lib32-fontconfig}}, and {{pkg|lib32-freetype2}} if you also installed 32-bit versions.<br />
<br />
== Infinality-like font substitution ==<br />
<br />
{{remove|Explain why they remain valuable and avoid referring to "recent versions".|section=30-infinality-aliases.conf}}<br />
<br />
For user provided fontconfig [[Fonts#Font_alias|substitutions]] replicating those offered with the [https://github.com/bohoomil/fontconfig-ultimate bundle] install either {{AUR|fonts-meta-extended-lt}} (light version) or {{AUR|fonts-meta-extended}} (complete version) and [[Font_configuration#Presets|enable]] the provided {{ic|30-infinality-aliases.conf}} preset.<br />
<br />
== See also ==<br />
<br />
* [http://forums.gentoo.org/viewtopic-p-7273876.html#7273876 Gentoo forums]<br />
* [https://github.com/meribold/dotfiles/tree/master/home/config/fontconfig Thoroughly explained configuration that changes default fonts and sets fallback fonts for emoji and traditional Chinese characters]</div>Meribold