https://wiki.archlinux.org/api.php?action=feedcontributions&user=ENV25&feedformat=atomArchWiki - User contributions [en]2024-03-29T14:05:31ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Talk:Rust_package_guidelines&diff=786976Talk:Rust package guidelines2023-09-04T21:45:01Z<p>ENV25: /* RUSTFLAGS link-time optimization */ re</p>
<hr />
<div>==Using cargo install in package()==<br />
<br />
The {{ic|cargo install}} command seems invalid, it contains {{ic|--root}} twice ? It seems {{ic|cargo install --locked --root "${pkgdir}"/usr --path "${srcdir}/${pkgname}-${pkgver}"}} is closer to what we need, but it creates a {{ic|.creates.toml}} file in {{ic|/usr/bin}} (see https://github.com/rust-lang/cargo/issues/3316)<br />
<br />
[[User:Nicoulaj|Nicoulaj]] ([[User talk:Nicoulaj|talk]]) 08:34, 24 June 2019 (UTC)<br />
<br />
:That PR actually provides a solution: {{ic|--no-metadata}}. So I guess the command now should be {{ic|cargo install --locked --no-metadata --root "${pkgdir}"/usr --path "${srcdir}/${pkgname}-${pkgver}"}} ? [[User:Renyuneyun|Renyuneyun]] ([[User talk:Renyuneyun|talk]]) 18:41, 5 November 2019 (UTC)<br />
<br />
== A few concerns ==<br />
<br />
{{ic|--target "$CARCH-unknown-linux-gnu"}} is not required, as the host architecture is the [https://doc.rust-lang.org/cargo/commands/cargo-fetch.html#fetch-options default] value.<br />
<br />
[[User:Grawlinson|Grawlinson]] ([[User talk:Grawlinson|talk]]) 07:38, 13 August 2021 (UTC)<br />
<br />
: This is empirically not the case. Honestly it looks like the Rust docs are wrong here. The host architecture is the default only for ''build'', not for ''fetch''. For fetch the default is re download dependencies for '''all''' possible targets. You can see this pretty plainly if you check the actual downloads. For example take the {{pkg|starship}} package and build it yourself after adding a `du -sh ~cargo;exit 1` to the end of the prepare() function. You should get a dependency cache of 182M. Now delete the target argument and try again. Now you'll get 326M. This is why the argument is worthwhile for a huge portion of Rust packages: by default somewhere down the dependency chain they will have libraries for other platforms.<br />
: [[User:Alerque|Alerque]] ([[User talk:Alerque|talk]]) 11:49, 13 August 2021 (UTC)<br />
<br />
:: In fact closer inspection shows the docs contradict themselves. In the options block it has the text copied from {{ic|cargo build}} (which is wrong for {{ic|cargo fetch}}) but just above that in the [https://doc.rust-lang.org/cargo/commands/cargo-fetch.html#description description block] it does have the right thing documented: "If --target is not specified, then all target dependencies are fetched." I'm working on a PR to send upstream. <br />
:: [[User:Alerque|Alerque]] ([[User talk:Alerque|talk]]) 12:32, 13 August 2021 (UTC)<br />
<br />
::: Fantastic! Glad to hear that upstream documentation will (hopefully) be amended.<br />
::: [[User:Grawlinson|Grawlinson]] ([[User talk:Grawlinson|talk]]) 01:01, 14 August 2021 (UTC)<br />
<br />
: This seems to cause problems on e.g. RaspberryPi 4 where {{ic|1=CARCH=armv7h}} but cargo expects {{ic|--target armv7-unknown-linux-gnueabihf}}<br />
: [[User:Christoph.gysin|Christoph.gysin]] ([[User talk:Christoph.gysin|talk]]) 20:28, 7 October 2021 (UTC)<br />
<br />
{{ic|1=RUSTUP_TOOLCHAIN=stable}} is not used when {{ic|rust}} is installed, as per the [https://doc.rust-lang.org/cargo/reference/environment-variables.html documentation]. This also causes builds to not be reproducible due to "stable" being the latest stable version, not a pinned version.<br />
<br />
[[User:Grawlinson|Grawlinson]] ([[User talk:Grawlinson|talk]]) 07:38, 13 August 2021 (UTC)<br />
<br />
: No, this logic only applies when the specific package {{pkg|rust}} is installed, it does not apply when something else that ''provides'' rust is installed. This argument is specifically document as only being suggested for AUR packages not repo builds. There are quite a few packages including {{pkg|rustup}} that {{ic|1=provide=(rust)}} that can be configured to default to other tool chains such as nightly.<br />
: [[User:Alerque|Alerque]] ([[User talk:Alerque|talk]]) 11:49, 13 August 2021 (UTC)<br />
<br />
:: Using rustup with toolchain=stable does result in non-reproducible builds.<br />
:: [[User:Grawlinson|Grawlinson]] ([[User talk:Grawlinson|talk]]) 01:30, 14 August 2021 (UTC)<br />
<br />
::: While sort of true, this is irrelevant on two counts: ① the variable in question is noted ''only'' for inclusion in AUR builds where reproduciblity isn't exactly a front and center goal while not breaking is, and ② the makedepends should never use {{pkg|rustup}}, only either {{ic|cargo}} or {{ic|cargo-nightly}}. There are other things that can provide ''cargo-nightly'' besides ''rustup'' that may come in to play for some users, and only in the event that nightly is is reproduciblity a problem. In which case the variable in question won't be set to stable anyway!<br />
::: [[User:Alerque|Alerque]] ([[User talk:Alerque|talk]]) 20:41, 14 August 2021 (UTC)<br />
<br />
{{ic|CARGO_TARGET_DIR}}, or {{ic|--target}} or {{ic|--target-dir}} cause Cargo to run in a different [https://doc.rust-lang.org/cargo/guide/build-cache.html mode]. The default value is sane enough.<br />
<br />
[[User:Grawlinson|Grawlinson]] ([[User talk:Grawlinson|talk]]) 07:38, 13 August 2021 (UTC)<br />
<br />
: No it doesn't. And the docs don't say this. They say this for the {{ic|--target}} argument but not for the {{ic|CARGO_TARGET_DIR}} environment variable. And the default value is sane of course, the issue we are trying to fix is people who have user environments that override the default. We need the default back because it is generally assumed in the {{ic|package()}} function where the builds will be.<br />
: [[User:Alerque|Alerque]] ([[User talk:Alerque|talk]]) 11:49, 13 August 2021 (UTC)<br />
<br />
As it is, this page seems to be targeted at AUR users, rather than packagers. Providing both methods on this page suggests that packagers are happy with the page is it is.<br />
<br />
[[User:Grawlinson|Grawlinson]] ([[User talk:Grawlinson|talk]]) 07:38, 13 August 2021 (UTC)<br />
<br />
: It includes tips for both with specific documentation for when, why, and where each argument is useful. I don't understand what the issue is. If you'd prefer the notes be rewritten the other way (notes for AUR instead of notes for not-AUR) we could do that, but the examples and formatting would get more cluttered — which is why I picked this way while editing it.<br />
: [[User:Alerque|Alerque]] ([[User talk:Alerque|talk]]) 11:49, 13 August 2021 (UTC)<br />
<br />
: '''Note''' Almost all of these concerns boil down to "is it okay to spell out good practices for AUR packages here, or is this strictly for repo. My edits (and many before me) have been done with the idea that good practices for AUR package are topical here but should be called out as such and explain why they are slightly different from repo packages (coping with user environments).<br />
: [[User:Alerque|Alerque]] ([[User talk:Alerque|talk]]) 11:49, 13 August 2021 (UTC)<br />
<br />
:: A new thought on this topic ... since the real issues here is user env vars leaking into the build, maybe it would be better to recommend explicitly unsetting them instead of setting them back to defaults: e.g. {{ic|unset CARGO_TARGET_DIR}}. I think this would be a better pointer towards the purpose of setting this in the first place.<br />
:: [[User:Alerque|Alerque]] ([[User talk:Alerque|talk]]) 13:02, 13 August 2021 (UTC)<br />
<br />
::: The usage of export explicitly overrides the variable for the session of the shell. An in-line environment variable override temporarily sets that variable for the scope of the command preceding it. They are two completely separate behaviours, setting/unsetting variables with export/unset gets messy fast.<br />
::: [[User:Grawlinson|Grawlinson]] ([[User talk:Grawlinson|talk]]) 01:22, 14 August 2021 (UTC)<br />
<br />
:::: So? That's excatly what we want, if we could trust the functions would all be run we could just do it once, but since there are ways to skip some steps we need to export in each function to be safe. We want these to last for the duration of the build session. If this is such an anti-pattern maybe first work on fixing it for all the perl and other language prototype PKGBUILDs that come packaged in pacman. I don't think it's messy at all when the result is exactly the behaviour you ''want'' in the first place.<br />
:::: [[User:Alerque|Alerque]] ([[User talk:Alerque|talk]]) 20:41, 14 August 2021 (UTC)<br />
<br />
:::: Follow up idea: How about recommending {{ic|local FOO}} instead of {{ic|export FOO}}? This will prevent the scope leakage you were concerned about while preserving the attributes I was worried about.<br />
:::: [[User:Alerque|Alerque]] ([[User talk:Alerque|talk]]) 12:56, 18 August 2021 (UTC)<br />
<br />
To ensure builds are reproducible, either {{ic|rust}} or {{ic|rustup}} should be specified as a build dependency instead of {{ic|cargo}}. Rustup should *only* be used if upstream has explicitly stated this, *and* provides a toolchain file with an exact version.<br />
<br />
[[User:Grawlinson|Grawlinson]] ([[User talk:Grawlinson|talk]]) 07:38, 13 August 2021 (UTC)<br />
<br />
: This isn't the way it works. {{pkg|rustup}} should never be specified as a dependency. Users may choose to meet the depends clause with it because it provides both ''cargo'' and ''cargo-nightly'', but PKGBUILDs should always depend on either ''cargo'' or ''cargo-nightly'' and let those resolve te either the direct packages (as will always be the case for repository packages) or whatever the user has that provides them (as will sometimes be different for AUR builds). There is not point in depending an {{pkg|rust}} instead of {{pkg|cargo}} as far as reproducibility goes as they are currently provided by the same thing, and given that the actual tool being used by the build is ''cargo'' that is the most future-prof thing to require for now.<br />
: [[User:Alerque|Alerque]] ([[User talk:Alerque|talk]]) 11:49, 13 August 2021 (UTC)<br />
<br />
:: vaultwarden uses rustup as a dependency because that is what's required, so there is a point in using rust/rustup for explicit package dependencies.<br />
:: [[User:Grawlinson|Grawlinson]] ([[User talk:Grawlinson|talk]]) 01:28, 14 August 2021 (UTC)<br />
<br />
: As an additional followup on this point, see this IRC conversation with the {{pkg|rust}} package maintainer: https://paste.rs/NWZ<br />
: [[User:Alerque|Alerque]] ([[User talk:Alerque|talk]]) 09:51, 13 September 2021 (UTC)<br />
<br />
:: You have completely misrepresented my point regarding reproducibility. Reproducibility is questionable when rustup is used along with the version environment variable, as there is no guarantee that rustup will pull the same version of cargo on later rebuilds.<br />
:: It doesn't matter, these are simply guidelines and any packages that I maintain will be using rust as a make dependency because I would rather be explicit when there are multiple providers of cargo.<br />
:: [[User:Grawlinson|Grawlinson]] ([[User talk:Grawlinson|talk]]) 06:13, 14 September 2021 (UTC)<br />
<br />
The usage of {{ic|export}} is completely unnecessary when only one command will pick up the environment variables, or when CLI flags/options are available.<br />
<br />
[[User:Grawlinson|Grawlinson]] ([[User talk:Grawlinson|talk]]) 07:38, 13 August 2021 (UTC)<br />
<br />
: Again this is not quite true. First, the argument variants are '''not equivalent'''. They do cause slightly different things to happen. Also there is an order of precedence issue. Because user environment variables are what we are countering, fixing them as environment variables introduces the least surface area for possible precedence confusion. Beyond that it is mostly a style thing. It is a lot easier to compare/diff/grep across different packages if these interventions are on their own line. One way is easier to transform AUR needs into repo needs and vise versa. <br />
: [[User:Alerque|Alerque]] ([[User talk:Alerque|talk]]) 11:49, 13 August 2021 (UTC)<br />
<br />
== export or not ? ==<br />
if a project wants rustflags, should they be exported as well, and why? i saw you do export CARGO_TARGET_DIR. --[[User:Soloturn|Soloturn]] ([[User talk:Soloturn|talk]]) 17:01, 15 February 2023 (UTC)<br />
<br />
: Users can configure {{ic|RUSTFLAGS}} via {{man|5|makepkg.conf}}. It is not good to override user flags.<br />
: {{ic|CARGO_TARGET_DIR{{=}}target}} is exported for a reason. This is default value for {{ic|cargo}} and most PKGBUILDs do something like<br />
: {{bc|install "target/executable_name" -t "${pkgdir}/usr/bin"}}<br />
: But it obviously will break if user set custom {{ic|CARGO_TARGET_DIR}} location. So it is a safety measure.<br />
: [[User:Hanabishi|Hanabishi]] ([[User talk:Hanabishi|talk]]) 18:21, 15 February 2023 (UTC)<br />
<br />
:: Why not set {{ic|RUSTFLAGS}} to {{ic|RUSTFLAGS{{=}}"${RUSTFLAGS:---remap-path-prefix{{=}}\"$srcdir\"{{=}}src}"}} in PKGBUILD for instance?<br />
:: Therefore the user's {{ic|RUSTFLAGS}} would be taken into account while still setting a default.<br />
:: [[User:HarmfulBreeze|HarmfulBreeze]] ([[User talk:HarmfulBreeze|talk]]) 14:23, 28 March 2023 (UTC)<br />
<br />
== mold linker ==<br />
can we use the mold linker by default, or this would be bad practice? --[[User:Soloturn|Soloturn]] ([[User talk:Soloturn|talk]]) 17:01, 15 February 2023 (UTC)<br />
<br />
: Again, this requires overriding of user flags, which is not good. Users should be able use whatever linker they want.<br />
: And {{ic|mold}} itself does not provide any quality improvements, it is more about performance tips. Also considering that it is not Rust exclusive, it is better to be adviced in e.g. [[Makepkg#Improving compile times]] imo.<br />
: [[User:Hanabishi|Hanabishi]] ([[User talk:Hanabishi|talk]]) 18:44, 15 February 2023 (UTC)<br />
<br />
== RUSTFLAGS link-time optimization ==<br />
<br />
Currently enabling {{ic|lto}} in PKGBUILD does not enable link-time optimization in Rust i.e. {{ic|1=RUSTFLAGS+=' -C lto=true '}}<br />
<br />
Is this intended behaviour? If true, should this be changed upstream in makepkg?<br />
<br />
--[[User:ENV25|ENV25]] ([[User talk:ENV25|talk]]) 21:40, 4 September 2023 (UTC)<br />
<br />
:Actually, reading https://doc.rust-lang.org/cargo/reference/profiles.html#lto, perhaps it should be {{ic|1=RUSTFLAGS+=' -C linker-plugin-lto=true '}}.<br />
:https://doc.rust-lang.org/rustc/codegen-options/index.html#linker-plugin-lto<br />
:[[User:ENV25|ENV25]] ([[User talk:ENV25|talk]]) 21:45, 4 September 2023 (UTC)</div>ENV25https://wiki.archlinux.org/index.php?title=Talk:Rust_package_guidelines&diff=786975Talk:Rust package guidelines2023-09-04T21:40:58Z<p>ENV25: /* RUSTFLAGS link-time optimization */ new section</p>
<hr />
<div>==Using cargo install in package()==<br />
<br />
The {{ic|cargo install}} command seems invalid, it contains {{ic|--root}} twice ? It seems {{ic|cargo install --locked --root "${pkgdir}"/usr --path "${srcdir}/${pkgname}-${pkgver}"}} is closer to what we need, but it creates a {{ic|.creates.toml}} file in {{ic|/usr/bin}} (see https://github.com/rust-lang/cargo/issues/3316)<br />
<br />
[[User:Nicoulaj|Nicoulaj]] ([[User talk:Nicoulaj|talk]]) 08:34, 24 June 2019 (UTC)<br />
<br />
:That PR actually provides a solution: {{ic|--no-metadata}}. So I guess the command now should be {{ic|cargo install --locked --no-metadata --root "${pkgdir}"/usr --path "${srcdir}/${pkgname}-${pkgver}"}} ? [[User:Renyuneyun|Renyuneyun]] ([[User talk:Renyuneyun|talk]]) 18:41, 5 November 2019 (UTC)<br />
<br />
== A few concerns ==<br />
<br />
{{ic|--target "$CARCH-unknown-linux-gnu"}} is not required, as the host architecture is the [https://doc.rust-lang.org/cargo/commands/cargo-fetch.html#fetch-options default] value.<br />
<br />
[[User:Grawlinson|Grawlinson]] ([[User talk:Grawlinson|talk]]) 07:38, 13 August 2021 (UTC)<br />
<br />
: This is empirically not the case. Honestly it looks like the Rust docs are wrong here. The host architecture is the default only for ''build'', not for ''fetch''. For fetch the default is re download dependencies for '''all''' possible targets. You can see this pretty plainly if you check the actual downloads. For example take the {{pkg|starship}} package and build it yourself after adding a `du -sh ~cargo;exit 1` to the end of the prepare() function. You should get a dependency cache of 182M. Now delete the target argument and try again. Now you'll get 326M. This is why the argument is worthwhile for a huge portion of Rust packages: by default somewhere down the dependency chain they will have libraries for other platforms.<br />
: [[User:Alerque|Alerque]] ([[User talk:Alerque|talk]]) 11:49, 13 August 2021 (UTC)<br />
<br />
:: In fact closer inspection shows the docs contradict themselves. In the options block it has the text copied from {{ic|cargo build}} (which is wrong for {{ic|cargo fetch}}) but just above that in the [https://doc.rust-lang.org/cargo/commands/cargo-fetch.html#description description block] it does have the right thing documented: "If --target is not specified, then all target dependencies are fetched." I'm working on a PR to send upstream. <br />
:: [[User:Alerque|Alerque]] ([[User talk:Alerque|talk]]) 12:32, 13 August 2021 (UTC)<br />
<br />
::: Fantastic! Glad to hear that upstream documentation will (hopefully) be amended.<br />
::: [[User:Grawlinson|Grawlinson]] ([[User talk:Grawlinson|talk]]) 01:01, 14 August 2021 (UTC)<br />
<br />
: This seems to cause problems on e.g. RaspberryPi 4 where {{ic|1=CARCH=armv7h}} but cargo expects {{ic|--target armv7-unknown-linux-gnueabihf}}<br />
: [[User:Christoph.gysin|Christoph.gysin]] ([[User talk:Christoph.gysin|talk]]) 20:28, 7 October 2021 (UTC)<br />
<br />
{{ic|1=RUSTUP_TOOLCHAIN=stable}} is not used when {{ic|rust}} is installed, as per the [https://doc.rust-lang.org/cargo/reference/environment-variables.html documentation]. This also causes builds to not be reproducible due to "stable" being the latest stable version, not a pinned version.<br />
<br />
[[User:Grawlinson|Grawlinson]] ([[User talk:Grawlinson|talk]]) 07:38, 13 August 2021 (UTC)<br />
<br />
: No, this logic only applies when the specific package {{pkg|rust}} is installed, it does not apply when something else that ''provides'' rust is installed. This argument is specifically document as only being suggested for AUR packages not repo builds. There are quite a few packages including {{pkg|rustup}} that {{ic|1=provide=(rust)}} that can be configured to default to other tool chains such as nightly.<br />
: [[User:Alerque|Alerque]] ([[User talk:Alerque|talk]]) 11:49, 13 August 2021 (UTC)<br />
<br />
:: Using rustup with toolchain=stable does result in non-reproducible builds.<br />
:: [[User:Grawlinson|Grawlinson]] ([[User talk:Grawlinson|talk]]) 01:30, 14 August 2021 (UTC)<br />
<br />
::: While sort of true, this is irrelevant on two counts: ① the variable in question is noted ''only'' for inclusion in AUR builds where reproduciblity isn't exactly a front and center goal while not breaking is, and ② the makedepends should never use {{pkg|rustup}}, only either {{ic|cargo}} or {{ic|cargo-nightly}}. There are other things that can provide ''cargo-nightly'' besides ''rustup'' that may come in to play for some users, and only in the event that nightly is is reproduciblity a problem. In which case the variable in question won't be set to stable anyway!<br />
::: [[User:Alerque|Alerque]] ([[User talk:Alerque|talk]]) 20:41, 14 August 2021 (UTC)<br />
<br />
{{ic|CARGO_TARGET_DIR}}, or {{ic|--target}} or {{ic|--target-dir}} cause Cargo to run in a different [https://doc.rust-lang.org/cargo/guide/build-cache.html mode]. The default value is sane enough.<br />
<br />
[[User:Grawlinson|Grawlinson]] ([[User talk:Grawlinson|talk]]) 07:38, 13 August 2021 (UTC)<br />
<br />
: No it doesn't. And the docs don't say this. They say this for the {{ic|--target}} argument but not for the {{ic|CARGO_TARGET_DIR}} environment variable. And the default value is sane of course, the issue we are trying to fix is people who have user environments that override the default. We need the default back because it is generally assumed in the {{ic|package()}} function where the builds will be.<br />
: [[User:Alerque|Alerque]] ([[User talk:Alerque|talk]]) 11:49, 13 August 2021 (UTC)<br />
<br />
As it is, this page seems to be targeted at AUR users, rather than packagers. Providing both methods on this page suggests that packagers are happy with the page is it is.<br />
<br />
[[User:Grawlinson|Grawlinson]] ([[User talk:Grawlinson|talk]]) 07:38, 13 August 2021 (UTC)<br />
<br />
: It includes tips for both with specific documentation for when, why, and where each argument is useful. I don't understand what the issue is. If you'd prefer the notes be rewritten the other way (notes for AUR instead of notes for not-AUR) we could do that, but the examples and formatting would get more cluttered — which is why I picked this way while editing it.<br />
: [[User:Alerque|Alerque]] ([[User talk:Alerque|talk]]) 11:49, 13 August 2021 (UTC)<br />
<br />
: '''Note''' Almost all of these concerns boil down to "is it okay to spell out good practices for AUR packages here, or is this strictly for repo. My edits (and many before me) have been done with the idea that good practices for AUR package are topical here but should be called out as such and explain why they are slightly different from repo packages (coping with user environments).<br />
: [[User:Alerque|Alerque]] ([[User talk:Alerque|talk]]) 11:49, 13 August 2021 (UTC)<br />
<br />
:: A new thought on this topic ... since the real issues here is user env vars leaking into the build, maybe it would be better to recommend explicitly unsetting them instead of setting them back to defaults: e.g. {{ic|unset CARGO_TARGET_DIR}}. I think this would be a better pointer towards the purpose of setting this in the first place.<br />
:: [[User:Alerque|Alerque]] ([[User talk:Alerque|talk]]) 13:02, 13 August 2021 (UTC)<br />
<br />
::: The usage of export explicitly overrides the variable for the session of the shell. An in-line environment variable override temporarily sets that variable for the scope of the command preceding it. They are two completely separate behaviours, setting/unsetting variables with export/unset gets messy fast.<br />
::: [[User:Grawlinson|Grawlinson]] ([[User talk:Grawlinson|talk]]) 01:22, 14 August 2021 (UTC)<br />
<br />
:::: So? That's excatly what we want, if we could trust the functions would all be run we could just do it once, but since there are ways to skip some steps we need to export in each function to be safe. We want these to last for the duration of the build session. If this is such an anti-pattern maybe first work on fixing it for all the perl and other language prototype PKGBUILDs that come packaged in pacman. I don't think it's messy at all when the result is exactly the behaviour you ''want'' in the first place.<br />
:::: [[User:Alerque|Alerque]] ([[User talk:Alerque|talk]]) 20:41, 14 August 2021 (UTC)<br />
<br />
:::: Follow up idea: How about recommending {{ic|local FOO}} instead of {{ic|export FOO}}? This will prevent the scope leakage you were concerned about while preserving the attributes I was worried about.<br />
:::: [[User:Alerque|Alerque]] ([[User talk:Alerque|talk]]) 12:56, 18 August 2021 (UTC)<br />
<br />
To ensure builds are reproducible, either {{ic|rust}} or {{ic|rustup}} should be specified as a build dependency instead of {{ic|cargo}}. Rustup should *only* be used if upstream has explicitly stated this, *and* provides a toolchain file with an exact version.<br />
<br />
[[User:Grawlinson|Grawlinson]] ([[User talk:Grawlinson|talk]]) 07:38, 13 August 2021 (UTC)<br />
<br />
: This isn't the way it works. {{pkg|rustup}} should never be specified as a dependency. Users may choose to meet the depends clause with it because it provides both ''cargo'' and ''cargo-nightly'', but PKGBUILDs should always depend on either ''cargo'' or ''cargo-nightly'' and let those resolve te either the direct packages (as will always be the case for repository packages) or whatever the user has that provides them (as will sometimes be different for AUR builds). There is not point in depending an {{pkg|rust}} instead of {{pkg|cargo}} as far as reproducibility goes as they are currently provided by the same thing, and given that the actual tool being used by the build is ''cargo'' that is the most future-prof thing to require for now.<br />
: [[User:Alerque|Alerque]] ([[User talk:Alerque|talk]]) 11:49, 13 August 2021 (UTC)<br />
<br />
:: vaultwarden uses rustup as a dependency because that is what's required, so there is a point in using rust/rustup for explicit package dependencies.<br />
:: [[User:Grawlinson|Grawlinson]] ([[User talk:Grawlinson|talk]]) 01:28, 14 August 2021 (UTC)<br />
<br />
: As an additional followup on this point, see this IRC conversation with the {{pkg|rust}} package maintainer: https://paste.rs/NWZ<br />
: [[User:Alerque|Alerque]] ([[User talk:Alerque|talk]]) 09:51, 13 September 2021 (UTC)<br />
<br />
:: You have completely misrepresented my point regarding reproducibility. Reproducibility is questionable when rustup is used along with the version environment variable, as there is no guarantee that rustup will pull the same version of cargo on later rebuilds.<br />
:: It doesn't matter, these are simply guidelines and any packages that I maintain will be using rust as a make dependency because I would rather be explicit when there are multiple providers of cargo.<br />
:: [[User:Grawlinson|Grawlinson]] ([[User talk:Grawlinson|talk]]) 06:13, 14 September 2021 (UTC)<br />
<br />
The usage of {{ic|export}} is completely unnecessary when only one command will pick up the environment variables, or when CLI flags/options are available.<br />
<br />
[[User:Grawlinson|Grawlinson]] ([[User talk:Grawlinson|talk]]) 07:38, 13 August 2021 (UTC)<br />
<br />
: Again this is not quite true. First, the argument variants are '''not equivalent'''. They do cause slightly different things to happen. Also there is an order of precedence issue. Because user environment variables are what we are countering, fixing them as environment variables introduces the least surface area for possible precedence confusion. Beyond that it is mostly a style thing. It is a lot easier to compare/diff/grep across different packages if these interventions are on their own line. One way is easier to transform AUR needs into repo needs and vise versa. <br />
: [[User:Alerque|Alerque]] ([[User talk:Alerque|talk]]) 11:49, 13 August 2021 (UTC)<br />
<br />
== export or not ? ==<br />
if a project wants rustflags, should they be exported as well, and why? i saw you do export CARGO_TARGET_DIR. --[[User:Soloturn|Soloturn]] ([[User talk:Soloturn|talk]]) 17:01, 15 February 2023 (UTC)<br />
<br />
: Users can configure {{ic|RUSTFLAGS}} via {{man|5|makepkg.conf}}. It is not good to override user flags.<br />
: {{ic|CARGO_TARGET_DIR{{=}}target}} is exported for a reason. This is default value for {{ic|cargo}} and most PKGBUILDs do something like<br />
: {{bc|install "target/executable_name" -t "${pkgdir}/usr/bin"}}<br />
: But it obviously will break if user set custom {{ic|CARGO_TARGET_DIR}} location. So it is a safety measure.<br />
: [[User:Hanabishi|Hanabishi]] ([[User talk:Hanabishi|talk]]) 18:21, 15 February 2023 (UTC)<br />
<br />
:: Why not set {{ic|RUSTFLAGS}} to {{ic|RUSTFLAGS{{=}}"${RUSTFLAGS:---remap-path-prefix{{=}}\"$srcdir\"{{=}}src}"}} in PKGBUILD for instance?<br />
:: Therefore the user's {{ic|RUSTFLAGS}} would be taken into account while still setting a default.<br />
:: [[User:HarmfulBreeze|HarmfulBreeze]] ([[User talk:HarmfulBreeze|talk]]) 14:23, 28 March 2023 (UTC)<br />
<br />
== mold linker ==<br />
can we use the mold linker by default, or this would be bad practice? --[[User:Soloturn|Soloturn]] ([[User talk:Soloturn|talk]]) 17:01, 15 February 2023 (UTC)<br />
<br />
: Again, this requires overriding of user flags, which is not good. Users should be able use whatever linker they want.<br />
: And {{ic|mold}} itself does not provide any quality improvements, it is more about performance tips. Also considering that it is not Rust exclusive, it is better to be adviced in e.g. [[Makepkg#Improving compile times]] imo.<br />
: [[User:Hanabishi|Hanabishi]] ([[User talk:Hanabishi|talk]]) 18:44, 15 February 2023 (UTC)<br />
<br />
== RUSTFLAGS link-time optimization ==<br />
<br />
Currently enabling {{ic|lto}} in PKGBUILD does not enable link-time optimization in Rust i.e. {{ic|1=RUSTFLAGS+=' -C lto=true '}}<br />
<br />
Is this intended behaviour? If true, should this be changed upstream in makepkg?<br />
<br />
--[[User:ENV25|ENV25]] ([[User talk:ENV25|talk]]) 21:40, 4 September 2023 (UTC)</div>ENV25https://wiki.archlinux.org/index.php?title=SDDM&diff=782006SDDM2023-06-26T16:27:12Z<p>ENV25: /* Running under Wayland */ Mention the weston is the default value of CompositorCommand=. See {{man|5|sddm.conf}}.</p>
<hr />
<div>[[Category:KDE]]<br />
[[Category:Display managers]]<br />
[[de:Login-Manager#SDDM]]<br />
[[fr:SDDM]]<br />
[[ja:SDDM]]<br />
[[ru:SDDM]]<br />
[[zh-hans:SDDM]]<br />
{{Related articles start}}<br />
{{Related|Display manager}}<br />
{{Related|KDE}}<br />
{{Related articles end}}<br />
The [https://github.com/sddm/sddm/ Simple Desktop Display Manager] (SDDM) is a [[display manager]]. It is the recommended display manager for the [[KDE]] Plasma and [[LXQt]] desktop environments.<br />
<br />
From [[Wikipedia:Simple Desktop Display Manager]]:<br />
<br />
:Simple Desktop Display Manager (SDDM) is a display manager (a graphical login program and session manager) for the X11 and Wayland windowing systems. SDDM was written from scratch in C++11 and supports theming via QML.<br />
<br />
The [[KDE]] development team has [https://invent.kde.org/plasma/plasma-desktop/-/issues/91 accepted a proposal] to incorporate the SDDM project into the Plasma Desktop project. SDDM will be an official part of Plasma and updates will likely be pushed alongside Plasma Desktop updates. <br />
<br />
{{Note|As of SDDM version 0.20, [[Wayland]] sessions are listed and can be started from SDDM, but the SDDM greeter itself still runs in X11 mode by default, although an experimental Wayland greeter [[#Running under Wayland|can be enabled]].}}<br />
<br />
== Installation ==<br />
<br />
[[Install]] the {{Pkg|sddm}} package. Optionally install {{Pkg|sddm-kcm}} for the [[KDE#KCM|KConfig Module]].<br />
<br />
Follow [[Display manager#Loading the display manager]] to start SDDM at boot.<br />
<br />
== Configuration ==<br />
<br />
The default configuration file for SDDM can be found at {{ic|/usr/lib/sddm/sddm.conf.d/default.conf}}. For any changes, create configuration file(s) in {{ic|/etc/sddm.conf.d/}}. See {{man|5|sddm.conf}} for all options.<br />
<br />
The {{pkg|sddm-kcm}} package (included in the {{grp|plasma}} group) provides a GUI to configure SDDM in Plasma's system settings. There is also a [[Qt]]-based {{AUR|sddm-config-editor-git}} available.<br />
<br />
Everything should work out of the box, since Arch Linux uses [[systemd]] and SDDM defaults to using {{ic|systemd-logind}} for session management.<br />
<br />
=== Autologin ===<br />
<br />
SDDM supports automatic login through its configuration file, for example:<br />
<br />
{{hc|/etc/sddm.conf.d/autologin.conf|2=<br />
[Autologin]<br />
User=john<br />
Session=plasma<br />
}}<br />
<br />
This configuration causes a KDE Plasma session to be started for user {{ic|john}} when the system is booted. Available session types can be found in {{ic|/usr/share/xsessions/}} for X and in {{ic|/usr/share/wayland-sessions/}} for Wayland.<br />
<br />
An option to autologin into KDE Plasma while simultaneously locking the session is not available [https://github.com/sddm/sddm/issues/306]<br />
<br />
You can add a script that activates the screensaver of KDE to the autostart as a workaround:<br />
<br />
#!/bin/sh<br />
/usr/bin/dbus-send --session --type=method_call --dest=org.freedesktop.ScreenSaver /ScreenSaver org.freedesktop.ScreenSaver.Lock &<br />
<br />
=== Unlock KDE Wallet automatically on login ===<br />
<br />
See [[KDE Wallet#Unlock KDE Wallet automatically on login]].<br />
<br />
=== Theme settings ===<br />
<br />
Theme settings can be changed in the {{ic|[Theme]}} section. If you use Plasma's system settings, themes may show previews.<br />
<br />
Set to {{ic|breeze}} for the default Plasma theme.<br />
<br />
Some themes are available in the [[AUR]], for example {{AUR|archlinux-themes-sddm}}.<br />
<br />
==== Current theme ====<br />
<br />
Set the current theme through the {{ic|Current}} value, e.g. {{ic|1=Current=archlinux-simplyblack}}.<br />
<br />
==== Editing themes ====<br />
<br />
The default SDDM theme directory is {{ic|/usr/share/sddm/themes/}}. You can add your custom made themes to that directory under a separate subdirectory. Note that SDDM requires these subdirectory names to be the same as the theme names. Study the files installed to modify or create your own theme.<br />
<br />
==== Customizing a theme ====<br />
<br />
To override settings in the {{ic|theme.conf}} configuration file, create a custom {{ic|theme.conf.user}} file in the same directory. For example, to change the theme's background:<br />
<br />
{{hc|head=/usr/share/sddm/themes/''name''/theme.conf.user|output=<br />
[General]<br />
background=''/path/to/background.png''<br />
}}<br />
<br />
==== Testing (previewing) a theme ====<br />
<br />
You can preview an SDDM theme if needed. This is especially helpful if you are not sure how the theme would look if selected or just edited a theme and want to see how it would look without logging out. You can run something like this:<br />
<br />
$ sddm-greeter --test-mode --theme /usr/share/sddm/themes/breeze<br />
<br />
This should open a new window for every monitor you have connected and show a preview of the theme.<br />
<br />
{{Note|This is just a preview. In this mode, some actions like shutdown, suspend or login will have no effect.}}<br />
<br />
==== Mouse cursor ====<br />
<br />
To set the mouse cursor theme, set {{ic|CursorTheme}} to your preferred cursor theme.<br />
<br />
Valid [[Plasma]] mouse cursor theme names are {{ic|breeze_cursors}}, {{ic|Breeze_Snow}} and {{ic|breeze-dark}}.<br />
<br />
==== User icon (avatar) ====<br />
<br />
{{Out of date|SDDM detects icons in {{ic|/var/lib/AccountsService/icons/}} without configuration and Plasma no longer creates the files in {{ic|$HOME/}}.}}<br />
<br />
SDDM reads the user icon (a.k.a. "avatar") as a PNG image from either {{ic|~/.face.icon}} for each user, or the common location for all users specified by {{ic|FacesDir}} in an SDDM configuration file. The configuration setting can be placed in either {{ic|/etc/sddm.conf}} directly, or, better, a file under {{ic|/etc/sddm.conf.d/}} such as {{ic|/etc/sddm.conf.d/avatar.conf}}.<br />
<br />
To use the {{ic|FacesDir}} location option, place a PNG image for each user named {{ic|''username''.face.icon}} at the location specified by the {{ic|FacesDir}} key in the configuration file. The default location for {{ic|FacesDir}} is {{ic|/usr/share/sddm/faces/}}. You can change the default {{ic|FacesDir}} location to suit your needs. Here is an example:<br />
<br />
{{hc|/etc/sddm.conf.d/avatar.conf|2=<br />
[Theme]<br />
FacesDir=/var/lib/AccountsService/icons/<br />
}}<br />
<br />
The other option is to put a PNG image named {{ic|.face.icon}} at the root of your home directory. In this case, no changes to any SDDM configuration file is required. However, you need to make sure that {{ic|sddm}} user can read the PNG image file(s) for the user icon(s).<br />
<br />
{{Note|In many KDE versions, the user icon image file is {{ic|~/.face}} and {{ic|~/.face.icon}} is a symlink to that file. If the user icon images are symlinks, you need to set proper file permissions to the target files.}}<br />
<br />
To [[Access Control Lists#Set ACL|set proper permissions]] run:<br />
<br />
$ setfacl -m u:sddm:x ~/<br />
$ setfacl -m u:sddm:r ~/.face.icon<br />
<br />
You can [[Access Control Lists#Show ACL|check permissions]] with:<br />
<br />
$ getfacl ~/<br />
$ getfacl ~/.face.icon<br />
<br />
See [https://github.com/sddm/sddm#no-user-icon SDDM README: No User Icon].<br />
<br />
=== Numlock ===<br />
<br />
If you want to enforce Numlock to be enabled, set {{ic|1=Numlock=on}} in the {{ic|[General]}} section.<br />
<br />
=== Rotate display ===<br />
<br />
See [[Xrandr#Configuration]].<br />
<br />
=== DPI settings ===<br />
<br />
Sometimes it is useful to set up the correct monitor's PPI settings on a "Display Manager" level.[https://github.com/sddm/sddm/blob/master/README.md#custom-dpi] To do so you need to add to {{ic|ServerArguments}} the parameter {{ic|-dpi ''your_dpi''}} at the end of the string. For example:<br />
<br />
{{hc|head=/etc/sddm.conf.d/dpi.conf|output=<br />
[X11]<br />
ServerArguments=-nolisten tcp -dpi 94<br />
}}<br />
<br />
=== Enable HiDPI ===<br />
<br />
{{Note|Since sddm version 0.20.0, HiDPI support is enabled by default, and the following step is not neccesary.}}<br />
<br />
Create the following file:<br />
<br />
{{hc|/etc/sddm.conf.d/hidpi.conf|2=<br />
[Wayland]<br />
EnableHiDPI=true<br />
<br />
[X11]<br />
EnableHiDPI=true<br />
}}<br />
<br />
=== Enable virtual keyboard ===<br />
<br />
Install {{pkg|qt5-virtualkeyboard}}.<br />
<br />
Create the following file:<br />
<br />
{{hc|/etc/sddm.conf.d/virtualkbd.conf|2=<br />
[General]<br />
InputMethod=qtvirtualkeyboard<br />
}}<br />
<br />
SDDM now displays a button in lower-left corner of login screen to open the virtual keyboard.<br />
<br />
=== Using a fingerprint reader ===<br />
<br />
{{Note|Make sure that your fingerprint is registered before making these changes. Fingerprint support is not completely working properly yet, and it seems logging in with only a password no longer works using this method.}}<br />
<br />
SDDM works with a fingerprint reader when using [[fprint]]. After installing fprint and adding fingerprint signatures, add the following to the top of {{ic|/etc/pam.d/sddm}}:<br />
<br />
{{hc|/etc/pam.d/sddm|<br />
auth sufficient pam_fprintd.so}}<br />
<br />
In order to use either a password or a fingerprint, you can instead add the following to the top of the file:<br />
<br />
{{hc|1=/etc/pam.d/sddm|2=<br />
auth [success=1 new_authtok_reqd=1 default=ignore] pam_unix.so try_first_pass likeauth nullok<br />
auth sufficient pam_fprintd.so}}<br />
<br />
Note that KWallet cannot be unlocked using a fingerprint reader (see [[KDE Wallet#Unlock KDE Wallet automatically on login]]), but the first line ensures that a password login will automatically unlock KWallet.<br />
<br />
{{Tip|To make this work in KDE's lock screen, you can add the following lines at the beginning of {{ic|/etc/pam.d/kde}}:<br />
<br />
{{hc|/etc/pam.d/kde|<br />
auth sufficient pam_unix.so try_first_pass likeauth nullok<br />
auth sufficient pam_fprintd.so}}<br />
<br />
The first line looks different from the corresponding {{ic|/etc/pam.d/sddm}} configuration because the KDE lock screen does not need to run the KWallet pam module.<br />
}}<br />
<br />
If you now press enter in the empty password field, the fingerprint reader should start working.<br />
<br />
=== Rootless Xorg ===<br />
<br />
SDDM can run rootless under X11, since {{Pkg|sddm}} 0.20.0.<br />
<br />
Create a new config file in the {{ic|/etc/sddm.conf.d/}} directory, name it something like {{ic|/etc/sddm.conf.d/rootless-x11.conf}}.<br />
<br />
Add the following to the new file:<br />
<br />
{{hc|/etc/sddm.conf.d/rootless-x11.conf|2=<br />
[General]<br />
DisplayServer=x11-user}}<br />
<br />
=== Running under Wayland ===<br />
<br />
SDDM can run rootless under Wayland, since {{Pkg|sddm}} 0.20.0.<br />
<br />
Create a new config file in the {{ic|/etc/sddm.conf.d/}} directory, name it something like {{ic|/etc/sddm.conf.d/10-wayland.conf}}.<br />
<br />
Add the following to the new file:<br />
<br />
{{hc|/etc/sddm.conf.d/10-wayland.conf|2=<br />
[General]<br />
DisplayServer=wayland<br />
GreeterEnvironment=QT_WAYLAND_SHELL_INTEGRATION=layer-shell<br />
}}<br />
<br />
By default, this uses [[weston]] as the Wayland compositor and you need to install it. To use a different Wayland compositor (such as [[KDE]]'s KWin compositor) to render SDDM, enter the program and relevant arguments as a parameter to {{ic|CompositorCommand}}.<br />
<br />
For more details, see {{man|5|sddm.conf}}.<br />
<br />
==== KDE / KWin ====<br />
<br />
{{Warning|As SDDM will be treated as a separate window by KWin, logging in will close the window. Therefore '''logging out''' or '''switching user''' will present undesirable behaviour.}}<br />
<br />
{{Tip|Any changes to your display configuration in KDE Wayland (e.g. monitor layout, resolution, etc) will not persist to SDDM. To make them persist, open KDE's ''System Settings'' and navigate to ''Startup and Shutdown> Login Screen (SDDM)'' and click "''Apply Plasma Settings...''". You will need to have permission to perform this action.}}<br />
<br />
Add the following as a parameter to {{ic|CompositorCommand}} into the SDDM config file created above (e.g {{ic|/etc/sddm.conf.d/10-wayland.conf}}):<br />
<br />
{{hc|/etc/sddm.conf.d/10-wayland.conf|2=<br />
[Wayland]<br />
CompositorCommand=kwin_wayland --no-lockscreen --no-global-shortcuts}}<br />
<br />
To enable virtual keyboard support (e.g. using {{pkg|qt5-virtualkeyboard}} or {{pkg|maliit-keyboard}}), append the {{ic|--inputmethod}} flag with the appropriate keyboard to the {{ic|kwin_wayland}} command, like so (replacing {{ic|maliit-keyboard}} with {{ic|qtvirtualkeyboard}} as necessary):<br />
<br />
{{hc|/etc/sddm.conf.d/10-wayland.conf|2=<br />
[Wayland]<br />
CompositorCommand=kwin_wayland --no-lockscreen --no-global-shortcuts --inputmethod maliit-keyboard}}<br />
<br />
{{Warning|By default, KWin starts up with global shortcuts enabled. This could be dangerous for a login screen, since it becomes possible to bypass the login prompt using default key bindings. {{ic|--no-global-shortcuts}} fixes this.[https://invent.kde.org/plasma/plasma-workspace/-/commit/7e4159e46f816dc65ac62eae37b15c882f0c8064]}}<br />
<br />
== Troubleshooting ==<br />
<br />
=== Blank screen with cursor, but no greeter shows ===<br />
<br />
Greeter crashes if there is no available disk space. Check your disk space with {{ic|df -h}}.<br />
<br />
If disk space is not the issue, it may be due to [https://github.com/sddm/sddm/issues/1179 a bug]. Switch [[Getty#Installation|to another TTY]], and then try {{ic|loginctl unlock-session ''session_id''}} or to [[restart]] SDDM.<br />
<br />
=== Long load time before SDDM shows the greeter ===<br />
<br />
A low entropy pool can cause long SDDM load time ([https://github.com/sddm/sddm/issues/1036 Bug report]). See [[Random number generation]] for suggestions to increase the entropy pool.<br />
<br />
=== Hangs after login ===<br />
<br />
Try removing {{ic|~/.Xauthority}} and logging in again without rebooting. Rebooting without logging in creates the file again and the problem will persist.<br />
<br />
=== SDDM starts on tty1 instead of tty7 ===<br />
<br />
SDDM follows the [http://0pointer.de/blog/projects/serial-console.html systemd convention] of starting the first graphical session on tty1. If you prefer the old convention where tty1 through tty6 are reserved for text consoles, change the default value of {{ic|MinimumVT}} variable, which comes under the {{ic|[X11]}} section:<br />
<br />
{{hc|/etc/sddm.conf.d/tty.conf|2=<br />
[X11]<br />
MinimumVT=7<br />
}}<br />
<br />
=== One or more users do not show up on the greeter ===<br />
<br />
{{Warning|Users set with a [https://systemd.io/UIDS-GIDS/ UID lower than 1000 or higher than 60513] should generally not be exposed to a [[display manager]].}}<br />
<br />
By default, SDDM is configured to displays only users with a UID in the range of 1000 to 60513. If the UIDs of the desired users are outside this range then you will have to modify the range.<br />
<br />
For example, for a UID of 501, set {{ic|MinimumUid}} and hide those with shells used by system users:<br />
<br />
{{hc|/etc/sddm.conf.d/uid.conf|2=<br />
[Users]<br />
HideShells=/usr/bin/nologin,/sbin/nologin,/bin/false,/usr/bin/git-shell<br />
MinimumUid=500<br />
}}<br />
<br />
For users with a higher UIDs, set {{ic|MaximumUid}} to the appropriate value.<br />
<br />
=== User avatars do not show up on the greeter ===<br />
<br />
User avatars are not shown on the greeter if the number of users exceeds {{ic|DisableAvatarsThreshold}} parameter or if avatars are not enabled at all as controlled by {{ic|EnableAvatars}} parameter. To circumvent this add the following lines to your sddm configuration:<br />
{{hc|/etc/sddm.conf.d/avatars.conf|2=<br />
[Theme]<br />
EnableAvatars=true # enable avatars<br />
DisableAvatarsThreshold=7 # set the threshold for the number of users. Avatars are not shown if this threshold is exceeded.<br />
}}<br />
<br />
=== SDDM loads only US keyboard layout ===<br />
<br />
SDDM loads the keyboard layout specified in {{ic|/etc/X11/xorg.conf.d/00-keyboard.conf}}. You can generate this configuration file by {{ic|localectl set-x11-keymap}} command. See [[Keyboard configuration in Xorg]] for more information.<br />
<br />
An alternative way of setting the keyboard layout that will only set it in SDDM and not subsequent sessions is to invoke a ''setxkbmap'' command in the startup script of SDDM, located at {{ic|/usr/share/sddm/scripts/Xsetup}}. See [[Xorg/Keyboard configuration#Using setxkbmap]] for examples.<br />
<br />
SDDM may also incorrectly display the layout as US but will immediately change to the correct layout after you start typing your password [https://github.com/sddm/sddm/issues/202#issuecomment-76001543]. This seems to not be a bug in SDDM but in [[X server]].[https://gitlab.freedesktop.org/xorg/xserver/-/issues/257]<br />
<br />
=== Screen resolution is too low ===<br />
<br />
Issue may be caused by HiDPI usage for monitors with corrupted [[Wikipedia:Extended Display Identification Data|EDID]] [https://github.com/sddm/sddm/issues/692]. If you have [[#Enable HiDPI|enabled HiDPI]], try to disable it.<br />
<br />
If even the above fails, you can try setting your screen size in a Xorg configuration file:<br />
<br />
{{hc|/etc/X11/xorg.conf.d/90-monitor.conf|2=<br />
Section "Monitor"<br />
Identifier "<default monitor>"<br />
DisplaySize 345 194 # in millimeters<br />
EndSection<br />
}}<br />
<br />
=== Long load time on autofs home directory ===<br />
<br />
SDDM by default tries to display avatars of users by accessing {{ic|~/.face.icon}} file. If your home directory is an ''autofs'', for example if you use [[dm-crypt]], this will make it wait for 60 seconds, until autofs reports that the directory cannot be mounted.<br />
<br />
You can disable avatars by creating the following configuration file:<br />
<br />
{{hc|/etc/sddm.conf.d/avatar.conf|2=<br />
[Theme]<br />
EnableAvatars=false<br />
}}<br />
<br />
=== X authority (aka MIT-MAGIC-COOKIE) file ===<br />
<br />
SDDM uses a random fresh UUID for the auth file as described in details at [https://github.com/sddm/sddm/issues/622]. So in order to find that file one may use a script:<br />
<br />
# find /var/run/sddm/ -type f<br />
<br />
This may be needed if one needs to start [[x11vnc]] when there is no user logged in. For example:<br />
<br />
# x11vnc -display :0 -auth "$( find /var/run/sddm/ -type f )"<br />
<br />
=== Overlapping greeters on multiscreen setup ===<br />
<br />
It happens that the X monitor layout is not setup correctly on multiscreen setup leading to overlapping greeters. To solve this add the following lines to order your sddm greeter layout from left to right:<br />
<br />
{{hc|/usr/share/sddm/scripts/Xsetup|2=<br />
for next in $(xrandr --listmonitors {{!}} grep -E " *[0-9]+:.*" {{!}} cut -d" " -f6); do<br />
[ -z "$current" ] && current=$next && continue<br />
xrandr --output $current --auto --output $next --auto --right-of $current<br />
current=$next<br />
done<br />
}}<br />
<br />
=== Login session appears on an unexpected display ===<br />
<br />
It can happen that the SDDM login session appears on a different display than your primary display if multiple displays are connected. This problem can be annoying if the secondary display is rotated and the primary display is not. A simple fix to this problem is to use ''xrandr'' to configure the displays before the login session using ''Xsetup'' script. E.g. here ''xrandr'' reports that there are two connected displays where the secondary display (DP-2) is left of the primary display (DP-4).<br />
<br />
# xrandr | grep -w connected<br />
DP-2 connected 2160x3840+0+0 left (normal left inverted right x axis y axis) 597mm x 336mm<br />
DP-4 connected primary 3840x2160+2160+0 (normal left inverted right x axis y axis) 697mm x 392mm<br />
<br />
The following ''Xsetup'' recreates the above setup for the login window:<br />
{{hc|/usr/share/sddm/scripts/Xsetup|2=<br />
#!/bin/sh<br />
# Xsetup - run as root before the login dialog appears<br />
<br />
xrandr --output DP-4 --auto --primary<br />
xrandr --output DP-2 --left-of DP-4 --rotate left --noprimary<br />
}}<br />
<br />
=== KDE Plasma Wayland hangs on shutdown and reboot ===<br />
<br />
In some cases on KDE Plasma Wayland sessions, SDDM (release 0.19.0-9) does not stop when issuing a shutdown or a reboot. This results in the shutdown process hanging while [[systemd]] waits for SDDM to stop. This bug has already been fixed, but until a new version of SDDM is released, there are a few possible workarounds:<br />
<br />
* Install {{AUR|sddm-git}}, which includes the commits fixing the problem<br />
<br />
* While the shutdown process is hanging, pressing {{ic|Ctrl+Alt+F1}} to switch to the SDDM tty will allow SDDM to stop properly<br />
<br />
* Logging out from Plasma and then shutting down or rebooting from SDDM will also work properly<br />
<br />
* By default [[systemd]] waits 90s before forcibly terminating SDDM with a SIGKILL, but you can lower that time threshold by [[edit]]ing the service {{ic|sddm.service}} with a [[drop-in file]].<br />
<br />
{{hc|/etc/systemd/system/sddm.service.d/override.conf|2=<br />
[Service]<br />
TimeoutStopSec=5s<br />
}}<br />
<br />
For more information about the bug see [https://github.com/sddm/sddm/issues/1476] and [https://bugs.kde.org/show_bug.cgi?id=445449].<br />
<br />
=== Black screen after logout with NVIDIA graphics card ===<br />
<br />
One may encounter a complete black screen or with only cursor/display device logo on it after the logout of any user. This happens because {{ic|sddm.service}} starts faster than the NVIDIA drivers. Consider using [[NVIDIA#Early loading|early KMS]].</div>ENV25https://wiki.archlinux.org/index.php?title=SDDM&diff=766724SDDM2023-02-06T08:46:55Z<p>ENV25: /* KDE Plasma Wayland hangs on shutdown and reboot */ Suggest edit systemd service rather than change global settings</p>
<hr />
<div>[[Category:KDE]]<br />
[[Category:Display managers]]<br />
[[de:Login-Manager#SDDM]]<br />
[[fr:SDDM]]<br />
[[ja:SDDM]]<br />
[[ru:SDDM]]<br />
[[zh-hans:SDDM]]<br />
{{Related articles start}}<br />
{{Related|Display manager}}<br />
{{Related|KDE}}<br />
{{Related articles end}}<br />
The [https://github.com/sddm/sddm/ Simple Desktop Display Manager] (SDDM) is a [[display manager]]. It is the recommended display manager for the [[KDE]] Plasma and [[LXQt]] desktop environments.<br />
<br />
From [[Wikipedia:Simple Desktop Display Manager]]:<br />
<br />
:Simple Desktop Display Manager (SDDM) is a display manager (a graphical login program and session manager) for the X11 and Wayland windowing systems. SDDM was written from scratch in C++11 and supports theming via QML.<br />
<br />
{{Note|The Wayland windowing system is not yet fully supported: Wayland sessions are listed, but SDDM runs on X11. SDDM 0.20 will introduce full Wayland support.[https://github.com/sddm/sddm/pull/1393]}}<br />
<br />
== Installation ==<br />
<br />
[[Install]] the {{Pkg|sddm}} package. Optionally install {{Pkg|sddm-kcm}} for the [[KDE#KCM|KConfig Module]].<br />
<br />
Follow [[Display manager#Loading the display manager]] to start SDDM at boot.<br />
<br />
== Configuration ==<br />
<br />
The default configuration file for SDDM can be found at {{ic|/usr/lib/sddm/sddm.conf.d/default.conf}}. For any changes, create configuration file(s) in {{ic|/etc/sddm.conf.d/}}. See {{man|5|sddm.conf}} for all options.<br />
<br />
The {{pkg|sddm-kcm}} package (included in the {{grp|plasma}} group) provides a GUI to configure SDDM in Plasma's system settings. There is also a [[Qt]]-based {{AUR|sddm-config-editor-git}} available in the [[AUR]].<br />
<br />
Everything should work out of the box, since Arch Linux uses [[systemd]] and SDDM defaults to using {{ic|systemd-logind}} for session management.<br />
<br />
=== Autologin ===<br />
<br />
SDDM supports automatic login through its configuration file, for example:<br />
<br />
{{hc|/etc/sddm.conf.d/autologin.conf|2=<br />
[Autologin]<br />
User=john<br />
Session=plasma<br />
}}<br />
<br />
This configuration causes a KDE Plasma session to be started for user {{ic|john}} when the system is booted. Available session types can be found in {{ic|/usr/share/xsessions/}} for X and in {{ic|/usr/share/wayland-sessions/}} for Wayland.<br />
<br />
An option to autologin into KDE Plasma while simultaneously locking the session is not available [https://github.com/sddm/sddm/issues/306]<br />
<br />
You can add a script that activates the screensaver of KDE to the autostart as a workaround:<br />
<br />
#!/bin/sh<br />
/usr/bin/dbus-send --session --type=method_call --dest=org.freedesktop.ScreenSaver /ScreenSaver org.freedesktop.ScreenSaver.Lock &<br />
<br />
=== Unlock KDE Wallet automatically on login ===<br />
<br />
See [[KDE Wallet#Unlock KDE Wallet automatically on login]].<br />
<br />
=== Theme settings ===<br />
<br />
Theme settings can be changed in the {{ic|[Theme]}} section. If you use Plasma's system settings, themes may show previews.<br />
<br />
Set to {{ic|breeze}} for the default Plasma theme.<br />
<br />
Some themes are available in the [[AUR]], for example {{AUR|archlinux-themes-sddm}}.<br />
<br />
==== Current theme ====<br />
<br />
Set the current theme through the {{ic|Current}} value, e.g. {{ic|1=Current=archlinux-simplyblack}}.<br />
<br />
==== Editing themes ====<br />
<br />
The default SDDM theme directory is {{ic|/usr/share/sddm/themes/}}. You can add your custom made themes to that directory under a separate subdirectory. Note that SDDM requires these subdirectory names to be the same as the theme names. Study the files installed to modify or create your own theme.<br />
<br />
==== Customizing a theme ====<br />
<br />
To override settings in the {{ic|theme.conf}} configuration file, create a custom {{ic|theme.conf.user}} file in the same directory. For example, to change the theme's background:<br />
<br />
{{hc|head=/usr/share/sddm/themes/''name''/theme.conf.user|output=<br />
[General]<br />
background=''/path/to/background.png''<br />
}}<br />
<br />
==== Testing (previewing) a theme ====<br />
<br />
You can preview an SDDM theme if needed. This is especially helpful if you are not sure how the theme would look if selected or just edited a theme and want to see how it would look without logging out. You can run something like this:<br />
<br />
$ sddm-greeter --test-mode --theme /usr/share/sddm/themes/breeze<br />
<br />
This should open a new window for every monitor you have connected and show a preview of the theme.<br />
<br />
{{Note|This is just a preview. In this mode, some actions like shutdown, suspend or login will have no effect.}}<br />
<br />
==== Mouse cursor ====<br />
<br />
To set the mouse cursor theme, set {{ic|CursorTheme}} to your preferred cursor theme.<br />
<br />
Valid [[Plasma]] mouse cursor theme names are {{ic|breeze_cursors}}, {{ic|Breeze_Snow}} and {{ic|breeze-dark}}.<br />
<br />
==== User icon (avatar) ====<br />
<br />
{{Out of date|SDDM detects icons in {{ic|/var/lib/AccountsService/icons/}} without configuration and Plasma no longer creates the files in {{ic|$HOME/}}.}}<br />
<br />
SDDM reads the user icon (a.k.a. "avatar") as a PNG image from either {{ic|~/.face.icon}} for each user, or the common location for all users specified by {{ic|FacesDir}} in an SDDM configuration file. The configuration setting can be placed in either {{ic|/etc/sddm.conf}} directly, or, better, a file under {{ic|/etc/sddm.conf.d/}} such as {{ic|/etc/sddm.conf.d/avatar.conf}}.<br />
<br />
To use the {{ic|FacesDir}} location option, place a PNG image for each user named {{ic|''username''.face.icon}} at the location specified by the {{ic|FacesDir}} key in the configuration file. The default location for {{ic|FacesDir}} is {{ic|/usr/share/sddm/faces/}}. You can change the default {{ic|FacesDir}} location to suit your needs. Here is an example:<br />
<br />
{{hc|/etc/sddm.conf.d/avatar.conf|2=<br />
[Theme]<br />
FacesDir=/var/lib/AccountsService/icons/<br />
}}<br />
<br />
The other option is to put a PNG image named {{ic|.face.icon}} at the root of your home directory. In this case, no changes to any SDDM configuration file is required. However, you need to make sure that {{ic|sddm}} user can read the PNG image file(s) for the user icon(s).<br />
<br />
{{Note|In many KDE versions, the user icon image file is {{ic|~/.face}} and {{ic|~/.face.icon}} is a symlink to that file. If the user icon images are symlinks, you need to set proper file permissions to the target files.}}<br />
<br />
To [[Access Control Lists#Set ACL|set proper permissions]] run:<br />
<br />
$ setfacl -m u:sddm:x ~/<br />
$ setfacl -m u:sddm:r ~/.face.icon<br />
<br />
You can [[Access Control Lists#Show ACL|check permissions]] with:<br />
<br />
$ getfacl ~/<br />
$ getfacl ~/.face.icon<br />
<br />
See [https://github.com/sddm/sddm#no-user-icon SDDM README: No User Icon].<br />
<br />
=== Numlock ===<br />
<br />
If you want to enforce Numlock to be enabled, set {{ic|1=Numlock=on}} in the {{ic|[General]}} section.<br />
<br />
=== Rotate display ===<br />
<br />
See [[Xrandr#Configuration]].<br />
<br />
=== DPI settings ===<br />
<br />
Sometimes it is useful to set up the correct monitor's PPI settings on a "Display Manager" level.[https://github.com/sddm/sddm/blob/master/README.md#custom-dpi] To do so you need to add to {{ic|ServerArguments}} the parameter {{ic|-dpi ''your_dpi''}} at the end of the string. For example:<br />
<br />
{{hc|head=/etc/sddm.conf.d/dpi.conf|output=<br />
[X11]<br />
ServerArguments=-nolisten tcp -dpi 94<br />
}}<br />
<br />
=== Enable HiDPI ===<br />
<br />
Create the following file:<br />
<br />
{{hc|/etc/sddm.conf.d/hidpi.conf|2=<br />
[Wayland]<br />
EnableHiDPI=true<br />
<br />
[X11]<br />
EnableHiDPI=true<br />
}}<br />
<br />
=== Enable virtual keyboard ===<br />
<br />
Install {{pkg|qt5-virtualkeyboard}}.<br />
<br />
Create the following file:<br />
<br />
{{hc|/etc/sddm.conf.d/virtualkbd.conf|2=<br />
[General]<br />
InputMethod=qtvirtualkeyboard<br />
}}<br />
<br />
SDDM now displays a button in lower-left corner of login screen to open the virtual keyboard.<br />
<br />
=== Using a fingerprint reader ===<br />
<br />
{{Note|Make sure that your fingerprint is registered before making these changes. Fingerprint support is not completely working properly yet, and it seems logging in with only a password no longer works using this method.}}<br />
<br />
SDDM works with a fingerprint reader when using [[fprint]]. After installing fprint and adding fingerprint signatures, add the following to the top of {{ic|/etc/pam.d/sddm}}:<br />
<br />
{{hc|/etc/pam.d/sddm|<br />
auth sufficient pam_fprintd.so}}<br />
<br />
In order to use either a password or a fingerprint, you can instead add the following to the top of the file:<br />
<br />
{{hc|1=/etc/pam.d/sddm|2=<br />
auth [success=1 new_authtok_reqd=1 default=ignore] pam_unix.so try_first_pass likeauth nullok<br />
auth sufficient pam_fprintd.so}}<br />
<br />
Note that KWallet cannot be unlocked using a fingerprint reader (see [[KDE Wallet#Unlock KDE Wallet automatically on login]]), but the first line ensures that a password login will automatically unlock KWallet.<br />
<br />
{{Tip|To make this work in KDE's lock screen, you can add the following lines at the beginning of {{ic|/etc/pam.d/kde}}:<br />
<br />
{{hc|/etc/pam.d/kde|<br />
auth sufficient pam_unix.so try_first_pass likeauth nullok<br />
auth sufficient pam_fprintd.so}}<br />
<br />
The first line looks different from the corresponding {{ic|/etc/pam.d/sddm}} configuration because the KDE lock screen does not need to run the KWallet pam module.<br />
}}<br />
<br />
If you now press enter in the empty password field, the fingerprint reader should start working.<br />
<br />
=== Running under Wayland ===<br />
<br />
SDDM can run rootless under Wayland, but currently only when using the {{AUR|sddm-git}} package.<br />
<br />
Create a new config file in the {{ic|/etc/sddm.conf.d/}} directory, name it something like {{ic|/etc/sddm.conf.d/10-wayland.conf}}.<br />
<br />
Add the following to the new file:<br />
<br />
{{hc|/etc/sddm.conf.d/10-wayland.conf|2=<br />
[General]<br />
DisplayServer=wayland<br />
GreeterEnvironment=QT_WAYLAND_SHELL_INTEGRATION=layer-shell<br />
<br />
[Wayland]<br />
CompositorCommand=}}<br />
<br />
Next, you will need a Wayland compositor (such as [[KDE]]'s KWin compositor) to render SDDM, and enter the program and relevant arguments as a parameter to {{ic|CompositorCommand}}.<br />
<br />
==== KDE / KWin ====<br />
<br />
{{Warning|As SDDM will be treated as a separate window by KWin, logging in will close the window. Therefore '''logging out''' or '''switching user''' will present undesirable behaviour.}}<br />
<br />
{{Tip|Any changes to your display configuration in KDE Wayland (e.g. monitor layout, resolution, etc) will not persist to SDDM. To make them persist, open KDE's ''System Settings'' and navigate to ''Startup and Shutdown> Login Screen (SDDM)'' and click "''Apply Plasma Settings...''". You will need to have permission to perform this action.}}<br />
<br />
Add the following as a parameter to {{ic|CompositorCommand}} into the SDDM config file created above (e.g {{ic|/etc/sddm.conf.d/10-wayland.conf}}):<br />
<br />
{{hc|/etc/sddm.conf.d/10-wayland.conf|2=<br />
[Wayland]<br />
CompositorCommand=kwin_wayland --no-lockscreen}}<br />
<br />
To enable virtual keyboard support (e.g. using {{pkg|qt5-virtualkeyboard}} or {{pkg|maliit-keyboard}}), append the {{ic|--inputmethod}} flag with the appropriate keyboard to the {{ic|kwin_wayland}} command, like so (replacing {{ic|maliit-keyboard}} with {{ic|qtvirtualkeyboard}} as necessary):<br />
<br />
{{hc|/etc/sddm.conf.d/10-wayland.conf|2=<br />
[Wayland]<br />
CompositorCommand=kwin_wayland --no-lockscreen --inputmethod maliit-keyboard}}<br />
<br />
== Troubleshooting ==<br />
<br />
=== Blank screen with cursor, but no greeter shows ===<br />
<br />
Greeter crashes if there is no available disk space. Check your disk space with {{ic|df -h}}.<br />
<br />
If disk space is not the issue, it may be due to [https://github.com/sddm/sddm/issues/1179 a bug]. Switch [[Getty#Installation|to another TTY]], and then try {{ic|loginctl unlock-session ''session_id''}} or to [[restart]] SDDM.<br />
<br />
=== Long load time before SDDM shows the greeter ===<br />
<br />
A low entropy pool can cause long SDDM load time ([https://github.com/sddm/sddm/issues/1036 Bug report]). See [[Random number generation]] for suggestions to increase the entropy pool.<br />
<br />
=== Hangs after login ===<br />
<br />
Try removing {{ic|~/.Xauthority}} and logging in again without rebooting. Rebooting without logging in creates the file again and the problem will persist.<br />
<br />
=== SDDM starts on tty1 instead of tty7 ===<br />
<br />
SDDM follows the [http://0pointer.de/blog/projects/serial-console.html systemd convention] of starting the first graphical session on tty1. If you prefer the old convention where tty1 through tty6 are reserved for text consoles, change the default value of {{ic|MinimumVT}} variable, which comes under the {{ic|[X11]}} section:<br />
<br />
{{hc|/etc/sddm.conf.d/tty.conf|2=<br />
[X11]<br />
MinimumVT=7<br />
}}<br />
<br />
=== One or more users do not show up on the greeter ===<br />
<br />
{{Warning|Users set with a [https://systemd.io/UIDS-GIDS/ UID lower than 1000 or higher than 60513] should generally not be exposed to a [[display manager]].}}<br />
<br />
By default, SDDM is configured to displays only users with a UID in the range of 1000 to 60513. If the UIDs of the desired users are outside this range then you will have to modify the range.<br />
<br />
For example, for a UID of 501, set {{ic|MinimumUid}} and hide those with shells used by system users:<br />
<br />
{{hc|/etc/sddm.conf.d/uid.conf|2=<br />
[Users]<br />
HideShells=/usr/bin/nologin,/sbin/nologin,/bin/false,/usr/bin/git-shell<br />
MinimumUid=500<br />
}}<br />
<br />
For users with a higher UIDs, set {{ic|MaximumUid}} to the appropriate value.<br />
<br />
=== User avatars do not show up on the greeter ===<br />
<br />
User avatars are not shown on the greeter if the number of users exceeds {{ic|DisableAvatarsThreshold}} parameter or if avatars are not enabled at all as controlled by {{ic|EnableAvatars}} parameter. To circumvent this add the following lines to your sddm configuration:<br />
{{hc|/etc/sddm.conf.d/avatars.conf|2=<br />
[Theme]<br />
EnableAvatars=true # enable avatars<br />
DisableAvatarsThreshold=7 # set the threshold for the number of users. Avatars are not shown if this threshold is exceeded.<br />
}}<br />
<br />
=== SDDM loads only US keyboard layout ===<br />
<br />
SDDM loads the keyboard layout specified in {{ic|/etc/X11/xorg.conf.d/00-keyboard.conf}}. You can generate this configuration file by {{ic|localectl set-x11-keymap}} command. See [[Keyboard configuration in Xorg]] for more information.<br />
<br />
An alternative way of setting the keyboard layout that will only set it in SDDM and not subsequent sessions is to invoke a ''setxkbmap'' command in the startup script of SDDM, located at {{ic|/usr/share/sddm/scripts/Xsetup}}. See [[Xorg/Keyboard configuration#Using setxkbmap]] for examples.<br />
<br />
SDDM may also incorrectly display the layout as US but will immediately change to the correct layout after you start typing your password [https://github.com/sddm/sddm/issues/202#issuecomment-76001543]. This seems to not be a bug in SDDM but in [[X server]].[https://gitlab.freedesktop.org/xorg/xserver/-/issues/257]<br />
<br />
=== Screen resolution is too low ===<br />
<br />
Issue may be caused by HiDPI usage for monitors with corrupted [[Wikipedia:Extended Display Identification Data|EDID]] [https://github.com/sddm/sddm/issues/692]. If you have [[#Enable HiDPI|enabled HiDPI]], try to disable it.<br />
<br />
If even the above fails, you can try setting your screen size in a Xorg configuration file:<br />
<br />
{{hc|/etc/X11/xorg.conf.d/90-monitor.conf|2=<br />
Section "Monitor"<br />
Identifier "<default monitor>"<br />
DisplaySize 345 194 # in millimeters<br />
EndSection<br />
}}<br />
<br />
=== Long load time on autofs home directory ===<br />
<br />
SDDM by default tries to display avatars of users by accessing {{ic|~/.face.icon}} file. If your home directory is an ''autofs'', for example if you use [[dm-crypt]], this will make it wait for 60 seconds, until autofs reports that the directory cannot be mounted.<br />
<br />
You can disable avatars by creating the following configuration file:<br />
<br />
{{hc|/etc/sddm.conf.d/avatar.conf|2=<br />
[Theme]<br />
EnableAvatars=false<br />
}}<br />
<br />
=== X authority (aka MIT-MAGIC-COOKIE) file ===<br />
<br />
SDDM uses a random fresh UUID for the auth file as described in details at [https://github.com/sddm/sddm/issues/622]. So in order to find that file one may use a script:<br />
<br />
# find /var/run/sddm/ -type f<br />
<br />
This may be needed if one needs to start [[x11vnc]] when there is no user logged in. For example:<br />
<br />
# x11vnc -display :0 -auth "$( find /var/run/sddm/ -type f )"<br />
<br />
=== Overlapping greeters on multiscreen setup ===<br />
<br />
It happens that the X monitor layout is not setup correctly on multiscreen setup leading to overlapping greeters. To solve this add the following lines to order your sddm greeter layout from left to right:<br />
<br />
{{hc|/usr/share/sddm/scripts/Xsetup|2=<br />
for next in $(xrandr --listmonitors {{!}} grep -E " *[0-9]+:.*" {{!}} cut -d" " -f6); do<br />
[ -z "$current" ] && current=$next && continue<br />
xrandr --output $current --auto --output $next --auto --right-of $current<br />
current=$next<br />
done<br />
}}<br />
<br />
=== Login session appears on an unexpected display ===<br />
<br />
It can happen that the SDDM login session appears on a different display than your primary display if multiple displays are connected. This problem can be annoying if the secondary display is rotated and the primary display is not. A simple fix to this problem is to use ''xrandr'' to configure the displays before the login session using ''Xsetup'' script. E.g. here ''xrandr'' reports that there are two connected displays where the secondary display (DP-2) is left of the primary display (DP-4).<br />
<br />
# xrandr | grep -w connected<br />
DP-2 connected 2160x3840+0+0 left (normal left inverted right x axis y axis) 597mm x 336mm<br />
DP-4 connected primary 3840x2160+2160+0 (normal left inverted right x axis y axis) 697mm x 392mm<br />
<br />
The following ''Xsetup'' recreates the above setup for the login window:<br />
{{hc|/usr/share/sddm/scripts/Xsetup|2=<br />
#!/bin/sh<br />
# Xsetup - run as root before the login dialog appears<br />
<br />
xrandr --output DP-4 --auto --primary<br />
xrandr --output DP-2 --left-of DP-4 --rotate left --noprimary<br />
}}<br />
<br />
=== KDE Plasma Wayland hangs on shutdown and reboot ===<br />
<br />
In some cases on KDE Plasma Wayland sessions, SDDM (release 0.19.0-9) does not stop when issuing a shutdown or a reboot. This results in the shutdown process hanging while [[systemd]] waits for SDDM to stop. This bug has already been fixed, but until a new version of SDDM is released, there are a few possible workarounds:<br />
<br />
* Install {{AUR|sddm-git}}, which includes the commits fixing the problem<br />
<br />
* While the shutdown process is hanging, pressing {{ic|Ctrl+Alt+F1}} to switch to the SDDM tty will allow SDDM to stop properly<br />
<br />
* Logging out from Plasma and then shutting down or rebooting from SDDM will also work properly<br />
<br />
* By default [[systemd]] waits 90s before forcibly terminating SDDM with a SIGKILL, but you can lower that time threshold by [[edit]]ing the service {{ic|sddm.service}} with a [[drop-in file]].<br />
<br />
{{hc|/etc/systemd/system/sddm.service.d/override.conf|2=<br />
[Service]<br />
TimeoutStopSec=5s<br />
}}<br />
<br />
For more information about the bug see [https://github.com/sddm/sddm/issues/1476] and [https://bugs.kde.org/show_bug.cgi?id=445449].</div>ENV25https://wiki.archlinux.org/index.php?title=PC_speaker&diff=764377PC speaker2023-01-17T17:42:29Z<p>ENV25: /* Globally */ Links</p>
<hr />
<div>[[Category:Sound]]<br />
[[es:PC speaker]]<br />
[[ja:PC スピーカー]]<br />
[[ru:PC speaker]]<br />
[[zh-hans:PC speaker]]<br />
{{Related articles start}}<br />
{{Related|Kernel modules}}<br />
{{Related|Advanced Linux Sound Architecture}}<br />
{{Related articles end}}<br />
<br />
Ever since the first IBM PC most PCs have a built-in '''PC speaker''' (or ''beeper'') which may produce beeps. This speaker is not capable of high quality playback and merely serves as a simple means of auditory feedback in the form of beeps. Some software, e.g. web browsers, editors and terminals, may produce beeps which may or may not be desired by the user. Hence this article serves as a guide on how to configure or even disable those beeps.<br />
<br />
For situations where no sound card or speakers are available and a simple audio notification is desired, see [[#Beep]].<br />
<br />
== Mechanism ==<br />
<br />
The PC speaker is typically a physical unit connected on the front connections header of the motherboard. Some motherboard manufacturers do not ship their motherboards with a PC speaker at all, whereas others may have the PC speaker soldered directly onto the surface. Laptops typically have no physical PC speaker but have the beeper routed to the laptop's internal speakers. In some cases, the beeper is heard on the regular output (i.e. speakers, headphones) of the soundcard, which tends to be unexpectedly loud.<br />
<br />
Upon boot the BIOS will traditionally generate a beep during [[Wikipedia:Power-on self-test|POST]]. More recent motherboard models omit the POST beep in favor of rapidly booting into the OS. The BIOS typically allows for toggling the POST beeps but it cannot configure the PC speaker to be turned off completely.<br />
<br />
Once the system has booted into Linux and the {{ic|pcspkr}} [[kernel module]] is loaded, the PC speaker can be used by the environment, be invoked manually by the user, and be configured to some extent. Because the PC speaker is controlled directly by the CPU, along with the fact that they are built for beeping only, PC speakers cannot be used for playing back audio files. If this is really desired, unloading {{ic|pcspkr}} and [[install]]ing {{AUR|snd-pcsp-dkms}} provides a rudimentary audio output.<br />
<br />
== Disabling the PC speaker ==<br />
<br />
Turning off a particular instance of a sound, while leaving the others operational, is possible if and only if one can identify which portion of the environment generates the particular sound. This allows customizing the selection of sounds. Please feel free to add any configurations and settings to this wiki page that may be useful for other users.<br />
<br />
=== Physically ===<br />
<br />
By removing the PC speaker the system will not be able to produce beeps. This can be achieved by physically removing the unit from the motherboard (if possible). Some manufacturers may provide a jumper header to switch it off.<br />
<br />
{{Warning|Removing the PC speaker is generally not recommended as it is a useful tool in diagnosing boot problems, after which it may produce a unique beeping pattern related to the source of fault (refer to your motherboard manual). A better solution is to turn off the POST beeps in the BIOS and blacklisting the beeper as written below. If you do however wish to remove it physically it is highly recommended to keep it at bay for this scenario.}}<br />
<br />
=== Globally ===<br />
<br />
The PC speaker can be disabled by [[Kernel modules#Manual module handling|unloading]] the {{ic|pcspkr}} and {{ic|snd_pcsp}} [[kernel module]]s:<br />
<br />
{{Note|This will not disable your entire sound system, only the [[Wikipedia:PC speaker|PC speaker]].}}<br />
<br />
# rmmod pcspkr<br />
# rmmod snd_pcsp<br />
<br />
[[Blacklisting]] the {{ic|pcspkr}} and {{ic|snd_pcsp}} modules will prevent [[udev]] from loading them at boot. [[Create]] the file:<br />
<br />
{{hc|/etc/modprobe.d/nobeep.conf|<br />
blacklist pcspkr<br />
blacklist snd_pcsp<br />
}}<br />
<br />
[[Kernel modules#Using kernel command line_2|Blacklisting it on the kernel command line]] is yet another way. Simply add {{ic|1=module_blacklist=pcspkr,snd_pcsp}} to your bootloader's kernel line.<br />
<br />
=== Console ===<br />
<br />
You can add this command in {{ic|/etc/profile}} or a dedicated file like {{ic|/etc/profile.d/disable-beep.sh}}:<br />
setterm -blength 0<br />
<br />
Another way is to uncomment or add this line in {{ic|/etc/inputrc}} or {{ic|~/.inputrc}}:<br />
set bell-style none<br />
<br />
==== Less pager ====<br />
<br />
To disable PC speaker in {{Pkg|less}} pager, you can launch it with {{ic|less -q}} to mute PC speaker for end of line events or {{ic|less -Q}} to mute it altogether. For [[man page]]s, launch {{ic|man -P "less -Q"}} or set the {{ic|$MANPAGER}} or {{ic|$PAGER}} [[environment variable]]s.<br />
<br />
Alternatively, you can add these lines to your {{ic|~/[[.bashrc]]}}:<br />
<br />
alias less='less -Q'<br />
alias man='man -P "less -Q"'<br />
<br />
=== Xorg ===<br />
<br />
$ xset -b<br />
<br />
You can add this command to a startup file such as {{ic|/etc/xprofile}} to make it permanent. See [[xprofile]] for more information.<br />
<br />
=== ALSA ===<br />
<br />
For most sound cards the PC speaker is listed as an [[ALSA]] channel, named either ''PC Speaker'', ''PC Beep'', or ''Beep''. To mute the speaker, either use {{ic|alsamixer}} or {{ic|amixer}} , for example:<br />
$ amixer set 'PC Speaker' 0% mute<br />
<br />
To unmute the channel, see [[Advanced Linux Sound Architecture#Unmuting the channels]].<br />
<br />
{{Tip|If you are using PulseAudio and the PC speaker channel is not listed for the default ALSA device, try selecting the device corresponding to the sound card - PulseAudio proxy controls may not list the PC speaker.}}<br />
<br />
=== GNOME ===<br />
<br />
Using [[GNOME#Configuration|GSettings]]:<br />
<br />
$ gsettings set org.gnome.desktop.wm.preferences audible-bell false<br />
<br />
=== KDE Plasma ===<br />
<br />
Bell notification settings can be modified in ''System Settings > Accessibility Options > Bell''.<br />
<br />
=== Cinnamon ===<br />
<br />
[[Cinnamon]] seems to play a "water drop" sound. To disable it, set in {{man|1|gsettings}}:<br />
<br />
$ gsettings set org.cinnamon.desktop.wm.preferences audible-bell false<br />
<br />
=== GTK ===<br />
<br />
Append this line to {{ic|~/.gtkrc-2.0}}:<br />
<br />
gtk-error-bell = 0<br />
<br />
Add the same line to the [Settings] section of {{ic|$XDG_CONFIG_HOME/gtk-3.0/settings.ini}}:<br />
<br />
[Settings]<br />
gtk-error-bell = 0<br />
<br />
This is documented in the [https://developer.gnome.org/gtk3/stable/GtkSettings.html Gnome Developer Handbook].<br />
<br />
=== PulseAudio ===<br />
<br />
Play a sound instead of a PC speaker beep [[PulseAudio#X11 Bell Events|using PulseAudio]].<br />
<br />
== Beep ==<br />
<br />
A user can create a short audible tone when logged in to a [[virtual console]]. See [[Wikipedia:bell character#usage]] for the details.<br />
<br />
Beep is an advanced PC speaker beeping program. It is useful for situations where no sound card and/or speakers are available, and simple audio notification is desired.<br />
<br />
=== Installation ===<br />
<br />
[[Install]] the {{Pkg|beep}} package.<br />
<br />
You may also need to [[#ALSA|unmute]] the PC speaker in [[ALSA]].<br />
<br />
=== Run as non-root user ===<br />
<br />
{{ic|beep}} uses {{ic|/dev/input/by-path/platform-pcspkr-event-spkr}} to control the PC speaker. To access it as a non-root user, one has to set the proper permissions. Create {{ic|/etc/udev/rules.d/70-pcspkr-beep.rules}} and add the following rule:<br />
<br />
ACTION=="add", SUBSYSTEM=="input", ATTRS{name}=="PC Speaker", ENV{DEVNAME}!="", TAG+="uaccess"<br />
<br />
That will allow any user, who is logged into the currently active virtual console session, to use the PC speaker.<br />
<br />
Alternatively, a new user group may be created (e.g. {{ic|beep}}) with the corresponding rule to set the right permissions on the device file:<br />
<br />
ACTION=="add", SUBSYSTEM=="input", ATTRS{name}=="PC Speaker", ENV{DEVNAME}!="", GROUP="beep", MODE="0620"<br />
<br />
With that solution any user in the {{ic|beep}} group will be able to control the speaker.<br />
<br />
To force reloading rules and device file to apply new user permission without a reboot, execute:<br />
<br />
$ udevadm control --reload && rmmod pcspkr && modprobe pcspkr<br />
<br />
=== Tips and tricks ===<br />
<br />
While many people are happy with the traditional beep sound, some may like to change its properties a bit. The following example plays slightly higher and shorter sound and repeats it two times.<br />
<br />
# beep -f 5000 -l 50 -r 2<br />
<br />
== See also ==<br />
<br />
* {{man|1|xset}}, {{man|1|setterm}}, {{man|1|bash}}<br />
* https://github.com/NaWer/beep and https://github.com/ShaneMcC/beeps - repositories collecting bash scripts playing various music using beep</div>ENV25https://wiki.archlinux.org/index.php?title=PC_speaker&diff=764376PC speaker2023-01-17T17:41:47Z<p>ENV25: /* Globally */ Mention snd_pcsp kernel module, some kernels might have it</p>
<hr />
<div>[[Category:Sound]]<br />
[[es:PC speaker]]<br />
[[ja:PC スピーカー]]<br />
[[ru:PC speaker]]<br />
[[zh-hans:PC speaker]]<br />
{{Related articles start}}<br />
{{Related|Kernel modules}}<br />
{{Related|Advanced Linux Sound Architecture}}<br />
{{Related articles end}}<br />
<br />
Ever since the first IBM PC most PCs have a built-in '''PC speaker''' (or ''beeper'') which may produce beeps. This speaker is not capable of high quality playback and merely serves as a simple means of auditory feedback in the form of beeps. Some software, e.g. web browsers, editors and terminals, may produce beeps which may or may not be desired by the user. Hence this article serves as a guide on how to configure or even disable those beeps.<br />
<br />
For situations where no sound card or speakers are available and a simple audio notification is desired, see [[#Beep]].<br />
<br />
== Mechanism ==<br />
<br />
The PC speaker is typically a physical unit connected on the front connections header of the motherboard. Some motherboard manufacturers do not ship their motherboards with a PC speaker at all, whereas others may have the PC speaker soldered directly onto the surface. Laptops typically have no physical PC speaker but have the beeper routed to the laptop's internal speakers. In some cases, the beeper is heard on the regular output (i.e. speakers, headphones) of the soundcard, which tends to be unexpectedly loud.<br />
<br />
Upon boot the BIOS will traditionally generate a beep during [[Wikipedia:Power-on self-test|POST]]. More recent motherboard models omit the POST beep in favor of rapidly booting into the OS. The BIOS typically allows for toggling the POST beeps but it cannot configure the PC speaker to be turned off completely.<br />
<br />
Once the system has booted into Linux and the {{ic|pcspkr}} [[kernel module]] is loaded, the PC speaker can be used by the environment, be invoked manually by the user, and be configured to some extent. Because the PC speaker is controlled directly by the CPU, along with the fact that they are built for beeping only, PC speakers cannot be used for playing back audio files. If this is really desired, unloading {{ic|pcspkr}} and [[install]]ing {{AUR|snd-pcsp-dkms}} provides a rudimentary audio output.<br />
<br />
== Disabling the PC speaker ==<br />
<br />
Turning off a particular instance of a sound, while leaving the others operational, is possible if and only if one can identify which portion of the environment generates the particular sound. This allows customizing the selection of sounds. Please feel free to add any configurations and settings to this wiki page that may be useful for other users.<br />
<br />
=== Physically ===<br />
<br />
By removing the PC speaker the system will not be able to produce beeps. This can be achieved by physically removing the unit from the motherboard (if possible). Some manufacturers may provide a jumper header to switch it off.<br />
<br />
{{Warning|Removing the PC speaker is generally not recommended as it is a useful tool in diagnosing boot problems, after which it may produce a unique beeping pattern related to the source of fault (refer to your motherboard manual). A better solution is to turn off the POST beeps in the BIOS and blacklisting the beeper as written below. If you do however wish to remove it physically it is highly recommended to keep it at bay for this scenario.}}<br />
<br />
=== Globally ===<br />
<br />
The PC speaker can be disabled by [[Kernel modules#Manual module handling|unloading]] the {{ic|pcspkr}} and {{ic|snd_pcsp}} [[kernel module]]s:<br />
<br />
{{Note|This will not disable your entire sound system, only the [[Wikipedia:PC speaker|PC speaker]].}}<br />
<br />
# rmmod pcspkr<br />
# rmmod snd_pcsp<br />
<br />
[[Blacklisting]] the {{ic|pcspkr}} and {{ic|snd_pcsp}} modules will prevent [[udev]] from loading them at boot. Create the file:<br />
<br />
{{hc|/etc/modprobe.d/nobeep.conf|<br />
blacklist pcspkr<br />
blacklist snd_pcsp<br />
}}<br />
<br />
[[Kernel modules#Using kernel command line_2|Blacklisting it on the kernel command line]] is yet another way. Simply add {{ic|1=module_blacklist=pcspkr,snd_pcsp}} to your bootloader's kernel line.<br />
<br />
=== Console ===<br />
<br />
You can add this command in {{ic|/etc/profile}} or a dedicated file like {{ic|/etc/profile.d/disable-beep.sh}}:<br />
setterm -blength 0<br />
<br />
Another way is to uncomment or add this line in {{ic|/etc/inputrc}} or {{ic|~/.inputrc}}:<br />
set bell-style none<br />
<br />
==== Less pager ====<br />
<br />
To disable PC speaker in {{Pkg|less}} pager, you can launch it with {{ic|less -q}} to mute PC speaker for end of line events or {{ic|less -Q}} to mute it altogether. For [[man page]]s, launch {{ic|man -P "less -Q"}} or set the {{ic|$MANPAGER}} or {{ic|$PAGER}} [[environment variable]]s.<br />
<br />
Alternatively, you can add these lines to your {{ic|~/[[.bashrc]]}}:<br />
<br />
alias less='less -Q'<br />
alias man='man -P "less -Q"'<br />
<br />
=== Xorg ===<br />
<br />
$ xset -b<br />
<br />
You can add this command to a startup file such as {{ic|/etc/xprofile}} to make it permanent. See [[xprofile]] for more information.<br />
<br />
=== ALSA ===<br />
<br />
For most sound cards the PC speaker is listed as an [[ALSA]] channel, named either ''PC Speaker'', ''PC Beep'', or ''Beep''. To mute the speaker, either use {{ic|alsamixer}} or {{ic|amixer}} , for example:<br />
$ amixer set 'PC Speaker' 0% mute<br />
<br />
To unmute the channel, see [[Advanced Linux Sound Architecture#Unmuting the channels]].<br />
<br />
{{Tip|If you are using PulseAudio and the PC speaker channel is not listed for the default ALSA device, try selecting the device corresponding to the sound card - PulseAudio proxy controls may not list the PC speaker.}}<br />
<br />
=== GNOME ===<br />
<br />
Using [[GNOME#Configuration|GSettings]]:<br />
<br />
$ gsettings set org.gnome.desktop.wm.preferences audible-bell false<br />
<br />
=== KDE Plasma ===<br />
<br />
Bell notification settings can be modified in ''System Settings > Accessibility Options > Bell''.<br />
<br />
=== Cinnamon ===<br />
<br />
[[Cinnamon]] seems to play a "water drop" sound. To disable it, set in {{man|1|gsettings}}:<br />
<br />
$ gsettings set org.cinnamon.desktop.wm.preferences audible-bell false<br />
<br />
=== GTK ===<br />
<br />
Append this line to {{ic|~/.gtkrc-2.0}}:<br />
<br />
gtk-error-bell = 0<br />
<br />
Add the same line to the [Settings] section of {{ic|$XDG_CONFIG_HOME/gtk-3.0/settings.ini}}:<br />
<br />
[Settings]<br />
gtk-error-bell = 0<br />
<br />
This is documented in the [https://developer.gnome.org/gtk3/stable/GtkSettings.html Gnome Developer Handbook].<br />
<br />
=== PulseAudio ===<br />
<br />
Play a sound instead of a PC speaker beep [[PulseAudio#X11 Bell Events|using PulseAudio]].<br />
<br />
== Beep ==<br />
<br />
A user can create a short audible tone when logged in to a [[virtual console]]. See [[Wikipedia:bell character#usage]] for the details.<br />
<br />
Beep is an advanced PC speaker beeping program. It is useful for situations where no sound card and/or speakers are available, and simple audio notification is desired.<br />
<br />
=== Installation ===<br />
<br />
[[Install]] the {{Pkg|beep}} package.<br />
<br />
You may also need to [[#ALSA|unmute]] the PC speaker in [[ALSA]].<br />
<br />
=== Run as non-root user ===<br />
<br />
{{ic|beep}} uses {{ic|/dev/input/by-path/platform-pcspkr-event-spkr}} to control the PC speaker. To access it as a non-root user, one has to set the proper permissions. Create {{ic|/etc/udev/rules.d/70-pcspkr-beep.rules}} and add the following rule:<br />
<br />
ACTION=="add", SUBSYSTEM=="input", ATTRS{name}=="PC Speaker", ENV{DEVNAME}!="", TAG+="uaccess"<br />
<br />
That will allow any user, who is logged into the currently active virtual console session, to use the PC speaker.<br />
<br />
Alternatively, a new user group may be created (e.g. {{ic|beep}}) with the corresponding rule to set the right permissions on the device file:<br />
<br />
ACTION=="add", SUBSYSTEM=="input", ATTRS{name}=="PC Speaker", ENV{DEVNAME}!="", GROUP="beep", MODE="0620"<br />
<br />
With that solution any user in the {{ic|beep}} group will be able to control the speaker.<br />
<br />
To force reloading rules and device file to apply new user permission without a reboot, execute:<br />
<br />
$ udevadm control --reload && rmmod pcspkr && modprobe pcspkr<br />
<br />
=== Tips and tricks ===<br />
<br />
While many people are happy with the traditional beep sound, some may like to change its properties a bit. The following example plays slightly higher and shorter sound and repeats it two times.<br />
<br />
# beep -f 5000 -l 50 -r 2<br />
<br />
== See also ==<br />
<br />
* {{man|1|xset}}, {{man|1|setterm}}, {{man|1|bash}}<br />
* https://github.com/NaWer/beep and https://github.com/ShaneMcC/beeps - repositories collecting bash scripts playing various music using beep</div>ENV25https://wiki.archlinux.org/index.php?title=PC_speaker&diff=764375PC speaker2023-01-17T17:24:33Z<p>ENV25: /* Globally */ Update from modprobe.blacklist to module_blacklist, this mirrors Kernel_module#Using_kernel_command_line_2</p>
<hr />
<div>[[Category:Sound]]<br />
[[es:PC speaker]]<br />
[[ja:PC スピーカー]]<br />
[[ru:PC speaker]]<br />
[[zh-hans:PC speaker]]<br />
{{Related articles start}}<br />
{{Related|Kernel modules}}<br />
{{Related|Advanced Linux Sound Architecture}}<br />
{{Related articles end}}<br />
<br />
Ever since the first IBM PC most PCs have a built-in '''PC speaker''' (or ''beeper'') which may produce beeps. This speaker is not capable of high quality playback and merely serves as a simple means of auditory feedback in the form of beeps. Some software, e.g. web browsers, editors and terminals, may produce beeps which may or may not be desired by the user. Hence this article serves as a guide on how to configure or even disable those beeps.<br />
<br />
For situations where no sound card or speakers are available and a simple audio notification is desired, see [[#Beep]].<br />
<br />
== Mechanism ==<br />
<br />
The PC speaker is typically a physical unit connected on the front connections header of the motherboard. Some motherboard manufacturers do not ship their motherboards with a PC speaker at all, whereas others may have the PC speaker soldered directly onto the surface. Laptops typically have no physical PC speaker but have the beeper routed to the laptop's internal speakers. In some cases, the beeper is heard on the regular output (i.e. speakers, headphones) of the soundcard, which tends to be unexpectedly loud.<br />
<br />
Upon boot the BIOS will traditionally generate a beep during [[Wikipedia:Power-on self-test|POST]]. More recent motherboard models omit the POST beep in favor of rapidly booting into the OS. The BIOS typically allows for toggling the POST beeps but it cannot configure the PC speaker to be turned off completely.<br />
<br />
Once the system has booted into Linux and the {{ic|pcspkr}} [[kernel module]] is loaded, the PC speaker can be used by the environment, be invoked manually by the user, and be configured to some extent. Because the PC speaker is controlled directly by the CPU, along with the fact that they are built for beeping only, PC speakers cannot be used for playing back audio files. If this is really desired, unloading {{ic|pcspkr}} and [[install]]ing {{AUR|snd-pcsp-dkms}} provides a rudimentary audio output.<br />
<br />
== Disabling the PC speaker ==<br />
<br />
Turning off a particular instance of a sound, while leaving the others operational, is possible if and only if one can identify which portion of the environment generates the particular sound. This allows customizing the selection of sounds. Please feel free to add any configurations and settings to this wiki page that may be useful for other users.<br />
<br />
=== Physically ===<br />
<br />
By removing the PC speaker the system will not be able to produce beeps. This can be achieved by physically removing the unit from the motherboard (if possible). Some manufacturers may provide a jumper header to switch it off.<br />
<br />
{{Warning|Removing the PC speaker is generally not recommended as it is a useful tool in diagnosing boot problems, after which it may produce a unique beeping pattern related to the source of fault (refer to your motherboard manual). A better solution is to turn off the POST beeps in the BIOS and blacklisting the beeper as written below. If you do however wish to remove it physically it is highly recommended to keep it at bay for this scenario.}}<br />
<br />
=== Globally ===<br />
<br />
The PC speaker can be disabled by [[Kernel modules#Manual module handling|unloading]] the {{ic|pcspkr}} [[kernel module]]:<br />
<br />
{{Note|This will not disable your entire sound system, only the [[Wikipedia:PC speaker|PC speaker]].}}<br />
<br />
# rmmod pcspkr<br />
<br />
[[Blacklisting]] the {{ic|pcspkr}} module will prevent [[udev]] from loading it at boot. Create the file:<br />
<br />
{{hc|/etc/modprobe.d/nobeep.conf|<br />
blacklist pcspkr<br />
}}<br />
<br />
[[Kernel modules#Using kernel command line_2|Blacklisting it on the kernel command line]] is yet another way. Simply add {{ic|1=module_blacklist=pcspkr}} to your bootloader's kernel line.<br />
<br />
=== Console ===<br />
<br />
You can add this command in {{ic|/etc/profile}} or a dedicated file like {{ic|/etc/profile.d/disable-beep.sh}}:<br />
setterm -blength 0<br />
<br />
Another way is to uncomment or add this line in {{ic|/etc/inputrc}} or {{ic|~/.inputrc}}:<br />
set bell-style none<br />
<br />
==== Less pager ====<br />
<br />
To disable PC speaker in {{Pkg|less}} pager, you can launch it with {{ic|less -q}} to mute PC speaker for end of line events or {{ic|less -Q}} to mute it altogether. For [[man page]]s, launch {{ic|man -P "less -Q"}} or set the {{ic|$MANPAGER}} or {{ic|$PAGER}} [[environment variable]]s.<br />
<br />
Alternatively, you can add these lines to your {{ic|~/[[.bashrc]]}}:<br />
<br />
alias less='less -Q'<br />
alias man='man -P "less -Q"'<br />
<br />
=== Xorg ===<br />
<br />
$ xset -b<br />
<br />
You can add this command to a startup file such as {{ic|/etc/xprofile}} to make it permanent. See [[xprofile]] for more information.<br />
<br />
=== ALSA ===<br />
<br />
For most sound cards the PC speaker is listed as an [[ALSA]] channel, named either ''PC Speaker'', ''PC Beep'', or ''Beep''. To mute the speaker, either use {{ic|alsamixer}} or {{ic|amixer}} , for example:<br />
$ amixer set 'PC Speaker' 0% mute<br />
<br />
To unmute the channel, see [[Advanced Linux Sound Architecture#Unmuting the channels]].<br />
<br />
{{Tip|If you are using PulseAudio and the PC speaker channel is not listed for the default ALSA device, try selecting the device corresponding to the sound card - PulseAudio proxy controls may not list the PC speaker.}}<br />
<br />
=== GNOME ===<br />
<br />
Using [[GNOME#Configuration|GSettings]]:<br />
<br />
$ gsettings set org.gnome.desktop.wm.preferences audible-bell false<br />
<br />
=== KDE Plasma ===<br />
<br />
Bell notification settings can be modified in ''System Settings > Accessibility Options > Bell''.<br />
<br />
=== Cinnamon ===<br />
<br />
[[Cinnamon]] seems to play a "water drop" sound. To disable it, set in {{man|1|gsettings}}:<br />
<br />
$ gsettings set org.cinnamon.desktop.wm.preferences audible-bell false<br />
<br />
=== GTK ===<br />
<br />
Append this line to {{ic|~/.gtkrc-2.0}}:<br />
<br />
gtk-error-bell = 0<br />
<br />
Add the same line to the [Settings] section of {{ic|$XDG_CONFIG_HOME/gtk-3.0/settings.ini}}:<br />
<br />
[Settings]<br />
gtk-error-bell = 0<br />
<br />
This is documented in the [https://developer.gnome.org/gtk3/stable/GtkSettings.html Gnome Developer Handbook].<br />
<br />
=== PulseAudio ===<br />
<br />
Play a sound instead of a PC speaker beep [[PulseAudio#X11 Bell Events|using PulseAudio]].<br />
<br />
== Beep ==<br />
<br />
A user can create a short audible tone when logged in to a [[virtual console]]. See [[Wikipedia:bell character#usage]] for the details.<br />
<br />
Beep is an advanced PC speaker beeping program. It is useful for situations where no sound card and/or speakers are available, and simple audio notification is desired.<br />
<br />
=== Installation ===<br />
<br />
[[Install]] the {{Pkg|beep}} package.<br />
<br />
You may also need to [[#ALSA|unmute]] the PC speaker in [[ALSA]].<br />
<br />
=== Run as non-root user ===<br />
<br />
{{ic|beep}} uses {{ic|/dev/input/by-path/platform-pcspkr-event-spkr}} to control the PC speaker. To access it as a non-root user, one has to set the proper permissions. Create {{ic|/etc/udev/rules.d/70-pcspkr-beep.rules}} and add the following rule:<br />
<br />
ACTION=="add", SUBSYSTEM=="input", ATTRS{name}=="PC Speaker", ENV{DEVNAME}!="", TAG+="uaccess"<br />
<br />
That will allow any user, who is logged into the currently active virtual console session, to use the PC speaker.<br />
<br />
Alternatively, a new user group may be created (e.g. {{ic|beep}}) with the corresponding rule to set the right permissions on the device file:<br />
<br />
ACTION=="add", SUBSYSTEM=="input", ATTRS{name}=="PC Speaker", ENV{DEVNAME}!="", GROUP="beep", MODE="0620"<br />
<br />
With that solution any user in the {{ic|beep}} group will be able to control the speaker.<br />
<br />
To force reloading rules and device file to apply new user permission without a reboot, execute:<br />
<br />
$ udevadm control --reload && rmmod pcspkr && modprobe pcspkr<br />
<br />
=== Tips and tricks ===<br />
<br />
While many people are happy with the traditional beep sound, some may like to change its properties a bit. The following example plays slightly higher and shorter sound and repeats it two times.<br />
<br />
# beep -f 5000 -l 50 -r 2<br />
<br />
== See also ==<br />
<br />
* {{man|1|xset}}, {{man|1|setterm}}, {{man|1|bash}}<br />
* https://github.com/NaWer/beep and https://github.com/ShaneMcC/beeps - repositories collecting bash scripts playing various music using beep</div>ENV25https://wiki.archlinux.org/index.php?title=Talk:KDE_Wallet&diff=762312Talk:KDE Wallet2022-12-28T07:56:49Z<p>ENV25: /* Bug: Using the KDE Wallet to store ssh key passphrases | Bug in Plasma 5.25 */ issue fixed</p>
<hr />
<div>== Unlock KDE Wallet automatically on login ==<br />
<br />
Apparently, the use of pam_kwallet-git does not work if the wallet is encrypted with a GnuPG key. --[[User:Fahrgast|Fahrgast]] ([[User talk:Fahrgast|talk]]) 15:10, 28 January 2015 (UTC)<br />
:It is possible use a blank password too to open the wallet automatically according with [https://forum.kde.org/viewtopic.php?t=39258#p56114] [[User:J0n4t|J0n4t]] ([[User talk:J0n4t|talk]]) 19:35, 21 July 2016 (UTC)<br />
<br />
:I offer these comments with some trepidation: Kwallet can be unlocked automatically when using a GnuPG key, but it's complicated. . . complicated enough that I don't quite recall all the details of how it's done. Hence, my trepidation. However, I am using this on one of my machines. The basics are that kwallet is configured to use a GnuGP key, and gnome-keyring is configured to unlock my GnuGP keys automatically. Editing files in /etc/pam.d/ is required, and unfortunately, this is where my knowledge and recollection is lacking. I'm pretty sure that login, sddm-autologin, and passwd in that folder all required editing. I was following someone else's instructions at the time and unfortunately cannot locate them again. I can say that my kwallet configuration is definitely using a GnuGP key, and my Network Manager wifi configuration is set to encrypt my stored wifi password, my GnuGP keys are unlocked automatically by gnome-keyring, and when I log on, my system connects automatically to wifi without my having to key in a wifi password or a kwallet password. If anyone has interest in pursuing this, and possesses a better understanding of PAM than I do, I'm willing to share the contents of my PAM files. If there are any further tricks required, I don't recall what they were unfortunately.<br />
[[User:L userx|L userx]] ([[User talk:L userx|talk]]) 02:27, 20 March 2019 (UTC)<br />
<br />
== Plasma ==<br />
<br />
kwalletmanager in repo is for kde4, and use different path from kde5 ( ./.local/share/kwalletd/kdewallet.kwl ) and also seems to be incompatible (copied/linked kwl file giver password error).<br />
kwalletmanager-git works fine, but is still lacking gpg.<br />
<br />
== kwallet-pam does not unlock KDE Wallet with SDDM ==<br />
<br />
May be helpful: workaround for this bug (or feature) is [https://bbs.archlinux.org/viewtopic.php?pid=1557361#p1557361 here]<br />
<br />
== kwallet-pam for non-graphical login ==<br />
<br />
Can we please get a guide for this? I've added the lines to /etc/pam.d/login but it's not unlocking. Other guides have lines added to /etc/pam.d/passwd but for some reason the file looks different on other distros, or maybe I'm seeing old tutorials. [[User:MisterMustafa|MisterMustafa]] ([[User talk:MisterMustafa|talk]]) 21:06, 27 March 2017 (UTC)<br />
<br />
== Using the KDE Wallet to store ssh key passphrases ==<br />
Had difficulty following this section as it didn't specify how to start ssh-agent. I believe there was a race condition with my chosen method using systemtl --user and KDE. This it makes sense to start the ssh-agent within KDE's startup scripts as mentioned below via [https://archived.forum.manjaro.org/t/howto-use-kwallet-as-a-login-keychain-for-storing-ssh-key-passphrases-on-manjaro-arm-kde/115719 An External Forum Post]<br />
{{Unsigned|05:34, 8 February 2021 (UTC)|Dcraig327}}<br />
<br />
:[[KDE Wallet#Using the KDE Wallet to store ssh key passphrases|Using the KDE Wallet to store ssh key passphrases]] works fine for me with the [[SSH keys#Start ssh-agent with systemd user|systemd user service]]. -- [[User:nl6720|nl6720]] ([[User talk:nl6720|talk]]) 15:47, 8 February 2021 (UTC)<br />
<br />
===Start ssh-agent upon login===<br />
<br />
$ sudo pacman -S kwallet ksshaskpass kwalletmanager<br />
<br />
{{hc|~/.config/plasma-workspace/env/ssh-agent.sh|<br />
#!/bin/sh<br />
<br />
if [ -z "$SSH_AUTH_SOCK" ]; then<br />
eval "$(ssh-agent -s)"<br />
fi<br />
}}<br />
$ chmod u+x ~/.config/plasma-workspace/env/ssh-agent.sh<br />
<br />
<s><br />
== Bug: Using the KDE Wallet to store ssh key passphrases | Bug in Plasma 5.25 ==<br />
</s><br />
<br />
In the section '''Using the KDE Wallet to store ssh key passphrases''',<br />
<br />
The following instruction does not work,<br />
Exec=ssh-add -q ~/.ssh/key1<br />
as per this [https://bugs.kde.org/show_bug.cgi?id=455252 bug], systemd boot was enabled in plasma 5.25.<br />
<br />
I was able to get it to run with<br />
Exec=ssh-add -q /home/username/.ssh/key1<br />
<br />
I'm not sure if this is the best way to do it.<br />
I'll edit it later or someone else can if there are no objections.<br />
<br />
[[User:LowProfile|lowProfile]] ([[User talk:LowProfile|talk]]) 17:09, 28 August 2022 (UTC)<br />
<br />
:Just {{ic|ssh-add .ssh/key1}} should work. Desktop entries run relative to {{ic|$HOME}} anyway.<br />
{{hc|1=pwd.desktop|2=<br />
#!/usr/bin/kioclient exec<br />
[Desktop Entry]<br />
Version=1.0<br />
Type=Application<br />
Terminal=true<br />
Exec=sh -c 'pwd; sleep inf'<br />
}}<br />
$ kioclient exec pwd.desktop<br />
:[[User:ENV25|ENV25]] ([[User talk:ENV25|talk]]) 12:08, 11 October 2022 (UTC)<br />
<br />
:This issue was fixed in the latest version. -- [[User:ENV25|ENV25]] ([[User talk:ENV25|talk]]) 07:56, 28 December 2022 (UTC)</div>ENV25https://wiki.archlinux.org/index.php?title=KDE_Wallet&diff=762311KDE Wallet2022-12-28T07:51:45Z<p>ENV25: /* Using the KDE Wallet to store ssh key passphrases */ remove tilde "~" because systemd-xdg-autostart-generator does not support it Talk:KDE_Wallet#Bug:_Using_the_KDE_Wallet_to_store_ssh_key_passphrases_.7C_Bug_in_Plasma_5.25</p>
<hr />
<div>[[Category:KDE]]<br />
[[es:KDE Wallet]]<br />
[[ja:KDE Wallet]]<br />
[[zh-hans:KDE Wallet]]<br />
[https://utils.kde.org/projects/kwalletmanager/ KDE Wallet Manager] is a tool to manage passwords on the [[KDE]] Plasma system. By using the KWallet subsystem it not only allows you to keep your own secrets but also to access and manage the passwords of every application that integrates with KWallet.<br />
<br />
{{Note|Since KDE Frameworks 5.97.0 KDE Wallet supports org.freedesktop.secrets DBus API and can now be used by libsecret for storing and retrieving passwords and other secrets using the Secret Service API.<br />
}}<br />
<br />
== Unlock KDE Wallet automatically on login ==<br />
<br />
To unlock KDE Wallet automatically on login, [[install]] {{Pkg|kwallet-pam}} for the [[PAM]] compatible module. The chosen KWallet password must be the same as the current [[user]] password.<br />
<br />
{{Note|<br />
* {{Pkg|kwallet-pam}} is not compatible with [[GnuPG]] keys, the KDE Wallet must use the standard {{ic|blowfish}} encryption.<br />
* When using autologin, the wallet can only be unlocked if the autologin method saves the password. [[pam_autologin]] does, for example.<br />
* The wallet cannot be unlocked when using a fingerprint reader to login<br />
* The wallet must be named {{ic|kdewallet}} (default name). It does not unlock any other wallet(s).<br />
* If using [[KDE]], one may want to disable ''Close when last application stops using it'' in KDE Wallet settings to prevent the wallet from being closed after each usage ([[WiFi]]-passphrase unlock, etc.).<br />
* It may be needed to remove the default created wallet first, thus removing all stored entries.<br />
* If the kwallet Migration Assistant asks for a password after every login, rename or delete the {{ic|~/.kde4/share/apps/kwallet}} folder.<br />
}}<br />
<br />
Optionally [[install]] {{Pkg|kwalletmanager}} for the wallet management tool. This tool can be used to create a KDE Wallet with {{ic|blowfish}} encryption and more settings not provided by the ''kcm-module''.<br />
<br />
{{Tip|An alternative is to use KWalletManager and set an empty Kwallet-password, thus preventing the need of entering a password to unlock a wallet. Simply do not enter a password on both fields in ''Change Password..''. This may however lead to unwanted (read/write) access to the user's wallet. Enabling ''Prompt when an application accesses a wallet'' under ''Access Control'' is highly recommended to prevent unwanted access to the wallet.}}<br />
<br />
=== Configure PAM ===<br />
<br />
The following lines must be present under their corresponding sections:<br />
<br />
{{bc|1=<br />
auth optional pam_kwallet5.so<br />
session optional pam_kwallet5.so auto_start<br />
}}<br />
<br />
Edit the [[PAM]] configuration corresponding to your situation:<br />
<br />
* For [[SDDM]] no further edits should be needed because the lines are already present in {{ic|/etc/pam.d/sddm}}.<br />
* For [[GDM]] edit {{ic|/etc/pam.d/gdm-password}} accordingly.<br />
* For [[greetd]] edit {{ic|/etc/pam.d/greetd}} accordingly.<br />
* For [[LightDM]] edit {{ic|/etc/pam.d/lightdm}} and {{ic|/etc/pam.d/lightdm-autologin}} files:<br />
* For unlocking on tty login (no display manager), edit {{ic|/etc/pam.d/login}} accordingly. You will need to specify the '''force_run''' parameter.<br />
<br />
{{hc|/etc/pam.d/login|2=<br />
auth optional pam_kwallet5.so<br />
session optional pam_kwallet5.so auto_start '''force_run'''<br />
}}<br />
<br />
{{hc|/etc/pam.d/lightdm|2=<br />
#%PAM-1.0<br />
auth include system-login<br />
'''auth optional pam_kwallet5.so'''<br />
<br />
account include system-login<br />
<br />
password include system-login<br />
<br />
session include system-login<br />
'''session optional pam_kwallet5.so auto_start'''<br />
}}<br />
<br />
{{hc|/etc/pam.d/lightdm-autologin|2=<br />
#%PAM-1.0<br />
auth required pam_env.so<br />
auth required pam_faillock.so preauth<br />
auth required pam_shells.so<br />
auth required pam_nologin.so<br />
auth [success=1 default=ignore] pam_succeed_if.so user ingroup autologin<br />
auth required pam_unix.so<br />
auth required pam_permit.so<br />
'''auth optional pam_kwallet5.so'''<br />
<br />
account include system-local-login<br />
<br />
password include system-local-login<br />
<br />
session include system-local-login<br />
'''session optional pam_kwallet5.so auto_start'''<br />
}}<br />
<br />
{{hc|/etc/pam.d/greetd|2=<br />
#%PAM-1.0<br />
<br />
auth required pam_securetty.so<br />
auth requisite pam_nologin.so<br />
auth include system-local-login<br />
'''auth optional pam_kwallet5.so'''<br />
account include system-local-login<br />
session include system-local-login<br />
'''session optional pam_kwallet5.so auto_start force_run'''<br />
<br />
}}<br />
<br />
== Using the KDE Wallet to store ssh key passphrases ==<br />
<br />
{{Note|An [[SSH agent]] should be up and running.}}<br />
<br />
[[Install]] {{Pkg|ksshaskpass}} package.<br />
<br />
[[Create]] an [[KDE#Autostart|autostart .desktop file]]:<br />
<br />
{{hc|~/.config/autostart/ssh-add.desktop|2=<br />
[Desktop Entry]<br />
Exec=ssh-add -q<br />
Name=ssh-add<br />
Type=Application<br />
}}<br />
<br />
{{Tip|By default, {{man|1|ssh-add}} will only add the default key {{ic|~/.ssh/id_rsa}}. Assuming you have different SSH keys named {{ic|key1}}, {{ic|key2}}, {{ic|key3}} in {{ic|~/.ssh/}}, you may add them automatically on login by passing them as arguments to ''ssh-add''. E.g.:<br />
<br />
{{hc|~/.config/autostart/ssh-add.desktop|2=<br />
[Desktop Entry]<br />
Exec=ssh-add -q .ssh/key1 .ssh/key2 .ssh/key3<br />
Name=ssh-add<br />
Type=Application<br />
}}<br />
<br />
To use [[shell]] features like globbing, change the {{ic|1=Exec=}} line to start the shell and execute the ''ssh-add'' command with it. For example, to add all private keys whose file names start with {{ic|id}} to ''ssh-add'' using the extended globbing features of [[Zsh]]:<br />
<br />
{{hc|~/.config/autostart/ssh-add.desktop|2=<br />
[Desktop Entry]<br />
Exec=zsh --extendedglob -c 'ssh-add -q ~/.ssh/id^*.pub < /dev/null'<br />
Name=ssh-add<br />
Type=Application<br />
X-KDE-AutostartScript=true<br />
}}<br />
<br />
}}<br />
<br />
You also have to set the {{ic|SSH_ASKPASS}} [[environment variable]] to {{ic|ksshaskpass}} and {{ic|SSH_ASKPASS_REQUIRE}} to {{ic|prefer}} (prefer to use the askpass program instead of the TTY). To set it automatically on each login, create the following [https://man.archlinux.org/man/environment.d.5 systemd environment file]:<br />
<br />
{{hc|~/.config/environment.d/ssh_askpass.conf|2=<br />
SSH_ASKPASS='/usr/bin/ksshaskpass'<br />
SSH_ASKPASS_REQUIRE=prefer<br />
}}<br />
<br />
It will ask for your password and unlock your SSH keys. Upon restart your SSH keys should be unlocked once you give your kwallet password. <br />
<br />
To add a new key and store the password with kwallet use the following command<br />
<br />
$ ssh-add ''/path/to/new/key'' </dev/null<br />
<br />
and append the key to the list of keys in {{ic|~/.config/autostart/ssh-add.desktop}} as explained above to have it unlocked upon providing the kwallet password.<br />
<br />
== Using the KDE Wallet to store Git credentials ==<br />
<br />
[[Git]] can delegate credential handling to a credential helper. By using {{Pkg|ksshaskpass}} as a credential helper, the HTTP/HTTPS and SMTP passwords can be safely stored in the KDE Wallet.<br />
<br />
[[Install]] the {{Pkg|ksshaskpass}} package.<br />
<br />
Configure Git by setting the {{ic|GIT_ASKPASS}} [[environment variable]]:<br />
<br />
{{hc|~/.config/environment.d/git_askpass.conf|2=<br />
GIT_ASKPASS='/usr/bin/ksshaskpass'<br />
}}<br />
<br />
<br />
{{Tip|If the {{ic|SSH_ASKPASS}} environment variable [[#Using the KDE Wallet to store ssh key passphrases|is set to ksshaskpass]], then additionally setting {{ic|GIT_ASKPASS}} is not required.}}<br />
<br />
See {{man|7|gitcredentials}} for alternatives and more details.<br />
<br />
== KDE Wallet for Chrome and Chromium ==<br />
<br />
Chrome/Chromium/Opera has built in wallet integration. To enable it, run Chromium with the {{ic|1=--password-store=kwallet5}} or {{ic|1=--password-store=detect}} argument. To make the change persistent, see [[Chromium#Making flags persistent]]. (Setting CHROMIUM_USER_FLAGS will not work.)<br />
<br />
== Query passwords from the terminal ==<br />
<br />
Instead of storing passwords in plain text files, you can manually add new entries in your wallet and retrieve them with ''kwallet-query''.<br />
<br />
For example, if you want to log into the Docker Hub registry with Podman, which supports getting the passwords from stdin with the {{ic|--password-stdin}} flag, you can use the following command to login:<br />
<br />
$ kwallet-query -r folder_entry wallet_name -f folder_name | podman login docker.io -u dockerhub_username --password-stdin<br />
<br />
This way, your password is not stored in any text file and neither is it stored in the terminal history file.<br />
<br />
== Unlocking KWallet automatically in a window manager ==<br />
<br />
To unlock KWallet protected by the login password, it is necessary to add<br />
<br />
exec --no-startup-id /usr/lib/pam_kwallet_init<br />
<br />
to the configuration file of the window manager in addition to configuring [[PAM]].<br />
<br />
== Disable KWallet ==<br />
<br />
In case you want to permanently disable kwallet:<br />
<br />
{{hc|~/.config/kwalletrc|2=<br />
[Wallet]<br />
'''Enabled=false'''<br />
}}<br />
<br />
== See also ==<br />
<br />
* [https://www.dennogumi.org/2014/04/unlocking-kwallet-with-pam/ Unlocking KWallet with PAM]<br />
* [https://invent.kde.org/frameworks/kwallet/-/merge_requests/11 org.freedesktop.secrets DBus API initial support]</div>ENV25https://wiki.archlinux.org/index.php?title=Undervolting_CPU&diff=756295Undervolting CPU2022-11-08T11:15:31Z<p>ENV25: Expansion: generalise to mention CPU frequency scaling, no only thermald.</p>
<hr />
<div>[[Category:CPU]]<br />
[[Category:Power management]]<br />
[[ja:CPU の低電圧化]]<br />
[[ru:Undervolting CPU]]<br />
{{Related articles start}}<br />
{{Related|CPU frequency scaling}}<br />
{{Related|Improving performance}}<br />
{{Related|Benchmarking}}<br />
{{Related|Fan speed control}}<br />
{{Related articles end}}<br />
<br />
Undervolting is a process where voltage to CPU is reduced in order to reduce its energy consumption and heat without affecting performance. Note that most desktop motherboards allow tweaking CPU voltage settings in BIOS as well.<br />
<br />
{{Warning|Misconfiguration of CPU voltage settings might result in permanently damaged hardware. You have been warned!}}<br />
<br />
{{Note|It is no longer possible to undervolt Intel processors with modern BIOSes and microcode, due to the changes needed to patch the [https://plundervolt.com Plundervolt] vulnerability.}}<br />
<br />
{{Expansion|Mention relationship with [[CPU frequency scaling]]. It could be used as an alternative to undervolting.}}<br />
<br />
== intel-undervolt ==<br />
<br />
[https://github.com/kitsunyan/intel-undervolt Intel-undervolt] is a tool based on this [https://github.com/mihic/linux-intel-undervolt article] for undervolting Haswell and newer Intel CPUs using [[wikipedia:Model-specific_register|MSR]] and MCHBAR registers. In addition, it also allows to change power and temperature limits. It is '''not''' compatible with Tiger Lake and above, but is compatible with {{ic|intel_pstate}}.<br />
<br />
=== Installation ===<br />
<br />
The tool can be installed as {{Pkg|intel-undervolt}}.<br />
<br />
=== Configuration and usage ===<br />
<br />
The following command prints ''in use'' voltage settings:<br />
<br />
# intel-undervolt read<br />
<br />
Now edit the configuration file {{ic|/etc/intel-undervolt.conf}}. Example configuration with undervolted CPU Cache by -100mV:<br />
<br />
{{Note|Looks like 'CPU' and 'GPU' values does not have any effect on some laptops (e.g [[ASUS Zenbook UX430UQ]]) but they do work on some (e.g ASUS ROG STRIX G502VY).}}<br />
<br />
{{hc|/etc/intel-undervolt.conf|<br />
...<br />
undervolt 0 'CPU' 0<br />
undervolt 1 'GPU' 0<br />
undervolt 2 'CPU Cache' -100<br />
undervolt 3 'System Agent' 0<br />
undervolt 4 'Analog I/O' 0<br />
...<br />
}}<br />
<br />
Decreasing CPU and CPU Cache by 100 to 200 mV is usually stable. Going above 200 mV may result in a crash, or may not have any effect at all.<br />
<br />
{{Warning| It may also make the computer freeze at what seem to be random moments even though the computer is stable during multiple days/months/years and may be totally stable under another OS with the same undervolting settings. The CPU can degrade with time and only start to crash/freeze months/years after you applied undervolting. Therefore it is '''crucial''' to always remember to revert to original settings in case of regular computer freeze.}}<br />
<br />
Once you saved configuration file - test it:<br />
<br />
# intel-undervolt apply<br />
<br />
It will print ''Success'' if settings were applied. You can double check ''in use'' configuration using the following command:<br />
<br />
# intel-undervolt read<br />
<br />
Once you find stable configuration, you can also [[enable]] {{ic|intel-undervolt.service}} to make changes persistent.<br />
<br />
== amdctl ==<br />
<br />
[https://github.com/kevinlekiller/amdctl/ amdctl] is a tool for undervolting K10 and newer AMD CPUs.<br />
<br />
=== Installation ===<br />
<br />
The tool can be installed as {{AUR|amdctl-git}}.</div>ENV25https://wiki.archlinux.org/index.php?title=Undervolting_CPU&diff=756230Undervolting CPU2022-11-08T04:11:53Z<p>ENV25: /* intel-undervolt */ Accuracy: mention Intel CPU frequency scaling#thermald</p>
<hr />
<div>[[Category:CPU]]<br />
[[Category:Power management]]<br />
[[ja:CPU の低電圧化]]<br />
[[ru:Undervolting CPU]]<br />
{{Related articles start}}<br />
{{Related|CPU frequency scaling}}<br />
{{Related|Improving performance}}<br />
{{Related|Benchmarking}}<br />
{{Related|Fan speed control}}<br />
{{Related articles end}}<br />
<br />
Undervolting is a process where voltage to CPU is reduced in order to reduce its energy consumption and heat without affecting performance. Note that most desktop motherboards allow tweaking CPU voltage settings in BIOS as well.<br />
<br />
{{Warning|Misconfiguration of CPU voltage settings might result in permanently damaged hardware. You have been warned!}}<br />
{{Note|It is no longer possible to undervolt Intel processors with modern BIOSes and microcode, due to the changes needed to patch the [https://plundervolt.com Plundervolt] vulnerability.}}<br />
<br />
{{Expansion|Needs to be expanded.}}<br />
<br />
{{Accuracy|Intel [[CPU frequency scaling#thermald|thermald]] for Intel CPU is not mentioned. This tool automatically adjusts CPU settings to power consumption and uses P-states, which is used to adjust voltage in addition to frequency.}}<br />
<br />
== intel-undervolt ==<br />
<br />
[https://github.com/kitsunyan/intel-undervolt Intel-undervolt] is a tool based on this [https://github.com/mihic/linux-intel-undervolt article] for undervolting Haswell and newer Intel CPUs using [[wikipedia:Model-specific_register|MSR]] and MCHBAR registers. In addition, it also allows to change power and temperature limits. It is '''not''' compatible with Tiger Lake and above, but is compatible with {{ic|intel_pstate}}.<br />
<br />
=== Installation ===<br />
<br />
The tool can be installed as {{Pkg|intel-undervolt}}.<br />
<br />
=== Configuration and usage ===<br />
<br />
The following command prints ''in use'' voltage settings:<br />
<br />
# intel-undervolt read<br />
<br />
Now edit the configuration file {{ic|/etc/intel-undervolt.conf}}. Example configuration with undervolted CPU Cache by -100mV:<br />
<br />
{{Note|Looks like 'CPU' and 'GPU' values does not have any effect on some laptops (e.g [[ASUS Zenbook UX430UQ]]) but they do work on some (e.g ASUS ROG STRIX G502VY).}}<br />
<br />
{{hc|/etc/intel-undervolt.conf|<br />
...<br />
undervolt 0 'CPU' 0<br />
undervolt 1 'GPU' 0<br />
undervolt 2 'CPU Cache' -100<br />
undervolt 3 'System Agent' 0<br />
undervolt 4 'Analog I/O' 0<br />
...<br />
}}<br />
<br />
Decreasing CPU and CPU Cache by 100 to 200 mV is usually stable. Going above 200 mV may result in a crash, or may not have any effect at all.<br />
<br />
{{Warning| It may also make the computer freeze at what seem to be random moments even though the computer is stable during multiple days/months/years and may be totally stable under another OS with the same undervolting settings. The CPU can degrade with time and only start to crash/freeze months/years after you applied undervolting. Therefore it is '''crucial''' to always remember to revert to original settings in case of regular computer freeze.}}<br />
<br />
Once you saved configuration file - test it:<br />
<br />
# intel-undervolt apply<br />
<br />
It will print ''Success'' if settings were applied. You can double check ''in use'' configuration using the following command:<br />
<br />
# intel-undervolt read<br />
<br />
Once you find stable configuration, you can also [[enable]] {{ic|intel-undervolt.service}} to make changes persistent.<br />
<br />
== amdctl ==<br />
<br />
[https://github.com/kevinlekiller/amdctl/ amdctl] is a tool for undervolting K10 and newer AMD CPUs.<br />
<br />
=== Installation ===<br />
<br />
The tool can be installed as {{AUR|amdctl-git}}.</div>ENV25https://wiki.archlinux.org/index.php?title=Uniform_look_for_Qt_and_GTK_applications&diff=754462Uniform look for Qt and GTK applications2022-10-22T15:51:41Z<p>ENV25: /* Consistent file dialog under KDE Plasma */ links</p>
<hr />
<div>[[Category:Widget toolkits]]<br />
[[Category:Eye candy]]<br />
[[ja:Qt と GTK アプリケーションの外観の統合]]<br />
[[ru:Uniform look for Qt and GTK applications]]<br />
[[zh-hans:Uniform look for Qt and GTK applications]]<br />
{{Related articles start}}<br />
{{Related|GTK}}<br />
{{Related|Qt}}<br />
{{Related articles end}}<br />
[[Qt]] and [[GTK]] based programs both use a different widget toolkit to render the graphical user interface. Each come with different themes, styles and icon sets by default, among other things, so the "look and feel" differ significantly. This article will help you make your Qt and GTK applications look similar for a more streamlined and integrated desktop experience.<br />
<br />
== Overview ==<br />
<br />
To get a similar look between the toolkits, you will most likely have to modify the following:<br />
* '''Theme''': The custom appearance of an application, widget set, etc. It usually consists of a style, an icon theme and a color theme.<br />
* '''Style''': The graphical layout and look of the widget set.<br />
* '''Icon Theme''': A set of global icons.<br />
* '''Color Theme''': A set of global colors that are used in conjunction with the style.<br />
<br />
You can choose various approaches:<br />
* Modify [[#Styles for both Qt and GTK|GTK and Qt styles]] separately with the tools listed below for each toolkit and aim for choosing similarly looking themes (style, colors, icons, cursors, fonts).<br />
* Use a special [[#Theme engines|theme engine]], which intermediates the modification of the other graphical toolkit to match your main toolkit.<br />
<br />
== Styles for both Qt and GTK ==<br />
<br />
There are widget style sets available for the purpose of integration, where builds are written and provided for both Qt and GTK, all major versions included. With these, you can have one look for all applications regardless of the toolkit they had been written with.<br />
<br />
{{Tip|You may want to apply user defined styles to root applications, see [[GTK#Theme not applied to root applications]] and [[Qt#Theme not applied to root applications]].}}<br />
{{Note|1=Since version 3.16, GTK 3 [https://bbs.archlinux.org/viewtopic.php?pid=1518404#p1518404 does not support] non-CSS themes, hence previous solutions such as Oxygen-Gtk are [https://bugs.kde.org/show_bug.cgi?id=340288 no longer viable] options.}}<br />
<br />
=== Breeze ===<br />
<br />
Breeze is the default Qt style of KDE Plasma. It can be installed with the {{Pkg|breeze}} package for Qt5, the {{AUR|breeze-kde4}} package for Qt4, and the {{Pkg|breeze-gtk}} package for GTK 2 and GTK 3.<br />
<br />
Once installed, you can use one of the many [[GTK#Configuration tools|GTK configuration tools]] to change the GTK theme. <br />
<br />
If running KDE Plasma, install {{pkg|kde-gtk-config}} and either run it from the command line, or log-out and log-in again and go to ''System Settings > Appearance > Application Style > Configure GNOME/GTK Application Style…''. Fonts, icon themes, cursors, and widget styles set in System Settings affect GTK settings automatically; only the GTK theme should be set manually using the previously mentioned module.<br />
<br />
=== Adwaita ===<br />
<br />
Adwaita is the default GNOME theme. The GTK 3 version is included in the {{Pkg|gtk3}} package, while the GTK 2 version is in {{Pkg|gnome-themes-extra}}. [https://github.com/MartinBriza/adwaita-qt adwaita-qt] is a Qt port of the Adwaita theme. Unlike [[#QGtkStyle]], which mimics the GTK 2 theme, it provides a native Qt style made to look like the GTK 3 Adwaita. It can be [[install|installed]] with the {{AUR|adwaita-qt4}}, {{Pkg|adwaita-qt5}} and {{Pkg|adwaita-qt6}} packages (it might require some time for compiling) for the Qt 4, 5 and 6 versions, respectively.<br />
<br />
To set the Qt style as default:<br />
<br />
* For Qt4, it can be enabled with ''Qt Configuration'' ({{ic|qtconfig-qt4}}), choose ''adwaita'' under ''Appearance > GUI Style''. Alternatively, edit the {{ic|/etc/xdg/Trolltech.conf}} (system-wide) or {{ic|~/.config/Trolltech.conf}} (user-specific) file:<br />
<br />
{{hc|~/.config/Trolltech.conf|2=<br />
...<br />
[Qt]<br />
style=adwaita<br />
...<br />
}}<br />
<br />
* For Qt 5, it can be enabled by setting the following [[Environment variables#Graphical environment|environment variable]]: {{ic|1=QT_STYLE_OVERRIDE=adwaita}}. Alternatively, use {{Pkg|qt5ct}} package. For more detailed instructions, see [[Qt#Configuration of Qt 5 applications under environments other than KDE Plasma]].<br />
<br />
== Theme engines ==<br />
<br />
A ''theme engine'' can be thought of as a thin layer API which translates themes (excluding icons) between one or more toolkits. These engines add some extra code in the process and it is arguable that this kind of a solution is not as elegant and optimal as using native styles.<br />
<br />
=== Kvantum ===<br />
<br />
Kvantum ({{Pkg|kvantum}}) is a customizable SVG-based theme engine for Qt5 that comes with a variety of built-in styles, including versions of some of popular GTK themes such as Adapta, Arc, Ambiance, Libadwaita and Materia. More themes can be found [https://store.kde.org/browse?cat=123 on the KDE Store].<br />
<br />
Kvantum is treated as a style instead of a platform theme. To set Kvantum for all qt applications using environment variables, issue {{ic|1=QT_STYLE_OVERRIDE=kvantum}}.<br />
<br />
=== QGtkStyle ===<br />
<br />
{{Note|QGtkStyle has been removed from {{Pkg|qt5-base}} 5.7.0 [https://github.com/qtproject/qtbase/commit/899a815414e95da8d9429a4a4f4d7094e49cfc55] and added to {{AUR|qt5-styleplugins}} [https://github.com/qtproject/qtstyleplugins/commit/102da7d50231fc5723dba6e72340bef3d29471aa]}}<br />
<br />
{{Warning|Depending on GTK 2 theme, this style may cause rendering issues such as transparent fonts or inconsistent widgets.}}<br />
<br />
This Qt style uses GTK 2 to render all components to blend in with [[GNOME]] and similar GTK based environments. Beginning with Qt 4.5, this style is included in Qt. It requires {{Pkg|gtk2}} to be installed and configured.<br />
<br />
This is the default Qt4 style in Cinnamon, GNOME and Xfce, and the default Qt5 style in Cinnamon, GNOME, MATE, LXDE and Xfce. In other environments:<br />
<br />
* For Qt4, it can be enabled with ''Qt Configuration'' ({{ic|qtconfig-qt4}}), choose ''GTK'' under ''Appearance > GUI Style''. Alternatively, edit the {{ic|/etc/xdg/Trolltech.conf}} (system-wide) or {{ic|~/.config/Trolltech.conf}} (user-specific) file:<br />
<br />
{{hc|~/.config/Trolltech.conf|2=<br />
...<br />
[Qt]<br />
style=GTK+<br />
...<br />
}}<br />
<br />
* For Qt 5, it can be enabled by installing {{AUR|qt5-styleplugins}} and setting the following [[Environment variables#Graphical environment|environment variable]]: {{ic|1=QT_QPA_PLATFORMTHEME=gtk2}}<br />
<br />
* For Qt 6, it can be enabled by installing {{AUR|qt6gtk2}} and choosing the ''qt6gtk2'' style in {{Pkg|qt6ct}}, or alternatively setting the following environment variable: {{ic|1=QT_QPA_PLATFORMTHEME=gtk2}}<br />
<br />
For full uniformity, make sure that the configured [[GTK#Themes|GTK theme]] supports both GTK 2 and GTK 3. If your preferred theme has inconsistent rendering after configuring Qt to use GTK2, install {{AUR|gtk-theme-switch2}} and choose a theme.<br />
<br />
=== QGnomePlatform ===<br />
<br />
This Qt 5 platform theme applies the appearance settings of GNOME for Qt applications. It can be installed with the {{Pkg|qgnomeplatform-qt5}} or {{Pkg|qgnomeplatform-qt6}} packages or the {{AUR|qgnomeplatform-qt5-git}} and {{AUR|qgnomeplatform-qt6-git}} packages for the development version. It does not provide a Qt style itself, instead it requires a [[#Styles for both Qt and GTK|style that support both Qt and GTK]].<br />
<br />
This platform theme is enabled automatically in GNOME since version 3.20. For other systems, it can be enabled by setting the following [[Environment variables#Graphical environment|environment variable]]: {{ic|1=QT_QPA_PLATFORMTHEME=gnome}}.<br />
<br />
== Tips and tricks ==<br />
<br />
=== Using a GTK icon theme in Qt apps ===<br />
<br />
If you are running [[Plasma]], run {{Pkg|kde-gtk-config}} and select the icon-theme under ''System Settings > Application Style > GTK''.<br />
<br />
If you are using [[GNOME]], run {{Pkg|dconf-editor}} and change the {{ic|icon-theme}} key under ''org > gnome > desktop > interface'' to your preferred icon theme. <br />
<br />
If you are not using a [[Desktop environment]], for example if you are running a minimal system with {{Pkg|i3-wm}}, [[install]] {{Pkg|dconf-editor}} and set the icon-theme as explained above. <br />
You might also have to set the value of {{ic|DESKTOP_SESSION}} in your profile. See [[Environment variables#Defining variables]] for the possible ways to obtain the desired result. <br />
<br />
{{Note| If the icon theme was not applied, you might want to check if the name that you entered of your preferred theme, was in the correct format. For example, if you want to apply the currently active icon theme to your QT applications, you can find the correct format of its name with the command:<br />
<br />
{{bc|1=$ awk -F= '/icon-theme/ {print $2}' ~/.gtkrc-2.0}}<br />
<br />
}}<br />
<br />
=== Add Title bar and frame to GTK3 applications under KDE Plasma ===<br />
<br />
To have Gnome/GTK applications display with a KDE/Plasma title bar and frame, install {{AUR|gtk3-nocsd-git}} and restart your window manager to load the updated library path.<br />
<br />
You can also run Gtk application with the wrapper:<br />
$ gtk3-nocsd gedit<br />
<br />
=== Improve subpixel rendering of GTK apps under KDE Plasma ===<br />
<br />
See [[Font configuration#LCD filter]].<br />
<br />
=== Consistent file dialog under KDE Plasma ===<br />
<br />
{{Accuracy|GTK seems to have replaced {{ic|1=GTK_USE_PORTAL=1}} with {{ic|1=GDK_DEBUG=portals}}. https://gitlab.gnome.org/GNOME/gtk/-/blob/636827800525770715bba96671edb2fc0234ccc2/NEWS#L34}}<br />
<br />
In order to have the same file dialog, one can use XDG Portals.<br />
<br />
[[Install]] {{Pkg|xdg-desktop-portal}} and {{Pkg|xdg-desktop-portal-kde}} and set {{ic|1=GTK_USE_PORTAL=1}} [[environment variable]].<br />
<br />
Note that currently not all GTK applications support KDE file dialogs correctly. <br />
<br />
Applications using electron should use at least electron 14 (see [https://github.com/electron/electron/pull/19159 #19159]) and properly implement this function.<br />
<br />
[[VSCode]] has a pull request for fixing a problem, see [https://github.com/microsoft/vscode/pull/126113 #126113].<br />
<br />
[[GIMP]] has not implemented use of the portal yet, see [https://gitlab.gnome.org/GNOME/gimp/-/issues/1830 bug report].<br />
<br />
{{Note|There are still lots of GTK applications that do not implement portal properly (abandoned applications, or authors are focused on other tasks). To simplify file picking from such applications, you can at least synchronize bookmarks from dolphin to nautilus. Use this command:<br />
<br />
{{bc|1=$ awk -F\" '/<bookmark href=\"file/ {print $2}' < $HOME/.local/share/user-places.xbel > $HOME/.config/gtk-3.0/bookmarks}}<br />
<br />
Alternatively, use {{AUR|bookmarksync-git}} for that purpose. There you can manually edit and sync bookmarks to both sides.<br />
}}<br />
<br />
== Troubleshooting ==<br />
<br />
=== Themes not working in GTK apps ===<br />
<br />
If the style or theme engine you set up is not showing in your GTK applications then it is likely your GTK settings files are not being loaded for some reason. You can check where your system expects to find these files by doing the following..<br />
$ export | grep gtk<br />
<br />
Usually the expected files should be {{ic|~/.gtkrc}} for GTK1 and {{ic|~/.gtkrc2.0}} or {{ic|~/.gtkrc2.0-kde}} for GTK 2.x.<br />
<br />
=== GTK apps do not use svg (breeze) icons after system upgrade ===<br />
<br />
Try to run this to fix this issue:<br />
# gdk-pixbuf-query-loaders --update-cache<br />
<br />
=== Flatpak Qt apps do not use Gnome Adwaita dark theme ===<br />
<br />
If you switched your theme to Adwaita-dark and Flatpak Qt applications still use the light version, install the required KStyle:<br />
<br />
# flatpak install flathub org.kde.KStyle.Adwaita<br />
<br />
=== Qt apps run on GNOME Wayland have a non-matching window decoration look, even after setting a Qt theme ===<br />
<br />
In order to have a matching window decoration look, you have to install {{Pkg|qgnomeplatform-qt5}}, and set the following [[Environment variables#Graphical environment|environment variable]]: {{ic|1=QT_QPA_PLATFORMTHEME='gnome'}}<br />
This fix is guaranteed to work with Adwaita or Adwaita-dark.<br />
<br />
=== GTK apps do not fully use KDE system settings ===<br />
<br />
To further integrate [[Plasma]] settings on GTK apps, one may want to [[install]] {{Pkg|gnome-settings-daemon}}, {{Pkg|gsettings-desktop-schemas}} and {{Pkg|gsettings-qt}}. This will offer proper Qt bindings for GTK.<br />
<br />
=== kde-gtk-config "System Settings > Application Style > GTK" menu missing ===<br />
<br />
When {{pkg|kde-gtk-config}} breaks and the "Application Style > GTK" menu is missing from System Settings, it is possible to choose [[GTK#Configuration tools|GTK configuration tools]] like {{pkg|lxappearance}} to be able to configure GTK 2 and GTK 3 styles.<br />
It is desktop independent even if it comes from the LXDE project (it does not require other parts of the LXDE desktop).<br />
<br />
=== Dolphin theming does not match Nautilus well ===<br />
Check the section [[Dolphin#Mismatched folder view background colors|Mismatched folder view background colors]] for how to deal with weird coloring.</div>ENV25https://wiki.archlinux.org/index.php?title=Uniform_look_for_Qt_and_GTK_applications&diff=754461Uniform look for Qt and GTK applications2022-10-22T15:47:57Z<p>ENV25: /* Consistent file dialog under KDE Plasma */ accuracy: gtk seems to have replaced GTK_USE_PORTAL=1 with GDK_DEBUG=portals https://gitlab.gnome.org/GNOME/gtk/-/blob/636827800525770715bba96671edb2fc0234ccc2/NEWS#L34</p>
<hr />
<div>[[Category:Widget toolkits]]<br />
[[Category:Eye candy]]<br />
[[ja:Qt と GTK アプリケーションの外観の統合]]<br />
[[ru:Uniform look for Qt and GTK applications]]<br />
[[zh-hans:Uniform look for Qt and GTK applications]]<br />
{{Related articles start}}<br />
{{Related|GTK}}<br />
{{Related|Qt}}<br />
{{Related articles end}}<br />
[[Qt]] and [[GTK]] based programs both use a different widget toolkit to render the graphical user interface. Each come with different themes, styles and icon sets by default, among other things, so the "look and feel" differ significantly. This article will help you make your Qt and GTK applications look similar for a more streamlined and integrated desktop experience.<br />
<br />
== Overview ==<br />
<br />
To get a similar look between the toolkits, you will most likely have to modify the following:<br />
* '''Theme''': The custom appearance of an application, widget set, etc. It usually consists of a style, an icon theme and a color theme.<br />
* '''Style''': The graphical layout and look of the widget set.<br />
* '''Icon Theme''': A set of global icons.<br />
* '''Color Theme''': A set of global colors that are used in conjunction with the style.<br />
<br />
You can choose various approaches:<br />
* Modify [[#Styles for both Qt and GTK|GTK and Qt styles]] separately with the tools listed below for each toolkit and aim for choosing similarly looking themes (style, colors, icons, cursors, fonts).<br />
* Use a special [[#Theme engines|theme engine]], which intermediates the modification of the other graphical toolkit to match your main toolkit.<br />
<br />
== Styles for both Qt and GTK ==<br />
<br />
There are widget style sets available for the purpose of integration, where builds are written and provided for both Qt and GTK, all major versions included. With these, you can have one look for all applications regardless of the toolkit they had been written with.<br />
<br />
{{Tip|You may want to apply user defined styles to root applications, see [[GTK#Theme not applied to root applications]] and [[Qt#Theme not applied to root applications]].}}<br />
{{Note|1=Since version 3.16, GTK 3 [https://bbs.archlinux.org/viewtopic.php?pid=1518404#p1518404 does not support] non-CSS themes, hence previous solutions such as Oxygen-Gtk are [https://bugs.kde.org/show_bug.cgi?id=340288 no longer viable] options.}}<br />
<br />
=== Breeze ===<br />
<br />
Breeze is the default Qt style of KDE Plasma. It can be installed with the {{Pkg|breeze}} package for Qt5, the {{AUR|breeze-kde4}} package for Qt4, and the {{Pkg|breeze-gtk}} package for GTK 2 and GTK 3.<br />
<br />
Once installed, you can use one of the many [[GTK#Configuration tools|GTK configuration tools]] to change the GTK theme. <br />
<br />
If running KDE Plasma, install {{pkg|kde-gtk-config}} and either run it from the command line, or log-out and log-in again and go to ''System Settings > Appearance > Application Style > Configure GNOME/GTK Application Style…''. Fonts, icon themes, cursors, and widget styles set in System Settings affect GTK settings automatically; only the GTK theme should be set manually using the previously mentioned module.<br />
<br />
=== Adwaita ===<br />
<br />
Adwaita is the default GNOME theme. The GTK 3 version is included in the {{Pkg|gtk3}} package, while the GTK 2 version is in {{Pkg|gnome-themes-extra}}. [https://github.com/MartinBriza/adwaita-qt adwaita-qt] is a Qt port of the Adwaita theme. Unlike [[#QGtkStyle]], which mimics the GTK 2 theme, it provides a native Qt style made to look like the GTK 3 Adwaita. It can be [[install|installed]] with the {{AUR|adwaita-qt4}}, {{Pkg|adwaita-qt5}} and {{Pkg|adwaita-qt6}} packages (it might require some time for compiling) for the Qt 4, 5 and 6 versions, respectively.<br />
<br />
To set the Qt style as default:<br />
<br />
* For Qt4, it can be enabled with ''Qt Configuration'' ({{ic|qtconfig-qt4}}), choose ''adwaita'' under ''Appearance > GUI Style''. Alternatively, edit the {{ic|/etc/xdg/Trolltech.conf}} (system-wide) or {{ic|~/.config/Trolltech.conf}} (user-specific) file:<br />
<br />
{{hc|~/.config/Trolltech.conf|2=<br />
...<br />
[Qt]<br />
style=adwaita<br />
...<br />
}}<br />
<br />
* For Qt 5, it can be enabled by setting the following [[Environment variables#Graphical environment|environment variable]]: {{ic|1=QT_STYLE_OVERRIDE=adwaita}}. Alternatively, use {{Pkg|qt5ct}} package. For more detailed instructions, see [[Qt#Configuration of Qt 5 applications under environments other than KDE Plasma]].<br />
<br />
== Theme engines ==<br />
<br />
A ''theme engine'' can be thought of as a thin layer API which translates themes (excluding icons) between one or more toolkits. These engines add some extra code in the process and it is arguable that this kind of a solution is not as elegant and optimal as using native styles.<br />
<br />
=== Kvantum ===<br />
<br />
Kvantum ({{Pkg|kvantum}}) is a customizable SVG-based theme engine for Qt5 that comes with a variety of built-in styles, including versions of some of popular GTK themes such as Adapta, Arc, Ambiance, Libadwaita and Materia. More themes can be found [https://store.kde.org/browse?cat=123 on the KDE Store].<br />
<br />
Kvantum is treated as a style instead of a platform theme. To set Kvantum for all qt applications using environment variables, issue {{ic|1=QT_STYLE_OVERRIDE=kvantum}}.<br />
<br />
=== QGtkStyle ===<br />
<br />
{{Note|QGtkStyle has been removed from {{Pkg|qt5-base}} 5.7.0 [https://github.com/qtproject/qtbase/commit/899a815414e95da8d9429a4a4f4d7094e49cfc55] and added to {{AUR|qt5-styleplugins}} [https://github.com/qtproject/qtstyleplugins/commit/102da7d50231fc5723dba6e72340bef3d29471aa]}}<br />
<br />
{{Warning|Depending on GTK 2 theme, this style may cause rendering issues such as transparent fonts or inconsistent widgets.}}<br />
<br />
This Qt style uses GTK 2 to render all components to blend in with [[GNOME]] and similar GTK based environments. Beginning with Qt 4.5, this style is included in Qt. It requires {{Pkg|gtk2}} to be installed and configured.<br />
<br />
This is the default Qt4 style in Cinnamon, GNOME and Xfce, and the default Qt5 style in Cinnamon, GNOME, MATE, LXDE and Xfce. In other environments:<br />
<br />
* For Qt4, it can be enabled with ''Qt Configuration'' ({{ic|qtconfig-qt4}}), choose ''GTK'' under ''Appearance > GUI Style''. Alternatively, edit the {{ic|/etc/xdg/Trolltech.conf}} (system-wide) or {{ic|~/.config/Trolltech.conf}} (user-specific) file:<br />
<br />
{{hc|~/.config/Trolltech.conf|2=<br />
...<br />
[Qt]<br />
style=GTK+<br />
...<br />
}}<br />
<br />
* For Qt 5, it can be enabled by installing {{AUR|qt5-styleplugins}} and setting the following [[Environment variables#Graphical environment|environment variable]]: {{ic|1=QT_QPA_PLATFORMTHEME=gtk2}}<br />
<br />
* For Qt 6, it can be enabled by installing {{AUR|qt6gtk2}} and choosing the ''qt6gtk2'' style in {{Pkg|qt6ct}}, or alternatively setting the following environment variable: {{ic|1=QT_QPA_PLATFORMTHEME=gtk2}}<br />
<br />
For full uniformity, make sure that the configured [[GTK#Themes|GTK theme]] supports both GTK 2 and GTK 3. If your preferred theme has inconsistent rendering after configuring Qt to use GTK2, install {{AUR|gtk-theme-switch2}} and choose a theme.<br />
<br />
=== QGnomePlatform ===<br />
<br />
This Qt 5 platform theme applies the appearance settings of GNOME for Qt applications. It can be installed with the {{Pkg|qgnomeplatform-qt5}} or {{Pkg|qgnomeplatform-qt6}} packages or the {{AUR|qgnomeplatform-qt5-git}} and {{AUR|qgnomeplatform-qt6-git}} packages for the development version. It does not provide a Qt style itself, instead it requires a [[#Styles for both Qt and GTK|style that support both Qt and GTK]].<br />
<br />
This platform theme is enabled automatically in GNOME since version 3.20. For other systems, it can be enabled by setting the following [[Environment variables#Graphical environment|environment variable]]: {{ic|1=QT_QPA_PLATFORMTHEME=gnome}}.<br />
<br />
== Tips and tricks ==<br />
<br />
=== Using a GTK icon theme in Qt apps ===<br />
<br />
If you are running [[Plasma]], run {{Pkg|kde-gtk-config}} and select the icon-theme under ''System Settings > Application Style > GTK''.<br />
<br />
If you are using [[GNOME]], run {{Pkg|dconf-editor}} and change the {{ic|icon-theme}} key under ''org > gnome > desktop > interface'' to your preferred icon theme. <br />
<br />
If you are not using a [[Desktop environment]], for example if you are running a minimal system with {{Pkg|i3-wm}}, [[install]] {{Pkg|dconf-editor}} and set the icon-theme as explained above. <br />
You might also have to set the value of {{ic|DESKTOP_SESSION}} in your profile. See [[Environment variables#Defining variables]] for the possible ways to obtain the desired result. <br />
<br />
{{Note| If the icon theme was not applied, you might want to check if the name that you entered of your preferred theme, was in the correct format. For example, if you want to apply the currently active icon theme to your QT applications, you can find the correct format of its name with the command:<br />
<br />
{{bc|1=$ awk -F= '/icon-theme/ {print $2}' ~/.gtkrc-2.0}}<br />
<br />
}}<br />
<br />
=== Add Title bar and frame to GTK3 applications under KDE Plasma ===<br />
<br />
To have Gnome/GTK applications display with a KDE/Plasma title bar and frame, install {{AUR|gtk3-nocsd-git}} and restart your window manager to load the updated library path.<br />
<br />
You can also run Gtk application with the wrapper:<br />
$ gtk3-nocsd gedit<br />
<br />
=== Improve subpixel rendering of GTK apps under KDE Plasma ===<br />
<br />
See [[Font configuration#LCD filter]].<br />
<br />
=== Consistent file dialog under KDE Plasma ===<br />
<br />
{{Accuracy|GTK seems to have replaced {{ic|1=GTK_USE_PORTAL=1}} with {{ic|1=GDK_DEBUG=portals}}. https://gitlab.gnome.org/GNOME/gtk/-/blob/636827800525770715bba96671edb2fc0234ccc2/NEWS#L34}}<br />
<br />
In order to have the same file dialog, one can use XDG Portals.<br />
<br />
[[Install]] {{Pkg|xdg-desktop-portal}} and {{Pkg|xdg-desktop-portal-kde}} and set {{ic|1=GTK_USE_PORTAL=1}} [[environment variable]].<br />
<br />
Note that currently not all GTK applications support KDE file dialogs correctly. <br />
<br />
Applications using electron should use at least electron 14 (see [https://github.com/electron/electron/pull/19159 #19159]) and properly implement this function.<br />
<br />
vscode has a pull request for fixing a problem, see [https://github.com/microsoft/vscode/pull/126113 #126113].<br />
<br />
GIMP has not implemented use of the portal yet, see [https://gitlab.gnome.org/GNOME/gimp/-/issues/1830 bug report].<br />
<br />
{{Note|There are still lots of GTK applications that do not implement portal properly (abandoned applications, or authors are focused on other tasks). To simplify file picking from such applications, you can at least synchronize bookmarks from dolphin to nautilus. Use this command:<br />
<br />
{{bc|1=$ awk -F\" '/<bookmark href=\"file/ {print $2}' < $HOME/.local/share/user-places.xbel > $HOME/.config/gtk-3.0/bookmarks}}<br />
<br />
Alternatively, use {{AUR|bookmarksync-git}} for that purpose. There you can manually edit and sync bookmarks to both sides.<br />
}}<br />
<br />
== Troubleshooting ==<br />
<br />
=== Themes not working in GTK apps ===<br />
<br />
If the style or theme engine you set up is not showing in your GTK applications then it is likely your GTK settings files are not being loaded for some reason. You can check where your system expects to find these files by doing the following..<br />
$ export | grep gtk<br />
<br />
Usually the expected files should be {{ic|~/.gtkrc}} for GTK1 and {{ic|~/.gtkrc2.0}} or {{ic|~/.gtkrc2.0-kde}} for GTK 2.x.<br />
<br />
=== GTK apps do not use svg (breeze) icons after system upgrade ===<br />
<br />
Try to run this to fix this issue:<br />
# gdk-pixbuf-query-loaders --update-cache<br />
<br />
=== Flatpak Qt apps do not use Gnome Adwaita dark theme ===<br />
<br />
If you switched your theme to Adwaita-dark and Flatpak Qt applications still use the light version, install the required KStyle:<br />
<br />
# flatpak install flathub org.kde.KStyle.Adwaita<br />
<br />
=== Qt apps run on GNOME Wayland have a non-matching window decoration look, even after setting a Qt theme ===<br />
<br />
In order to have a matching window decoration look, you have to install {{Pkg|qgnomeplatform-qt5}}, and set the following [[Environment variables#Graphical environment|environment variable]]: {{ic|1=QT_QPA_PLATFORMTHEME='gnome'}}<br />
This fix is guaranteed to work with Adwaita or Adwaita-dark.<br />
<br />
=== GTK apps do not fully use KDE system settings ===<br />
<br />
To further integrate [[Plasma]] settings on GTK apps, one may want to [[install]] {{Pkg|gnome-settings-daemon}}, {{Pkg|gsettings-desktop-schemas}} and {{Pkg|gsettings-qt}}. This will offer proper Qt bindings for GTK.<br />
<br />
=== kde-gtk-config "System Settings > Application Style > GTK" menu missing ===<br />
<br />
When {{pkg|kde-gtk-config}} breaks and the "Application Style > GTK" menu is missing from System Settings, it is possible to choose [[GTK#Configuration tools|GTK configuration tools]] like {{pkg|lxappearance}} to be able to configure GTK 2 and GTK 3 styles.<br />
It is desktop independent even if it comes from the LXDE project (it does not require other parts of the LXDE desktop).<br />
<br />
=== Dolphin theming does not match Nautilus well ===<br />
Check the section [[Dolphin#Mismatched folder view background colors|Mismatched folder view background colors]] for how to deal with weird coloring.</div>ENV25https://wiki.archlinux.org/index.php?title=Input_remap_utilities&diff=754041Input remap utilities2022-10-21T07:52:49Z<p>ENV25: /* keyd */ elaborate</p>
<hr />
<div>[[Category:Input devices]]<br />
[[Category:Lists of software]]<br />
[[ja:入力リマップユーティリティ]]<br />
This page lists software that you can use to reconfigure input events from keyboards, mice and other hardware. Also it briefly describes how to configure them.<br />
<br />
Wayland's security model prevents programs other than the compositor from grabbing raw keyboard input. Some compositors support remapping keys (for example, {{Pkg|mutter}} through {{Pkg|gnome-tweaks}}), but many do not. Utilities work around this by grabbing the keyboard before the compositor, and passing modified keyboard input through to it.<br />
<br />
== Utilities ==<br />
<br />
=== evremap ===<br />
<br />
[https://github.com/wez/evremap evremap] ({{AUR|evremap}}) - A keyboard input remapper for Linux/Wayland systems. This tool can do remap in a following way: remap the {{ic|CapsLock}} key so that it produces {{ic|Ctrl}} when held, but {{ic|Esc}} if tapped and remap {{ic|n}} keys to {{ic|m}} keys. E.g.: {{ic|F3}} to {{ic|Ctrl+c}}, and {{ic|Alt+Left}} to {{ic|Home}}.<br />
<br />
After installation, create a config file ([https://github.com/wez/evremap/blob/master/pixelbookgo.toml example] from repo), and [[edit]] {{ic|evremap.service}} to point to your config. Then [[start]] the service.<br />
<br />
=== evdevremapkeys ===<br />
<br />
[https://github.com/philipl/evdevremapkeys evdevremapkeys] ({{AUR|evdevremapkeys-git}}) - A daemon to remap key events on linux input devices. This tool can remap keyboard and mouse events. It can map to repeated actions (for example, do double click) and can generate them while button is pressed (for example, generate wheel up events while holding back button).<br />
<br />
It is also possible to remap combo to combo, but this is not yet merged, and is available in pronobis fork. See [https://github.com/philipl/evdevremapkeys/issues/4#issuecomment-407684344 here].<br />
<br />
=== evsieve ===<br />
<br />
[https://github.com/KarsMulder/evsieve evsieve] ({{AUR|evsieve}}) - a low-level utility that can read events from Linux event devices (evdev) and write them to virtual event devices (uinput), performing simple manipulations on the events along the way. Works on Wayland. Evsieve is particularly intended to be used in conjunction with the evdev-passthrough functionality of Qemu.<br />
<br />
=== kbct ===<br />
<br />
[https://github.com/samvel1024/kbct kbct] ({{AUR|kbct-git}}) - Keyboard Customization Tool for Linux. Despite its name, also supports mouse events. This tool allows you to map an event (keyboard or mouse button) to another event. You can define multiple "layers" - lists of maps depending of which modifier you press with an input key. Unfortunately, currently the kbct does not allow you to generate multi-button event. See [https://github.com/samvel1024/kbct/issues/13].<br />
<br />
After installation, edit {{ic|/etc/kbct/config.yml}} as required, then [[start]] {{ic|kbct.service}}.<br />
<br />
=== keyd ===<br />
<br />
[https://github.com/rvaiya/keyd keyd] ({{AUR|keyd}} {{AUR|keyd-git}}) A key remapping daemon for Linux using a flexible system-wide daemon which remaps keys using kernel level input primitives (evdev, uinput). Keyd works in both graphical environments, like X11 and Wayland, and the Linux virtual console. Read the project's README for more information about how keyd compared to similar software.<br />
<br />
=== Input Remapper ===<br />
<br />
[https://github.com/sezanzeb/input-remapper/ Input Remapper] {{AUR|input-remapper-git}} - utility that provides a GUI and a CLI to configure remappings. Works with both X and Wayland.<br />
<br />
=== Other ===<br />
<br />
* [https://github.com/mathportillo/wayland-mouse-mapper wayland-mouse-mapper] is a small script for mapping mouse buttons to keystrokes on Wayland.<br />
* [[IMWheel]] is a tool for X11 that can remap mouse wheel events depending on pressed modifier and individually per application.<br />
* [https://github.com/kempniu/evmapy evmapy] - evdev event mapper written in Python. Not in AUR yet.<br />
* [[Mouse buttons#User tools]] - list of hardware-dependent utilities to configure mouse buttons.<br />
* [https://python-evdev.readthedocs.io/en/latest/ python-evdev] - utility that allows you to read and write input events on Linux. An event can be a key or button press, a mouse movement or a tap on a touchscreen.<br />
<br />
== Testing ==<br />
<br />
[https://gitlab.freedesktop.org/libevdev/evtest evtest] ({{Pkg|evtest}}) - utility that can show you the button names when you press them, which can help when configuring remap utilities.<br />
<br />
[https://git.sr.ht/~sircmpwn/wev wev] ({{AUR|wev}}) - utility to view input events in wayland, similar to [[xev]].<br />
<br />
With {{ic|evsieve --input /dev/input/event* --print}} you can see all events that are emitted on your computer.<br />
<br />
Another approach of testing keyboard buttons is with online websites. Most of such testers cannot distinguish between left and right modifiers. One example that can is: https://stendec.io/yakt/.</div>ENV25https://wiki.archlinux.org/index.php?title=Input_remap_utilities&diff=754040Input remap utilities2022-10-21T07:51:08Z<p>ENV25: /* keyd */ elaborate</p>
<hr />
<div>[[Category:Input devices]]<br />
[[Category:Lists of software]]<br />
[[ja:入力リマップユーティリティ]]<br />
This page lists software that you can use to reconfigure input events from keyboards, mice and other hardware. Also it briefly describes how to configure them.<br />
<br />
Wayland's security model prevents programs other than the compositor from grabbing raw keyboard input. Some compositors support remapping keys (for example, {{Pkg|mutter}} through {{Pkg|gnome-tweaks}}), but many do not. Utilities work around this by grabbing the keyboard before the compositor, and passing modified keyboard input through to it.<br />
<br />
== Utilities ==<br />
<br />
=== evremap ===<br />
<br />
[https://github.com/wez/evremap evremap] ({{AUR|evremap}}) - A keyboard input remapper for Linux/Wayland systems. This tool can do remap in a following way: remap the {{ic|CapsLock}} key so that it produces {{ic|Ctrl}} when held, but {{ic|Esc}} if tapped and remap {{ic|n}} keys to {{ic|m}} keys. E.g.: {{ic|F3}} to {{ic|Ctrl+c}}, and {{ic|Alt+Left}} to {{ic|Home}}.<br />
<br />
After installation, create a config file ([https://github.com/wez/evremap/blob/master/pixelbookgo.toml example] from repo), and [[edit]] {{ic|evremap.service}} to point to your config. Then [[start]] the service.<br />
<br />
=== evdevremapkeys ===<br />
<br />
[https://github.com/philipl/evdevremapkeys evdevremapkeys] ({{AUR|evdevremapkeys-git}}) - A daemon to remap key events on linux input devices. This tool can remap keyboard and mouse events. It can map to repeated actions (for example, do double click) and can generate them while button is pressed (for example, generate wheel up events while holding back button).<br />
<br />
It is also possible to remap combo to combo, but this is not yet merged, and is available in pronobis fork. See [https://github.com/philipl/evdevremapkeys/issues/4#issuecomment-407684344 here].<br />
<br />
=== evsieve ===<br />
<br />
[https://github.com/KarsMulder/evsieve evsieve] ({{AUR|evsieve}}) - a low-level utility that can read events from Linux event devices (evdev) and write them to virtual event devices (uinput), performing simple manipulations on the events along the way. Works on Wayland. Evsieve is particularly intended to be used in conjunction with the evdev-passthrough functionality of Qemu.<br />
<br />
=== kbct ===<br />
<br />
[https://github.com/samvel1024/kbct kbct] ({{AUR|kbct-git}}) - Keyboard Customization Tool for Linux. Despite its name, also supports mouse events. This tool allows you to map an event (keyboard or mouse button) to another event. You can define multiple "layers" - lists of maps depending of which modifier you press with an input key. Unfortunately, currently the kbct does not allow you to generate multi-button event. See [https://github.com/samvel1024/kbct/issues/13].<br />
<br />
After installation, edit {{ic|/etc/kbct/config.yml}} as required, then [[start]] {{ic|kbct.service}}.<br />
<br />
=== keyd ===<br />
<br />
[https://github.com/rvaiya/keyd keyd] ({{AUR|keyd}} {{AUR|keyd-git}}) A key remapping daemon for Linux using a flexible system-wide daemon which remaps keys using kernel level input primitives (evdev, uinput). Keyd works in both graphical environments, like X11 and Wayland, and the Linux virtual console.<br />
<br />
=== Input Remapper ===<br />
<br />
[https://github.com/sezanzeb/input-remapper/ Input Remapper] {{AUR|input-remapper-git}} - utility that provides a GUI and a CLI to configure remappings. Works with both X and Wayland.<br />
<br />
=== Other ===<br />
<br />
* [https://github.com/mathportillo/wayland-mouse-mapper wayland-mouse-mapper] is a small script for mapping mouse buttons to keystrokes on Wayland.<br />
* [[IMWheel]] is a tool for X11 that can remap mouse wheel events depending on pressed modifier and individually per application.<br />
* [https://github.com/kempniu/evmapy evmapy] - evdev event mapper written in Python. Not in AUR yet.<br />
* [[Mouse buttons#User tools]] - list of hardware-dependent utilities to configure mouse buttons.<br />
* [https://python-evdev.readthedocs.io/en/latest/ python-evdev] - utility that allows you to read and write input events on Linux. An event can be a key or button press, a mouse movement or a tap on a touchscreen.<br />
<br />
== Testing ==<br />
<br />
[https://gitlab.freedesktop.org/libevdev/evtest evtest] ({{Pkg|evtest}}) - utility that can show you the button names when you press them, which can help when configuring remap utilities.<br />
<br />
[https://git.sr.ht/~sircmpwn/wev wev] ({{AUR|wev}}) - utility to view input events in wayland, similar to [[xev]].<br />
<br />
With {{ic|evsieve --input /dev/input/event* --print}} you can see all events that are emitted on your computer.<br />
<br />
Another approach of testing keyboard buttons is with online websites. Most of such testers cannot distinguish between left and right modifiers. One example that can is: https://stendec.io/yakt/.</div>ENV25https://wiki.archlinux.org/index.php?title=Input_remap_utilities&diff=754034Input remap utilities2022-10-21T07:42:59Z<p>ENV25: Add initial reference to keyd</p>
<hr />
<div>[[Category:Input devices]]<br />
[[Category:Lists of software]]<br />
[[ja:入力リマップユーティリティ]]<br />
This page lists software that you can use to reconfigure input events from keyboards, mice and other hardware. Also it briefly describes how to configure them.<br />
<br />
Wayland's security model prevents programs other than the compositor from grabbing raw keyboard input. Some compositors support remapping keys (for example, {{Pkg|mutter}} through {{Pkg|gnome-tweaks}}), but many do not. Utilities work around this by grabbing the keyboard before the compositor, and passing modified keyboard input through to it.<br />
<br />
== Utilities ==<br />
<br />
=== evremap ===<br />
<br />
[https://github.com/wez/evremap evremap] ({{AUR|evremap}}) - A keyboard input remapper for Linux/Wayland systems. This tool can do remap in a following way: remap the {{ic|CapsLock}} key so that it produces {{ic|Ctrl}} when held, but {{ic|Esc}} if tapped and remap {{ic|n}} keys to {{ic|m}} keys. E.g.: {{ic|F3}} to {{ic|Ctrl+c}}, and {{ic|Alt+Left}} to {{ic|Home}}.<br />
<br />
After installation, create a config file ([https://github.com/wez/evremap/blob/master/pixelbookgo.toml example] from repo), and [[edit]] {{ic|evremap.service}} to point to your config. Then [[start]] the service.<br />
<br />
=== evdevremapkeys ===<br />
<br />
[https://github.com/philipl/evdevremapkeys evdevremapkeys] ({{AUR|evdevremapkeys-git}}) - A daemon to remap key events on linux input devices. This tool can remap keyboard and mouse events. It can map to repeated actions (for example, do double click) and can generate them while button is pressed (for example, generate wheel up events while holding back button).<br />
<br />
It is also possible to remap combo to combo, but this is not yet merged, and is available in pronobis fork. See [https://github.com/philipl/evdevremapkeys/issues/4#issuecomment-407684344 here].<br />
<br />
=== evsieve ===<br />
<br />
[https://github.com/KarsMulder/evsieve evsieve] ({{AUR|evsieve}}) - a low-level utility that can read events from Linux event devices (evdev) and write them to virtual event devices (uinput), performing simple manipulations on the events along the way. Works on Wayland. Evsieve is particularly intended to be used in conjunction with the evdev-passthrough functionality of Qemu.<br />
<br />
=== kbct ===<br />
<br />
[https://github.com/samvel1024/kbct kbct] ({{AUR|kbct-git}}) - Keyboard Customization Tool for Linux. Despite its name, also supports mouse events. This tool allows you to map an event (keyboard or mouse button) to another event. You can define multiple "layers" - lists of maps depending of which modifier you press with an input key. Unfortunately, currently the kbct does not allow you to generate multi-button event. See [https://github.com/samvel1024/kbct/issues/13].<br />
<br />
After installation, edit {{ic|/etc/kbct/config.yml}} as required, then [[start]] {{ic|kbct.service}}.<br />
<br />
=== keyd ===<br />
<br />
[https://github.com/rvaiya/keyd keyd] ({{AUR|keyd}} {{AUR|keyd-git}})<br />
<br />
=== Input Remapper ===<br />
<br />
[https://github.com/sezanzeb/input-remapper/ Input Remapper] {{AUR|input-remapper-git}} - utility that provides a GUI and a CLI to configure remappings. Works with both X and Wayland.<br />
<br />
=== Other ===<br />
<br />
* [https://github.com/mathportillo/wayland-mouse-mapper wayland-mouse-mapper] is a small script for mapping mouse buttons to keystrokes on Wayland.<br />
* [[IMWheel]] is a tool for X11 that can remap mouse wheel events depending on pressed modifier and individually per application.<br />
* [https://github.com/kempniu/evmapy evmapy] - evdev event mapper written in Python. Not in AUR yet.<br />
* [[Mouse buttons#User tools]] - list of hardware-dependent utilities to configure mouse buttons.<br />
* [https://python-evdev.readthedocs.io/en/latest/ python-evdev] - utility that allows you to read and write input events on Linux. An event can be a key or button press, a mouse movement or a tap on a touchscreen.<br />
<br />
== Testing ==<br />
<br />
[https://gitlab.freedesktop.org/libevdev/evtest evtest] ({{Pkg|evtest}}) - utility that can show you the button names when you press them, which can help when configuring remap utilities.<br />
<br />
[https://git.sr.ht/~sircmpwn/wev wev] ({{AUR|wev}}) - utility to view input events in wayland, similar to [[xev]].<br />
<br />
With {{ic|evsieve --input /dev/input/event* --print}} you can see all events that are emitted on your computer.<br />
<br />
Another approach of testing keyboard buttons is with online websites. Most of such testers cannot distinguish between left and right modifiers. One example that can is: https://stendec.io/yakt/.</div>ENV25https://wiki.archlinux.org/index.php?title=Talk:SDDM&diff=752186Talk:SDDM2022-10-11T12:34:40Z<p>ENV25: /* rootless X */ re</p>
<hr />
<div>== Regarding the language support on login ==<br />
<br />
The instructions do no always work (https://bbs.archlinux.org/viewtopic.php?id=196248 and I got this too) but there is a work-around<br />
<br />
"Alternatively, if the above doesn't work for some reason, you could edit the file /usr/share/sddm/scripts/Xsetup and add the command setxkbmap -layout ISO, e.g. setxkbmap -layout se for a Swedish keyboard." I don't know if you want this included or if we are doing something stupid to not getting it to work.<br />
--[[User:Shieldfire|Shieldfire]] ([[User talk:Shieldfire|talk]]) 08:46, 1 June 2015 (UTC)<br />
<br />
== Regarding SDDM and root login ==<br />
There is some discussion on root login in SDDM here: https://forum.kde.org/viewtopic.php?f=289&t=124502&hilit=dolphin+plasma+5#p328070<br />
Don't know if it's a "feature" or something is broken in SDDM or if it's a bug in Arch (and openSuse).<br />
: There's a clear statement from the developer there now stating that it is the intended behaviour. It's a feature; not a bug. (And other posts noting that, really, you shouldn't want to be running an X session as root, for example.) --[[User:Margali|cfr]] ([[User talk:Margali|talk]]) 01:19, 31 August 2022 (UTC)<br />
<br />
== Regarding SDDM 0.14.0 ==<br />
As the default shipped /etc/sddm.conf was changed some parts of the page have to be changed when 0.14.0 lands in [extra]. [[User:Z3ntu|Z3ntu]] ([[User talk:Z3ntu|talk]]) 10:15, 1 September 2016 (UTC)<br />
<br />
== SDDM loading before radeon module (ATI video driver) ==<br />
Some update by 11-Sep-19 made SDDM unable to load normally during the boot process. The Wiki page should encourage the adding of the 'radeon' module in /etc/mkinitcpio.conf [MODULES=(radeon...)]. The update that caused the issue is for sure not related to SDDM, whose version 0.18.1 went out on 31-Mar-19. Probably is kernel or mesa related. [[User:Nicoadamo|Nicoadamo]] ([[User talk:Nicoadamo|talk]])<br />
<br />
:This is already pointed out in various places, e.g. [[ATI#Enable early KMS]]. As you say, it is not related to SDDM. Closing. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 13:55, 21 September 2019 (UTC)<br />
<br />
:I disagree with 'already pointed out in various places'. The article you linked only mentions how to, but never says it is a condition for a Desktop Manager to start properly at boot. [[User:Nicoadamo|Nicoadamo]] ([[User talk:Nicoadamo|talk]])<br />
<br />
::So let's see if more people have this problem. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 07:00, 22 September 2019 (UTC)<br />
<br />
== rootless X ==<br />
<br />
Does sddm support running X rootless? It would be helpful to include a statement about this either way. (I can't find this information anywhere. I thought I'd read sddm didn't support it, but is that still the case? And, if so, is it still the recommended DM for KDE/Plasma?) --[[User:Margali|cfr]] ([[User talk:Margali|talk]]) 01:15, 31 August 2022 (UTC)<br />
<br />
:It looks like is being worked on and there is code for it in the develop branch. You could try it with {{aur|sddm-git}} But it looks like it doesn't work well yet https://github.com/sddm/sddm/issues/1502. If everything goes well, it might be released in the next version, 1.20. —[[User:ENV25|ENV25]] ([[User talk:ENV25|talk]]) 12:30, 11 October 2022 (UTC)<br />
<br />
::https://www.reddit.com/r/kde/comments/uan8a2/got_rootless_xorg_working/ —[[User:ENV25|ENV25]] ([[User talk:ENV25|talk]]) 12:34, 11 October 2022 (UTC)</div>ENV25https://wiki.archlinux.org/index.php?title=Talk:SDDM&diff=752185Talk:SDDM2022-10-11T12:30:46Z<p>ENV25: /* rootless X */ re</p>
<hr />
<div>== Regarding the language support on login ==<br />
<br />
The instructions do no always work (https://bbs.archlinux.org/viewtopic.php?id=196248 and I got this too) but there is a work-around<br />
<br />
"Alternatively, if the above doesn't work for some reason, you could edit the file /usr/share/sddm/scripts/Xsetup and add the command setxkbmap -layout ISO, e.g. setxkbmap -layout se for a Swedish keyboard." I don't know if you want this included or if we are doing something stupid to not getting it to work.<br />
--[[User:Shieldfire|Shieldfire]] ([[User talk:Shieldfire|talk]]) 08:46, 1 June 2015 (UTC)<br />
<br />
== Regarding SDDM and root login ==<br />
There is some discussion on root login in SDDM here: https://forum.kde.org/viewtopic.php?f=289&t=124502&hilit=dolphin+plasma+5#p328070<br />
Don't know if it's a "feature" or something is broken in SDDM or if it's a bug in Arch (and openSuse).<br />
: There's a clear statement from the developer there now stating that it is the intended behaviour. It's a feature; not a bug. (And other posts noting that, really, you shouldn't want to be running an X session as root, for example.) --[[User:Margali|cfr]] ([[User talk:Margali|talk]]) 01:19, 31 August 2022 (UTC)<br />
<br />
== Regarding SDDM 0.14.0 ==<br />
As the default shipped /etc/sddm.conf was changed some parts of the page have to be changed when 0.14.0 lands in [extra]. [[User:Z3ntu|Z3ntu]] ([[User talk:Z3ntu|talk]]) 10:15, 1 September 2016 (UTC)<br />
<br />
== SDDM loading before radeon module (ATI video driver) ==<br />
Some update by 11-Sep-19 made SDDM unable to load normally during the boot process. The Wiki page should encourage the adding of the 'radeon' module in /etc/mkinitcpio.conf [MODULES=(radeon...)]. The update that caused the issue is for sure not related to SDDM, whose version 0.18.1 went out on 31-Mar-19. Probably is kernel or mesa related. [[User:Nicoadamo|Nicoadamo]] ([[User talk:Nicoadamo|talk]])<br />
<br />
:This is already pointed out in various places, e.g. [[ATI#Enable early KMS]]. As you say, it is not related to SDDM. Closing. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 13:55, 21 September 2019 (UTC)<br />
<br />
:I disagree with 'already pointed out in various places'. The article you linked only mentions how to, but never says it is a condition for a Desktop Manager to start properly at boot. [[User:Nicoadamo|Nicoadamo]] ([[User talk:Nicoadamo|talk]])<br />
<br />
::So let's see if more people have this problem. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 07:00, 22 September 2019 (UTC)<br />
<br />
== rootless X ==<br />
<br />
Does sddm support running X rootless? It would be helpful to include a statement about this either way. (I can't find this information anywhere. I thought I'd read sddm didn't support it, but is that still the case? And, if so, is it still the recommended DM for KDE/Plasma?) --[[User:Margali|cfr]] ([[User talk:Margali|talk]]) 01:15, 31 August 2022 (UTC)<br />
<br />
:It looks like is being worked on and there is code for it in the develop branch. You could try it with {{aur|sddm-git}} But it looks like it doesn't work well yet https://github.com/sddm/sddm/issues/1502. If everything goes well, it might be released in the next version, 1.20. —[[User:ENV25|ENV25]] ([[User talk:ENV25|talk]]) 12:30, 11 October 2022 (UTC)</div>ENV25https://wiki.archlinux.org/index.php?title=Talk:KDE_Wallet&diff=752183Talk:KDE Wallet2022-10-11T12:08:28Z<p>ENV25: /* Bug: Using the KDE Wallet to store ssh key passphrases | Bug in Plasma 5.25 */ re</p>
<hr />
<div>== Unlock KDE Wallet automatically on login ==<br />
<br />
Apparently, the use of pam_kwallet-git does not work if the wallet is encrypted with a GnuPG key. --[[User:Fahrgast|Fahrgast]] ([[User talk:Fahrgast|talk]]) 15:10, 28 January 2015 (UTC)<br />
:It is possible use a blank password too to open the wallet automatically according with [https://forum.kde.org/viewtopic.php?t=39258#p56114] [[User:J0n4t|J0n4t]] ([[User talk:J0n4t|talk]]) 19:35, 21 July 2016 (UTC)<br />
<br />
:I offer these comments with some trepidation: Kwallet can be unlocked automatically when using a GnuPG key, but it's complicated. . . complicated enough that I don't quite recall all the details of how it's done. Hence, my trepidation. However, I am using this on one of my machines. The basics are that kwallet is configured to use a GnuGP key, and gnome-keyring is configured to unlock my GnuGP keys automatically. Editing files in /etc/pam.d/ is required, and unfortunately, this is where my knowledge and recollection is lacking. I'm pretty sure that login, sddm-autologin, and passwd in that folder all required editing. I was following someone else's instructions at the time and unfortunately cannot locate them again. I can say that my kwallet configuration is definitely using a GnuGP key, and my Network Manager wifi configuration is set to encrypt my stored wifi password, my GnuGP keys are unlocked automatically by gnome-keyring, and when I log on, my system connects automatically to wifi without my having to key in a wifi password or a kwallet password. If anyone has interest in pursuing this, and possesses a better understanding of PAM than I do, I'm willing to share the contents of my PAM files. If there are any further tricks required, I don't recall what they were unfortunately.<br />
[[User:L userx|L userx]] ([[User talk:L userx|talk]]) 02:27, 20 March 2019 (UTC)<br />
<br />
== Plasma ==<br />
<br />
kwalletmanager in repo is for kde4, and use different path from kde5 ( ./.local/share/kwalletd/kdewallet.kwl ) and also seems to be incompatible (copied/linked kwl file giver password error).<br />
kwalletmanager-git works fine, but is still lacking gpg.<br />
<br />
== kwallet-pam does not unlock KDE Wallet with SDDM ==<br />
<br />
May be helpful: workaround for this bug (or feature) is [https://bbs.archlinux.org/viewtopic.php?pid=1557361#p1557361 here]<br />
<br />
== kwallet-pam for non-graphical login ==<br />
<br />
Can we please get a guide for this? I've added the lines to /etc/pam.d/login but it's not unlocking. Other guides have lines added to /etc/pam.d/passwd but for some reason the file looks different on other distros, or maybe I'm seeing old tutorials. [[User:MisterMustafa|MisterMustafa]] ([[User talk:MisterMustafa|talk]]) 21:06, 27 March 2017 (UTC)<br />
<br />
== Using the KDE Wallet to store ssh key passphrases ==<br />
Had difficulty following this section as it didn't specify how to start ssh-agent. I believe there was a race condition with my chosen method using systemtl --user and KDE. This it makes sense to start the ssh-agent within KDE's startup scripts as mentioned below via [https://archived.forum.manjaro.org/t/howto-use-kwallet-as-a-login-keychain-for-storing-ssh-key-passphrases-on-manjaro-arm-kde/115719 An External Forum Post]<br />
{{Unsigned|05:34, 8 February 2021 (UTC)|Dcraig327}}<br />
<br />
:[[KDE Wallet#Using the KDE Wallet to store ssh key passphrases|Using the KDE Wallet to store ssh key passphrases]] works fine for me with the [[SSH keys#Start ssh-agent with systemd user|systemd user service]]. -- [[User:nl6720|nl6720]] ([[User talk:nl6720|talk]]) 15:47, 8 February 2021 (UTC)<br />
<br />
===Start ssh-agent upon login===<br />
<br />
$ sudo pacman -S kwallet ksshaskpass kwalletmanager<br />
<br />
{{hc|~/.config/plasma-workspace/env/ssh-agent.sh|<br />
#!/bin/sh<br />
<br />
if [ -z "$SSH_AUTH_SOCK" ]; then<br />
eval "$(ssh-agent -s)"<br />
fi<br />
}}<br />
$ chmod u+x ~/.config/plasma-workspace/env/ssh-agent.sh<br />
<br />
== Bug: Using the KDE Wallet to store ssh key passphrases | Bug in Plasma 5.25 ==<br />
<br />
In the section '''Using the KDE Wallet to store ssh key passphrases''',<br />
<br />
The following instruction does not work,<br />
Exec=ssh-add -q ~/.ssh/key1<br />
as per this [https://bugs.kde.org/show_bug.cgi?id=455252 bug], systemd boot was enabled in plasma 5.25.<br />
<br />
I was able to get it to run with<br />
Exec=ssh-add -q /home/username/.ssh/key1<br />
<br />
I'm not sure if this is the best way to do it.<br />
I'll edit it later or someone else can if there are no objections.<br />
<br />
[[User:LowProfile|lowProfile]] ([[User talk:LowProfile|talk]]) 17:09, 28 August 2022 (UTC)<br />
<br />
:Just {{ic|ssh-add .ssh/key1}} should work. Desktop entries run relative to {{ic|$HOME}} anyway.<br />
{{hc|1=pwd.desktop|2=<br />
#!/usr/bin/kioclient exec<br />
[Desktop Entry]<br />
Version=1.0<br />
Type=Application<br />
Terminal=true<br />
Exec=sh -c 'pwd; sleep inf'<br />
}}<br />
$ kioclient exec pwd.desktop<br />
:[[User:ENV25|ENV25]] ([[User talk:ENV25|talk]]) 12:08, 11 October 2022 (UTC)</div>ENV25https://wiki.archlinux.org/index.php?title=Talk:Go_package_guidelines&diff=747875Talk:Go package guidelines2022-09-23T08:39:50Z<p>ENV25: /* Recommend {{ic|1=GOENV=off}} */ new section</p>
<hr />
<div>== Go Modules and Caching ==<br />
<br />
I was recently building a package and noticed that it errored in CI but worked locally. It turned out I had a cached version of a dependency that had been removed upstream. This made me wonder if it wouldn't be good practice to recommend setting: GOCACHE="${srcdir}/cache" or similar before downloading packages so that doing a clean build also destroys the cache.<br />
<br />
[[User:SamWhited|SamWhited]] ([[User talk:SamWhited|talk]]) 05:44, 22 January 2019 (UTC)<br />
<br />
I'm not sure if this is desirable for most users. When I'm not building in a chroot, I want makepkg to use my local cache to build with. This saves me time when building. <br />
<br />
The problem you experienced is a side-effect of the golang community relying on third party hosting for dependencies that aren't immutable, like github. Projects like [https://github.com/gomods/athens Athens] address this by providing a proxy that caches any dependency ever requested of it. If run locally using such a proxy also saves a lot of time downloading dependencies if running in a clean chroot. It can also be set up to run for your CI so that a changed repo doesn't stop your build anymore. This requires exporting GOPROXY in your build to point at the proxy endpoint.<br />
<br />
[[User:Alaskanarcher|Alaskanarcher]] ([[User talk:Alaskanarcher|talk]]) 04:39, 9 May 2019 (UTC)<br />
<br />
== Go Modules, -git packages, and pkgver ==<br />
<br />
For anyone maintaining -git packages of Go tools, the following can be put in pkgver() to output the version that Go Modules uses if you don't have any semver compatible tags. This way, your packages can have a version that someone requiring your tool can drop in their go.mod file:<br />
<br />
git show --abbrev-commit --abbrev=12 --date='format:%G%m%d%H%M%S' --pretty=format:v0.0.0_%cd_%h --no-patch HEAD<br />
<br />
—[[User:SamWhited|SamWhited]] ([[User talk:SamWhited|talk]]) 05:56, 22 January 2019 (UTC)<br />
<br />
EDIT: and if you want to automatically pick up the tag if they start using them, something like this will work:<br />
<br />
TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0" | sed s/-/_/g)<br />
SUFFIX=$(git show --abbrev-commit --abbrev=12 --date='format:%G%m%d%H%M%S' --pretty=format:%cd_%h --no-patch HEAD)<br />
printf '%s_%s' "$TAG" "$SUFFIX"<br />
<br />
[[User:SamWhited|SamWhited]] ([[User talk:SamWhited|talk]]) 15:55, 22 January 2019 (UTC)<br />
<br />
== More detail about best practices for LDFLAGS and patching makefiles ==<br />
<br />
The page currently suggests patching the Makefile or "Export GOFLAGS - This is less desirable as we are dropping flags from LDFLAGS."<br />
<br />
Could someone explain how LDFLAGS should be used when running go build? That would help me understand why the use of GOFLAGS is less desirable, and how I might patch an existing Makefile to make use of LDFLAGS.<br />
<br />
[[User:Alaskanarcher|Alaskanarcher]] ([[User talk:Alaskanarcher|talk]]) 04:20, 9 May 2019 (UTC)<br />
<br />
Additionally, can anyone comment on whether CGO_LDFLAGS should be set for projects that use CGO?<br />
<br />
[[User:Alaskanarcher|Alaskanarcher]] ([[User talk:Alaskanarcher|talk]]) 04:40, 9 May 2019 (UTC)<br />
<br />
<br />
:: {{ic|CGO_LDFLAGS}} is more or less mentioned in the guidelines now [[User:Foxboron|Foxboron]] ([[User talk:Foxboron|talk]]) 11:48, 15 March 2020 (UTC)<br />
<br />
== Add section suggesting the use of GOPROXY when building packages in a clean chroot ==<br />
<br />
When building in a clean chroot, `go build` must fetch all dependencies again. Using a go modules proxy locally like [https://github.com/gomods/athens Athens] dramatically speeds up subsequent builds by allowing all dependencies to be cached for future builds in the clean chroot. I find this extremely helpful when working on my golang PKGBUILDs.<br />
<br />
[[User:Alaskanarcher|Alaskanarcher]] ([[User talk:Alaskanarcher|talk]]) 19:40, 9 May 2019 (UTC)<br />
<br />
:: {{ic|GOPROXY}} shouldn't be used in proper PKGBUILDs. And there is no way for you to whitelist this ENV variable when building with devtools. Setting this inside the PKGBUILD would break for anyone not running a proxy. This is not going to be part of the package guidelines. [[User:Foxboron|Foxboron]] ([[User talk:Foxboron|talk]]) 11:47, 15 March 2020 (UTC)<br />
<br />
== Guidelines should mention proper usage of go mod ==<br />
<br />
The guidelines speak about `go mod` but then make no mention on how to use that properly. Is it `go mod vendor` as I see in some of the official packages or `go mod download`? [[User:Svenstaro|Svenstaro]] ([[User talk:Svenstaro|talk]]) 17:49, 14 January 2020 (UTC)<br />
<br />
== Mention usage of -mod=vendor ==<br />
<br />
The official(?) [https://github.com/golang/go/wiki/Modules go modules wiki] mentions `-mod=vendor` but I don't see a consistent usage on that on our packages. It should be mentioned on when to use that. [[User:Svenstaro|Svenstaro]] ([[User talk:Svenstaro|talk]]) 17:56, 14 January 2020 (UTC)<br />
<br />
: From experience, {{ic|1=-mod=vendor}} should be used when package sources (tarballs, VCS repositories, etc) include a {{ic|vendor}} directory containing {{ic|modules.txt}}. Despite upstream [https://golang.org/ref/mod#build-commands documentation] stating that the {{ic|-mod}} flag can be safely omitted if the go version in the {{ic|go.mod}} file is higher than 1.14, it would be simpler to differentiate between the flag's options ({{ic|readonly}} vs. {{ic|vendor}}).<br />
: [[User:Grawlinson|Grawlinson]] ([[User talk:Grawlinson|talk]]) 00:05, 4 October 2021 (UTC)<br />
<br />
== about -linkmode=external ==<br />
<br />
It's better to let go decide the linkmode. Go programs that don't use net os/user or runtime/cgo let a warning when this flag is used.<br />
<br />
{{hc|1=https://golang.org/src/cmd/cgo/doc.go#L1000|2=<br />
By default, cmd/link will decide the linking mode as follows: if the only<br />
packages using cgo are those on a list of known standard library<br />
packages (net, os/user, runtime/cgo), cmd/link will use internal linking<br />
mode. Otherwise, there are non-standard cgo packages involved, and cmd/link<br />
will use external linking mode. The first rule means that a build of<br />
the godoc binary, which uses net but no other cgo, can run without<br />
needing gcc available. The second rule means that a build of a<br />
cgo-wrapped library like sqlite3 can generate a standalone executable<br />
instead of needing to refer to a dynamic library. The specific choice<br />
can be overridden using a command line flag: cmd/link -linkmode=internal or<br />
cmd/link -linkmode=external.<br />
}}<br />
<br />
Try compiling this simple go program that doesn't use cgo.<br />
<br />
{{hc|1=main.go|2=<br />
package main<br />
<br />
func main() {<br />
println("main")<br />
}<br />
}}<br />
<br />
$ go mod init main<br />
$ go build -ldflags=-linkmode=external<br />
# main<br />
loadinternal: cannot find runtime/cgo<br />
$ go build<br />
<br />
{{Unsigned|06:14, 11 January 2022 (UTC)|ENV25}}<br />
<br />
:: The reason why they are provided is because you need the external linker to provide RELRO and binary hardening, these are not supported by the internal linker. Now, we could argue if they are important or not, but generally we want the hardening we can get.<br />
:: [[User:Foxboron|Foxboron]] ([[User talk:Foxboron|talk]]) 08:39, 11 January 2022 (UTC)<br />
<br />
== Recommend {{ic|1=GOENV=off}} ==<br />
<br />
Go stores environment variable overrides in {{ic|~/.config/go/env}}.<br />
This means that, if not building in a clean chroot, options specified using environment variable might not take effect.<br />
<br />
I think we should mention that in [[Go package guidelines#Flags and build options]] and recommend adding {{ic|1=export GOENV=off}}.<br />
<br />
https://github.com/golang/go/issues/30411<br />
<br />
https://github.com/golang/go/issues/46840<br />
<br />
— [[User:ENV25|ENV25]] ([[User talk:ENV25|talk]]) 08:39, 23 September 2022 (UTC)</div>ENV25https://wiki.archlinux.org/index.php?title=Git&diff=747571Git2022-09-20T12:33:52Z<p>ENV25: /* Git prompt */ expand env var table, direct to full documentation in script</p>
<hr />
<div>[[Category:Version Control System]]<br />
[[Category:Commands]]<br />
[[de:Git]]<br />
[[es:Git]]<br />
[[ja:Git]]<br />
[[zh-hans:Git]]<br />
{{Related articles start}}<br />
{{Related|Bisecting bugs with Git}}<br />
{{Related|Concurrent Versions System}}<br />
{{Related|Git server}}<br />
{{Related|Gitweb}}<br />
{{Related|HTTP tunneling#Tunneling Git}}<br />
{{Related|Subversion}}<br />
{{Related|VCS package guidelines}}<br />
{{Related articles end}}<br />
:"I've met people who thought git is a front-end to GitHub. They were wrong, git is a front-end to the AUR." — [https://public-inbox.org/git/#didyoureallythinklinuswouldsaythat Linus T.]<br />
<br />
[[wikipedia:Git (software)|Git]] is the version control system (VCS) designed and developed by Linus Torvalds, the creator of the Linux kernel. Git is now used to maintain [[AUR]] packages, as well as many other projects, including sources for the Linux kernel.<br />
<br />
== Installation ==<br />
<br />
[[Install]] the {{Pkg|git}} package. For the development version, install the {{AUR|git-git}} package. Check the optional dependencies when using tools such as ''git svn'', ''git gui'' and ''gitk''.<br />
<br />
=== Graphical front-ends ===<br />
<br />
See also [https://git-scm.com/download/gui/linux git GUI Clients].<br />
<br />
* {{App|Giggle|GTK frontend for git.|https://wiki.gnome.org/Apps/giggle/|{{Pkg|giggle}}}}<br />
* {{App|GitAhead|Graphical git client including a built-in Merge Tool.|https://gitahead.github.io/gitahead.com/|{{AUR|gitahead}}}}<br />
* {{App|Git Cola|Sleek and powerful graphical user interface for Git written in Python.|https://git-cola.github.io/|{{AUR|git-cola}}}}<br />
* {{App|Git Extensions|Graphical user interface for Git that allows you to control Git without using the commandline.|https://gitextensions.github.io/|{{AUR|gitextensions}}}}<br />
* {{App|gitg|GNOME GUI client to view git repositories.|https://wiki.gnome.org/Apps/Gitg|{{Pkg|gitg}}}}<br />
* {{App|git-gui|Tcl/Tk based portable graphical interface to Git.|https://git-scm.com/docs/git-gui|{{Pkg|git}} + {{Pkg|tk}}}}<br />
:{{Note|To enable spell checking in ''git-gui'', {{Pkg|aspell}} is required, along with the dictionary corresponding to the {{ic|LC_MESSAGES}} [[environment variable]]. See {{Bug|28181}} and the [[aspell]] article.}}<br />
* {{App|GitHub Desktop|Electron-based graphical user interface built by the GitHub team.|https://github.com/desktop/desktop|{{AUR|github-desktop}} {{AUR|github-desktop-bin}}}}<br />
* {{App|gitk|Tcl/Tk based Git repository browser.|https://git-scm.com/docs/gitk|{{Pkg|git}} + {{Pkg|tk}}}}<br />
* {{App|Guitar|Git GUI Client.|https://github.com/soramimi/Guitar|{{AUR|guitar}}}}<br />
* {{App|lazygit|simple terminal UI for git commands.|https://github.com/jesseduffield/lazygit|{{Pkg|lazygit}}}}<br />
* {{App|QGit|Git GUI viewer to browse revisions history, view patch content and changed files, graphically following different development branches.|https://github.com/tibirna/qgit|{{Pkg|qgit}}}}<br />
* {{App|[[Wikipedia:RabbitVCS|RabbitVCS]]|Set of graphical tools written to provide simple and straightforward access to the version control systems you use.|http://rabbitvcs.org/|{{AUR|rabbitvcs}}}}<br />
* {{App|Sublime Merge|Git Client from the makers of Sublime Text. |https://www.sublimemerge.com/|{{AUR|sublime-merge}}}}<br />
* {{App|Tig|ncurses-based text-mode interface for git.|https://jonas.github.io/tig/|{{Pkg|tig}}}}<br />
* {{App|ungit|Brings user friendliness to git without sacrificing the versatility of git.|https://github.com/FredrikNoren/ungit|{{AUR|nodejs-ungit}}}}<br />
<br />
== Configuration ==<br />
<br />
In order to use Git you need to set at least a name and email:<br />
<br />
$ git config --global user.name "''John Doe''"<br />
$ git config --global user.email "''johndoe@example.com''"<br />
<br />
See [https://git-scm.com/book/en/Getting-Started-First-Time-Git-Setup Getting Started - First-Time Git Setup].<br />
<br />
See [[#Tips and tricks]] for more settings.<br />
<br />
== Usage ==<br />
<br />
A Git repository is contained in a {{ic|.git}} directory, which holds the revision history and other metadata. The directory tracked by the repository, by default the parent directory, is called the working directory. Changes in the working tree need to be staged before they can be recorded (committed) to the repository. Git also lets you restore, previously committed, working tree files.<br />
<br />
See [https://git-scm.com/book/en/Getting-Started-Git-Basics Getting Started - Git Basics].<br />
<br />
=== Getting a Git repository ===<br />
<br />
* Initialize a repository<br />
:{{ic|git init}}, see {{man|1|git-init}}<br />
* Clone an existing repository<br />
:{{ic|git clone ''repository''}}, see {{man|1|git-clone}} (also explains the Git URLs)<br />
<br />
=== Recording changes ===<br />
<br />
Git projects have a staging area, which is an {{ic|index}} file in your Git directory, that stores the changes that will go into your next commit. To record a modified file you therefore firstly need to add it to the index (stage it). The {{ic|git commit}} command then stores the current index in a new commit.<br />
<br />
==== Staging changes ====<br />
<br />
* Add working tree changes to the index<br />
:{{ic|git add ''pathspec''}}, see {{man|1|git-add}}<br />
* Remove changes from the index<br />
:{{ic|git reset ''pathspec''}}, see {{man|1|git-reset}}<br />
* Show changes to be committed, unstaged changes and untracked files<br />
:{{ic|git status}}, see {{man|1|git-status}}<br />
<br />
You can tell Git to ignore certain untracked files using {{ic|.gitignore}} files, see {{man|5|gitignore}}.<br />
<br />
Git does not track file movement. Move detection during merges is based only on content similarity. The {{ic|git mv}} command is just there for convenience and is equivalent to:<br />
<br />
$ mv -i foo bar<br />
$ git reset -- foo<br />
$ git add bar<br />
<br />
==== Committing changes ====<br />
<br />
The {{ic|git commit}} command records the staged changes to the repository, see {{man|1|git-commit}}.<br />
<br />
* {{ic|-m}} – supply the commit message as an argument, instead of composing it in your default text editor<br />
* {{ic|-a}} – automatically stage files that have been modified or deleted (does not add untracked files)<br />
* {{ic|--amend}} – redo the last commit, amending the commit message or the committed files<br />
<br />
{{Tip|Always commit small changes frequently and with meaningful messages.}}<br />
<br />
==== Revision selection ====<br />
<br />
Git offers multiple ways to specify revisions, see {{man|7|gitrevisions}} and [https://git-scm.com/book/en/v2/Git-Tools-Revision-Selection Revision Selection].<br />
<br />
Many Git commands take revisions as arguments. A commit can be identified by any of the following:<br />
<br />
* SHA-1 hash of the commit (the first 7 digits are usually sufficient to identify it uniquely)<br />
* Any commit label such as a branch or tag name<br />
* The label {{ic|HEAD}} always refers to the currently checked-out commit (usually the head of the branch, unless you used ''git checkout'' to jump back in history to an old commit)<br />
* Any of the above plus {{ic|~}} to refer to previous commits. For example, {{ic|HEAD~}} refers to one commit before {{ic|HEAD}} and {{ic|HEAD~5}} refers to five commits before {{ic|HEAD}}.<br />
<br />
==== Viewing changes ====<br />
<br />
Show differences between commits:<br />
<br />
$ git diff HEAD HEAD~3<br />
<br />
or between staging area and working tree:<br />
<br />
$ git diff<br />
<br />
View history of changes (where "''-N''" is the number of latest commits):<br />
<br />
$ git log -p ''(-N)''<br />
<br />
=== Undoing things ===<br />
<br />
* {{ic|git checkout}} - to restore working tree files, see {{man|1|git-checkout}}<br />
* {{ic|git reset}} - reset current HEAD to the specified state, see {{man|1|git-reset}}<br />
* {{ic|git revert}} - revert some existing commits, see {{man|1|git-revert}}<br />
<br />
These, along with few others, are further explained at [https://www.atlassian.com/git/tutorials/undoing-changes undoing-changes].<br />
<br />
For more complex modifications of history, such as {{ic|git commit --amend}} and {{ic|git rebase}} see, for example, [https://www.atlassian.com/git/tutorials/rewriting-history rewriting-history]. It is highly advised not to use such rewrites for commits that were collaborated with other users. Or, at the very least, highly coordinate it in advance.<br />
<br />
=== Branching ===<br />
<br />
{{Expansion|Add links for some common branching models.}}<br />
<br />
Fixes and new features are usually tested in branches. When changes are satisfactory they can merged back into the default (master) branch.<br />
<br />
Create a branch, whose name accurately reflects its purpose:<br />
<br />
$ git branch ''help-section-addition''<br />
<br />
List branches:<br />
<br />
$ git branch<br />
<br />
Switch branches:<br />
<br />
$ git checkout ''branch''<br />
<br />
Create and switch:<br />
<br />
$ git checkout -b ''branch''<br />
<br />
Merge a branch back to the master branch:<br />
<br />
$ git checkout master<br />
$ git merge ''branch''<br />
<br />
The changes will be merged if they do not conflict. Otherwise, Git will print an error message, and annotate files in the working tree to record the conflicts. The annotations can be displayed with {{ic|git diff}}. Conflicts are resolved by editing the files to remove the annotations, and committing the final version. See [[#Dealing with merges]] below.<br />
<br />
When done with a branch, delete it with:<br />
<br />
$ git branch -d ''branch''<br />
<br />
=== Collaboration ===<br />
<br />
A typical Git work-flow is:<br />
<br />
# Create a new repository or clone a remote one.<br />
# Create a branch to make changes; then commit those changes.<br />
# Consolidate commits for better organization/understanding.<br />
# Merge commits back into the main branch.<br />
# (Optional) Push changes to a remote server.<br />
<br />
==== Pull requests ====<br />
<br />
After making and committing some changes, the contributor can ask the original author to merge them. This is called a ''pull request''.<br />
<br />
To pull:<br />
<br />
$ git pull ''location'' master<br />
<br />
The ''pull'' command combines both ''fetching'' and ''merging''. If there are conflicts (e.g. the original author made changes in the same time span), then it will be necessary to manually fix them.<br />
<br />
Alternatively, the original author can pick the changes wanting to be incorporated. Using the ''fetch'' option (and ''log'' option with a special {{ic|FETCH_HEAD}} symbol), the contents of the pull request can be viewed before deciding what to do:<br />
<br />
$ git fetch ''location'' master<br />
$ git log -p HEAD..FETCH_HEAD<br />
$ git merge ''location'' master<br />
<br />
==== Using remotes ====<br />
<br />
Remotes are aliases for tracked remote repositories. A ''label'' is created defining a location. These labels are used to identify frequently accessed repositories.<br />
<br />
Create a remote:<br />
<br />
$ git remote add ''label'' ''location''<br />
<br />
Fetch a remote:<br />
<br />
$ git fetch ''label''<br />
<br />
Show differences between master and a remote master:<br />
<br />
$ git log -p master..''label''/master<br />
<br />
View remotes for the current repository:<br />
<br />
$ git remote -v<br />
<br />
When defining a remote that is a parent of the fork (the project lead), it is defined as ''upstream''.<br />
<br />
==== Push to a repository ====<br />
<br />
After being given rights from the original authors, push changes with:<br />
<br />
$ git push ''location'' ''branch''<br />
<br />
When ''git clone'' is performed, it records the original location and gives it a remote name of {{ic|origin}}.<br />
<br />
So what ''typically'' is done is this:<br />
<br />
$ git push origin master<br />
<br />
If the {{ic|-u}} ({{ic|--set-upstream}}) option is used, the location is recorded so the next time just a {{ic|git push}} is necessary.<br />
<br />
==== Dealing with merges ====<br />
<br />
See [https://git-scm.com/book/en/Git-Branching-Basic-Branching-and-Merging#Basic-Merge-Conflicts Basic Merge Conflicts] in the Git Book for a detailed explanation on how to resolve merge conflicts. Merges are generally reversible. If wanting to back out of a merge one can usually use the {{ic|--abort}} command (e.g. {{ic|git merge --abort}} or {{ic|git pull --abort}}).<br />
<br />
=== History and versioning ===<br />
<br />
==== Searching the history ====<br />
<br />
{{ic|git log}} will give the history with a commit checksum, author, date, and the short message. The ''checksum'' is the "object name" of a commit object, typically a 40-character SHA-1 hash.<br />
<br />
For history with a long message (where the "''checksum''" can be truncated, as long as it is unique):<br />
<br />
$ git show (''checksum'')<br />
<br />
Search for ''pattern'' in tracked files:<br />
<br />
$ git grep ''pattern''<br />
<br />
Search in {{ic|.c}} and {{ic|.h}} files:<br />
<br />
$ git grep ''pattern'' -- '*.[ch]'<br />
<br />
==== Tagging ====<br />
<br />
Tag commits for versioning:<br />
<br />
$ git tag 2.14 ''checksum''<br />
<br />
''Tagging'' is generally done for [https://www.drupal.org/node/1066342 releasing/versioning] but it can be any string. Generally annotated tags are used, because they get added to the Git database.<br />
<br />
Tag the current commit with:<br />
<br />
$ git tag -a 2.14 -m "Version 2.14"<br />
<br />
List tags:<br />
<br />
$ git tag -l<br />
<br />
Delete a tag:<br />
<br />
$ git tag -d 2.08<br />
<br />
Update remote tags:<br />
<br />
$ git push --tags<br />
<br />
==== Organizing commits ====<br />
<br />
Before submitting a pull request it may be desirable to consolidate/organize the commits. This is done with the ''git rebase'' {{ic|--interactive}} option:<br />
<br />
$ git rebase -i ''checksum''<br />
<br />
This will open the editor with a summary of all the commits in the range specified; in this case including the newest ({{ic|HEAD}}) back to, but excluding, commit {{ic|''checksum''}}. Or to use a number notation, use for example {{ic|HEAD~3}}, which will rebase the last three commits:<br />
<br />
pick d146cc7 Mountpoint test.<br />
pick 4f47712 Explain -o option in readme.<br />
pick 8a4d479 Rename documentation.<br />
<br />
Editing the action in the first column will dictate how the rebase will be done. The options are:<br />
<br />
* {{ic|pick}} — Apply this commit as is (the default).<br />
* {{ic|edit}} — Edit files and/or commit message.<br />
* {{ic|reword}} — Edit commit message.<br />
* {{ic|squash}} — Merge/fold into previous commit.<br />
* {{ic|fixup}} — Merge/fold into previous commit discarding its message.<br />
<br />
The commits can be re-ordered or erased from the history (but be very careful with these). After editing the file, Git will perform the specified actions; if prompted to resolve merge problems, fix them and continue with {{ic|git rebase --continue}} or back out with the {{ic|git rebase --abort}} command.<br />
<br />
{{Note|Squashing commits is only used for local commits, it will cause troubles on a repository that is shared by other people.}}<br />
<br />
== Tips and tricks ==<br />
<br />
=== Using git-config ===<br />
<br />
Git reads its configuration from four INI-type configuration files:<br />
<br />
* {{ic|/etc/gitconfig}} for system-wide defaults<br />
* {{ic|~/.gitconfig}} and {{ic|~/.config/git/config}} (since 1.7.12) for user-specific configuration<br />
* {{ic|.git/config}} for repository-specific configuration<br />
<br />
These files can be edited directly, but the usual method is to use ''git config'', as shown in the examples below.<br />
<br />
List the currently set variables:<br />
<br />
$ git config {--local,--global,--system} --list<br />
<br />
Set the default editor from [[vim]] to [[nano]]:<br />
<br />
$ git config --global core.editor "nano -w"<br />
<br />
Set the default push action:<br />
<br />
$ git config --global push.default simple<br />
<br />
Set a different tool for ''git difftool'' (''meld'' by default):<br />
<br />
$ git config --global diff.tool vimdiff<br />
<br />
See {{man|1|git-config}} and [https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration Git Configuration] for more information.<br />
<br />
=== Adopting a good etiquette ===<br />
<br />
* When considering contributing to an existing project, read and understand its license, as it may excessively limit your ability to change the code. Some licenses can generate disputes over the ownership of the code.<br />
* Think about the project's community and how well you can fit into it. To get a feeling of the direction of the project, read any documentation and even the [[#History and versioning|log]] of the repository.<br />
* When requesting to pull a commit, or submit a patch, keep it small and well documented; this will help the maintainers understand your changes and decide whether to merge them or ask you to make some amendments.<br />
* If a contribution is rejected, do not get discouraged, it is their project after all. If it is important, discuss the reasoning for the contribution as clearly and as patiently as possible: with such an approach a resolution may eventually be possible.<br />
<br />
=== Speeding up authentication ===<br />
<br />
You may wish to avoid the hassle of authenticating interactively at every push to the Git server.<br />
<br />
* If you are authenticating with SSH keys, use an [[SSH agent]]. See also [[OpenSSH#Speeding up SSH]] and [[OpenSSH#Keep alive]].<br />
* If you are authenticating with username and password, switch to [[SSH keys]] if the server supports SSH, otherwise use git-credential-libsecret credential helper, or try [https://git-scm.com/docs/git-credential-cache git-credential-cache] or [https://git-scm.com/docs/git-credential-store git-credential-store].<br />
<br />
=== Using git-credential-libsecret as credential-helper ===<br />
<br />
Git may fetch your credentials from a org.freedesktop.secrets compatible keyring like [[GNOME/Keyring]] or [[KeePassXC]]. Therefore set up one compatible keyring and check if a keyring is registered to dbus using:<br />
<br />
dbus-send --session --print-reply --dest=org.freedesktop.DBus / \<br />
org.freedesktop.DBus.GetConnectionUnixProcessID \<br />
string:org.freedesktop.secrets<br />
<br />
then run<br />
<br />
git config --global credential.helper /usr/lib/git-core/git-credential-libsecret<br />
<br />
to set up git.<br />
<br />
=== Protocol defaults ===<br />
<br />
If you are running a multiplexed SSH connection as shown above, Git over SSH might be faster than HTTPS. Also, some servers (like the AUR) only allow pushing via SSH. For example, the following configuration will set Git over SSH for any repository hosted on the AUR.<br />
<br />
{{hc|~/.gitconfig|<nowiki><br />
[url "ssh://aur@aur.archlinux.org/"]<br />
insteadOf = https://aur.archlinux.org/<br />
insteadOf = http://aur.archlinux.org/<br />
insteadOf = git://aur.archlinux.org/<br />
</nowiki>}}<br />
<br />
=== Bash completion ===<br />
<br />
In order to enable Bash completion, source {{ic|/usr/share/git/completion/git-completion.bash}} in a [[Bash#Configuration_files|Bash startup file]]. Alternatively, install {{pkg|bash-completion}}.<br />
<br />
=== Git prompt ===<br />
<br />
The Git package comes with a prompt script. To enable it, source the {{ic|/usr/share/git/completion/git-prompt.sh}} and set a custom prompt with the {{ic|%s}} parameter:<br />
<br />
* For [[Bash]]: {{ic|1=PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ '}}<br />
* For [[zsh]]: {{ic|1=setopt PROMPT_SUBST ; PS1='[%n@%m %c$(__git_ps1 " (%s)")]\$ '}}<br />
<br />
Note that the command substitution must be escaped, see [[Bash/Prompt customization#Embedding commands]] for details. See [[Command-line shell#Configuration files]] for persistent configuration.<br />
<br />
When changing to a directory of a Git repository, the prompt will change to show the branch name. Extra details can be set to be shown by the prompt by setting the corresponding environment variable:<br />
<br />
{| class="wikitable"<br />
|+<br />
! Shell variable !! Information<br />
|-<br />
| GIT_PS1_SHOWDIRTYSTATE || '''+''' for staged, '''*''' if unstaged. <br />
|-<br />
| GIT_PS1_SHOWSTASHSTATE || '''$''' if something is stashed.<br />
|-<br />
| GIT_PS1_SHOWUNTRACKEDFILES || '''%''' if there are untracked files.<br />
|-<br />
| GIT_PS1_SHOWUPSTREAM || '''<''', '''>''', '''<>''' behind, ahead, or diverged from upstream.<br />
|-<br />
| GIT_PS1_STATESEPARATOR || separator between branch name and state symbols<br />
|-<br />
| GIT_PS1_DESCRIBE_STYLE || show commit relative to tag or branch, when detached HEAD<br />
|-<br />
| GIT_PS1_SHOWCOLORHINTS || display in color<br />
|}<br />
<br />
The full documentation for the environment variables is available in the comments of the script.<br />
<br />
{{Note|If you experience that {{ic|$(__git_ps1)}} returns {{ic|((unknown))}}, then there is a {{ic|.git}} folder in your current directory which does not contain any repository, and therefore Git does not recognize it. This can, for example, happen if you mistake Git's configuration file to be {{ic|~/.git/config}} instead of {{ic|~/.gitconfig}}.}}<br />
<br />
Alternatively, you can use one of git shell prompt customization packages from [[AUR]] such as {{AUR|bash-git-prompt}} or {{AUR|gittify}}.<br />
<br />
=== Visual representation ===<br />
<br />
To get an idea of the amount of work done:<br />
<br />
$ git diff --stat<br />
<br />
''git log'' with forking representation:<br />
<br />
$ git log --graph --oneline --decorate<br />
<br />
''git log'' graph alias (i.e. ''git graph'' will show a decorated version):<br />
<br />
$ git config --global alias.graph 'log --graph --oneline --decorate'<br />
<br />
=== Commit tips ===<br />
<br />
Reset to previous commit (very dangerous, erases everything to specified commit):<br />
<br />
$ git reset --hard HEAD^<br />
<br />
If a repository address gets changed, its remote location will need to be updated:<br />
<br />
$ git remote set-url origin git@''address'':''user''/''repo''.git<br />
<br />
Alternatively, edit {{ic|.git/config}} with the new location.<br />
<br />
Signed-off-by line append (a name-email signature is added to the commit which is required by some projects):<br />
<br />
$ git commit -s<br />
<br />
Signed-off-by automatically append to patches (when using {{ic|git format-patch ''commit''}}):<br />
<br />
$ git config --local format.signoff true<br />
<br />
Commit specific parts of files that have changed. This is useful if there are a large number of changes made that would be best split into several commits:<br />
<br />
$ git add -p<br />
<br />
=== Signing commits ===<br />
<br />
Git allows commits and tags to be signed using [[GnuPG]], see [https://git-scm.com/book/en/Git-Tools-Signing-Your-Work Signing Your Work].<br />
<br />
{{Note|To use [[pinentry]] curses for GPG signing make sure to {{ic|1=export GPG_TTY=$(tty)}} (alternatively use pinentry-tty) otherwise the signing step will fail if GPG is currently in a locked state (since it cannot prompt for pin).}}<br />
<br />
To configure Git to automatically sign commits:<br />
<br />
$ git config --global commit.gpgSign true<br />
<br />
=== Working with a non-master branch ===<br />
<br />
Occasionally a maintainer will ask that work be done on a branch. These branches are often called {{ic|devel}} or {{ic|testing}}. Begin by cloning the repository.<br />
<br />
To enter another branch beside master (''git clone'' only shows master branch but others still exist, {{ic|git branch -a}} to show):<br />
<br />
$ git checkout -b ''branch'' origin/''branch''<br />
<br />
Now edit normally; however to keep the repository tree in sync be sure to use both:<br />
<br />
$ git pull --all<br />
$ git push --all<br />
<br />
=== Directly sending patches to a mailing list ===<br />
<br />
If you want to send patches directly to a mailing list, you have to install the following packages: {{Pkg|perl-authen-sasl}} and {{Pkg|perl-io-socket-ssl}}.<br />
<br />
Make sure you have configured your username and e-mail address, see [[#Configuration]].<br />
<br />
Configure your e-mail settings:<br />
<br />
$ git config --global sendemail.smtpserver ''smtp.example.com''<br />
$ git config --global sendemail.smtpserverport ''587''<br />
$ git config --global sendemail.smtpencryption ''tls''<br />
$ git config --global sendemail.smtpuser ''foobar@example.com''<br />
<br />
Now you should be able to send the patch to the mailing list (see also [https://www.openembedded.org/wiki/How_to_submit_a_patch_to_OpenEmbedded#Sending_patches OpenEmbedded:How to submit a patch to OpenEmbedded#Sending patches] and [https://git-send-email.io/ git-send-email.io]):<br />
<br />
$ git add ''filename''<br />
$ git commit -s<br />
$ git send-email --to=''pacman-contrib@lists.archlinux.org'' --confirm=always -M -1<br />
<br />
=== Working with a large git repository ===<br />
<br />
When working with a large remote repository, a significant amount of data has to be fetched. The following examples use the Linux kernel to illustrate how to work with such codebases.<br />
<br />
==== Fetching the entire repository ====<br />
<br />
The easiest solution is to get the entire repository: <br />
<br />
$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git<br />
<br />
{{Note|{{ic|git clone}} cannot be resumed if interrupted.}}<br />
<br />
You can update your repository by {{ic|git pull}}.<br />
<br />
==== Partially fetching the repository ====<br />
<br />
To limit your local repository to a smaller subset of the origin, say after v4.14 to bisect a bug, use a shallow clone:<br />
<br />
$ git clone --shallow-exclude v4.13 git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git<br />
<br />
You will get v4.14 and later, but not v4.13 and older.<br />
<br />
If you only want the latest snapshot, ignoring all history. (If a tarball is available and it suffices, choose that. Downloading from a git repository needs more bandwidth.) You can get it with:<br />
<br />
$ git clone --depth 1 git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git<br />
<br />
You can later obtain older commits, as the two following examples show: <br />
<br />
$ git fetch --tags --shallow-exclude v4.1<br />
$ git fetch --tags --shallow-since 2016-01-01<br />
<br />
{{Note|Without {{ic|--tags}}, tags will not be fetched.}}<br />
<br />
==== Getting other branches ====<br />
<br />
Your local repository tracks, in the above example, only the mainline kernel, i.e. in which the ''latest development is done''. Suppose you want the latest ''LTS'', for example the up-to-date 4.14 branch. You can get it by:<br />
<br />
$ git remote set-branches --add origin linux-4.17.y<br />
$ git fetch<br />
$ git branch --track linux-4.17.y origin/linux-4.17.y<br />
<br />
The last line is not mandatory, but probably wanted.<br />
(To know the name of the branch you want, there is no general rule. You can guess one by seeing the "ref" link in the gitweb interface.) <br />
<br />
For the snapshot of linux-4.17.y, do<br />
<br />
$ git checkout -b linux-4.17.y<br />
<br />
Or to extract it in another directory,<br />
<br />
$ mkdir /path/to/src-4.17; cd /path/to /src-4.17<br />
$ git clone --no-local --depth 1 -b linux-4.17.y ../linux-stable<br />
<br />
As usual, do {{ic|git pull}} to update your snapshot.<br />
<br />
==== Possible alternative ====<br />
<br />
Virtual File System for Git (VFS for Git), allows to access git repositories without a local one. (See [https://blogs.msdn.microsoft.com/bharry/2017/05/24/the-largest-git-repo-on-the-planet/ this Microsoft blog] or the [[wikipedia:Virtual File System for Git|Wikipedia article]].) <br />
<br />
It already has a successor : [https://github.com/microsoft/scalar Scalar], which is available in {{AUR|git-vfs}}, Microsoft's fork of git including gvfs and scalar.<br />
<br />
=== Filtering confidential information ===<br />
<br />
Occasionally, software may keep plain-text passwords in configuration files, as opposed to hooking into a keyring. In these cases, git clean-filters may be handy to avoid accidentally commiting confidential information. E. g., the following file assigns a filter to the file “some-dotfile”:<br />
<br />
{{hc|.gitattributes|<nowiki><br />
some-dotfile filter=remove-pass<br />
</nowiki>}}<br />
<br />
Whenever the file “some-dotfile” is checked into git, git will invoke the filter “remove-pass” on the file before checking it in. The filter must be defined in the git-configuration file, e. g.:<br />
<br />
{{hc|.git/config|<nowiki><br />
[filter "remove-pass"]<br />
clean = "sed -e 's/^password=.*/#password=TODO/'"<br />
</nowiki>}}<br />
<br />
{{Note|Escaping special characters for sed expressions can be a [https://stackoverflow.com/questions/49652495/git-filter-and-sed-fight-over tricky task] in this context. Remember that git is turning two backslashes into one, while the shell that git invokes to run commands will again turn two backslashes into one. For more details, see [https://stackoverflow.com/a/49654653 Git filter and sed fight over `\$`].}}<br />
<br />
=== HTML help files ===<br />
<br />
The {{ic|git help}} documentation is also available in HTML form by installing {{AUR|git-htmldocs}}. After installing, the HTML docs can be accessed by passing the {{ic|-w}} flag. For example:<br />
<br />
$ git help -w merge<br />
<br />
The HTML documentation can be loaded by default by setting a {{ic|git config}} option:<br />
<br />
$ git config --global help.format html<br />
<br />
== Extensions ==<br />
<br />
* {{App|gitflow-avh|Extend git with [https://nvie.com/posts/a-successful-git-branching-model/ Vincent Driessen's branching model]. The AVH Edition adds more functionality.|https://github.com/petervanderdoes/gitflow|{{AUR|gitflow-avh}}}}<br />
* {{App|git-extras|some utilities for git (repo summary, repl,changelog population, author commit percentages, etc.)|https://github.com/tj/git-extras|{{AUR|git-extras}}}} - If you're using [https://ohmyz.sh oh-my-zsh], you may also enable [https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/git-extras git-extras plugin]<br />
<br />
== See also ==<br />
<br />
* Git man pages, see {{man|1|git}}<br />
* [https://git-scm.com/book/en/ Pro Git book]<br />
* [https://git.github.io/git-reference/ Git Reference] by GitHub<br />
* [https://web.archive.org/web/20150316035247/https://nathanhoad.net/git-workflow-forks-remotes-and-pull-requests Git workflow: Forks, remotes, and pull requests]<br />
* [https://wiki.videolan.org/Git VideoLAN wiki article]<br />
* [https://gist.github.com/grawity/4392747 A comparison of protocols GitHubGist]<br />
* [https://gun.io/blog/how-to-github-fork-branch-and-pull-request How to GitHub]</div>ENV25https://wiki.archlinux.org/index.php?title=Uniform_look_for_Qt_and_GTK_applications&diff=745772Uniform look for Qt and GTK applications2022-09-11T13:15:38Z<p>ENV25: /* Consistent file dialog */ Change section name to "Consistent file dialog under KDE Plasma". This is appropriate because the content refers to xdg-desktop-portal-kde. Also setting this environment variable globally causes for GNOME-based DEs Talk:Uniform look for Qt and GTK applications#Tips and tricks - consistent file dialog.</p>
<hr />
<div>[[Category:Widget toolkits]]<br />
[[Category:Eye candy]]<br />
[[ja:Qt と GTK アプリケーションの外観の統合]]<br />
[[ru:Uniform look for Qt and GTK applications]]<br />
[[zh-hans:Uniform look for Qt and GTK applications]]<br />
{{Related articles start}}<br />
{{Related|GTK}}<br />
{{Related|Qt}}<br />
{{Related articles end}}<br />
[[Qt]] and [[GTK]] based programs both use a different widget toolkit to render the graphical user interface. Each come with different themes, styles and icon sets by default, among other things, so the "look and feel" differ significantly. This article will help you make your Qt and GTK applications look similar for a more streamlined and integrated desktop experience.<br />
<br />
== Overview ==<br />
<br />
To get a similar look between the toolkits, you will most likely have to modify the following:<br />
* '''Theme''': The custom appearance of an application, widget set, etc. It usually consists of a style, an icon theme and a color theme.<br />
* '''Style''': The graphical layout and look of the widget set.<br />
* '''Icon Theme''': A set of global icons.<br />
* '''Color Theme''': A set of global colors that are used in conjunction with the style.<br />
<br />
You can choose various approaches:<br />
* Modify [[#Styles for both Qt and GTK|GTK and Qt styles]] separately with the tools listed below for each toolkit and aim for choosing similarly looking themes (style, colors, icons, cursors, fonts).<br />
* Use a special [[#Theme engines|theme engine]], which intermediates the modification of the other graphical toolkit to match your main toolkit.<br />
<br />
== Styles for both Qt and GTK ==<br />
<br />
There are widget style sets available for the purpose of integration, where builds are written and provided for both Qt and GTK, all major versions included. With these, you can have one look for all applications regardless of the toolkit they had been written with.<br />
<br />
{{Tip|You may want to apply user defined styles to root applications, see [[GTK#Theme not applied to root applications]] and [[Qt#Theme not applied to root applications]].}}<br />
{{Note|1=Since version 3.16, GTK 3 [https://bbs.archlinux.org/viewtopic.php?pid=1518404#p1518404 does not support] non-CSS themes, hence previous solutions such as Oxygen-Gtk are [https://bugs.kde.org/show_bug.cgi?id=340288 no longer viable] options.}}<br />
<br />
=== Breeze ===<br />
<br />
Breeze is the default Qt style of KDE Plasma. It can be installed with the {{Pkg|breeze}} package for Qt5, the {{AUR|breeze-kde4}} package for Qt4, and the {{Pkg|breeze-gtk}} package for GTK 2 and GTK 3.<br />
<br />
Once installed, you can use one of the many [[GTK#Configuration tools|GTK configuration tools]] to change the GTK theme. <br />
<br />
If running KDE Plasma, install {{pkg|kde-gtk-config}} and either run it from the command line, or log-out and log-in again and go to ''System Settings > Appearance > Application Style > Configure GNOME/GTK Application Style…''. Fonts, icon themes, cursors, and widget styles set in System Settings affect GTK settings automatically; only the GTK theme should be set manually using the previously mentioned module.<br />
<br />
=== Adwaita ===<br />
<br />
Adwaita is the default GNOME theme. The GTK 3 version is included in the {{Pkg|gtk3}} package, while the GTK 2 version is in {{Pkg|gnome-themes-extra}}. [https://github.com/MartinBriza/adwaita-qt adwaita-qt] is a Qt port of the Adwaita theme. Unlike [[#QGtkStyle]], which mimics the GTK 2 theme, it provides a native Qt style made to look like the GTK 3 Adwaita. It can be [[install|installed]] with the {{AUR|adwaita-qt4}}, {{Pkg|adwaita-qt5}} and {{Pkg|adwaita-qt6}} packages (it might require some time for compiling) for the Qt 4, 5 and 6 versions, respectively.<br />
<br />
To set the Qt style as default:<br />
<br />
* For Qt4, it can be enabled with ''Qt Configuration'' ({{ic|qtconfig-qt4}}), choose ''adwaita'' under ''Appearance > GUI Style''. Alternatively, edit the {{ic|/etc/xdg/Trolltech.conf}} (system-wide) or {{ic|~/.config/Trolltech.conf}} (user-specific) file:<br />
<br />
{{hc|~/.config/Trolltech.conf|2=<br />
...<br />
[Qt]<br />
style=adwaita<br />
...<br />
}}<br />
<br />
* For Qt 5, it can be enabled by setting the following [[Environment variables#Graphical environment|environment variable]]: {{ic|1=QT_STYLE_OVERRIDE=adwaita}}. Alternatively, use {{Pkg|qt5ct}} package. For more detailed instructions, see [[Qt#Configuration of Qt 5 applications under environments other than KDE Plasma]].<br />
<br />
== Theme engines ==<br />
<br />
A ''theme engine'' can be thought of as a thin layer API which translates themes (excluding icons) between one or more toolkits. These engines add some extra code in the process and it is arguable that this kind of a solution is not as elegant and optimal as using native styles.<br />
<br />
=== Kvantum ===<br />
<br />
Kvantum ({{Pkg|kvantum}}) is a customizable SVG-based theme engine for Qt5 that comes with a variety of built-in styles, including versions of some of popular GTK themes such as Adapta, Arc, Ambiance, Libadwaita and Materia.<br />
<br />
Kvantum is treated as a style instead of a platform theme. To set Kvantum for all qt applications using environment variables, issue {{ic|1=QT_STYLE_OVERRIDE=kvantum}}.<br />
<br />
=== QGtkStyle ===<br />
<br />
{{Note|QGtkStyle has been removed from {{Pkg|qt5-base}} 5.7.0 [https://github.com/qtproject/qtbase/commit/899a815414e95da8d9429a4a4f4d7094e49cfc55] and added to {{AUR|qt5-styleplugins}} [https://github.com/qtproject/qtstyleplugins/commit/102da7d50231fc5723dba6e72340bef3d29471aa]}}<br />
<br />
{{Warning|Depending on GTK 2 theme, this style may cause rendering issues such as transparent fonts or inconsistent widgets.}}<br />
<br />
This Qt style uses GTK 2 to render all components to blend in with [[GNOME]] and similar GTK based environments. Beginning with Qt 4.5, this style is included in Qt. It requires {{Pkg|gtk2}} to be installed and configured.<br />
<br />
This is the default Qt4 style in Cinnamon, GNOME and Xfce, and the default Qt5 style in Cinnamon, GNOME, MATE, LXDE and Xfce. In other environments:<br />
<br />
* For Qt4, it can be enabled with ''Qt Configuration'' ({{ic|qtconfig-qt4}}), choose ''GTK'' under ''Appearance > GUI Style''. Alternatively, edit the {{ic|/etc/xdg/Trolltech.conf}} (system-wide) or {{ic|~/.config/Trolltech.conf}} (user-specific) file:<br />
<br />
{{hc|~/.config/Trolltech.conf|2=<br />
...<br />
[Qt]<br />
style=GTK+<br />
...<br />
}}<br />
<br />
* For Qt 5, it can be enabled by installing {{AUR|qt5-styleplugins}} and setting the following [[Environment variables#Graphical environment|environment variable]]: {{ic|1=QT_QPA_PLATFORMTHEME=gtk2}}<br />
<br />
* For Qt 6, it can be enabled by installing {{AUR|qt6gtk2}} and choosing the ''qt6gtk2'' style in {{Pkg|qt6ct}}, or alternatively setting the following environment variable: {{ic|1=QT_QPA_PLATFORMTHEME=gtk2}}<br />
<br />
For full uniformity, make sure that the configured [[GTK#Themes|GTK theme]] supports both GTK 2 and GTK 3. If your preferred theme has inconsistent rendering after configuring Qt to use GTK2, install {{AUR|gtk-theme-switch2}} and choose a theme.<br />
<br />
=== QGnomePlatform ===<br />
<br />
This Qt 5 platform theme applies the appearance settings of GNOME for Qt applications. It can be installed with the {{Pkg|qgnomeplatform-qt5}} package or the {{AUR|qgnomeplatform-git}} package for the development version. It does not provide a Qt style itself, instead it requires a [[#Styles for both Qt and GTK|style that support both Qt and GTK]].<br />
<br />
This platform theme is enabled automatically in GNOME since version 3.20. For other systems, it can be enabled by setting the following [[Environment variables#Graphical environment|environment variable]]: {{ic|1=QT_QPA_PLATFORMTHEME=gnome}}.<br />
<br />
== Tips and tricks ==<br />
<br />
=== Using a GTK icon theme in Qt apps ===<br />
<br />
If you are running [[Plasma]], run {{Pkg|kde-gtk-config}} and select the icon-theme under ''System Settings > Application Style > GTK''.<br />
<br />
If you are using [[GNOME]], run {{Pkg|dconf-editor}} and change the {{ic|icon-theme}} key under ''org > gnome > desktop > interface'' to your preferred icon theme. <br />
<br />
If you are not using a [[Desktop environment]], for example if you are running a minimal system with {{Pkg|i3-wm}}, [[install]] {{Pkg|dconf-editor}} and set the icon-theme as explained above. <br />
You might also have to set the value of {{ic|DESKTOP_SESSION}} in your profile. See [[Environment variables#Defining variables]] for the possible ways to obtain the desired result. <br />
<br />
{{Note| If the icon theme was not applied, you might want to check if the name that you entered of your preferred theme, was in the correct format. For example, if you want to apply the currently active icon theme to your QT applications, you can find the correct format of its name with the command:<br />
<br />
{{bc|1=$ awk -F= '/icon-theme/ {print $2}' ~/.gtkrc-2.0}}<br />
<br />
}}<br />
<br />
=== Add Title bar and frame to GTK3 applications under KDE Plasma ===<br />
<br />
To have Gnome/GTK applications display with a KDE/Plasma title bar and frame, install {{AUR|gtk3-nocsd-git}} and restart your window manager to load the updated library path.<br />
<br />
You can also run Gtk application with the wrapper:<br />
$ gtk3-nocsd gedit<br />
<br />
=== Improve subpixel rendering of GTK apps under KDE Plasma ===<br />
<br />
See [[Font configuration#LCD filter]].<br />
<br />
=== Consistent file dialog under KDE Plasma ===<br />
<br />
In order to have the same file dialog, one can use XDG Portals.<br />
<br />
[[Install]] {{Pkg|xdg-desktop-portal}} and {{Pkg|xdg-desktop-portal-kde}} and set {{ic|1=GTK_USE_PORTAL=1}} [[environment variable]].<br />
<br />
Note that currently not all gtk applications support kde file dialogs correctly. For example, [[Thunderbird]] supports it normally.<br />
<br />
Applications using electron should use at least electron 14 (see [https://github.com/electron/electron/pull/19159 #19159]) and properly implement this function.<br><br />
vscode has a pull request for fixing a problem, see [https://github.com/microsoft/vscode/pull/126113 #126113].<br />
<br />
Meld application from official repository version 3.20.3-1 still opens gtk file picker; version 3.21.1 from {{AUR|meld-git}} opens kde file picker, but fails to open directories, see [https://gitlab.gnome.org/GNOME/meld/-/issues/525 bug report] for more info.<br />
<br />
GIMP has not implemented use of the portal yet, see [https://gitlab.gnome.org/GNOME/gimp/-/issues/1830 bug report].<br />
<br />
{{Note| There are still lots of gtk applications that do not implement portal properly (abandoned applications, or authors are focused on other tasks). To simplify file picking from such applications, you can at least synchronize bookmarks from dolphin to nautilus. Use this command:<br />
{{bc|1=awk -F\" '/<bookmark href=\"file/ {print $2}' < $HOME/.local/share/user-places.xbel > $HOME/.config/gtk-3.0/bookmarks}}<br />
Alternatively, use {{AUR|bookmarksync-git}} for that purpose. There you can manually edit and sync bookmarks to both sides.<br />
}}<br />
<br />
== Troubleshooting ==<br />
<br />
=== Themes not working in GTK apps ===<br />
<br />
If the style or theme engine you set up is not showing in your GTK applications then it is likely your GTK settings files are not being loaded for some reason. You can check where your system expects to find these files by doing the following..<br />
$ export | grep gtk<br />
<br />
Usually the expected files should be {{ic|~/.gtkrc}} for GTK1 and {{ic|~/.gtkrc2.0}} or {{ic|~/.gtkrc2.0-kde}} for GTK 2.x.<br />
<br />
=== GTK apps do not use svg (breeze) icons after system upgrade ===<br />
<br />
Try to run this to fix this issue:<br />
# gdk-pixbuf-query-loaders --update-cache<br />
<br />
=== Flatpak Qt apps do not use Gnome Adwaita dark theme ===<br />
<br />
If you switched your theme to Adwaita-dark and Flatpak Qt applications still use the light version, install the required KStyle:<br />
<br />
# flatpak install flathub org.kde.KStyle.Adwaita<br />
<br />
=== Qt apps run on GNOME Wayland have a non-matching window decoration look, even after setting a Qt theme ===<br />
<br />
In order to have a matching window decoration look, you have to install {{Pkg|qgnomeplatform-qt5}}, and set the following [[Environment variables#Graphical environment|environment variable]]: {{ic|1=QT_QPA_PLATFORMTHEME='gnome'}}<br />
This fix is guaranteed to work with Adwaita or Adwaita-dark.<br />
<br />
=== GTK apps do not fully use KDE system settings ===<br />
<br />
To further integrate [[Plasma]] settings on GTK apps, one may want to [[install]] {{Pkg|gnome-settings-daemon}}, {{Pkg|gsettings-desktop-schemas}} and {{Pkg|gsettings-qt}}. This will offer proper Qt bindings for GTK.<br />
<br />
=== kde-gtk-config "System Settings > Application Style > GTK" menu missing ===<br />
<br />
When {{pkg|kde-gtk-config}} breaks and the "Application Style > GTK" menu is missing from System Settings, it is possible to choose [[GTK#Configuration tools|GTK configuration tools]] like {{pkg|lxappearance}} to be able to configure GTK 2 and GTK 3 styles.<br />
It is desktop independent even if it comes from the LXDE project (it does not require other parts of the LXDE desktop).<br />
<br />
=== Dolphin theming does not match Nautilus well ===<br />
Check the section [[Dolphin#Mismatched folder view background colors|Mismatched folder view background colors]] for how to deal with weird coloring.</div>ENV25https://wiki.archlinux.org/index.php?title=Uniform_look_for_Qt_and_GTK_applications&diff=745771Uniform look for Qt and GTK applications2022-09-11T13:07:39Z<p>ENV25: /* Consistent file dialog */ Remove mention of /etc/environment. This is not needed because we already link to environment variables. Also it causes issues for GNOME based DEs Talk:Uniform look for Qt and GTK applications#Tips and tricks - consistent file dialog.</p>
<hr />
<div>[[Category:Widget toolkits]]<br />
[[Category:Eye candy]]<br />
[[ja:Qt と GTK アプリケーションの外観の統合]]<br />
[[ru:Uniform look for Qt and GTK applications]]<br />
[[zh-hans:Uniform look for Qt and GTK applications]]<br />
{{Related articles start}}<br />
{{Related|GTK}}<br />
{{Related|Qt}}<br />
{{Related articles end}}<br />
[[Qt]] and [[GTK]] based programs both use a different widget toolkit to render the graphical user interface. Each come with different themes, styles and icon sets by default, among other things, so the "look and feel" differ significantly. This article will help you make your Qt and GTK applications look similar for a more streamlined and integrated desktop experience.<br />
<br />
== Overview ==<br />
<br />
To get a similar look between the toolkits, you will most likely have to modify the following:<br />
* '''Theme''': The custom appearance of an application, widget set, etc. It usually consists of a style, an icon theme and a color theme.<br />
* '''Style''': The graphical layout and look of the widget set.<br />
* '''Icon Theme''': A set of global icons.<br />
* '''Color Theme''': A set of global colors that are used in conjunction with the style.<br />
<br />
You can choose various approaches:<br />
* Modify [[#Styles for both Qt and GTK|GTK and Qt styles]] separately with the tools listed below for each toolkit and aim for choosing similarly looking themes (style, colors, icons, cursors, fonts).<br />
* Use a special [[#Theme engines|theme engine]], which intermediates the modification of the other graphical toolkit to match your main toolkit.<br />
<br />
== Styles for both Qt and GTK ==<br />
<br />
There are widget style sets available for the purpose of integration, where builds are written and provided for both Qt and GTK, all major versions included. With these, you can have one look for all applications regardless of the toolkit they had been written with.<br />
<br />
{{Tip|You may want to apply user defined styles to root applications, see [[GTK#Theme not applied to root applications]] and [[Qt#Theme not applied to root applications]].}}<br />
{{Note|1=Since version 3.16, GTK 3 [https://bbs.archlinux.org/viewtopic.php?pid=1518404#p1518404 does not support] non-CSS themes, hence previous solutions such as Oxygen-Gtk are [https://bugs.kde.org/show_bug.cgi?id=340288 no longer viable] options.}}<br />
<br />
=== Breeze ===<br />
<br />
Breeze is the default Qt style of KDE Plasma. It can be installed with the {{Pkg|breeze}} package for Qt5, the {{AUR|breeze-kde4}} package for Qt4, and the {{Pkg|breeze-gtk}} package for GTK 2 and GTK 3.<br />
<br />
Once installed, you can use one of the many [[GTK#Configuration tools|GTK configuration tools]] to change the GTK theme. <br />
<br />
If running KDE Plasma, install {{pkg|kde-gtk-config}} and either run it from the command line, or log-out and log-in again and go to ''System Settings > Appearance > Application Style > Configure GNOME/GTK Application Style…''. Fonts, icon themes, cursors, and widget styles set in System Settings affect GTK settings automatically; only the GTK theme should be set manually using the previously mentioned module.<br />
<br />
=== Adwaita ===<br />
<br />
Adwaita is the default GNOME theme. The GTK 3 version is included in the {{Pkg|gtk3}} package, while the GTK 2 version is in {{Pkg|gnome-themes-extra}}. [https://github.com/MartinBriza/adwaita-qt adwaita-qt] is a Qt port of the Adwaita theme. Unlike [[#QGtkStyle]], which mimics the GTK 2 theme, it provides a native Qt style made to look like the GTK 3 Adwaita. It can be [[install|installed]] with the {{AUR|adwaita-qt4}}, {{Pkg|adwaita-qt5}} and {{Pkg|adwaita-qt6}} packages (it might require some time for compiling) for the Qt 4, 5 and 6 versions, respectively.<br />
<br />
To set the Qt style as default:<br />
<br />
* For Qt4, it can be enabled with ''Qt Configuration'' ({{ic|qtconfig-qt4}}), choose ''adwaita'' under ''Appearance > GUI Style''. Alternatively, edit the {{ic|/etc/xdg/Trolltech.conf}} (system-wide) or {{ic|~/.config/Trolltech.conf}} (user-specific) file:<br />
<br />
{{hc|~/.config/Trolltech.conf|2=<br />
...<br />
[Qt]<br />
style=adwaita<br />
...<br />
}}<br />
<br />
* For Qt 5, it can be enabled by setting the following [[Environment variables#Graphical environment|environment variable]]: {{ic|1=QT_STYLE_OVERRIDE=adwaita}}. Alternatively, use {{Pkg|qt5ct}} package. For more detailed instructions, see [[Qt#Configuration of Qt 5 applications under environments other than KDE Plasma]].<br />
<br />
== Theme engines ==<br />
<br />
A ''theme engine'' can be thought of as a thin layer API which translates themes (excluding icons) between one or more toolkits. These engines add some extra code in the process and it is arguable that this kind of a solution is not as elegant and optimal as using native styles.<br />
<br />
=== Kvantum ===<br />
<br />
Kvantum ({{Pkg|kvantum}}) is a customizable SVG-based theme engine for Qt5 that comes with a variety of built-in styles, including versions of some of popular GTK themes such as Adapta, Arc, Ambiance, Libadwaita and Materia.<br />
<br />
Kvantum is treated as a style instead of a platform theme. To set Kvantum for all qt applications using environment variables, issue {{ic|1=QT_STYLE_OVERRIDE=kvantum}}.<br />
<br />
=== QGtkStyle ===<br />
<br />
{{Note|QGtkStyle has been removed from {{Pkg|qt5-base}} 5.7.0 [https://github.com/qtproject/qtbase/commit/899a815414e95da8d9429a4a4f4d7094e49cfc55] and added to {{AUR|qt5-styleplugins}} [https://github.com/qtproject/qtstyleplugins/commit/102da7d50231fc5723dba6e72340bef3d29471aa]}}<br />
<br />
{{Warning|Depending on GTK 2 theme, this style may cause rendering issues such as transparent fonts or inconsistent widgets.}}<br />
<br />
This Qt style uses GTK 2 to render all components to blend in with [[GNOME]] and similar GTK based environments. Beginning with Qt 4.5, this style is included in Qt. It requires {{Pkg|gtk2}} to be installed and configured.<br />
<br />
This is the default Qt4 style in Cinnamon, GNOME and Xfce, and the default Qt5 style in Cinnamon, GNOME, MATE, LXDE and Xfce. In other environments:<br />
<br />
* For Qt4, it can be enabled with ''Qt Configuration'' ({{ic|qtconfig-qt4}}), choose ''GTK'' under ''Appearance > GUI Style''. Alternatively, edit the {{ic|/etc/xdg/Trolltech.conf}} (system-wide) or {{ic|~/.config/Trolltech.conf}} (user-specific) file:<br />
<br />
{{hc|~/.config/Trolltech.conf|2=<br />
...<br />
[Qt]<br />
style=GTK+<br />
...<br />
}}<br />
<br />
* For Qt 5, it can be enabled by installing {{AUR|qt5-styleplugins}} and setting the following [[Environment variables#Graphical environment|environment variable]]: {{ic|1=QT_QPA_PLATFORMTHEME=gtk2}}<br />
<br />
* For Qt 6, it can be enabled by installing {{AUR|qt6gtk2}} and choosing the ''qt6gtk2'' style in {{Pkg|qt6ct}}, or alternatively setting the following environment variable: {{ic|1=QT_QPA_PLATFORMTHEME=gtk2}}<br />
<br />
For full uniformity, make sure that the configured [[GTK#Themes|GTK theme]] supports both GTK 2 and GTK 3. If your preferred theme has inconsistent rendering after configuring Qt to use GTK2, install {{AUR|gtk-theme-switch2}} and choose a theme.<br />
<br />
=== QGnomePlatform ===<br />
<br />
This Qt 5 platform theme applies the appearance settings of GNOME for Qt applications. It can be installed with the {{Pkg|qgnomeplatform-qt5}} package or the {{AUR|qgnomeplatform-git}} package for the development version. It does not provide a Qt style itself, instead it requires a [[#Styles for both Qt and GTK|style that support both Qt and GTK]].<br />
<br />
This platform theme is enabled automatically in GNOME since version 3.20. For other systems, it can be enabled by setting the following [[Environment variables#Graphical environment|environment variable]]: {{ic|1=QT_QPA_PLATFORMTHEME=gnome}}.<br />
<br />
== Tips and tricks ==<br />
<br />
=== Using a GTK icon theme in Qt apps ===<br />
<br />
If you are running [[Plasma]], run {{Pkg|kde-gtk-config}} and select the icon-theme under ''System Settings > Application Style > GTK''.<br />
<br />
If you are using [[GNOME]], run {{Pkg|dconf-editor}} and change the {{ic|icon-theme}} key under ''org > gnome > desktop > interface'' to your preferred icon theme. <br />
<br />
If you are not using a [[Desktop environment]], for example if you are running a minimal system with {{Pkg|i3-wm}}, [[install]] {{Pkg|dconf-editor}} and set the icon-theme as explained above. <br />
You might also have to set the value of {{ic|DESKTOP_SESSION}} in your profile. See [[Environment variables#Defining variables]] for the possible ways to obtain the desired result. <br />
<br />
{{Note| If the icon theme was not applied, you might want to check if the name that you entered of your preferred theme, was in the correct format. For example, if you want to apply the currently active icon theme to your QT applications, you can find the correct format of its name with the command:<br />
<br />
{{bc|1=$ awk -F= '/icon-theme/ {print $2}' ~/.gtkrc-2.0}}<br />
<br />
}}<br />
<br />
=== Add Title bar and frame to GTK3 applications under KDE Plasma ===<br />
<br />
To have Gnome/GTK applications display with a KDE/Plasma title bar and frame, install {{AUR|gtk3-nocsd-git}} and restart your window manager to load the updated library path.<br />
<br />
You can also run Gtk application with the wrapper:<br />
$ gtk3-nocsd gedit<br />
<br />
=== Improve subpixel rendering of GTK apps under KDE Plasma ===<br />
<br />
See [[Font configuration#LCD filter]].<br />
<br />
=== Consistent file dialog ===<br />
<br />
In order to have the same file dialog, one can use XDG Portals.<br />
<br />
[[Install]] {{Pkg|xdg-desktop-portal}} and {{Pkg|xdg-desktop-portal-kde}} and set {{ic|1=GTK_USE_PORTAL=1}} [[environment variable]].<br />
<br />
Note that currently not all gtk applications support kde file dialogs correctly. For example, [[Thunderbird]] supports it normally.<br />
<br />
Applications using electron should use at least electron 14 (see [https://github.com/electron/electron/pull/19159 #19159]) and properly implement this function.<br><br />
vscode has a pull request for fixing a problem, see [https://github.com/microsoft/vscode/pull/126113 #126113].<br />
<br />
Meld application from official repository version 3.20.3-1 still opens gtk file picker; version 3.21.1 from {{AUR|meld-git}} opens kde file picker, but fails to open directories, see [https://gitlab.gnome.org/GNOME/meld/-/issues/525 bug report] for more info.<br />
<br />
GIMP has not implemented use of the portal yet, see [https://gitlab.gnome.org/GNOME/gimp/-/issues/1830 bug report].<br />
<br />
{{Note| There are still lots of gtk applications that do not implement portal properly (abandoned applications, or authors are focused on other tasks). To simplify file picking from such applications, you can at least synchronize bookmarks from dolphin to nautilus. Use this command:<br />
{{bc|1=awk -F\" '/<bookmark href=\"file/ {print $2}' < $HOME/.local/share/user-places.xbel > $HOME/.config/gtk-3.0/bookmarks}}<br />
Alternatively, use {{AUR|bookmarksync-git}} for that purpose. There you can manually edit and sync bookmarks to both sides.<br />
}}<br />
<br />
== Troubleshooting ==<br />
<br />
=== Themes not working in GTK apps ===<br />
<br />
If the style or theme engine you set up is not showing in your GTK applications then it is likely your GTK settings files are not being loaded for some reason. You can check where your system expects to find these files by doing the following..<br />
$ export | grep gtk<br />
<br />
Usually the expected files should be {{ic|~/.gtkrc}} for GTK1 and {{ic|~/.gtkrc2.0}} or {{ic|~/.gtkrc2.0-kde}} for GTK 2.x.<br />
<br />
=== GTK apps do not use svg (breeze) icons after system upgrade ===<br />
<br />
Try to run this to fix this issue:<br />
# gdk-pixbuf-query-loaders --update-cache<br />
<br />
=== Flatpak Qt apps do not use Gnome Adwaita dark theme ===<br />
<br />
If you switched your theme to Adwaita-dark and Flatpak Qt applications still use the light version, install the required KStyle:<br />
<br />
# flatpak install flathub org.kde.KStyle.Adwaita<br />
<br />
=== Qt apps run on GNOME Wayland have a non-matching window decoration look, even after setting a Qt theme ===<br />
<br />
In order to have a matching window decoration look, you have to install {{Pkg|qgnomeplatform-qt5}}, and set the following [[Environment variables#Graphical environment|environment variable]]: {{ic|1=QT_QPA_PLATFORMTHEME='gnome'}}<br />
This fix is guaranteed to work with Adwaita or Adwaita-dark.<br />
<br />
=== GTK apps do not fully use KDE system settings ===<br />
<br />
To further integrate [[Plasma]] settings on GTK apps, one may want to [[install]] {{Pkg|gnome-settings-daemon}}, {{Pkg|gsettings-desktop-schemas}} and {{Pkg|gsettings-qt}}. This will offer proper Qt bindings for GTK.<br />
<br />
=== kde-gtk-config "System Settings > Application Style > GTK" menu missing ===<br />
<br />
When {{pkg|kde-gtk-config}} breaks and the "Application Style > GTK" menu is missing from System Settings, it is possible to choose [[GTK#Configuration tools|GTK configuration tools]] like {{pkg|lxappearance}} to be able to configure GTK 2 and GTK 3 styles.<br />
It is desktop independent even if it comes from the LXDE project (it does not require other parts of the LXDE desktop).<br />
<br />
=== Dolphin theming does not match Nautilus well ===<br />
Check the section [[Dolphin#Mismatched folder view background colors|Mismatched folder view background colors]] for how to deal with weird coloring.</div>ENV25https://wiki.archlinux.org/index.php?title=Talk:Intel_graphics&diff=730387Talk:Intel graphics2022-05-22T07:51:13Z<p>ENV25: /* "Enable GuC / HuC firmware loading" seems to use wrong values for {{ic|1=enable_guc=}} */ reply</p>
<hr />
<div>== [drm:intel_pipe_update_start [i915]] *ERROR* Potential atomic update failure on pipe A ==<br />
<br />
Maybe the solution to get rid of the above dmesg log spamming could be mentioned? You just add `options i915 enable_psr=0` to the file `/etc/modprobe.d/i915.conf`. [[User:Bjourne|Bjourne]] ([[User talk:Bjourne|talk]]) 17:04, 19 August 2016 (UTC)<br />
<br />
== Backlight is not adjustable after trying various acpi_osi values ==<br />
<br />
[http://unix.stackexchange.com/q/315178/3645 Full details] on Stack Exchange.<br />
<br />
{{unsigned|20:04, 8 October 2016|L0b0}}<br />
<br />
== DRI3 confusion ==<br />
<br />
I've seen in the forum people ask from time to time how to enable DRI3 on their system.<br />
<br />
As stated many times there, DRI3 should be on for most (if not all) of them. But people keep telling them to check<br />
<br />
cat /var/log/Xorg.0.log | grep DRI<br />
<br />
which shows up this message:<br />
<br />
GLX: Initialized DRI2 GL provider for screen 0<br />
<br />
which is *not accurate*.<br />
<br />
If you run this command instead:<br />
<br />
LC_ALL=C LIBGL_DEBUG=verbose glxinfo | grep DRI<br />
<br />
you might stump with this other message:<br />
<br />
libGL: Using DRI3 for screen 0<br />
<br />
which proves you are using DRI3 even though X11 doesn't reply with the correct information.<br />
<br />
The command was adapted from [https://lists.x.org/archives/xorg-devel/2014-June/042735.html xorg mailing list].<br />
<br />
So, it think adding this information in the page could be of major interest. What do you think?<br />
<br />
[[User:Franzrogar|Franzrogar]] ([[User talk:Franzrogar|talk]]) 07:01, 4 November 2016 (UTC)<br />
<br />
== Guide for screen scaling with external displays via xrandr? ==<br />
<br />
I tried to find instructions for scaling the display resolution without stretching on this wiki page, but the section only says that it's not implemented in the Intel drivers yet. However, [https://unix.stackexchange.com/questions/220387/how-to-set-scaling-mode-for-external-displays-on-intel-gpu this stackexchange thread] has a workaround using an xrandr transform matrix. Should this be added to the wiki page?<br />
<br />
[[User:Ibara|Ibara]] ([[User talk:Ibara|talk]]) 12:35, 22 May 2017 (UTC)<br />
<br />
== Screen flickering ==<br />
Intel's power saving features might lead to flickering on some devices visible in the desktop, login manager and even in the konsole. Add the kernel parameter {{ic|1=intel_idle.max_cstate=1}} and reboot.<br />
<br />
{{unsigned|20:57, 3 November 2020|R41n3r}}<br />
<br />
== Driver issues on 11th Gen CPU ==<br />
<br />
I've just left a comment in [[Talk:Dell_XPS_13_(9310)#Video drivers]] about issues with modesetting drivers on the new XPS 13. The issue appears when using modesetting drivers and is resolved when installing the xf86-video-intel package, which seems to go against most of the advice in this Wiki and the internet at large. The issue is not simple to describe, so I will just copy-paste what I've written on the other page: "some weird jittery behaviour in the rendering of text. For example, when attempting to type 'wiki.archlinux.org' in a browser address field the text rendering would suddenly jump back by 1/2 strokes (I'm typing 'ch', the 'c' appears shortly but the screen immediately refreshes to only show 'wiki.a') and refuse to update for maybe a second. It would then catch up if I kept typing."<br />
Is this a known issue with 11th Gen Intel CPUs? The model I have has an i7-1165G7, which includes the new Intel Iris Xe Graphics.<br />
[[User:Avernan|Avernan]] ([[User talk:Avernan|talk]]) 17:16, 30 December 2020 (UTC)<br />
<br />
== Washed colors on 7th gen CPU ==<br />
<br />
I found out that my iGPU shows washed colors randomly, but I managed to fix it by adding intel_agp and i915 modules into mkinitcpio.conf and rebuilding the initramfs after that. <br />
<br />
[[User:Myghi63|Paulo Marcos]] 11:37, 24 June 2021 (UTC)<br />
<br />
== GuC/HuC firmware loading not enabled by default on Gen 11+ hardware? ==<br />
<br />
It wasn't for me. Also:<br />
<br />
''As of now, HuC firmware support is disabled in Linux kernels by default.''<br />
<br />
Source: https://github.com/intel/media-driver#known-issues-and-limitations<br />
<br />
''HUC which is disabled by default on TGL in i915 driver''<br />
<br />
TGL being Tiger Lake - Source: https://github.com/intel/media-driver/issues/1149#issuecomment-785572865<br />
<br />
--[[User:Schlaefer|Schlaefer]] ([[User talk:Schlaefer|talk]]) 13:57, 7 November 2021 (UTC)<br />
<br />
== Potential performance gains via Observation Architecture ==<br />
<br />
[https://www.reddit.com/r/linux/comments/u7zxa0/psa_for_intel_tiger_lake_dynamic_tuning_laptops/ This /r/linux thread] claims the following:<br />
: Dynamic Tuning is not enabled in most distros due to late Intel KMS. Running "sudo sysctl dev.i915.pref_stream_paranoid=0" drastically improves game performance and clock management on relevant processors, specifically Tiger Lake.<br />
{{ic|dev.i915.perf_stream_paranoid}} was introduced in [https://patchwork.kernel.org/project/dri-devel/patch/20161020211910.4723-8-robert@sixbynine.org/ this Kernel commit], and its usage was [https://gitlab.freedesktop.org/mesa/mesa/-/commit/2001a80d4a81f2e8194b29cca301dd1b27be9acb introduced to Mesa in this commmit]. It now lives in [https://github.com/torvalds/linux/blob/v5.17/drivers/gpu/drm/i915/i915_perf.c linux/drivers/gpu/drm/i915/i915_perf.c]. This setting controls whether "non-root users [are allowed] to access system wide OA counter metrics". OA refers to Intel's [https://www.phoronix.com/scan.php?page=news_item&px=Intel-HSW-Observation-Arch Observation Architecture], and is [https://www.phoronix.com/scan.php?page=news_item&px=Intel-Mesa-OA-Perf-Counters used to provide performance info to applications].<br><br />
As I understand, the {{ic|perf_stream_paranoid}} family of options all may make a difference in whether applications are able to receive certain performance metrics. This is read-only information, and yet some users are reporting dramatic performance increases. What's more is that it's unclear whether early KMS fixes the issue; [https://forum.manjaro.org/t/cant-change-dev-i915-perf-stream-paranoid-to-0/66339/10 this Manjaro forum post] says it does, but the Reddit OP [https://www.reddit.com/r/linux/comments/u7zxa0/comment/i5ia8go/?utm_source=reddit&utm_medium=web2x&context=3 says otherwise]. Cheers, [[User:CodingKoopa|CodingKoopa]] ([[User talk:CodingKoopa|talk]]) 2022-04-21T02:38:34<br />
<br />
: I don't have the exact hardware to benchmark this, but on my (relatively old now) Skylake processor, I did not feel any difference. Neither from the perf_stream sysctl knob nor from early KMS. --[[User:Erus Iluvatar|Erus Iluvatar]] ([[User talk:Erus Iluvatar|talk]]) 06:55, 21 April 2022 (UTC)<br />
<br />
::[https://www.phoronix.com/scan.php?page=news_item&px=Intel-HSW-Observation-Arch Phoronix says that it's Haswell and newer], so your Skylake should just be fine. It's possible that the sysctl option makes no difference (that is, because of the permission to use the performance counter being present anyways), either because of your setup using Early KMS, or because of some Arch default. I think that a good test would be to disable Early KMS (e.g. take the i915 module out of the initrd), and run a program that triggers the {{ic|1=Performance support disabled, consider sysctl dev.i915.perf_stream_paranoid=0}} [https://gitlab.freedesktop.org/mesa/mesa/-/blob/68e8f00c441dc38f5a18a4aa5a30916c53fc986f/src/intel/vulkan/anv_perf.c#L60-L61 codepath]. I'm under the impression that affected applications are Vulkan programs which use the [https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VK_KHR_performance_query.html VK_KHR_performance_query extension] [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2775]. That said, I'm not sure how to reliably pick out affected programs, seeing as people are reporting this with Wine games, but DXVK does not use this extension. Cheers, [[User:CodingKoopa|CodingKoopa]] ([[User talk:CodingKoopa|talk]]) 17:05, 21 April 2022 (UTC)<br />
<br />
::: I'll try to find some time to benchmark this on the weekend, I probably have some random game on Steam that both uses Vulkan and runs through Wine. --[[User:Erus Iluvatar|Erus Iluvatar]] ([[User talk:Erus Iluvatar|talk]]) 18:35, 21 April 2022 (UTC)<br />
<br />
== "Enable GuC / HuC firmware loading" seems to use wrong values for {{ic|1=enable_guc=}} ==<br />
<br />
https://01.org/linuxgraphics/downloads/firmware<br />
<br />
According to the above page, {{ic|1=enable_guc=1}} enables GuC features, {{ic|1=enable_guc=2}} enables HuC features and {{ic|1=enable_guc=3}} enables both together.<br />
<br />
Current version of [[Intel_graphics#Enable GuC / HuC firmware loading]] suggests using {{ic|1=enable_guc=2}} for GuC and HuC firmware loading.<br />
<br />
[[User:ENV25|ENV25]] ([[User talk:ENV25|talk]]) 11:27, 18 May 2022 (UTC)<br />
<br />
:I see that Intel says that on their site, but I'm having difficulty verifying that in the kernel source. This setup with up to {{ic|1=enable_guc=3}} is the case for the patch series [https://patchwork.kernel.org/project/intel-gfx/patch/1511812473-16897-2-git-send-email-sujaritha.sundaresan@intel.com/ Removing enable_guc_loading and enable_guc_submission module parameters], but I don't think this was merged into the mainline kernel. Rather, I think the implementation from the patch series [https://patchwork.kernel.org/project/intel-gfx/patch/20171205163844.41264-6-michal.wajdeczko@intel.com/ Combine enable_guc_loading|submission modparams] is what was merged, for which the current wiki is actually correct. I determined this by looking at the blame for {{ic|enable_guc}}, as we can see [https://github.com/torvalds/linux/commit/121981fafe699d9f398a3c717912ef4eae6719b1 the commit] where this was added.<br />
:Essentially, it seems like that Intel page is wrong and reflects an earlier version of the GuC parameter. Cheers, [[User:CodingKoopa|CodingKoopa]] ([[User talk:CodingKoopa|talk]]) 08:53, 20 May 2022 (UTC).<br />
<br />
:: You are correct. You can verify in the current version of the file. https://github.com/archlinux/linux/blob/master/drivers/gpu/drm/i915/i915_params.c —[[User:ENV25|ENV25]] ([[User talk:ENV25|talk]]) 06:44, 21 May 2022 (UTC)<br />
<br />
:: Never mind I think you can still be wrong. Perhaps this flag uses a bit field. Where {{ic|0}} is {{ic|0b0000}}, {{ic|1}} is {{ic|0b0001}}, {{ic|2}} is {{ic|0b0010}} and {{ic|3}} => {{ic|0b0011}}. —[[User:ENV25|ENV25]] ([[User talk:ENV25|talk]]) 06:53, 21 May 2022 (UTC)<br />
<br />
:::Great point! You're right, I addressed it in the wiki now. Thanks, [[User:CodingKoopa|CodingKoopa]] ([[User talk:CodingKoopa|talk]]) 19:20, 21 May 2022 (UTC)<br />
<br />
:::: Thanks! I just tried out {{ic|1=enable_guc=4}} and there was an undocumented option message in {{ic|dmesg | grep -E -i 'guc|huc'}}. I didn't get that when I used {{ic|1=enable_guc=3}} so I'm pretty confident the new information is correct.</div>ENV25https://wiki.archlinux.org/index.php?title=Talk:Intel_graphics&diff=730314Talk:Intel graphics2022-05-21T06:53:43Z<p>ENV25: /* "Enable GuC / HuC firmware loading" seems to use wrong values for {{ic|1=enable_guc=}} */ sign</p>
<hr />
<div>== [drm:intel_pipe_update_start [i915]] *ERROR* Potential atomic update failure on pipe A ==<br />
<br />
Maybe the solution to get rid of the above dmesg log spamming could be mentioned? You just add `options i915 enable_psr=0` to the file `/etc/modprobe.d/i915.conf`. [[User:Bjourne|Bjourne]] ([[User talk:Bjourne|talk]]) 17:04, 19 August 2016 (UTC)<br />
<br />
== Backlight is not adjustable after trying various acpi_osi values ==<br />
<br />
[http://unix.stackexchange.com/q/315178/3645 Full details] on Stack Exchange.<br />
<br />
{{unsigned|20:04, 8 October 2016|L0b0}}<br />
<br />
== DRI3 confusion ==<br />
<br />
I've seen in the forum people ask from time to time how to enable DRI3 on their system.<br />
<br />
As stated many times there, DRI3 should be on for most (if not all) of them. But people keep telling them to check<br />
<br />
cat /var/log/Xorg.0.log | grep DRI<br />
<br />
which shows up this message:<br />
<br />
GLX: Initialized DRI2 GL provider for screen 0<br />
<br />
which is *not accurate*.<br />
<br />
If you run this command instead:<br />
<br />
LC_ALL=C LIBGL_DEBUG=verbose glxinfo | grep DRI<br />
<br />
you might stump with this other message:<br />
<br />
libGL: Using DRI3 for screen 0<br />
<br />
which proves you are using DRI3 even though X11 doesn't reply with the correct information.<br />
<br />
The command was adapted from [https://lists.x.org/archives/xorg-devel/2014-June/042735.html xorg mailing list].<br />
<br />
So, it think adding this information in the page could be of major interest. What do you think?<br />
<br />
[[User:Franzrogar|Franzrogar]] ([[User talk:Franzrogar|talk]]) 07:01, 4 November 2016 (UTC)<br />
<br />
== Guide for screen scaling with external displays via xrandr? ==<br />
<br />
I tried to find instructions for scaling the display resolution without stretching on this wiki page, but the section only says that it's not implemented in the Intel drivers yet. However, [https://unix.stackexchange.com/questions/220387/how-to-set-scaling-mode-for-external-displays-on-intel-gpu this stackexchange thread] has a workaround using an xrandr transform matrix. Should this be added to the wiki page?<br />
<br />
[[User:Ibara|Ibara]] ([[User talk:Ibara|talk]]) 12:35, 22 May 2017 (UTC)<br />
<br />
== Screen flickering ==<br />
Intel's power saving features might lead to flickering on some devices visible in the desktop, login manager and even in the konsole. Add the kernel parameter {{ic|1=intel_idle.max_cstate=1}} and reboot.<br />
<br />
{{unsigned|20:57, 3 November 2020|R41n3r}}<br />
<br />
== Driver issues on 11th Gen CPU ==<br />
<br />
I've just left a comment in [[Talk:Dell_XPS_13_(9310)#Video drivers]] about issues with modesetting drivers on the new XPS 13. The issue appears when using modesetting drivers and is resolved when installing the xf86-video-intel package, which seems to go against most of the advice in this Wiki and the internet at large. The issue is not simple to describe, so I will just copy-paste what I've written on the other page: "some weird jittery behaviour in the rendering of text. For example, when attempting to type 'wiki.archlinux.org' in a browser address field the text rendering would suddenly jump back by 1/2 strokes (I'm typing 'ch', the 'c' appears shortly but the screen immediately refreshes to only show 'wiki.a') and refuse to update for maybe a second. It would then catch up if I kept typing."<br />
Is this a known issue with 11th Gen Intel CPUs? The model I have has an i7-1165G7, which includes the new Intel Iris Xe Graphics.<br />
[[User:Avernan|Avernan]] ([[User talk:Avernan|talk]]) 17:16, 30 December 2020 (UTC)<br />
<br />
== Washed colors on 7th gen CPU ==<br />
<br />
I found out that my iGPU shows washed colors randomly, but I managed to fix it by adding intel_agp and i915 modules into mkinitcpio.conf and rebuilding the initramfs after that. <br />
<br />
[[User:Myghi63|Paulo Marcos]] 11:37, 24 June 2021 (UTC)<br />
<br />
== GuC/HuC firmware loading not enabled by default on Gen 11+ hardware? ==<br />
<br />
It wasn't for me. Also:<br />
<br />
''As of now, HuC firmware support is disabled in Linux kernels by default.''<br />
<br />
Source: https://github.com/intel/media-driver#known-issues-and-limitations<br />
<br />
''HUC which is disabled by default on TGL in i915 driver''<br />
<br />
TGL being Tiger Lake - Source: https://github.com/intel/media-driver/issues/1149#issuecomment-785572865<br />
<br />
--[[User:Schlaefer|Schlaefer]] ([[User talk:Schlaefer|talk]]) 13:57, 7 November 2021 (UTC)<br />
<br />
== Potential performance gains via Observation Architecture ==<br />
<br />
[https://www.reddit.com/r/linux/comments/u7zxa0/psa_for_intel_tiger_lake_dynamic_tuning_laptops/ This /r/linux thread] claims the following:<br />
: Dynamic Tuning is not enabled in most distros due to late Intel KMS. Running "sudo sysctl dev.i915.pref_stream_paranoid=0" drastically improves game performance and clock management on relevant processors, specifically Tiger Lake.<br />
{{ic|dev.i915.perf_stream_paranoid}} was introduced in [https://patchwork.kernel.org/project/dri-devel/patch/20161020211910.4723-8-robert@sixbynine.org/ this Kernel commit], and its usage was [https://gitlab.freedesktop.org/mesa/mesa/-/commit/2001a80d4a81f2e8194b29cca301dd1b27be9acb introduced to Mesa in this commmit]. It now lives in [https://github.com/torvalds/linux/blob/v5.17/drivers/gpu/drm/i915/i915_perf.c linux/drivers/gpu/drm/i915/i915_perf.c]. This setting controls whether "non-root users [are allowed] to access system wide OA counter metrics". OA refers to Intel's [https://www.phoronix.com/scan.php?page=news_item&px=Intel-HSW-Observation-Arch Observation Architecture], and is [https://www.phoronix.com/scan.php?page=news_item&px=Intel-Mesa-OA-Perf-Counters used to provide performance info to applications].<br><br />
As I understand, the {{ic|perf_stream_paranoid}} family of options all may make a difference in whether applications are able to receive certain performance metrics. This is read-only information, and yet some users are reporting dramatic performance increases. What's more is that it's unclear whether early KMS fixes the issue; [https://forum.manjaro.org/t/cant-change-dev-i915-perf-stream-paranoid-to-0/66339/10 this Manjaro forum post] says it does, but the Reddit OP [https://www.reddit.com/r/linux/comments/u7zxa0/comment/i5ia8go/?utm_source=reddit&utm_medium=web2x&context=3 says otherwise]. Cheers, [[User:CodingKoopa|CodingKoopa]] ([[User talk:CodingKoopa|talk]]) 2022-04-21T02:38:34<br />
<br />
: I don't have the exact hardware to benchmark this, but on my (relatively old now) Skylake processor, I did not feel any difference. Neither from the perf_stream sysctl knob nor from early KMS. --[[User:Erus Iluvatar|Erus Iluvatar]] ([[User talk:Erus Iluvatar|talk]]) 06:55, 21 April 2022 (UTC)<br />
<br />
::[https://www.phoronix.com/scan.php?page=news_item&px=Intel-HSW-Observation-Arch Phoronix says that it's Haswell and newer], so your Skylake should just be fine. It's possible that the sysctl option makes no difference (that is, because of the permission to use the performance counter being present anyways), either because of your setup using Early KMS, or because of some Arch default. I think that a good test would be to disable Early KMS (e.g. take the i915 module out of the initrd), and run a program that triggers the {{ic|1=Performance support disabled, consider sysctl dev.i915.perf_stream_paranoid=0}} [https://gitlab.freedesktop.org/mesa/mesa/-/blob/68e8f00c441dc38f5a18a4aa5a30916c53fc986f/src/intel/vulkan/anv_perf.c#L60-L61 codepath]. I'm under the impression that affected applications are Vulkan programs which use the [https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VK_KHR_performance_query.html VK_KHR_performance_query extension] [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2775]. That said, I'm not sure how to reliably pick out affected programs, seeing as people are reporting this with Wine games, but DXVK does not use this extension. Cheers, [[User:CodingKoopa|CodingKoopa]] ([[User talk:CodingKoopa|talk]]) 17:05, 21 April 2022 (UTC)<br />
<br />
::: I'll try to find some time to benchmark this on the weekend, I probably have some random game on Steam that both uses Vulkan and runs through Wine. --[[User:Erus Iluvatar|Erus Iluvatar]] ([[User talk:Erus Iluvatar|talk]]) 18:35, 21 April 2022 (UTC)<br />
<br />
== "Enable GuC / HuC firmware loading" seems to use wrong values for {{ic|1=enable_guc=}} ==<br />
<br />
https://01.org/linuxgraphics/downloads/firmware<br />
<br />
According to the above page, {{ic|1=enable_guc=1}} enables GuC features, {{ic|1=enable_guc=2}} enables HuC features and {{ic|1=enable_guc=3}} enables both together.<br />
<br />
Current version of [[Intel_graphics#Enable GuC / HuC firmware loading]] suggests using {{ic|1=enable_guc=2}} for GuC and HuC firmware loading.<br />
<br />
[[User:ENV25|ENV25]] ([[User talk:ENV25|talk]]) 11:27, 18 May 2022 (UTC)<br />
<br />
:I see that Intel says that on their site, but I'm having difficulty verifying that in the kernel source. This setup with up to {{ic|1=enable_guc=3}} is the case for the patch series [https://patchwork.kernel.org/project/intel-gfx/patch/1511812473-16897-2-git-send-email-sujaritha.sundaresan@intel.com/ Removing enable_guc_loading and enable_guc_submission module parameters], but I don't think this was merged into the mainline kernel. Rather, I think the implementation from the patch series [https://patchwork.kernel.org/project/intel-gfx/patch/20171205163844.41264-6-michal.wajdeczko@intel.com/ Combine enable_guc_loading|submission modparams] is what was merged, for which the current wiki is actually correct. I determined this by looking at the blame for {{ic|enable_guc}}, as we can see [https://github.com/torvalds/linux/commit/121981fafe699d9f398a3c717912ef4eae6719b1 the commit] where this was added.<br />
:Essentially, it seems like that Intel page is wrong and reflects an earlier version of the GuC parameter. Cheers, [[User:CodingKoopa|CodingKoopa]] ([[User talk:CodingKoopa|talk]]) 08:53, 20 May 2022 (UTC).<br />
<br />
:: You are correct. You can verify in the current version of the file. https://github.com/archlinux/linux/blob/master/drivers/gpu/drm/i915/i915_params.c —[[User:ENV25|ENV25]] ([[User talk:ENV25|talk]]) 06:44, 21 May 2022 (UTC)<br />
<br />
:: Never mind I think you can still be wrong. Perhaps this flag uses a bit field. Where {{ic|0}} is {{ic|0b0000}}, {{ic|1}} is {{ic|0b0001}}, {{ic|2}} is {{ic|0b0010}} and {{ic|3}} => {{ic|0b0011}}. —[[User:ENV25|ENV25]] ([[User talk:ENV25|talk]]) 06:53, 21 May 2022 (UTC)</div>ENV25https://wiki.archlinux.org/index.php?title=Talk:Intel_graphics&diff=730313Talk:Intel graphics2022-05-21T06:53:06Z<p>ENV25: /* "Enable GuC / HuC firmware loading" seems to use wrong values for {{ic|1=enable_guc=}} */ reply</p>
<hr />
<div>== [drm:intel_pipe_update_start [i915]] *ERROR* Potential atomic update failure on pipe A ==<br />
<br />
Maybe the solution to get rid of the above dmesg log spamming could be mentioned? You just add `options i915 enable_psr=0` to the file `/etc/modprobe.d/i915.conf`. [[User:Bjourne|Bjourne]] ([[User talk:Bjourne|talk]]) 17:04, 19 August 2016 (UTC)<br />
<br />
== Backlight is not adjustable after trying various acpi_osi values ==<br />
<br />
[http://unix.stackexchange.com/q/315178/3645 Full details] on Stack Exchange.<br />
<br />
{{unsigned|20:04, 8 October 2016|L0b0}}<br />
<br />
== DRI3 confusion ==<br />
<br />
I've seen in the forum people ask from time to time how to enable DRI3 on their system.<br />
<br />
As stated many times there, DRI3 should be on for most (if not all) of them. But people keep telling them to check<br />
<br />
cat /var/log/Xorg.0.log | grep DRI<br />
<br />
which shows up this message:<br />
<br />
GLX: Initialized DRI2 GL provider for screen 0<br />
<br />
which is *not accurate*.<br />
<br />
If you run this command instead:<br />
<br />
LC_ALL=C LIBGL_DEBUG=verbose glxinfo | grep DRI<br />
<br />
you might stump with this other message:<br />
<br />
libGL: Using DRI3 for screen 0<br />
<br />
which proves you are using DRI3 even though X11 doesn't reply with the correct information.<br />
<br />
The command was adapted from [https://lists.x.org/archives/xorg-devel/2014-June/042735.html xorg mailing list].<br />
<br />
So, it think adding this information in the page could be of major interest. What do you think?<br />
<br />
[[User:Franzrogar|Franzrogar]] ([[User talk:Franzrogar|talk]]) 07:01, 4 November 2016 (UTC)<br />
<br />
== Guide for screen scaling with external displays via xrandr? ==<br />
<br />
I tried to find instructions for scaling the display resolution without stretching on this wiki page, but the section only says that it's not implemented in the Intel drivers yet. However, [https://unix.stackexchange.com/questions/220387/how-to-set-scaling-mode-for-external-displays-on-intel-gpu this stackexchange thread] has a workaround using an xrandr transform matrix. Should this be added to the wiki page?<br />
<br />
[[User:Ibara|Ibara]] ([[User talk:Ibara|talk]]) 12:35, 22 May 2017 (UTC)<br />
<br />
== Screen flickering ==<br />
Intel's power saving features might lead to flickering on some devices visible in the desktop, login manager and even in the konsole. Add the kernel parameter {{ic|1=intel_idle.max_cstate=1}} and reboot.<br />
<br />
{{unsigned|20:57, 3 November 2020|R41n3r}}<br />
<br />
== Driver issues on 11th Gen CPU ==<br />
<br />
I've just left a comment in [[Talk:Dell_XPS_13_(9310)#Video drivers]] about issues with modesetting drivers on the new XPS 13. The issue appears when using modesetting drivers and is resolved when installing the xf86-video-intel package, which seems to go against most of the advice in this Wiki and the internet at large. The issue is not simple to describe, so I will just copy-paste what I've written on the other page: "some weird jittery behaviour in the rendering of text. For example, when attempting to type 'wiki.archlinux.org' in a browser address field the text rendering would suddenly jump back by 1/2 strokes (I'm typing 'ch', the 'c' appears shortly but the screen immediately refreshes to only show 'wiki.a') and refuse to update for maybe a second. It would then catch up if I kept typing."<br />
Is this a known issue with 11th Gen Intel CPUs? The model I have has an i7-1165G7, which includes the new Intel Iris Xe Graphics.<br />
[[User:Avernan|Avernan]] ([[User talk:Avernan|talk]]) 17:16, 30 December 2020 (UTC)<br />
<br />
== Washed colors on 7th gen CPU ==<br />
<br />
I found out that my iGPU shows washed colors randomly, but I managed to fix it by adding intel_agp and i915 modules into mkinitcpio.conf and rebuilding the initramfs after that. <br />
<br />
[[User:Myghi63|Paulo Marcos]] 11:37, 24 June 2021 (UTC)<br />
<br />
== GuC/HuC firmware loading not enabled by default on Gen 11+ hardware? ==<br />
<br />
It wasn't for me. Also:<br />
<br />
''As of now, HuC firmware support is disabled in Linux kernels by default.''<br />
<br />
Source: https://github.com/intel/media-driver#known-issues-and-limitations<br />
<br />
''HUC which is disabled by default on TGL in i915 driver''<br />
<br />
TGL being Tiger Lake - Source: https://github.com/intel/media-driver/issues/1149#issuecomment-785572865<br />
<br />
--[[User:Schlaefer|Schlaefer]] ([[User talk:Schlaefer|talk]]) 13:57, 7 November 2021 (UTC)<br />
<br />
== Potential performance gains via Observation Architecture ==<br />
<br />
[https://www.reddit.com/r/linux/comments/u7zxa0/psa_for_intel_tiger_lake_dynamic_tuning_laptops/ This /r/linux thread] claims the following:<br />
: Dynamic Tuning is not enabled in most distros due to late Intel KMS. Running "sudo sysctl dev.i915.pref_stream_paranoid=0" drastically improves game performance and clock management on relevant processors, specifically Tiger Lake.<br />
{{ic|dev.i915.perf_stream_paranoid}} was introduced in [https://patchwork.kernel.org/project/dri-devel/patch/20161020211910.4723-8-robert@sixbynine.org/ this Kernel commit], and its usage was [https://gitlab.freedesktop.org/mesa/mesa/-/commit/2001a80d4a81f2e8194b29cca301dd1b27be9acb introduced to Mesa in this commmit]. It now lives in [https://github.com/torvalds/linux/blob/v5.17/drivers/gpu/drm/i915/i915_perf.c linux/drivers/gpu/drm/i915/i915_perf.c]. This setting controls whether "non-root users [are allowed] to access system wide OA counter metrics". OA refers to Intel's [https://www.phoronix.com/scan.php?page=news_item&px=Intel-HSW-Observation-Arch Observation Architecture], and is [https://www.phoronix.com/scan.php?page=news_item&px=Intel-Mesa-OA-Perf-Counters used to provide performance info to applications].<br><br />
As I understand, the {{ic|perf_stream_paranoid}} family of options all may make a difference in whether applications are able to receive certain performance metrics. This is read-only information, and yet some users are reporting dramatic performance increases. What's more is that it's unclear whether early KMS fixes the issue; [https://forum.manjaro.org/t/cant-change-dev-i915-perf-stream-paranoid-to-0/66339/10 this Manjaro forum post] says it does, but the Reddit OP [https://www.reddit.com/r/linux/comments/u7zxa0/comment/i5ia8go/?utm_source=reddit&utm_medium=web2x&context=3 says otherwise]. Cheers, [[User:CodingKoopa|CodingKoopa]] ([[User talk:CodingKoopa|talk]]) 2022-04-21T02:38:34<br />
<br />
: I don't have the exact hardware to benchmark this, but on my (relatively old now) Skylake processor, I did not feel any difference. Neither from the perf_stream sysctl knob nor from early KMS. --[[User:Erus Iluvatar|Erus Iluvatar]] ([[User talk:Erus Iluvatar|talk]]) 06:55, 21 April 2022 (UTC)<br />
<br />
::[https://www.phoronix.com/scan.php?page=news_item&px=Intel-HSW-Observation-Arch Phoronix says that it's Haswell and newer], so your Skylake should just be fine. It's possible that the sysctl option makes no difference (that is, because of the permission to use the performance counter being present anyways), either because of your setup using Early KMS, or because of some Arch default. I think that a good test would be to disable Early KMS (e.g. take the i915 module out of the initrd), and run a program that triggers the {{ic|1=Performance support disabled, consider sysctl dev.i915.perf_stream_paranoid=0}} [https://gitlab.freedesktop.org/mesa/mesa/-/blob/68e8f00c441dc38f5a18a4aa5a30916c53fc986f/src/intel/vulkan/anv_perf.c#L60-L61 codepath]. I'm under the impression that affected applications are Vulkan programs which use the [https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VK_KHR_performance_query.html VK_KHR_performance_query extension] [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2775]. That said, I'm not sure how to reliably pick out affected programs, seeing as people are reporting this with Wine games, but DXVK does not use this extension. Cheers, [[User:CodingKoopa|CodingKoopa]] ([[User talk:CodingKoopa|talk]]) 17:05, 21 April 2022 (UTC)<br />
<br />
::: I'll try to find some time to benchmark this on the weekend, I probably have some random game on Steam that both uses Vulkan and runs through Wine. --[[User:Erus Iluvatar|Erus Iluvatar]] ([[User talk:Erus Iluvatar|talk]]) 18:35, 21 April 2022 (UTC)<br />
<br />
== "Enable GuC / HuC firmware loading" seems to use wrong values for {{ic|1=enable_guc=}} ==<br />
<br />
https://01.org/linuxgraphics/downloads/firmware<br />
<br />
According to the above page, {{ic|1=enable_guc=1}} enables GuC features, {{ic|1=enable_guc=2}} enables HuC features and {{ic|1=enable_guc=3}} enables both together.<br />
<br />
Current version of [[Intel_graphics#Enable GuC / HuC firmware loading]] suggests using {{ic|1=enable_guc=2}} for GuC and HuC firmware loading.<br />
<br />
[[User:ENV25|ENV25]] ([[User talk:ENV25|talk]]) 11:27, 18 May 2022 (UTC)<br />
<br />
:I see that Intel says that on their site, but I'm having difficulty verifying that in the kernel source. This setup with up to {{ic|1=enable_guc=3}} is the case for the patch series [https://patchwork.kernel.org/project/intel-gfx/patch/1511812473-16897-2-git-send-email-sujaritha.sundaresan@intel.com/ Removing enable_guc_loading and enable_guc_submission module parameters], but I don't think this was merged into the mainline kernel. Rather, I think the implementation from the patch series [https://patchwork.kernel.org/project/intel-gfx/patch/20171205163844.41264-6-michal.wajdeczko@intel.com/ Combine enable_guc_loading|submission modparams] is what was merged, for which the current wiki is actually correct. I determined this by looking at the blame for {{ic|enable_guc}}, as we can see [https://github.com/torvalds/linux/commit/121981fafe699d9f398a3c717912ef4eae6719b1 the commit] where this was added.<br />
:Essentially, it seems like that Intel page is wrong and reflects an earlier version of the GuC parameter. Cheers, [[User:CodingKoopa|CodingKoopa]] ([[User talk:CodingKoopa|talk]]) 08:53, 20 May 2022 (UTC).<br />
<br />
:: You are correct. You can verify in the current version of the file. https://github.com/archlinux/linux/blob/master/drivers/gpu/drm/i915/i915_params.c —[[User:ENV25|ENV25]] ([[User talk:ENV25|talk]]) 06:44, 21 May 2022 (UTC)<br />
<br />
:: Never mind I think you can still be wrong. Perhaps this flag uses a bit field. Where {{ic|0}} is {{ic|0b0000}}, {{ic|1}} is {{ic|0b0001}}, {{ic|2}} is {{ic|0b0010}} and {{ic|3}} => {{ic|0b0011}}.</div>ENV25https://wiki.archlinux.org/index.php?title=Talk:Intel_graphics&diff=730312Talk:Intel graphics2022-05-21T06:45:11Z<p>ENV25: /* "Enable GuC / HuC firmware loading" seems to use wrong values for {{ic|1=enable_guc=}} */ reply</p>
<hr />
<div>== [drm:intel_pipe_update_start [i915]] *ERROR* Potential atomic update failure on pipe A ==<br />
<br />
Maybe the solution to get rid of the above dmesg log spamming could be mentioned? You just add `options i915 enable_psr=0` to the file `/etc/modprobe.d/i915.conf`. [[User:Bjourne|Bjourne]] ([[User talk:Bjourne|talk]]) 17:04, 19 August 2016 (UTC)<br />
<br />
== Backlight is not adjustable after trying various acpi_osi values ==<br />
<br />
[http://unix.stackexchange.com/q/315178/3645 Full details] on Stack Exchange.<br />
<br />
{{unsigned|20:04, 8 October 2016|L0b0}}<br />
<br />
== DRI3 confusion ==<br />
<br />
I've seen in the forum people ask from time to time how to enable DRI3 on their system.<br />
<br />
As stated many times there, DRI3 should be on for most (if not all) of them. But people keep telling them to check<br />
<br />
cat /var/log/Xorg.0.log | grep DRI<br />
<br />
which shows up this message:<br />
<br />
GLX: Initialized DRI2 GL provider for screen 0<br />
<br />
which is *not accurate*.<br />
<br />
If you run this command instead:<br />
<br />
LC_ALL=C LIBGL_DEBUG=verbose glxinfo | grep DRI<br />
<br />
you might stump with this other message:<br />
<br />
libGL: Using DRI3 for screen 0<br />
<br />
which proves you are using DRI3 even though X11 doesn't reply with the correct information.<br />
<br />
The command was adapted from [https://lists.x.org/archives/xorg-devel/2014-June/042735.html xorg mailing list].<br />
<br />
So, it think adding this information in the page could be of major interest. What do you think?<br />
<br />
[[User:Franzrogar|Franzrogar]] ([[User talk:Franzrogar|talk]]) 07:01, 4 November 2016 (UTC)<br />
<br />
== Guide for screen scaling with external displays via xrandr? ==<br />
<br />
I tried to find instructions for scaling the display resolution without stretching on this wiki page, but the section only says that it's not implemented in the Intel drivers yet. However, [https://unix.stackexchange.com/questions/220387/how-to-set-scaling-mode-for-external-displays-on-intel-gpu this stackexchange thread] has a workaround using an xrandr transform matrix. Should this be added to the wiki page?<br />
<br />
[[User:Ibara|Ibara]] ([[User talk:Ibara|talk]]) 12:35, 22 May 2017 (UTC)<br />
<br />
== Screen flickering ==<br />
Intel's power saving features might lead to flickering on some devices visible in the desktop, login manager and even in the konsole. Add the kernel parameter {{ic|1=intel_idle.max_cstate=1}} and reboot.<br />
<br />
{{unsigned|20:57, 3 November 2020|R41n3r}}<br />
<br />
== Driver issues on 11th Gen CPU ==<br />
<br />
I've just left a comment in [[Talk:Dell_XPS_13_(9310)#Video drivers]] about issues with modesetting drivers on the new XPS 13. The issue appears when using modesetting drivers and is resolved when installing the xf86-video-intel package, which seems to go against most of the advice in this Wiki and the internet at large. The issue is not simple to describe, so I will just copy-paste what I've written on the other page: "some weird jittery behaviour in the rendering of text. For example, when attempting to type 'wiki.archlinux.org' in a browser address field the text rendering would suddenly jump back by 1/2 strokes (I'm typing 'ch', the 'c' appears shortly but the screen immediately refreshes to only show 'wiki.a') and refuse to update for maybe a second. It would then catch up if I kept typing."<br />
Is this a known issue with 11th Gen Intel CPUs? The model I have has an i7-1165G7, which includes the new Intel Iris Xe Graphics.<br />
[[User:Avernan|Avernan]] ([[User talk:Avernan|talk]]) 17:16, 30 December 2020 (UTC)<br />
<br />
== Washed colors on 7th gen CPU ==<br />
<br />
I found out that my iGPU shows washed colors randomly, but I managed to fix it by adding intel_agp and i915 modules into mkinitcpio.conf and rebuilding the initramfs after that. <br />
<br />
[[User:Myghi63|Paulo Marcos]] 11:37, 24 June 2021 (UTC)<br />
<br />
== GuC/HuC firmware loading not enabled by default on Gen 11+ hardware? ==<br />
<br />
It wasn't for me. Also:<br />
<br />
''As of now, HuC firmware support is disabled in Linux kernels by default.''<br />
<br />
Source: https://github.com/intel/media-driver#known-issues-and-limitations<br />
<br />
''HUC which is disabled by default on TGL in i915 driver''<br />
<br />
TGL being Tiger Lake - Source: https://github.com/intel/media-driver/issues/1149#issuecomment-785572865<br />
<br />
--[[User:Schlaefer|Schlaefer]] ([[User talk:Schlaefer|talk]]) 13:57, 7 November 2021 (UTC)<br />
<br />
== Potential performance gains via Observation Architecture ==<br />
<br />
[https://www.reddit.com/r/linux/comments/u7zxa0/psa_for_intel_tiger_lake_dynamic_tuning_laptops/ This /r/linux thread] claims the following:<br />
: Dynamic Tuning is not enabled in most distros due to late Intel KMS. Running "sudo sysctl dev.i915.pref_stream_paranoid=0" drastically improves game performance and clock management on relevant processors, specifically Tiger Lake.<br />
{{ic|dev.i915.perf_stream_paranoid}} was introduced in [https://patchwork.kernel.org/project/dri-devel/patch/20161020211910.4723-8-robert@sixbynine.org/ this Kernel commit], and its usage was [https://gitlab.freedesktop.org/mesa/mesa/-/commit/2001a80d4a81f2e8194b29cca301dd1b27be9acb introduced to Mesa in this commmit]. It now lives in [https://github.com/torvalds/linux/blob/v5.17/drivers/gpu/drm/i915/i915_perf.c linux/drivers/gpu/drm/i915/i915_perf.c]. This setting controls whether "non-root users [are allowed] to access system wide OA counter metrics". OA refers to Intel's [https://www.phoronix.com/scan.php?page=news_item&px=Intel-HSW-Observation-Arch Observation Architecture], and is [https://www.phoronix.com/scan.php?page=news_item&px=Intel-Mesa-OA-Perf-Counters used to provide performance info to applications].<br><br />
As I understand, the {{ic|perf_stream_paranoid}} family of options all may make a difference in whether applications are able to receive certain performance metrics. This is read-only information, and yet some users are reporting dramatic performance increases. What's more is that it's unclear whether early KMS fixes the issue; [https://forum.manjaro.org/t/cant-change-dev-i915-perf-stream-paranoid-to-0/66339/10 this Manjaro forum post] says it does, but the Reddit OP [https://www.reddit.com/r/linux/comments/u7zxa0/comment/i5ia8go/?utm_source=reddit&utm_medium=web2x&context=3 says otherwise]. Cheers, [[User:CodingKoopa|CodingKoopa]] ([[User talk:CodingKoopa|talk]]) 2022-04-21T02:38:34<br />
<br />
: I don't have the exact hardware to benchmark this, but on my (relatively old now) Skylake processor, I did not feel any difference. Neither from the perf_stream sysctl knob nor from early KMS. --[[User:Erus Iluvatar|Erus Iluvatar]] ([[User talk:Erus Iluvatar|talk]]) 06:55, 21 April 2022 (UTC)<br />
<br />
::[https://www.phoronix.com/scan.php?page=news_item&px=Intel-HSW-Observation-Arch Phoronix says that it's Haswell and newer], so your Skylake should just be fine. It's possible that the sysctl option makes no difference (that is, because of the permission to use the performance counter being present anyways), either because of your setup using Early KMS, or because of some Arch default. I think that a good test would be to disable Early KMS (e.g. take the i915 module out of the initrd), and run a program that triggers the {{ic|1=Performance support disabled, consider sysctl dev.i915.perf_stream_paranoid=0}} [https://gitlab.freedesktop.org/mesa/mesa/-/blob/68e8f00c441dc38f5a18a4aa5a30916c53fc986f/src/intel/vulkan/anv_perf.c#L60-L61 codepath]. I'm under the impression that affected applications are Vulkan programs which use the [https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VK_KHR_performance_query.html VK_KHR_performance_query extension] [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2775]. That said, I'm not sure how to reliably pick out affected programs, seeing as people are reporting this with Wine games, but DXVK does not use this extension. Cheers, [[User:CodingKoopa|CodingKoopa]] ([[User talk:CodingKoopa|talk]]) 17:05, 21 April 2022 (UTC)<br />
<br />
::: I'll try to find some time to benchmark this on the weekend, I probably have some random game on Steam that both uses Vulkan and runs through Wine. --[[User:Erus Iluvatar|Erus Iluvatar]] ([[User talk:Erus Iluvatar|talk]]) 18:35, 21 April 2022 (UTC)<br />
<br />
== "Enable GuC / HuC firmware loading" seems to use wrong values for {{ic|1=enable_guc=}} ==<br />
<br />
https://01.org/linuxgraphics/downloads/firmware<br />
<br />
According to the above page, {{ic|1=enable_guc=1}} enables GuC features, {{ic|1=enable_guc=2}} enables HuC features and {{ic|1=enable_guc=3}} enables both together.<br />
<br />
Current version of [[Intel_graphics#Enable GuC / HuC firmware loading]] suggests using {{ic|1=enable_guc=2}} for GuC and HuC firmware loading.<br />
<br />
[[User:ENV25|ENV25]] ([[User talk:ENV25|talk]]) 11:27, 18 May 2022 (UTC)<br />
<br />
:I see that Intel says that on their site, but I'm having difficulty verifying that in the kernel source. This setup with up to {{ic|1=enable_guc=3}} is the case for the patch series [https://patchwork.kernel.org/project/intel-gfx/patch/1511812473-16897-2-git-send-email-sujaritha.sundaresan@intel.com/ Removing enable_guc_loading and enable_guc_submission module parameters], but I don't think this was merged into the mainline kernel. Rather, I think the implementation from the patch series [https://patchwork.kernel.org/project/intel-gfx/patch/20171205163844.41264-6-michal.wajdeczko@intel.com/ Combine enable_guc_loading|submission modparams] is what was merged, for which the current wiki is actually correct. I determined this by looking at the blame for {{ic|enable_guc}}, as we can see [https://github.com/torvalds/linux/commit/121981fafe699d9f398a3c717912ef4eae6719b1 the commit] where this was added.<br />
:Essentially, it seems like that Intel page is wrong and reflects an earlier version of the GuC parameter. Cheers, [[User:CodingKoopa|CodingKoopa]] ([[User talk:CodingKoopa|talk]]) 08:53, 20 May 2022 (UTC).<br />
<br />
:: You are correct. You can verify in the current version of the file. https://github.com/archlinux/linux/blob/master/drivers/gpu/drm/i915/i915_params.c —[[User:ENV25|ENV25]] ([[User talk:ENV25|talk]]) 06:44, 21 May 2022 (UTC)</div>ENV25https://wiki.archlinux.org/index.php?title=Talk:Intel_graphics&diff=730030Talk:Intel graphics2022-05-18T11:28:06Z<p>ENV25: /* 10 "Enable GuC / HuC firmware loading" seems to use wrong values for {{ic|1=enable_guc=}} */ add signature</p>
<hr />
<div>== [drm:intel_pipe_update_start [i915]] *ERROR* Potential atomic update failure on pipe A ==<br />
<br />
Maybe the solution to get rid of the above dmesg log spamming could be mentioned? You just add `options i915 enable_psr=0` to the file `/etc/modprobe.d/i915.conf`. [[User:Bjourne|Bjourne]] ([[User talk:Bjourne|talk]]) 17:04, 19 August 2016 (UTC)<br />
<br />
== Backlight is not adjustable after trying various acpi_osi values ==<br />
<br />
[http://unix.stackexchange.com/q/315178/3645 Full details] on Stack Exchange.<br />
<br />
{{unsigned|20:04, 8 October 2016|L0b0}}<br />
<br />
== DRI3 confusion ==<br />
<br />
I've seen in the forum people ask from time to time how to enable DRI3 on their system.<br />
<br />
As stated many times there, DRI3 should be on for most (if not all) of them. But people keep telling them to check<br />
<br />
cat /var/log/Xorg.0.log | grep DRI<br />
<br />
which shows up this message:<br />
<br />
GLX: Initialized DRI2 GL provider for screen 0<br />
<br />
which is *not accurate*.<br />
<br />
If you run this command instead:<br />
<br />
LC_ALL=C LIBGL_DEBUG=verbose glxinfo | grep DRI<br />
<br />
you might stump with this other message:<br />
<br />
libGL: Using DRI3 for screen 0<br />
<br />
which proves you are using DRI3 even though X11 doesn't reply with the correct information.<br />
<br />
The command was adapted from [https://lists.x.org/archives/xorg-devel/2014-June/042735.html xorg mailing list].<br />
<br />
So, it think adding this information in the page could be of major interest. What do you think?<br />
<br />
[[User:Franzrogar|Franzrogar]] ([[User talk:Franzrogar|talk]]) 07:01, 4 November 2016 (UTC)<br />
<br />
== Guide for screen scaling with external displays via xrandr? ==<br />
<br />
I tried to find instructions for scaling the display resolution without stretching on this wiki page, but the section only says that it's not implemented in the Intel drivers yet. However, [https://unix.stackexchange.com/questions/220387/how-to-set-scaling-mode-for-external-displays-on-intel-gpu this stackexchange thread] has a workaround using an xrandr transform matrix. Should this be added to the wiki page?<br />
<br />
[[User:Ibara|Ibara]] ([[User talk:Ibara|talk]]) 12:35, 22 May 2017 (UTC)<br />
<br />
== Screen flickering ==<br />
Intel's power saving features might lead to flickering on some devices visible in the desktop, login manager and even in the konsole. Add the kernel parameter {{ic|1=intel_idle.max_cstate=1}} and reboot.<br />
<br />
{{unsigned|20:57, 3 November 2020|R41n3r}}<br />
<br />
== Driver issues on 11th Gen CPU ==<br />
<br />
I've just left a comment in [[Talk:Dell_XPS_13_(9310)#Video drivers]] about issues with modesetting drivers on the new XPS 13. The issue appears when using modesetting drivers and is resolved when installing the xf86-video-intel package, which seems to go against most of the advice in this Wiki and the internet at large. The issue is not simple to describe, so I will just copy-paste what I've written on the other page: "some weird jittery behaviour in the rendering of text. For example, when attempting to type 'wiki.archlinux.org' in a browser address field the text rendering would suddenly jump back by 1/2 strokes (I'm typing 'ch', the 'c' appears shortly but the screen immediately refreshes to only show 'wiki.a') and refuse to update for maybe a second. It would then catch up if I kept typing."<br />
Is this a known issue with 11th Gen Intel CPUs? The model I have has an i7-1165G7, which includes the new Intel Iris Xe Graphics.<br />
[[User:Avernan|Avernan]] ([[User talk:Avernan|talk]]) 17:16, 30 December 2020 (UTC)<br />
<br />
== Washed colors on 7th gen CPU ==<br />
<br />
I found out that my iGPU shows washed colors randomly, but I managed to fix it by adding intel_agp and i915 modules into mkinitcpio.conf and rebuilding the initramfs after that. <br />
<br />
[[User:Myghi63|Paulo Marcos]] 11:37, 24 June 2021 (UTC)<br />
<br />
== GuC/HuC firmware loading not enabled by default on Gen 11+ hardware? ==<br />
<br />
It wasn't for me. Also:<br />
<br />
''As of now, HuC firmware support is disabled in Linux kernels by default.''<br />
<br />
Source: https://github.com/intel/media-driver#known-issues-and-limitations<br />
<br />
''HUC which is disabled by default on TGL in i915 driver''<br />
<br />
TGL being Tiger Lake - Source: https://github.com/intel/media-driver/issues/1149#issuecomment-785572865<br />
<br />
--[[User:Schlaefer|Schlaefer]] ([[User talk:Schlaefer|talk]]) 13:57, 7 November 2021 (UTC)<br />
<br />
== Potential performance gains via Observation Architecture ==<br />
<br />
[https://www.reddit.com/r/linux/comments/u7zxa0/psa_for_intel_tiger_lake_dynamic_tuning_laptops/ This /r/linux thread] claims the following:<br />
: Dynamic Tuning is not enabled in most distros due to late Intel KMS. Running "sudo sysctl dev.i915.pref_stream_paranoid=0" drastically improves game performance and clock management on relevant processors, specifically Tiger Lake.<br />
{{ic|dev.i915.perf_stream_paranoid}} was introduced in [https://patchwork.kernel.org/project/dri-devel/patch/20161020211910.4723-8-robert@sixbynine.org/ this Kernel commit], and its usage was [https://gitlab.freedesktop.org/mesa/mesa/-/commit/2001a80d4a81f2e8194b29cca301dd1b27be9acb introduced to Mesa in this commmit]. It now lives in [https://github.com/torvalds/linux/blob/v5.17/drivers/gpu/drm/i915/i915_perf.c linux/drivers/gpu/drm/i915/i915_perf.c]. This setting controls whether "non-root users [are allowed] to access system wide OA counter metrics". OA refers to Intel's [https://www.phoronix.com/scan.php?page=news_item&px=Intel-HSW-Observation-Arch Observation Architecture], and is [https://www.phoronix.com/scan.php?page=news_item&px=Intel-Mesa-OA-Perf-Counters used to provide performance info to applications].<br><br />
As I understand, the {{ic|perf_stream_paranoid}} family of options all may make a difference in whether applications are able to receive certain performance metrics. This is read-only information, and yet some users are reporting dramatic performance increases. What's more is that it's unclear whether early KMS fixes the issue; [https://forum.manjaro.org/t/cant-change-dev-i915-perf-stream-paranoid-to-0/66339/10 this Manjaro forum post] says it does, but the Reddit OP [https://www.reddit.com/r/linux/comments/u7zxa0/comment/i5ia8go/?utm_source=reddit&utm_medium=web2x&context=3 says otherwise]. Cheers, [[User:CodingKoopa|CodingKoopa]] ([[User talk:CodingKoopa|talk]]) 2022-04-21T02:38:34<br />
<br />
: I don't have the exact hardware to benchmark this, but on my (relatively old now) Skylake processor, I did not feel any difference. Neither from the perf_stream sysctl knob nor from early KMS. --[[User:Erus Iluvatar|Erus Iluvatar]] ([[User talk:Erus Iluvatar|talk]]) 06:55, 21 April 2022 (UTC)<br />
<br />
::[https://www.phoronix.com/scan.php?page=news_item&px=Intel-HSW-Observation-Arch Phoronix says that it's Haswell and newer], so your Skylake should just be fine. It's possible that the sysctl option makes no difference (that is, because of the permission to use the performance counter being present anyways), either because of your setup using Early KMS, or because of some Arch default. I think that a good test would be to disable Early KMS (e.g. take the i915 module out of the initrd), and run a program that triggers the {{ic|1=Performance support disabled, consider sysctl dev.i915.perf_stream_paranoid=0}} [https://gitlab.freedesktop.org/mesa/mesa/-/blob/68e8f00c441dc38f5a18a4aa5a30916c53fc986f/src/intel/vulkan/anv_perf.c#L60-L61 codepath]. I'm under the impression that affected applications are Vulkan programs which use the [https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VK_KHR_performance_query.html VK_KHR_performance_query extension] [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2775]. That said, I'm not sure how to reliably pick out affected programs, seeing as people are reporting this with Wine games, but DXVK does not use this extension. Cheers, [[User:CodingKoopa|CodingKoopa]] ([[User talk:CodingKoopa|talk]]) 17:05, 21 April 2022 (UTC)<br />
<br />
::: I'll try to find some time to benchmark this on the weekend, I probably have some random game on Steam that both uses Vulkan and runs through Wine. --[[User:Erus Iluvatar|Erus Iluvatar]] ([[User talk:Erus Iluvatar|talk]]) 18:35, 21 April 2022 (UTC)<br />
<br />
== "Enable GuC / HuC firmware loading" seems to use wrong values for {{ic|1=enable_guc=}} ==<br />
<br />
https://01.org/linuxgraphics/downloads/firmware<br />
<br />
According to the above page, {{ic|1=enable_guc=1}} enables GuC features, {{ic|1=enable_guc=2}} enables HuC features and {{ic|1=enable_guc=3}} enables both together.<br />
<br />
Current version of [[Intel_graphics#Enable GuC / HuC firmware loading]] suggests using {{ic|1=enable_guc=2}} for GuC and HuC firmware loading.<br />
<br />
[[User:ENV25|ENV25]] ([[User talk:ENV25|talk]]) 11:27, 18 May 2022 (UTC)</div>ENV25https://wiki.archlinux.org/index.php?title=Talk:Intel_graphics&diff=730029Talk:Intel graphics2022-05-18T11:27:21Z<p>ENV25: /* 10 "Enable GuC / HuC firmware loading" seems to use wrong values for {{ic|1=enable_guc=}} */ new section</p>
<hr />
<div>== [drm:intel_pipe_update_start [i915]] *ERROR* Potential atomic update failure on pipe A ==<br />
<br />
Maybe the solution to get rid of the above dmesg log spamming could be mentioned? You just add `options i915 enable_psr=0` to the file `/etc/modprobe.d/i915.conf`. [[User:Bjourne|Bjourne]] ([[User talk:Bjourne|talk]]) 17:04, 19 August 2016 (UTC)<br />
<br />
== Backlight is not adjustable after trying various acpi_osi values ==<br />
<br />
[http://unix.stackexchange.com/q/315178/3645 Full details] on Stack Exchange.<br />
<br />
{{unsigned|20:04, 8 October 2016|L0b0}}<br />
<br />
== DRI3 confusion ==<br />
<br />
I've seen in the forum people ask from time to time how to enable DRI3 on their system.<br />
<br />
As stated many times there, DRI3 should be on for most (if not all) of them. But people keep telling them to check<br />
<br />
cat /var/log/Xorg.0.log | grep DRI<br />
<br />
which shows up this message:<br />
<br />
GLX: Initialized DRI2 GL provider for screen 0<br />
<br />
which is *not accurate*.<br />
<br />
If you run this command instead:<br />
<br />
LC_ALL=C LIBGL_DEBUG=verbose glxinfo | grep DRI<br />
<br />
you might stump with this other message:<br />
<br />
libGL: Using DRI3 for screen 0<br />
<br />
which proves you are using DRI3 even though X11 doesn't reply with the correct information.<br />
<br />
The command was adapted from [https://lists.x.org/archives/xorg-devel/2014-June/042735.html xorg mailing list].<br />
<br />
So, it think adding this information in the page could be of major interest. What do you think?<br />
<br />
[[User:Franzrogar|Franzrogar]] ([[User talk:Franzrogar|talk]]) 07:01, 4 November 2016 (UTC)<br />
<br />
== Guide for screen scaling with external displays via xrandr? ==<br />
<br />
I tried to find instructions for scaling the display resolution without stretching on this wiki page, but the section only says that it's not implemented in the Intel drivers yet. However, [https://unix.stackexchange.com/questions/220387/how-to-set-scaling-mode-for-external-displays-on-intel-gpu this stackexchange thread] has a workaround using an xrandr transform matrix. Should this be added to the wiki page?<br />
<br />
[[User:Ibara|Ibara]] ([[User talk:Ibara|talk]]) 12:35, 22 May 2017 (UTC)<br />
<br />
== Screen flickering ==<br />
Intel's power saving features might lead to flickering on some devices visible in the desktop, login manager and even in the konsole. Add the kernel parameter {{ic|1=intel_idle.max_cstate=1}} and reboot.<br />
<br />
{{unsigned|20:57, 3 November 2020|R41n3r}}<br />
<br />
== Driver issues on 11th Gen CPU ==<br />
<br />
I've just left a comment in [[Talk:Dell_XPS_13_(9310)#Video drivers]] about issues with modesetting drivers on the new XPS 13. The issue appears when using modesetting drivers and is resolved when installing the xf86-video-intel package, which seems to go against most of the advice in this Wiki and the internet at large. The issue is not simple to describe, so I will just copy-paste what I've written on the other page: "some weird jittery behaviour in the rendering of text. For example, when attempting to type 'wiki.archlinux.org' in a browser address field the text rendering would suddenly jump back by 1/2 strokes (I'm typing 'ch', the 'c' appears shortly but the screen immediately refreshes to only show 'wiki.a') and refuse to update for maybe a second. It would then catch up if I kept typing."<br />
Is this a known issue with 11th Gen Intel CPUs? The model I have has an i7-1165G7, which includes the new Intel Iris Xe Graphics.<br />
[[User:Avernan|Avernan]] ([[User talk:Avernan|talk]]) 17:16, 30 December 2020 (UTC)<br />
<br />
== Washed colors on 7th gen CPU ==<br />
<br />
I found out that my iGPU shows washed colors randomly, but I managed to fix it by adding intel_agp and i915 modules into mkinitcpio.conf and rebuilding the initramfs after that. <br />
<br />
[[User:Myghi63|Paulo Marcos]] 11:37, 24 June 2021 (UTC)<br />
<br />
== GuC/HuC firmware loading not enabled by default on Gen 11+ hardware? ==<br />
<br />
It wasn't for me. Also:<br />
<br />
''As of now, HuC firmware support is disabled in Linux kernels by default.''<br />
<br />
Source: https://github.com/intel/media-driver#known-issues-and-limitations<br />
<br />
''HUC which is disabled by default on TGL in i915 driver''<br />
<br />
TGL being Tiger Lake - Source: https://github.com/intel/media-driver/issues/1149#issuecomment-785572865<br />
<br />
--[[User:Schlaefer|Schlaefer]] ([[User talk:Schlaefer|talk]]) 13:57, 7 November 2021 (UTC)<br />
<br />
== Potential performance gains via Observation Architecture ==<br />
<br />
[https://www.reddit.com/r/linux/comments/u7zxa0/psa_for_intel_tiger_lake_dynamic_tuning_laptops/ This /r/linux thread] claims the following:<br />
: Dynamic Tuning is not enabled in most distros due to late Intel KMS. Running "sudo sysctl dev.i915.pref_stream_paranoid=0" drastically improves game performance and clock management on relevant processors, specifically Tiger Lake.<br />
{{ic|dev.i915.perf_stream_paranoid}} was introduced in [https://patchwork.kernel.org/project/dri-devel/patch/20161020211910.4723-8-robert@sixbynine.org/ this Kernel commit], and its usage was [https://gitlab.freedesktop.org/mesa/mesa/-/commit/2001a80d4a81f2e8194b29cca301dd1b27be9acb introduced to Mesa in this commmit]. It now lives in [https://github.com/torvalds/linux/blob/v5.17/drivers/gpu/drm/i915/i915_perf.c linux/drivers/gpu/drm/i915/i915_perf.c]. This setting controls whether "non-root users [are allowed] to access system wide OA counter metrics". OA refers to Intel's [https://www.phoronix.com/scan.php?page=news_item&px=Intel-HSW-Observation-Arch Observation Architecture], and is [https://www.phoronix.com/scan.php?page=news_item&px=Intel-Mesa-OA-Perf-Counters used to provide performance info to applications].<br><br />
As I understand, the {{ic|perf_stream_paranoid}} family of options all may make a difference in whether applications are able to receive certain performance metrics. This is read-only information, and yet some users are reporting dramatic performance increases. What's more is that it's unclear whether early KMS fixes the issue; [https://forum.manjaro.org/t/cant-change-dev-i915-perf-stream-paranoid-to-0/66339/10 this Manjaro forum post] says it does, but the Reddit OP [https://www.reddit.com/r/linux/comments/u7zxa0/comment/i5ia8go/?utm_source=reddit&utm_medium=web2x&context=3 says otherwise]. Cheers, [[User:CodingKoopa|CodingKoopa]] ([[User talk:CodingKoopa|talk]]) 2022-04-21T02:38:34<br />
<br />
: I don't have the exact hardware to benchmark this, but on my (relatively old now) Skylake processor, I did not feel any difference. Neither from the perf_stream sysctl knob nor from early KMS. --[[User:Erus Iluvatar|Erus Iluvatar]] ([[User talk:Erus Iluvatar|talk]]) 06:55, 21 April 2022 (UTC)<br />
<br />
::[https://www.phoronix.com/scan.php?page=news_item&px=Intel-HSW-Observation-Arch Phoronix says that it's Haswell and newer], so your Skylake should just be fine. It's possible that the sysctl option makes no difference (that is, because of the permission to use the performance counter being present anyways), either because of your setup using Early KMS, or because of some Arch default. I think that a good test would be to disable Early KMS (e.g. take the i915 module out of the initrd), and run a program that triggers the {{ic|1=Performance support disabled, consider sysctl dev.i915.perf_stream_paranoid=0}} [https://gitlab.freedesktop.org/mesa/mesa/-/blob/68e8f00c441dc38f5a18a4aa5a30916c53fc986f/src/intel/vulkan/anv_perf.c#L60-L61 codepath]. I'm under the impression that affected applications are Vulkan programs which use the [https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VK_KHR_performance_query.html VK_KHR_performance_query extension] [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2775]. That said, I'm not sure how to reliably pick out affected programs, seeing as people are reporting this with Wine games, but DXVK does not use this extension. Cheers, [[User:CodingKoopa|CodingKoopa]] ([[User talk:CodingKoopa|talk]]) 17:05, 21 April 2022 (UTC)<br />
<br />
::: I'll try to find some time to benchmark this on the weekend, I probably have some random game on Steam that both uses Vulkan and runs through Wine. --[[User:Erus Iluvatar|Erus Iluvatar]] ([[User talk:Erus Iluvatar|talk]]) 18:35, 21 April 2022 (UTC)<br />
<br />
== 10 "Enable GuC / HuC firmware loading" seems to use wrong values for {{ic|1=enable_guc=}} ==<br />
<br />
https://01.org/linuxgraphics/downloads/firmware<br />
<br />
According to the above page, {{ic|1=enable_guc=1}} enables GuC features, {{ic|1=enable_guc=2}} enables HuC features and {{ic|1=enable_guc=3}} enables both together.<br />
<br />
Current version of [[Intel_graphics#Enable GuC / HuC firmware loading]] suggests using {{ic|1=enable_guc=2}} for GuC and HuC firmware loading.</div>ENV25https://wiki.archlinux.org/index.php?title=Talk:Firefox&diff=725348Talk:Firefox2022-04-04T06:17:04Z<p>ENV25: /* Hardware video acceleration */ About disabling codecs</p>
<hr />
<div>== Multimedia playback ==<br />
<br />
possible to note (somewhere around [https://wiki.archlinux.org/index.php/Firefox#Open-with_extension Open-with extension]) that video playback can be handled via a window manager key binding or shortcut like {{ic|bindsym $mod+m exec mpv -- $(sselp)}} for i3wm or similar [[User:Ubone|Ubone]] ([[User talk:Ubone|talk]]) 05:11, 20 June 2018 (UTC)<br />
<br />
== Dictionaries for spell checking ==<br />
<br />
I'm using Firefox stable version (61.0-1) and it no longer creates symbolic links to the system dictionaries. <br />
<br />
Now it uses this about:config key: "spellchecker.dictionary_path"<br />
<br />
{{Unsigned|14:27, 27 June 2018 (UTC)|J1simon}}<br />
<br />
== Screenshot of webpage ==<br />
<br />
[[Special:Diff/531137]]<br />
<br />
:''no need to list every possible way''<br />
<br />
Why not? They're not the same, moz://a might remove the new one, it may not work for someone, etc. ― [[User:Ubone|Ubone]] ([[User talk:Ubone|talk]]) 10:04, 27 July 2018 (UTC)<br />
<br />
:Mozilla won't remove the main way, there is no reason it shouldn't work, the developer toolbar will be removed in Firefox 62.[https://developer.mozilla.org/en-US/docs/Tools/GCLI] --[[User:Larivact|Larivact]] ([[User talk:Larivact|talk]]) 11:58, 27 July 2018 (UTC)<br />
<br />
::ok that explains the removal but was there really a need for the rewrite? ― [[User:Ubone|Ubone]] ([[User talk:Ubone|talk]]) 13:04, 27 July 2018 (UTC)<br />
<br />
:::The previous version was alright, I just made some slight improvements, like dropping irrelevant info ("Firefox 57", "Page actions") and elaborating why the Save button is misleading. --[[User:Larivact|Larivact]] ([[User talk:Larivact|talk]]) 13:51, 27 July 2018 (UTC)<br />
<br />
::::I can't call it an improvement when the reading entropy has increased. ― [[User:Ubone|Ubone]] ([[User talk:Ubone|talk]]) 14:52, 27 July 2018 (UTC)<br />
<br />
:::::How so? --[[User:Larivact|Larivact]] ([[User talk:Larivact|talk]]) 15:21, 27 July 2018 (UTC)<br />
<br />
::::::It's repetitive and unclear. ― [[User:Ubone|Ubone]] ([[User talk:Ubone|talk]]) 15:56, 27 July 2018 (UTC)<br />
<br />
:::::::[[Special:Diff/531244|Fixed it.]] --[[User:Larivact|Larivact]] ([[User talk:Larivact|talk]]) 16:33, 27 July 2018 (UTC)<br />
<br />
:::::::Please do not [[Special:Diff/531294|silently revert my edits without stating a reason]]. I thought I addressed your concern. --[[User:Larivact|Larivact]] ([[User talk:Larivact|talk]]) 10:46, 28 July 2018 (UTC)<br />
<br />
::::::::no not really, but respected your addition and it is there ― [[User:Ubone|Ubone]] ([[User talk:Ubone|talk]]) 11:00, 28 July 2018 (UTC)<br />
<br />
[[special:diff/536480]]<br />
<br />
:''The last sentence wrongly implies that the above method doesn't work when you block HTML canvas.''<br />
<br />
{{ic|1=about:config?filter=privacy.resistFingerprinting}} ― [[User:Ubone|Ubone]] ([[User talk:Ubone|talk]]) 06:44, 21 August 2018 (UTC)<br />
<br />
:You're right that does break it, contrary to [https://bugzilla.mozilla.org/show_bug.cgi?id=1412961 #1412961] being marked as fixed. --[[User:Larivact|Larivact]] ([[User talk:Larivact|talk]]) 06:54, 21 August 2018 (UTC)<br />
<br />
::please abstain from rewording ― [[User:Ubone|Ubone]] ([[User talk:Ubone|talk]]) 06:59, 21 August 2018 (UTC)<br />
<br />
:::Sorry, I just did. --[[User:Larivact|Larivact]] ([[User talk:Larivact|talk]]) 07:06, 21 August 2018 (UTC)<br />
<br />
::::[[special:diff/536510]] Enabling {{ic|privacy.resistFingerprinting}} does not break screen shooting but it does require per site confirmation, you might want to think more ― [[User:Ubone|Ubone]] ([[User talk:Ubone|talk]]) 07:18, 21 August 2018 (UTC)<br />
<br />
:::::On my system it breaks; please be a bit more [[Code of conduct#Respect|respectful]]. --[[User:Larivact|Larivact]] ([[User talk:Larivact|talk]]) 07:23, 21 August 2018 (UTC)<br />
<br />
::::::as i already wrote, it breaks on all systems and is unbroken on per site basis, also please don't accuse me of being not respectful in the same thread you gave me a middle finger just 17 minutes prior ― [[User:Ubone|Ubone]] ([[User talk:Ubone|talk]]) 07:30, 21 August 2018 (UTC)<br />
<br />
::::::and to be clear this wasn't an offence but an observation ― [[User:Ubone|Ubone]] ([[User talk:Ubone|talk]]) 07:38, 21 August 2018 (UTC)<br />
<br />
:::::::I deselected ''Always remember my decision'' in the prompt which breaks screen shooting. I didn't intentionally neglect you, I just missed your message. --[[User:Larivact|Larivact]] ([[User talk:Larivact|talk]]) 08:20, 21 August 2018 (UTC)<br />
<br />
== Dark themes ==<br />
<br />
RE: [[Special:Diff/552276]]. How exactly is copying and editing a ''.desktop'' file less complex than simply adding a setting to about:config ? And what's so unreliable about changing the content process's theme? -- [[User:nl6720|nl6720]] ([[User talk:nl6720|talk]]) 07:02, 1 November 2018 (UTC)<br />
<br />
:The {{ic|.desktop}} file is optional, it's just a simple variable. I've used css before and found it did not work well sometimes. They are really two different solutions that give similar results but are not the same. We could have both. The css is rightfully in the tweaks page as it may even give more flexibility for those who choose to have it. The main page only hints a standard option. --[[User:Ubone|Ubone]] ([[User talk:Ubone|talk]]) 07:21, 1 November 2018 (UTC)<br />
<br />
::I don't understand how a ''.desktop'' file is optional. Where else can you set {{ic|GTK_THEME}} so that it applies only to a specific application and not globally? [[Special:Diff/552275|My proposed solution]] wasn't to use the mostly non-working CSS workaround from [[Firefox/Tweaks#Unreadable input fields with dark GTK+ themes]], but to set the content process's theme with {{ic|widget.content.gtk-theme-override}}. -- [[User:nl6720|nl6720]] ([[User talk:nl6720|talk]]) 07:37, 1 November 2018 (UTC)<br />
<br />
:::You can do {{ic|1=GTK_THEME=Adwaita firefox}} in your terminal emulator or bind {{ic|1=GTK_THEME=Adwaita firefox}} to a key in your window manager, for example. The {{ic|.desktop}} file is one of the options a user has. {{ic|widget.content.gtk-theme-override}} is already in the tweaks page and that's ok. --[[User:Ubone|Ubone]] ([[User talk:Ubone|talk]]) 07:51, 1 November 2018 (UTC)<br />
<br />
::::Not everyone uses window managers. Anyway, I still think that [[Firefox#Dark themes]] should link to [[Firefox/Tweaks#Unreadable input fields with dark GTK+ themes]], otherwise readers might never think of looking there. -- [[User:nl6720|nl6720]] ([[User talk:nl6720|talk]]) 08:04, 1 November 2018 (UTC)<br />
<br />
::::[[Special:Diff/559199|See what happens]] when there's no link from [[Firefox#Dark themes]] to [[Firefox/Tweaks#Unreadable input fields with dark GTK+ themes]]. -- [[User:nl6720|nl6720]] ([[User talk:nl6720|talk]]) 14:03, 16 December 2018 (UTC)<br />
<br />
:::::I wonder if the links should be in reverse order. I understand you put the link there because it's a firefox page but my reasoning for this is 1/ the tweaks page has a lot more information so the gtk link could be quicker to give what some may want; and 2/ the link is quite long and kinda makes the sentence lose balance; or it maybe should be removed because it's already in the tweaks page --[[User:Ubone|Ubone]] ([[User talk:Ubone|talk]]) 16:06, 22 December 2018 (UTC)<br />
<br />
::::::I think the link is needed, since most people would not think to look at [[Firefox/Tweaks]]. -- [[User:nl6720|nl6720]] ([[User talk:nl6720|talk]]) 08:48, 23 December 2018 (UTC)<br />
<br />
:::::::no the other one --[[User:Ubone|Ubone]] ([[User talk:Ubone|talk]]) 13:00, 23 December 2018 (UTC)<br />
<br />
::::::::You mean "[[GTK#Themes]]"? I didn't remove it because I thought that you want to keep that link there. I have no objections to removing it. -- [[User:nl6720|nl6720]] ([[User talk:nl6720|talk]]) 16:23, 23 December 2018 (UTC)<br />
<br />
== Smooth scrolling ==<br />
<br />
Is [https://wiki.archlinux.org/index.php/Firefox#Smooth_Scrolling this] really relevant for recent releases of Firefox? I tried the tweaks and it actually made things worse.<br />
<br />
[[User:Shelter|Shelter]] ([[User talk:Shelter|talk]]) 09:46, 10 May 2020 (UTC)<br />
<br />
== GNOME keyring integration ==<br />
<br />
There is a broken package link in [[Firefox#KDE/GNOME integration]]. I researched a bit and I found out that [https://lists.archlinux.org/pipermail/aur-requests/2020-September/044979.html the AUR package has been deleted] because it is not compatible with a current Firefox/Thunderbird version. It is also not even available via addons.mozilla.org anymore.<br />
If the addon has been abandoned I would be in favor of removing this from the list.<br />
<br />
[[User:NetSysFire|NetSysFire]] ([[User talk:NetSysFire|talk]]) 00:41, 31 January 2021 (UTC)<br />
<br />
:Removed that bit and renamed that section to just "KDE integration". -- [[User:Svito|Svito]] ([[User talk:Svito|talk]]) 04:54, 31 January 2021 (UTC)<br />
<br />
== Firefox and Pulseaudio ==<br />
<br />
The Wiki says Firefox needs Pulseaudio package for audio playback. But I don't use Pulseaudio and don't have it installed on my system and Firefox plays audio just fine.<br />
Maybe we could edit that in the Wiki?<br />
[[User:Raphaelabb|Raphaelabb]] ([[User talk:Raphaelabb|talk]]) 07:05, 23 March 2021 (UTC)<br />
<br />
:Which framework do you use to play audio with Firefox ? [[User:Hdante|Hdante]] ([[User talk:Hdante|talk]]) 20:53, 22 March 2021 (UTC)<br />
<br />
:{{pkg|firefox}} depends on {{pkg|libpulse}} but not {{pkg|pulseaudio}} [https://www.memesmonkey.com/topic/works+on+my+machine <s>''on my machine''</s>] Darren "Un1Gfn" "[[User:PXf|PXf]]" Ng ([[User talk:PXf|talk]]) 02:08, 23 March 2021 (UTC)<br />
<br />
:I use {{pkg|libpulse}} only. I confirm that {{pkg|pulseaudio}} is not necessary. [[User:Raphaelabb|Raphaelabb]] ([[User talk:Raphaelabb|talk]]) 07:05, 23 March 2021 (UTC)<br />
:Pulseaudio is certainly not required, and I'm going to change the text. I don't think libpulse is required either, although it gets installed because it's listed as a dependency.<br />
:A bit of history: Around FF 53, alsa was disabled in the default Mozilla build of firefox. This caused a lot of trouble for many people, and the Arch maintainers re-enabled alsa in the Arch package, as can be seen in [https://github.com/archlinux/svntogit-packages/blob/packages/firefox/trunk/PKGBUILD the PKGBUILD]. So I believe when you run firefox and you don't have pulseaudio installed, it falls back to alsa, and libpulse is not used. At some point in the future Mozilla may decide to remove alsa support, and at that point we'll need to use some workaround like apulse. [[User:JimRees|JimRees]] ([[User talk:JimRees|talk]]) 19:31, 13 August 2021 (UTC)<br />
<br />
== Hardware video acceleration ==<br />
<br />
The page states "Nvidia's proprietary driver does not support VA-API and DMA-BUF so this feature will not work on that driver," however [[Hardware video acceleration#Installation]] mentions {{pkg|libva-vdpau-driver}} providing a VDPAU backend for VA-API, so with {{pkg|nvidia}} supporting VDPAU surely this combination provides video acceleration in Firefox? [[User:Mbromilow|Mbromilow]] ([[User talk:Mbromilow|talk]]) 02:46, 18 May 2021 (UTC)<br />
<br />
:The problem is DMA-BUF, not VA-API. Rumors say NVIDIA driver 470 will have DMA-BUF and Wayland support so let's wait until then to add this back to wiki [[User:N0k0m3|N0k0m3]] ([[User talk:N0k0m3|talk]]) 16:21, 22 May 2021 (UTC)<br />
<br />
:: I agree with [[User:N0k0m3|N0k0m3]]. NVIDIA has confirmed they are working [https://bugs.kde.org/show_bug.cgi?id=428089#c2 on DMA-BUF support], for now we should wait. I will edit the page to clarify DMA-BUF support is the blocking issue. For now should we remove the "The factual accuracy of this article or section is disputed" banner? [[User:Vchernin|Vchernin]] ([[User talk:Vchernin|talk]]) 06:51, 1 June 2021 (UTC)<br />
<br />
::: I added all currently known nvidia dma-buf information to the tips area of that section. I removed the warning as all information that might be useful is contained, if there's anything else that should be mentioned for nvidia users feel free to add it. [[User:Vchernin|Vchernin]] ([[User talk:Vchernin|talk]]) 06:13, 2 July 2021 (UTC)<br />
<br />
Under environment variables it states "MOZ_DISABLE_RDD_SANDBOX=1 to disable RDD sandbox, see [9]." However this can be achieved by setting media.rdd-vpx.enabled to false. Furthermore, the [https://mastransky.wordpress.com/2020/03/16/wayland-x11-how-to-run-firefox-in-mixed-environment/ given link] does not actually mention the MOZ_DISABLE_RDD_SANDBOX=1 variable. I don't see a need for this bullet point in it's current form. [[User:Vchernin|Vchernin]] ([[User talk:Vchernin|talk]]) 06:52, 2 July 2021 (UTC)<br />
<br />
In the Tips section it is mentioned that the h264ify extensions can be used to disable some codecs. I think it's simpler to use {{ic|about:config}}. For example I set {{ic|media.av1.enabled}} to {{ic|false}}. [[User:ENV25|ENV25]] ([[User talk:ENV25|talk]]) 06:17, 4 April 2022 (UTC)<br />
<br />
== Bengali fonts ==<br />
<br />
I'm not personally using them, so I could not test, but using [[Font configuration#Replace or set default fonts]] should give more permanent results than [[Firefox#Bengali font broken in some pages]] unless I'm mistaken? --[[User:Erus Iluvatar|Erus Iluvatar]] ([[User talk:Erus Iluvatar|talk]]) 06:14, 27 March 2022 (UTC)</div>ENV25https://wiki.archlinux.org/index.php?title=Mpv&diff=715308Mpv2022-02-03T11:50:01Z<p>ENV25: /* Hardware video acceleration */ mention "allow CPU processing with video filters"</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Video]]<br />
[[Category:Audio]]<br />
[[Category:Streaming]]<br />
[[de:Mpv]]<br />
[[es:Mpv]]<br />
[[ja:Mpv]]<br />
[[ru:Mpv]]<br />
[[zh-hans:Mpv]]<br />
{{Related articles start}}<br />
{{Related|MPlayer}}<br />
{{Related|youtube-dl}}<br />
{{Related articles end}}<br />
<br />
[https://mpv.io/ mpv] is a media player based on [[MPlayer]] and the now unmaintained ''mplayer2''. It supports a wide variety of video file formats, audio and video codecs, and subtitle types. A detailed (although admittedly incomplete) list of differences between ''mpv'' and the aforementioned players can be found [https://github.com/mpv-player/mpv/blob/master/DOCS/mplayer-changes.rst here].<br />
<br />
== Installation ==<br />
<br />
[[Install]] the {{Pkg|mpv}} package or {{AUR|mpv-git}} for the development version.<br />
<br />
=== Front ends ===<br />
<br />
See [[List of applications/Multimedia#mpv-based]].<br />
<br />
== Configuration ==<br />
<br />
''mpv'' comes with good all-around defaults that should work well on computers with weaker/older video cards. However, if you have a computer with a more modern video card then ''mpv'' allows you to do a great deal of configuration to achieve better video quality (limited only by the power of your video card). To do this one only needs to create a few configuration files (they do not exist by default).<br />
<br />
{{Note| Configuration files are read system-wide from {{ic|/etc/mpv}} and per-user from {{ic|~/.config/mpv}} (unless the [[environment variable]] {{ic|XDG_CONFIG_HOME}} is set), where per-user settings override system-wide settings, all of which are overridden by the command line. User specific configuration is suggested since it may require some trial and error.}}<br />
<br />
To help you get started ''mpv'' provides sample configuration files with default settings. Copy them to use as a starting point:<br />
<br />
$ cp -r /usr/share/doc/mpv/ ~/.config/<br />
<br />
{{ic|mpv.conf}} contains the majority of ''mpv'''s settings, {{ic|input.conf}} contains key bindings. Read through both of them to get an idea of how they work and what options are available.<br />
<br />
=== General settings ===<br />
<br />
Add the following settings to {{ic|~/.config/mpv/mpv.conf}}.<br />
<br />
==== Subtitle configurations ====<br />
<br />
Enable fuzzy searching:<br />
sub-auto=fuzzy<br />
<br />
Bold the subtitles to increase readability:<br />
sub-bold=yes<br />
<br />
==== High quality configurations ====<br />
<br />
This loads high quality OpenGL options when using {{ic|1=vo=gpu}} as video output (default). Most users can run these without any problems, but they are not enabled by default to avoid causing problems for the few users who cannot run them:<br />
<br />
profile=gpu-hq<br />
<br />
The {{ic|gpu-hq}} profile defaults to the {{ic|spline36}} scaling filter for mid quality and speed. For the best quality video output, the manual states that if your hardware can run it, {{ic|ewa_lanczossharp}} is probably what you should use.<br />
<br />
profile=gpu-hq<br />
scale=ewa_lanczossharp<br />
cscale=ewa_lanczossharp<br />
<br />
These last three options are a little more complicated. The first option makes it so that if audio and video go out of sync then instead of dropping video frames it will resample the audio (a slight change in audio pitch is often less noticeable than dropped frames). The mpv wiki has an in depth article on it titled [https://github.com/mpv-player/mpv/wiki/Display-synchronization Display Synchronization]. The remaining two essentially make motion appear smoother on your display by changing the way that frames are shown so that the source framerate jives better with your display's refresh rate (not to be confused with SVP's technique which actually converts video to 60fps). The mpv wiki has an in depth article on it titled [https://github.com/mpv-player/mpv/wiki/Interpolation Interpolation] though it is also commonly known as ''smoothmotion''.<br />
<br />
profile=gpu-hq<br />
scale=ewa_lanczossharp<br />
cscale=ewa_lanczossharp<br />
video-sync=display-resample<br />
interpolation<br />
tscale=oversample<br />
<br />
{{Note| If [[NVIDIA Optimus]] is being used, the line {{ic|1=video-sync=display-resample}} may cause video to be sped up.}}<br />
<br />
Beyond this there is still a lot you can do but things become more complicated, require more powerful video cards, and are in constant development. As a brief overview, it is possible to load special shaders that perform exotic scaling and sharpening techniques including some that actually use deep neural networks trained on images (for both real world and animated content). To learn more about this take a look around the [https://github.com/mpv-player/mpv/wiki mpv wiki], particularly the [https://github.com/mpv-player/mpv/wiki/User-Scripts#user-shaders user shader's section].<br />
<br />
There are also plenty of other options you may find desirable as well. It is worthwhile taking a look at {{man|1|mpv}}. It is also helpful to run ''mpv'' from the command line to check for error messages about the config.<br />
<br />
==== Custom profiles ====<br />
<br />
In {{ic|mpv.conf}} it is possible to create ''profiles'' which are essentially just "groups of options" with which you can:<br />
<br />
* Quickly switch between different configurations without having to rewrite the file.<br />
* Create special profiles for special content.<br />
* ''nest'' profiles so that you can make more complicated ''profiles'' out of simpler ones.<br />
<br />
Creating a profile is easy. The area at the top of {{ic|mpv.conf}} is called the top level, any options you write there will kick into effect once ''mpv'' is started. However, once you define a profile by writing its name in brackets then every option you write below it (until you define a new profile) is considered part of that profile. Here is an example {{ic|mpv.conf}}:<br />
<br />
profile=myprofile2 #Top level area, load myprofile2<br />
ontop=yes #Always on top<br />
<br />
[myprofile1] #A simple profile, top level area ends here<br />
profile-desc="a profile" #Optional description for profile<br />
fs=yes #Start in full screen<br />
<br />
[myprofile2] #Another simple profile<br />
profile=gpu-hq #A built in profile that comes with mpv<br />
log-file=~~/log #Sets a location for writing a log file, ~~/ translates to ~/.config/mpv<br />
<br />
There are only two lines within the top level area and there are two separate profiles defined below it. When ''mpv'' starts it sees the first line, loads the options in {{ic|myprofile2}} (which means it loads the options in {{ic|gpu-hq}} and {{ic|1=log-file=~~/log}}) finally it loads {{ic|1=ontop=yes}} and finishes starting up. Note, {{ic|myprofile1}} is never loaded because it is never called in the top level area.<br />
<br />
Alternatively one could call ''mpv'' from the command line with:<br />
<br />
$ mpv --profile=myprofile1 video.mkv<br />
<br />
and it would ignore all options except the ones for {{ic|myprofile1}}.<br />
<br />
=== Key bindings ===<br />
<br />
Key bindings are fairly straightforward given the examples in {{ic|/usr/share/doc/mpv/input.conf}} and the relevant section in the [https://mpv.io/manual/master/#command-interface manual].<br />
<br />
Add the following examples to {{ic|~/.config/mpv/input.conf}}:<br />
<br />
shift+s screenshot each-frame<br />
Shift+UP seek 600<br />
Shift+DOWN seek -600<br />
= cycle video-unscaled<br />
- cycle-values window-scale 2 3 1 .5<br />
WHEEL_UP add volume 5<br />
WHEEL_DOWN add volume -5<br />
WHEEL_LEFT ignore<br />
WHEEL_RIGHT ignore<br />
Alt+RIGHT add video-rotate 90<br />
Alt+LEFT add video-rotate -90<br />
Alt+- add video-zoom -0.25<br />
Alt+= add video-zoom 0.25<br />
Alt+j add video-pan-x -0.05<br />
Alt+l add video-pan-x 0.05<br />
Alt+i add video-pan-y 0.05<br />
Alt+k add video-pan-y -0.05<br />
Alt+BS set video-zoom 0; set video-pan-x 0; set video-pan-y 0<br />
<br />
For an attempt to reproduce MPC-HC key bindings in mpv, see [https://github.com/dragons4life/MPC-HC-config-for-MPV/blob/master/input.conf].<br />
<br />
=== Additional configuration files ===<br />
<br />
In addition there are a few more configuration files and directories that can be created, among which:<br />
<br />
* {{ic|~/.config/mpv/script-opts/osc.conf}} manages the [https://mpv.io/manual/master/#on-screen-controller On Screen Controller].<br />
* {{ic|~/.config/mpv/scripts/''script-name''.lua}} for Lua scripts. See [https://github.com/mpv-player/mpv/issues/3500#issuecomment-305646994] for an example.<br />
<br />
See https://mpv.io/manual/master/#files for more.<br />
<br />
== Scripts ==<br />
<br />
''mpv'' has a [https://github.com/mpv-player/mpv/wiki/User-Scripts large variety of scripts] that extend the functionality of the player. To this end, it has internal bindings for both Lua and JavaScript (added recently).<br />
<br />
Scripts are typically installed by putting them in the {{ic|~/.config/mpv/scripts/}} directory (you may have to create it first). After that they will be automatically loaded when mpv starts (this behavior can be altered with other ''mpv'' options). Some scripts come with their own installation and configuration instructions, so make sure to have a look. In addition some scripts are old, broken, and unmaintained.<br />
<br />
=== JavaScript ===<br />
<br />
JavaScript (ES5 via [https://mujs.com/ MuJS]) has been supported as an mpv scripting language since 2014. Currently only [https://github.com/mpv-player/mpv/wiki/User-Scripts#javascript a few scripts] are available, but [https://github.com/mpv-player/mpv/blob/master/DOCS/man/javascript.rst documentation exists] for anyone interested in making their own.<br />
<br />
To get started, drop a script with a {{ic|.js}} extension in the mpv {{ic|scripts}} directory, e.g.:<br />
<br />
{{hc|~/.config/mpv/scripts/fullscreen-off-on-pause.js|<br />
<nowiki><br />
function onPauseChange (prop, enabled) {<br />
if (enabled) {<br />
mp.set_property('fullscreen', 'no')<br />
}<br />
}<br />
<br />
mp.observe_property('pause', 'bool', onPauseChange)<br />
</nowiki><br />
}}<br />
<br />
For more details, e.g. on using {{ic|require}} to load CommonJS modules, see the [https://github.com/mpv-player/mpv/blob/master/DOCS/man/javascript.rst#commonjs-modules-and-requireid documentation].<br />
<br />
JavaScript support is available in the {{Pkg|mpv}} package, as well as some AUR packages, e.g. {{AUR|mpv-full}} and {{AUR|mpv-full-git}}.<br />
<br />
=== Lua ===<br />
<br />
The development of ''mpv'''s Lua scripts is documented in [https://github.com/mpv-player/mpv/blob/master/DOCS/man/lua.rst DOCS/man/lua.rst] with examples in [https://github.com/mpv-player/mpv/tree/master/TOOLS/lua TOOLS/lua]<br />
<br />
==== mpv-ytdlAutoFormat ====<br />
<br />
[https://github.com/Samillion/mpv-ytdlautoformat mpv-ytdlautoformat] is a Lua script to auto change ytdl-format for Youtube and Twitch or the domains you desire, to 480p or the quality you desire.<br />
<br />
==== mpv-stats ====<br />
<br />
[https://github.com/Argon-/mpv-stats/ mpv-stats] (or simply ''stats'') is a Lua script that outputs a lot of live statistics showing how well ''mpv'' is currently doing. It is very useful for making sure that your hardware can keep up with your configuration and for comparing different configurations. Since version [https://github.com/mpv-player/mpv/releases/tag/v0.28.0 v0.28.0], the script is built into {{Pkg|mpv}} and can be toggled on or off with the {{ic|i}} or {{ic|I}} keys (by default).<br />
<br />
==== mpv-webm ====<br />
<br />
[https://github.com/ekisu/mpv-webm mpv-webm] (or simply ''webm'') is a very easy to use Lua script that allows one to create WebM files while watching videos. It includes several features and does not have any extra dependencies (relies entirely on mpv).<br />
<br />
=== C ===<br />
<br />
==== mpv-mpris ====<br />
<br />
The C plugin [https://github.com/hoyon/mpv-mpris mpv-mpris] allows other applications to integrate with ''mpv'' via the [[MPRIS]] protocol. For example, with ''mpv-mpris'' installed, {{pkg|kdeconnect}} can automatically pause video playback in ''mpv'' when a phone call arrives. Another example is buttons (play\pause etc) on bluetooth audio-devices.<br />
<br />
Install {{AUR|mpv-mpris}} and follow the post-installation instructions displayed by Pacman.<br />
<br />
== Vapoursynth ==<br />
<br />
Vapoursynth is an alternative to AviSynth that can be used on Linux and allows for Video manipulation via python scripts. Vapoursynths python scripts can be used as video filters for ''mpv''.<br />
<br />
To use vapoursynth filters you have to install the {{Pkg|vapoursynth}} package (or {{AUR|vapoursynth-git}}) and compile ''mpv'' with the {{ic|--enable-vapoursynth}} build flag.<br />
<br />
This is easier to do by first installing Vapoursynth and then installing (or re-installing if it is already installed) {{AUR|mpv-git}}. The configure script for {{AUR|mpv-git}} will auto-detect Vapoursynth (as long as it has already been installed) and it will automatically compile ''mpv'' with support for Vapoursynth without having to manually change any configure options or anything (this makes it very easy to update ''mpv'' as well).<br />
<br />
=== SVP 4 Linux (SmoothVideoProject) ===<br />
<br />
[https://www.svp-team.com/wiki/Main_Page SmoothVideoProject SVP] is a program that is primarily known for converting video to 60fps. It is free [as in beer] and full featured for 64bit Linux (costs money for Windows and OS X and is incompatible with 32bit Linux).<br />
<br />
It has three main features and each one can be disabled/enabled as one chooses (you are not forced to use motion interpolation).<br />
<br />
# [https://www.svp-team.com/wiki/Manual:FRC Motion interpolation] ([https://www.youtube.com/watch?v=Wjb6CSe4708 youtube video]) - An algorithm that converts video to 60fps. This creates the somewhat controversial "soap opera effect" that some people love and others hate. Unfortunately the algorithm is not perfect and it also introduces more than its share of weird artifacts. The algorithm can be tuned (via a slider) for either performance or quality. It also has some artifact reduction settings that interpolate actual frames with the generated frames reducing the noticeability of the artifacts. The framerate detection can be set to automatic or manual (manual seems to resolve performance issues for some users).<br />
# [https://www.svp-team.com/wiki/Manual:Outer_lighting Black bar lighting] ([https://www.youtube.com/watch?v=yTzTpW3kTBE youtube video]) - If the image has an aspect ratio that produces black bars on your display then SVP will illuminate the black bars with "lights" generated by the content on the screen. It has some amount of customization but the defaults are pretty close to optimal.<br />
# [https://www.svp-team.com/wiki/Manual:SVPlight LED ambient lighting control] ([https://www.youtube.com/watch?v=UUM2n-8kIJ8 youtube video]) - Has the ability to control LED ambient lighting attached to your television.<br />
<br />
Once you have ''mpv'' compiled with Vapoursynth support it is fairly easy to get SVP working with ''mpv''. Simply install {{AUR|svp}}, open the SVP program to let it assess your system performance (you may want to close other programs first so that it gets an accurate reading), and finally add the following ''mpv'' profile to your mpv.conf[https://www.svp-team.com/wiki/SVP:mpv]:<br />
<br />
{{hc|1=mpv.conf|2=<br />
[svp]<br />
input-ipc-server=/tmp/mpvsocket # Receives input from SVP<br />
hr-seek-framedrop=no # Fixes audio desync<br />
resume-playback=no # Not compatible with SVP<br />
<br />
# Can fix stuttering in some cases, in other cases probably causes it. Try it if you experience stuttering.<br />
#opengl-early-flush=yes <br />
}}<br />
<br />
Then, in order to use SVP you must have the SVP program running in the background before opening the file using ''mpv'' with that profile. Either do:<br />
<br />
$ mpv --profile=svp video.mkv<br />
<br />
or set {{ic|1=profile=svp}} in the top-level portion of the ''mpv'' [[#Custom profiles|configuration]].<br />
<br />
If you want to use hardware decoding then you must use a copy-back decoder since normal decoders are not compatible with Vapoursynth (choose a {{ic|hwdec}} option that ends in {{ic|-copy}}). For instance:<br />
<br />
hwdec=auto-copy<br />
hwdec-codecs=all<br />
<br />
Either way, hardware decoding is discouraged by ''mpv'' developers and is not likely to make a significant difference in performance.<br />
<br />
== Tips and Tricks ==<br />
<br />
=== Hardware video acceleration ===<br />
<br />
See [[Hardware video acceleration]].<br />
<br />
Hardware accelerated video decoding is available via {{ic|1=--hwdec=''API''}} option. For list of all supported APIs and other required options see [https://mpv.io/manual/stable/#options-hwdec relevant manual section].<br />
<br />
To allow CPU processing with video filters choose a {{ic|*-copy}} API.<br />
<br />
For [[Wayland]] use {{ic|1=--gpu-context=wayland}} option. For list of other available GPU APIs see [https://mpv.io/manual/stable/#options-gpu-context manual].<br />
<br />
To troubleshoot hardware acceleration, adjusting the [https://mpv.io/manual/master/#options-msg-level logging levels] may be necessary. For instance, {{ic|1=--msg-level=vd=v,vo=v,vo/gpu/vaapi-egl=trace}} enables the following:<br />
* ''Verbose'' messages from the video decoder ({{ic|vd}}) and video output ({{ic|vo}}) modules.<br />
* Even more detailed ''trace'' messages for the module responsible for video decoding. Here, after running mpv once without any log levels adjusted, the module of interest was empirically determined to be {{ic|vo/gpu/vaapi-egl}}.<br />
<br />
=== Save position on quit ===<br />
<br />
By default you can save the position and quit by pressing {{ic|Shift+q}}. The shortcut can be changed by setting {{ic|quit_watch_later}} in the key bindings configuration file.<br />
<br />
To automatically save the current playback position on quit, start ''mpv'' with {{ic|--save-position-on-quit}}, or add {{ic|save-position-on-quit}} to the configuration file.<br />
<br />
=== Volume is too low ===<br />
<br />
Set {{ic|1=volume-max=''value''}} in your configuration file to a reasonable amount, such as {{ic|1=volume-max=150}}, which then allows you to increase your volume up to 150%, which is more than twice as loud. Increasing your volume too high will result in clipping artefacts. Additionally (or alternatively), you can utilize [[Wikipedia:Dynamic range compression|dynamic range compression]] with {{ic|1=af=acompressor}}.<br />
<br />
=== Specify an audio output ===<br />
<br />
Run the following command to get a list of available audio output devices<br />
<br />
$ mpv --audio-device=help<br />
<br />
Then add one to {{ic|~/.config/mpv/mpv.conf}}. For example:<br />
<br />
audio-device=alsa/hdmi:CARD=NVidia,DEV=1<br />
<br />
=== HD Audio passthrough ===<br />
<br />
To enable HD audio codecs like TrueHD and DTS-MA to passthrough to an AV receiver add the following to {{ic|~/.config/mpv/mpv.conf}}<br />
<br />
audio-spdif=ac3,eac3,dts-hd,truehd<br />
<br />
=== Better audio with sped up content ===<br />
<br />
If regularly viewing sped up content, use the following filter for a better audio quality:<br />
<br />
af=scaletempo2<br />
<br />
=== Volume normalization ===<br />
<br />
{{Expansion|Add little more details about the available filters, see [https://superuser.com/a/323127] for a comparison of {{ic|loudnorm}} and {{ic|dynaudnorm}}.}}<br />
<br />
Different sources may have different or inconsistent loudness, so ''mpv'' users may need to configure automatic volume normalization. For example:<br />
<br />
{{hc|~/.config/mpv/input.conf|2=<br />
n cycle_values af loudnorm=I=-30 loudnorm=I=-15 anull<br />
}}<br />
<br />
This binds the key {{ic|n}} to cycle the audio filter settings ({{ic|af}}) through the specified values:<br />
<br />
* {{ic|1=loudnorm=I=-30}}: loudnorm setting with {{ic|1=I=-30}}, soft volume, might be suitable for background music<br />
* {{ic|1=loudnorm=I=-15}}: louder volume, might be good for the video currently in view<br />
* {{ic|anull}}: reset audio filter to null, i.e., disable the audio filter<br />
<br />
{{Note|Binding a key does not change the default audio filter. To change the default, add e.g. {{ic|1=af=loudnorm=I=-30}} to the main configuration file.}}<br />
<br />
Audio filtering in ''mpv'' is provided by the [[FFmpeg]] backend. See [[Wikipedia:EBU R 128]] and [https://ffmpeg.org/ffmpeg-filters.html#loudnorm ffmpeg loudnorm filter] for details.<br />
<br />
See also upstream issues [https://github.com/mpv-player/mpv/issues/3979] and [https://github.com/mpv-player/mpv/issues/2883] which mention different options.<br />
<br />
=== Play a DVD ===<br />
<br />
mpv does not support DVD menus. To start the main stream with the longest title of a video DVD, use the command:<br />
<br />
$ mpv dvd://<br />
<br />
An optional title specifier is a number (starting at 0) which selects between separate video streams on the DVD:<br />
<br />
$ mpv dvd://[title] <br />
<br />
DVDs which have been copied on to a local file system (by e.g. the [[dvdbackup]] tool) are accommodated by specifying the path to the local copy: {{ic|1=--dvd-device=''PATH''}}.<br />
<br />
See the following [[desktop file]] example for playing DVDs from a local file system:<br />
<br />
[Desktop Entry]<br />
Type=Application<br />
Name=mpv Media Player DVD <br />
GenericName=Multimedia player<br />
Comment=Play movies and songs<br />
Icon=mpv<br />
Exec=mpv dvd:// --player-operation-mode=pseudo-gui --force-window --idle --dvd-device=%f<br />
Terminal=false<br />
Categories=AudioVideo;Audio;Video;Player;TV;<br />
# (MimeType and X-KDE-Protocols omitted, see orginianl mpv.desktop file)<br />
<br />
By replacing the Exec line with<br />
<br />
Exec=mpv dvd://0 dvd://1 dvd://2 dvd://3 dvd://4 dvd://5 dvd://6 dvd://7 dvd://8 dvd://9 --player-operation-mode=pseudo-gui --force-window --idle --dvd-device=%f<br />
<br />
the mpv player will queue DVD title 0 to 9 in the playlist, which allows the user to play the titles consecutively or jump forward and backward in the DVD titles with the mpv GUI.<br />
<br />
Install {{Pkg|libdvdcss}}, to fix the error:<br />
<br />
[dvdnav] Error getting next block from DVD 1 (Error reading from DVD.)<br />
<br />
=== Quickly cycle between aspect ratios ===<br />
<br />
You can cycle between aspect ratios using {{ic|Shift+a}}.<br />
<br />
=== Ignoring aspect ratio ===<br />
<br />
You can ignore aspect ratio using {{ic|1=--keepaspect=''no''}}. To make option permanent, add line {{ic|1=keepaspect=''no''}} to configuration file.<br />
<br />
=== Draw to the root window ===<br />
<br />
Run ''mpv'' with {{ic|1=--wid=0}}. ''mpv'' will draw to the window with a window ID of 0.<br />
<br />
=== Always show application window ===<br />
<br />
To show application window even for audio files when launching mpv from command line use {{ic|--force-window}} option. To make option permament, add line {{ic|1=force-window=yes}} to the configuration file.<br />
<br />
=== Disable video output ===<br />
<br />
To disable video output when launching from command line use {{ic|1=--vid=no}} option, or its alias, {{ic|--no-video}}.<br />
<br />
=== Restoring old OSC ===<br />
<br />
Since version 0.21.0, ''mpv'' has replaced the on-screen controls by a bottombar. In case you want on-screen controls back, you can edit the ''mpv'' configuration [https://github.com/mpv-player/mpv/wiki/FAQ#i-want-the-old-osc-back as described here].<br />
<br />
=== Use as a browser plugin ===<br />
<br />
With the help of {{AUR|mozplugger}}, ''mpv'' can be used in a supported browser to play video. See [[Browser plugins#MozPlugger]] for configuration details. This coupled with a user script such as [http://isebaro.com/viewtube/?ln=en ViewTube], allows you to use ''mpv'' in place of a site's integrated video player.<br />
<br />
It may be needed to specify a valid user agent for HTTP streaming, e.g. {{ic|1=user-agent="Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0"}}.<br />
<br />
[[Browser plugins#Multimedia playback]] page shows other easy ways to watch videos.<br />
<br />
=== Improving mpv as a music player with Lua scripts ===<br />
<br />
[https://web.archive.org/web/20160320001546/http://bamos.github.io/2014/07/05/mpv-lua-scripting/ This blog post] introduces the [https://github.com/bamos/dotfiles/blob/master/.mpv/scripts.old/music.lua music.lua] script, which shows how Lua scripts can be used to improve ''mpv'' as a music player.<br />
<br />
=== Twitch.tv streaming over mpv ===<br />
<br />
If [[youtube-dl]] is installed, ''mpv'' can directly open a Twitch livestream.<br />
<br />
Alternatively, see [[Streamlink#Twitch]].<br />
<br />
Another alternative based on Livestreamer is this Lua script: https://gist.github.com/ChrisK2/8701184fe3ea7701c9cc<br />
<br />
=== youtube-dl and choosing formats ===<br />
<br />
The default {{ic|--ytdl-format}} is {{ic|bestvideo+bestaudio/best}}. For youtube videos that have 4K resolutions available, this may mean that your device will struggle to decode 4K VP9 encoded video in software even if the attached monitor is much lower resolution.<br />
<br />
Setting the right youtube-dl format selectors can fix this easily though. In the following configuration example, only videos with a vertical resolution of 1080 pixels or less will be considered.<br />
<br />
ytdl-format="bestvideo[height<=?1080]+bestaudio/best"<br />
<br />
If you wish to avoid a certain codec altogether because you cannot hardware-decode it, you can add this to the format selector. For example, we can additionally choose to ignore VP9 as follows:<br />
<br />
ytdl-format="bestvideo[height<=?1080][vcodec!=vp9]+bestaudio/best"<br />
<br />
If you prefer best quality open codecs (VP9 and Opus), use:<br />
ytdl-format="((bestvideo[vcodec^=vp9]/bestvideo)+(bestaudio[acodec=opus]/bestaudio[acodec=vorbis]/bestaudio[acodec=aac]/bestaudio))/best"<br />
<br />
=== youtube-dl audio with search ===<br />
<br />
To find and stream audio from your terminal emulator with {{ic|yta ''search terms''}} put the following function in your {{ic|.bashrc}}:<br />
<br />
function yta() {<br />
mpv --ytdl-format=bestaudio ytdl://ytsearch:"$*"<br />
}<br />
<br />
=== Reproducible screenshots ===<br />
<br />
The [https://mpv.io/manual/stable/#options-screenshot-template filename template] option can include the precise timecode (HH:MM:SS.mmm) of the screenshoted frame. The meaningful filename makes it easy to know the origin of the screenshot. It is set like this:<br />
<br />
{{hc|1=~/.config/mpv/mpv.conf|2=<br />
screenshot-template="%F - [%P]v%#01n"<br />
}}<br />
<br />
This expands to {{ic|''filename'' - [HH:MM:SS.mmm]v''number''.jpg}}. Example result:<br />
<br />
Gunsmith Cats/<br />
├── Gunsmith Cats - 01 - [00:00:50.217]v1.jpg<br />
├── Gunsmith Cats - 01 - [00:22:55.874]v1.jpg<br />
├── Gunsmith Cats - 02 - [00:12:09.729]v1.jpg<br />
├── Gunsmith Cats - 02 - [00:12:09.729]v2.jpg<br />
├── Gunsmith Cats - 02 - [00:15:05.778]v1.jpg<br />
└── Gunsmith Cats - 03 - [00:03:20.001]v1.jpg<br />
<br />
A bonus is it sorts nicely because alphabetically, the timecode is sorted within the episode number.<br />
<br />
=== Creating a single screenshot ===<br />
<br />
An example of creating a single screenshot, by using a start time ({{ic|HH:MM:SS}}):<br />
<br />
$ mpv --no-audio --start=00:01:30 --frames=1 /path/to/video/file --o=/path/to/screenshot.png<br />
<br />
Screenshots will be saved in /path/to/screenshot.png.<br />
<br />
=== Terminal output (libcaca) ===<br />
<br />
{{Pkg|libcaca}} support is disabled due to vulnerabilities (see {{Bug|70962}}), so if you want or need terminal output, install {{AUR|mpv-caca}}.<br />
<br />
== Troubleshooting ==<br />
<br />
=== General debugging ===<br />
<br />
If you are having trouble with ''mpv'''s playback (or if it is flat out failing to run) then the first three things you should do are:<br />
<br />
# Run ''mpv'' from the command line (the -v flag increases verbosity). If you are lucky there will be an error message there telling you what is wrong.<br>{{ic|$ mpv -v video.mkv}}<br />
# Have ''mpv'' output a log file. The log file might be difficult to sift through but if something is broken you might see it there.<br>{{ic|1=$ mpv -v --log-file=./log video.mkv}}<br />
# Run ''mpv'' without a configuration. If this runs well then the problem is somewhere in your configuration (perhaps your hardware cannot keep up with your settings).<br>{{ic|$ mpv --no-config video.mkv}}<br />
<br />
If ''mpv'' runs but it just does not run well then a fourth thing that might be worth taking a look at is installing the [[#mpv-stats|mpv-stats]] script and using it to see exactly how it is performing.<br />
<br />
=== Fix jerky playback and tearing ===<br />
<br />
''mpv'' defaults to using the OpenGL video output device setting on hardware that supports it. In cases such as trying to play video back on a 4K display using a Intel HD4XXX series card or similar, you will find video playback unreliable, jerky to the point of stopping entirely at times and with major tearing when using any OpenGL output setting. If you experience any of these issues, using the XV ([[Xorg]] only) video output device may help:<br />
<br />
{{hc|1=~/.config/mpv/mpv.conf|2=<br />
vo=xv<br />
}}<br />
<br />
{{Note|This is the most compatible VO on X, but may be low-quality, and has issues with OSD and subtitle display.}}<br />
<br />
It is possible to increase playback performance even more (especially on lower hardware), but this decreases the video quality dramatically in most cases.<br />
<br />
The following [[#Configuration|options]] may be considered to increase the video playback performance:<br />
<br />
{{hc|~/.config/mpv/mpv.conf|2=<br />
vd-lavc-fast<br />
vd-lavc-skiploopfilter=<skipvalue><br />
vd-lavc-skipframe=<skipvalue><br />
vd-lavc-framedrop=<skipvalue><br />
vd-lavc-threads=<threads><br />
}}<br />
<br />
=== Problems with window compositors ===<br />
<br />
Window compositors such as KWin or Mutter can cause trouble for playback smoothness. In such cases, it may help to set {{ic|1=x11-bypass-compositor=yes}} to make ''mpv'' also disable window compositing when playing in windowed mode (if supported by the compositor).<br />
<br />
With KWin compositing and hardware decoding, you may also want to set {{ic|1=x11-bypass-compositor=no}} to keep compositing enabled in fullscreen, since reanabling compositing after leaving fullscreen may introduce stutter for a period of time.<br />
<br />
=== No volume bar, cannot change volume ===<br />
<br />
Spin the mouse wheel over the volume icon.<br />
<br />
=== GNOME Blank screen (Wayland) ===<br />
<br />
''mpv'' may not suspend GNOME's Power Saving Settings if using Wayland resulting in screen saver turning off the monitor during video playback. A workaround is to add {{ic|gnome-session-inhibit}} to the beginning of the {{ic|1=Exec=}} line in {{ic|mpv.desktop}}.<br />
<br />
=== Use mpv with a compositor ===<br />
<br />
If you are using a compositor (e.g. in KDE Plasma 5) and find that composition is disabled (e.g. in Plasma this would make you unable to present windows or see window thumbnails in the default app switcher) when ''mpv'' is playing a video, try {{ic|1=x11-bypass-compositor=no}}<br />
<br />
=== Cursor theme not respected under GNOME Wayland ===<br />
<br />
On Wayland, clients can display different cursor themes because there is not a unique configuration file for it. For the cursor theme, Qt apps usually accept the value that is set for the [[environment variable]] {{ic|XCURSOR_THEME}}. However, in the specific case of mpv, the cursor theme that is displayed needs to be the one set in {{ic|~/.icons/default/index.theme}}. Since GNOME does not update this file when changing the cursor theme with GNOME Tweaks, you will have to do it manually. See [[Cursor themes#XDG specification]] for more information.</div>ENV25https://wiki.archlinux.org/index.php?title=Talk:Go_package_guidelines&diff=709478Talk:Go package guidelines2022-01-11T06:14:58Z<p>ENV25: /* about -linkmode=external */ new section</p>
<hr />
<div>== Go Modules and Caching ==<br />
<br />
I was recently building a package and noticed that it errored in CI but worked locally. It turned out I had a cached version of a dependency that had been removed upstream. This made me wonder if it wouldn't be good practice to recommend setting: GOCACHE="${srcdir}/cache" or similar before downloading packages so that doing a clean build also destroys the cache.<br />
<br />
[[User:SamWhited|SamWhited]] ([[User talk:SamWhited|talk]]) 05:44, 22 January 2019 (UTC)<br />
<br />
I'm not sure if this is desirable for most users. When I'm not building in a chroot, I want makepkg to use my local cache to build with. This saves me time when building. <br />
<br />
The problem you experienced is a side-effect of the golang community relying on third party hosting for dependencies that aren't immutable, like github. Projects like [https://github.com/gomods/athens Athens] address this by providing a proxy that caches any dependency ever requested of it. If run locally using such a proxy also saves a lot of time downloading dependencies if running in a clean chroot. It can also be set up to run for your CI so that a changed repo doesn't stop your build anymore. This requires exporting GOPROXY in your build to point at the proxy endpoint.<br />
<br />
[[User:Alaskanarcher|Alaskanarcher]] ([[User talk:Alaskanarcher|talk]]) 04:39, 9 May 2019 (UTC)<br />
<br />
== Go Modules, -git packages, and pkgver ==<br />
<br />
For anyone maintaining -git packages of Go tools, the following can be put in pkgver() to output the version that Go Modules uses if you don't have any semver compatible tags. This way, your packages can have a version that someone requiring your tool can drop in their go.mod file:<br />
<br />
git show --abbrev-commit --abbrev=12 --date='format:%G%m%d%H%M%S' --pretty=format:v0.0.0_%cd_%h --no-patch HEAD<br />
<br />
—[[User:SamWhited|SamWhited]] ([[User talk:SamWhited|talk]]) 05:56, 22 January 2019 (UTC)<br />
<br />
EDIT: and if you want to automatically pick up the tag if they start using them, something like this will work:<br />
<br />
TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0" | sed s/-/_/g)<br />
SUFFIX=$(git show --abbrev-commit --abbrev=12 --date='format:%G%m%d%H%M%S' --pretty=format:%cd_%h --no-patch HEAD)<br />
printf '%s_%s' "$TAG" "$SUFFIX"<br />
<br />
[[User:SamWhited|SamWhited]] ([[User talk:SamWhited|talk]]) 15:55, 22 January 2019 (UTC)<br />
<br />
== More detail about best practices for LDFLAGS and patching makefiles ==<br />
<br />
The page currently suggests patching the Makefile or "Export GOFLAGS - This is less desirable as we are dropping flags from LDFLAGS."<br />
<br />
Could someone explain how LDFLAGS should be used when running go build? That would help me understand why the use of GOFLAGS is less desirable, and how I might patch an existing Makefile to make use of LDFLAGS.<br />
<br />
[[User:Alaskanarcher|Alaskanarcher]] ([[User talk:Alaskanarcher|talk]]) 04:20, 9 May 2019 (UTC)<br />
<br />
Additionally, can anyone comment on whether CGO_LDFLAGS should be set for projects that use CGO?<br />
<br />
[[User:Alaskanarcher|Alaskanarcher]] ([[User talk:Alaskanarcher|talk]]) 04:40, 9 May 2019 (UTC)<br />
<br />
<br />
:: {{ic|CGO_LDFLAGS}} is more or less mentioned in the guidelines now [[User:Foxboron|Foxboron]] ([[User talk:Foxboron|talk]]) 11:48, 15 March 2020 (UTC)<br />
<br />
== Add section suggesting the use of GOPROXY when building packages in a clean chroot ==<br />
<br />
When building in a clean chroot, `go build` must fetch all dependencies again. Using a go modules proxy locally like [https://github.com/gomods/athens Athens] dramatically speeds up subsequent builds by allowing all dependencies to be cached for future builds in the clean chroot. I find this extremely helpful when working on my golang PKGBUILDs.<br />
<br />
[[User:Alaskanarcher|Alaskanarcher]] ([[User talk:Alaskanarcher|talk]]) 19:40, 9 May 2019 (UTC)<br />
<br />
:: {{ic|GOPROXY}} shouldn't be used in proper PKGBUILDs. And there is no way for you to whitelist this ENV variable when building with devtools. Setting this inside the PKGBUILD would break for anyone not running a proxy. This is not going to be part of the package guidelines. [[User:Foxboron|Foxboron]] ([[User talk:Foxboron|talk]]) 11:47, 15 March 2020 (UTC)<br />
<br />
== Guidelines should mention proper usage of go mod ==<br />
<br />
The guidelines speak about `go mod` but then make no mention on how to use that properly. Is it `go mod vendor` as I see in some of the official packages or `go mod download`? [[User:Svenstaro|Svenstaro]] ([[User talk:Svenstaro|talk]]) 17:49, 14 January 2020 (UTC)<br />
<br />
== Mention usage of -mod=vendor ==<br />
<br />
The official(?) [https://github.com/golang/go/wiki/Modules go modules wiki] mentions `-mod=vendor` but I don't see a consistent usage on that on our packages. It should be mentioned on when to use that. [[User:Svenstaro|Svenstaro]] ([[User talk:Svenstaro|talk]]) 17:56, 14 January 2020 (UTC)<br />
<br />
: From experience, {{ic|1=-mod=vendor}} should be used when package sources (tarballs, VCS repositories, etc) include a {{ic|vendor}} directory containing {{ic|modules.txt}}. Despite upstream [https://golang.org/ref/mod#build-commands documentation] stating that the {{ic|-mod}} flag can be safely omitted if the go version in the {{ic|go.mod}} file is higher than 1.14, it would be simpler to differentiate between the flag's options ({{ic|readonly}} vs. {{ic|vendor}}).<br />
: [[User:Grawlinson|Grawlinson]] ([[User talk:Grawlinson|talk]]) 00:05, 4 October 2021 (UTC)<br />
<br />
== about -linkmode=external ==<br />
<br />
It's better to let go decide the linkmode. Go programs that don't use net os/user or runtime/cgo let a warning when this flag is used.<br />
<br />
{{hc|1=https://golang.org/src/cmd/cgo/doc.go#L1000|2=<br />
By default, cmd/link will decide the linking mode as follows: if the only<br />
packages using cgo are those on a list of known standard library<br />
packages (net, os/user, runtime/cgo), cmd/link will use internal linking<br />
mode. Otherwise, there are non-standard cgo packages involved, and cmd/link<br />
will use external linking mode. The first rule means that a build of<br />
the godoc binary, which uses net but no other cgo, can run without<br />
needing gcc available. The second rule means that a build of a<br />
cgo-wrapped library like sqlite3 can generate a standalone executable<br />
instead of needing to refer to a dynamic library. The specific choice<br />
can be overridden using a command line flag: cmd/link -linkmode=internal or<br />
cmd/link -linkmode=external.<br />
}}<br />
<br />
Try compiling this simple go program that doesn't use cgo.<br />
<br />
{{hc|1=main.go|2=<br />
package main<br />
<br />
func main() {<br />
println("main")<br />
}<br />
}}<br />
<br />
$ go mod init main<br />
$ go build -ldflags=-linkmode=external<br />
# main<br />
loadinternal: cannot find runtime/cgo<br />
$ go build</div>ENV25https://wiki.archlinux.org/index.php?title=Go_package_guidelines&diff=709471Go package guidelines2022-01-11T03:43:40Z<p>ENV25: /* Flags and build options */ It's better to let go decide the linkmode. Go programs that don't use net os/user or runtime/cgo let a warning when this flag is used. https://golang.org/src/cmd/cgo/doc.go#L1000</p>
<hr />
<div>[[Category:Arch package guidelines]]<br />
[[ja:Go パッケージガイドライン]]<br />
[[pt:Go package guidelines]]<br />
[[zh-hans:Go package guidelines]]<br />
{{Package guidelines}}<br />
<br />
This document covers standards and guidelines on writing [[PKGBUILD]]s for [[Go]].<br />
<br />
== General guidelines ==<br />
<br />
=== Package naming ===<br />
<br />
For [[Go]] library modules, use {{ic|golang-''modulename''}}. Also use the prefix if the package provides a program that is strongly coupled to the Go ecosystem. For other applications, use only the program name.<br />
<br />
{{Note|The package name should be entirely lowercase.}}<br />
<br />
== Building ==<br />
<br />
=== Dependencies ===<br />
<br />
Go 1.11 introduced the initial support for [https://github.com/golang/go/wiki/Modules go modules]. This allows Go upstream code to declare dependencies and pin them to the given project version. Currently our packaging efforts utilize this to vendor dependencies.<br />
<br />
==== Upstream project without go modules ====<br />
<br />
For upstream code that does not utilise Go modules, the following workaround exists. Consider filing an issue upstream.<br />
<br />
{{hc|PKGBUILD|2=<br />
<nowiki><br />
url=https://github.com/upstream_user/upstream_project<br />
<br />
prepare() {<br />
cd "$pkgname-$pkgver"<br />
go mod init "${url#https://}" # strip https:// from canonical URL<br />
go mod tidy<br />
}<br />
</nowiki><br />
}}<br />
<br />
=== Flags and build options ===<br />
<br />
Most Makefiles written for go applications do not respect the build flags provided by build systems along with overwriting {{ic|GOFLAGS}}, this causes Go binaries to not be compiled with [https://www.redhat.com/en/blog/hardening-elf-binaries-using-relocation-read-only-relro RELRO] as we need {{ic|CGO_CFLAGS}} and {{ic|CGO_LDFLAGS}} to be set for the compiler. This needs to be patched into the Makefile, or the Makefile should be omitted.<br />
<br />
{{bc|1=<br />
export CGO_CPPFLAGS="${CPPFLAGS}"<br />
export CGO_CFLAGS="${CFLAGS}"<br />
export CGO_CXXFLAGS="${CXXFLAGS}"<br />
export CGO_LDFLAGS="${LDFLAGS}"<br />
export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"<br />
<br />
# or alternatively you can define some of these flags from the CLI options<br />
go build \<br />
-trimpath \<br />
-buildmode=pie \<br />
-mod=readonly \<br />
-modcacherw \<br />
-ldflags "-extldflags \"${LDFLAGS}\"" \<br />
.<br />
}}<br />
<br />
==== Flag meaning ====<br />
<br />
* {{ic|1=-buildmode=pie}} enables [[Wikipedia:Position-independent code|PIE compilation]] for binary harderning.<br />
* {{ic|-trimpath}} important for [[Reproducible Builds]] so full build paths and module paths are not embedded.<br />
* {{ic|1=-mod=readonly}} ensure the module files are not updated in any go actions.<br />
* {{ic|-modcacherw}} is not important, but it ensures that go modules creates a write-able path. Default is read-only.<br />
<br />
{{Tip|When package sources include a {{ic|vendor}} directory with {{ic|modules.txt}}, the {{ic|-mod}} flag can safely be changed to {{ic|1=-mod=vendor}}.}}<br />
<br />
{{Warning|It is up to the packager to verify the build flags are passed correctly to the compiler. Read the {{ic|Makefile}} if there is one.}}<br />
<br />
=== Output directory ===<br />
<br />
There are currently a few ways to build all go binaries in a project.<br />
<br />
{{bc|<br />
build(){<br />
cd "$pkgname-$pkgver"<br />
go build -o output-binary .<br />
}<br />
}}<br />
<br />
{{ic|...}} is a shorthand for the compiler to recursively descend into the directory and find all binaries. It can be used in conjunction with a output directory to build everything.<br />
<br />
{{bc|<br />
prepare(){<br />
cd "$pkgname-$pkgver"<br />
mkdir -p build<br />
}<br />
<br />
build(){<br />
cd "$pkgname-$pkgver"<br />
go build -o build ./cmd/...<br />
}<br />
}}<br />
<br />
== Sample PKGBUILD ==<br />
<br />
{{bc|<nowiki><br />
pkgname=foo<br />
pkgver=0.0.1<br />
pkgrel=1<br />
pkgdesc='Go PKGBUILD Example'<br />
arch=('x86_64')<br />
url="https://example.org/$pkgname"<br />
license=('GPL')<br />
makedepends=('go')<br />
source=("$url/$pkgname-$pkgver.tar.gz")<br />
sha256sums=('1337deadbeef')<br />
<br />
prepare(){<br />
cd "$pkgname-$pkgver"<br />
mkdir -p build/<br />
}<br />
<br />
build() {<br />
cd "$pkgname-$pkgver"<br />
export CGO_CPPFLAGS="${CPPFLAGS}"<br />
export CGO_CFLAGS="${CFLAGS}"<br />
export CGO_CXXFLAGS="${CXXFLAGS}"<br />
export CGO_LDFLAGS="${LDFLAGS}"<br />
export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"<br />
go build -o build ./cmd/...<br />
}<br />
<br />
check() {<br />
cd "$pkgname-$pkgver"<br />
go test ./...<br />
}<br />
<br />
package() {<br />
cd "$pkgname-$pkgver"<br />
install -Dm755 build/$pkgname "$pkgdir"/usr/bin/$pkgname<br />
}<br />
</nowiki>}}<br />
<br />
== Example packages ==<br />
<br />
* {{Pkg|podman}}<br />
* {{Pkg|k9s}}<br />
* {{Pkg|helm}}</div>ENV25https://wiki.archlinux.org/index.php?title=User:ENV25&diff=709238User:ENV252022-01-09T16:22:02Z<p>ENV25: </p>
<hr />
<div>== Profile ==<br />
{|<br />
|-<br />
! Email:<br />
| env252525@gmail.com<br />
|-<br />
! IRC:<br />
| eNV25, eNV25[m] on Libera or<br />
| eNV25 on OFTC (I don't use these much)<br />
|}</div>ENV25https://wiki.archlinux.org/index.php?title=Bluetooth_headset&diff=703536Bluetooth headset2021-11-26T07:58:14Z<p>ENV25: /* Battery level reporting */ Change `bluetoothd -E none` to `bluetoothd --experimental`. `none` doesn't make sense and isn't mentioned in the man page.</p>
<hr />
<div>[[Category:Sound]]<br />
[[Category:Bluetooth]]<br />
[[ja:Bluetooth ヘッドセット]]<br />
[[zh-hans:Bluetooth headset]]<br />
{{Related articles start}}<br />
{{Related|Bluetooth}}<br />
{{Related articles end}}<br />
<br />
Currently, Arch Linux supports the A2DP profile (Audio Sink) for remote audio playback with the default installation.<br />
<br />
== Headset via Pipewire ==<br />
<br />
[[PipeWire]] acts as a drop-in replacement for [[PulseAudio]] and offers an easy way to set up Bluetooth headsets. It includes out-of-the-box support for A2DP sink profiles using SBC/SBC-XQ, AptX, LDAC or AAC codecs, and HFP/HSP.<br />
<br />
[[Install]] {{Pkg|pipewire-pulse}} (which replaces {{Pkg|pulseaudio}} and {{Pkg|pulseaudio-bluetooth}}).<br />
<br />
The daemon will be started automatically as a [[systemd/User|user service]]. Use {{Pkg|pavucontrol}} or your desktop environment's settings for configuration. For more information, see [[PipeWire#Bluetooth devices]].<br />
<br />
=== Battery level reporting ===<br />
<br />
To get the current battery level of your headset reported to {{Pkg|upower}}, the ''bluetoothd'' daemon must be started with experimental features.<br />
<br />
This can be done by creating a [[replacement unit file]] for {{ic|bluetooth.service}} and appending {{ic|-E}} to the {{ic|ExecStart}} line. [[Restart]] the service afterwards.<br />
<br />
Alternatively, a [[drop-in file]] for {{ic|bluetooth.service}} can be created, with the following contents:<br />
<br />
{{hc|/etc/systemd/system/bluetooth.service.d/override.conf|2=<br />
[Service]<br />
ExecStart=<br />
ExecStart=/usr/lib/bluetooth/bluetoothd --experimental<br />
}}<br />
<br />
[[Restart]] the service afterwards.<br />
<br />
== Headset via Bluez5/PulseAudio ==<br />
<br />
{{Merge|Bluetooth|Significant redundancy with general setup on Bluetooth page. Should be merged there. Headset-specific info would stay on this page.|Talk:Bluetooth#Merging general setup from Keyboard, Mouse, Headset pages}}<br />
<br />
[[Install]] the {{Pkg|pulseaudio-alsa}}, {{Pkg|pulseaudio-bluetooth}} and {{Pkg|bluez-utils}} packages, the last of which provides the {{ic|bluetoothctl}} utility.<br />
<br />
{{Note|Before continuing, ensure that the bluetooth device is not blocked by [[rfkill]].}}<br />
<br />
=== Configuration via CLI ===<br />
<br />
[[Start]] {{ic|bluetooth.service}}.<br />
<br />
Now we can use the ''bluetoothctl'' command line utility to pair and connect. For troubleshooting and more detailed explanations of ''bluetoothctl'' see the [[Bluetooth]] article. Run<br />
<br />
$ bluetoothctl<br />
<br />
to be greeted by its internal command prompt. Then enter:<br />
<br />
[bluetooth]# power on<br />
[bluetooth]# agent on<br />
[bluetooth]# default-agent<br />
[bluetooth]# scan on<br />
<br />
Now make sure that your headset is in pairing mode. It should be discovered shortly. For example,<br />
<br />
[NEW] Device 00:1D:43:6D:03:26 Lasmex LBT10<br />
<br />
shows a device that calls itself ''"Lasmex LBT10"'' and has MAC address ''"00:1D:43:6D:03:26"''. We will now use that MAC address to initiate the pairing:<br />
<br />
[bluetooth]# pair 00:1D:43:6D:03:26<br />
<br />
After pairing, you also need to explicitly connect the device (if this does not work, try the {{ic|trust}} command below ''before'' attempting to connect):<br />
<br />
[bluetooth]# connect 00:1D:43:6D:03:26<br />
<br />
If you are getting a connection error {{ic|org.bluez.Error.Failed}} retry by killing existing PulseAudio daemon first:<br />
<br />
$ pulseaudio -k<br />
[bluetooth]# connect 00:1D:43:6D:03:26<br />
<br />
Finally, if you want to automatically connect to this device in the future:<br />
<br />
[bluetooth]# trust 00:1D:43:6D:03:26<br />
<br />
If everything works correctly, you now have a separate output device in [[PulseAudio]].<br />
<br />
{{Note|The device may be off by default. Select its audio profile ({{ic|OFF}}, {{ic|A2DP}}, {{ic|HFP}}) in the "Configuration" tab of {{Pkg|pavucontrol}}.}}<br />
<br />
You can now redirect any audio through that device using the "Playback" and "Recording" tabs of {{Pkg|pavucontrol}}.<br />
<br />
You can now disable scanning again and exit the program:<br />
<br />
[bluetooth]# scan off<br />
[bluetooth]# exit<br />
<br />
==== Setting up auto connection ====<br />
<br />
To make your headset auto connect you need to enable PulseAudio's switch-on-connect module. Do this by adding the following lines to {{ic|/etc/pulse/default.pa}}:<br />
<br />
{{hc|/etc/pulse/default.pa|<br />
### Automatically switch to newly-connected devices<br />
load-module module-switch-on-connect<br />
}}<br />
<br />
{{Note|<br />
* Make sure that your bluetooth audio device is ''trusted'', otherwise repeated pairing will fail. See [[Bluetooth#Pairing]] for details.<br />
* By default, your Bluetooth adapter will not power on after boot. See [[Bluetooth#Auto power-on after boot]] for details.<br />
}}<br />
<br />
==== Media controls ====<br />
<br />
To use the media controls they may be forwarded to MPRIS, where they can be picked up by media players that support MPRIS for external control. See [[MPRIS#Bluetooth]] for details.<br />
<br />
=== Configuration via GNOME Bluetooth ===<br />
<br />
{{Note| The A2DP profile will not activate using this method with pulseaudio 9/10 due to an ongoing bug, leading to possible low quality mono sound. See [[#A2DP not working with PulseAudio]] for a possible solution.}}<br />
<br />
You can use [[Bluetooth#Graphical|GNOME Bluetooth]] graphical front-end to easily configure your bluetooth headset. <br />
<br />
First, you need to be sure that {{ic|bluetooth.service}} systemd unit is running. <br />
<br />
Open GNOME Bluetooth and activate the bluetooth. After scanning for devices, you can connect to your headset selecting it on the device list. You can directly access to sound configuration panel from the device menu. On the sound panel, a new sink should appear when your device is connected.<br />
<br />
=== LDAC/aptX ===<br />
<br />
[[Wikipedia:LDAC_(codec)|LDAC]]/[[Wikipedia:aptX|aptX]] codec support can be enabled by installing {{AUR|pulseaudio-modules-bt}} and {{Pkg|libldac}}, and restarting PulseAudio. See its [https://github.com/EHfive/pulseaudio-modules-bt project page] for configuration tips. You can verify the codec you are using for connection as follows:<br />
<br />
$ pactl list | grep a2dp_codec<br />
<br />
=== Troubleshooting ===<br />
<br />
{{Note|Many users report frustration with getting A2DP/Bluetooth Headsets to work. see [[#Switch between HSP/HFP and A2DP setting]] for additional information.}}<br />
<br />
==== Bad sound / Static noise / "Muddy" sound ====<br />
<br />
If you experience bad sound quality with your headset, it could in all likelihood be because your headset is not set to the correct profile.<br />
See [[#Switch between HSP/HFP and A2DP setting]] to solve the problem.<br />
<br />
==== Selected audio profile, but headset inactive and audio cannot be redirected ====<br />
<br />
Deceptively, this menu is available before the device has been connected; annoyingly it will have no effect. The menu seems to be created as soon as the receiver recognizes the device.<br />
<br />
Make sure to run {{ic|bluetoothctl}} as root and connect the device manually. There may be configuration options to remove the need to do this each time, but neither pairing nor trusting induce automatic connecting for me.<br />
<br />
==== Pairing fails with AuthenticationFailed ====<br />
<br />
If pairing fails, you can try enabling or [https://stackoverflow.com/questions/12888589/linux-command-line-howto-accept-pairing-for-bluetooth-device-without-pin disabling SSPMode] with:<br />
<br />
# btmgmt ssp off<br />
<br />
or<br />
<br />
# btmgmt ssp on<br />
<br />
You may need to turn off BlueTooth while you run this command.<br />
<br />
==== Pairing works, but connecting does not ====<br />
<br />
You might see the following error in ''bluetoothctl'':<br />
<br />
[bluetooth]# connect 00:1D:43:6D:03:26<br />
Attempting to connect to 00:1D:43:6D:03:26<br />
Failed to connect: org.bluez.Error.Failed<br />
<br />
To further investigate, check the [[unit status]] of {{ic|bluetooth.service}} or have a look at the log as follows:<br />
<br />
# journalctl -n 20<br />
<br />
You might see a message like this:<br />
<br />
bluetoothd[5556]: a2dp-sink profile connect failed for 00:1D:43:6D:03:26: Protocol not available<br />
<br />
This may be due to the {{Pkg|pulseaudio-bluetooth}} package not being installed (or {{AUR|pulseaudio-modules-bt-git}} [https://github.com/EHfive/pulseaudio-modules-bt/issues/140 needing a clean reinstall]). Install it if it missing, then restart pulseaudio.<br />
<br />
It can also be due to permission, especially if starting pulseaudio as root allows you to connect. Add your user to the ''lp'' group, then restart pulseaudio.<br />
See {{ic|/etc/dbus-1/system.d/bluetooth.conf}} for reference.<br />
<br />
If the issue is not due to the missing package, the problem in this case is that PulseAudio is not catching up. A common solution to this problem is to restart PulseAudio. Note that it is perfectly fine to run ''bluetoothctl'' as root while PulseAudio runs as user. After restarting PulseAudio, retry to connect. It is not necessary to repeat the pairing.<br />
<br />
If restarting PulseAudio does not work, you need to load module-bluetooth-discover.<br />
<br />
# pactl load-module module-bluetooth-discover<br />
<br />
The same load-module command can be added to {{ic|/etc/pulse/default.pa}}.<br />
<br />
If that still does not work, or you are using PulseAudio's system-wide mode, also load the following PulseAudio modules (again these can be loaded via your {{ic|default.pa}} or {{ic|system.pa}}):<br />
<br />
module-bluetooth-policy<br />
module-bluez5-device<br />
module-bluez5-discover<br />
<br />
It is also possible there are no write [[permissions]] for the owner of {{ic|/var/lib/bluetooth/}}. If this is the case, you may get the device to work by removing and re-pairing it, but the issue will return after rebooting. Restoring write permissions fixes this issue:<br />
<br />
# chmod -R u+w /var/lib/bluetooth<br />
<br />
==== Connecting works, but there are sound glitches all the time ====<br />
<br />
This is very likely to occur when the Bluetooth and the WiFi share the same chip as they share the same physical antenna and possibly band range (2.4GHz). Although this works seamlessly on Windows, this is not the case on Linux.<br />
<br />
A possible solution is to move your WiFi network to 5GHz so that there will be no interference. If your card/router does not support this, you can upgrade your WiFi drivers/firmware. This approach works on Realtek 8723BE and latest rtl drivers for this chip from AUR.<br />
<br />
If nothing of the previous is possible, a less effective mitigation is to tweak the fragment size and the latency on PulseAudio output port, trying to compensate interference. Reasonable values must be chosen, because these settings can make the audio out of sync (e.g. when playing videos). To change the latency of the bluetooth headset's port (e.g. to 125000 microseconds in the following example):<br />
<br />
$ pactl set-port-latency-offset <bluez_card> headset-output '''125000'''<br />
<br />
where the identifier of the card can be found with<br />
<br />
$ pacmd list-sinks | egrep -o 'bluez_card[^>]*'<br />
<br />
The fragment size can be set in the config file {{ic|/etc/pulse/daemon.conf}} and takes effect after a restart of PulseAudio (for more details please see [[PulseAudio/Troubleshooting#Setting the default fragment number and buffer size in PulseAudio]]).<br />
<br />
Perhaps it will help to add {{ic|1=options ath9k btcoex_enable=1}} to the {{ic|/etc/modprobe.d/ath9k.conf}} (with the appropriate bluetooth adapter):<br />
<br />
{{hc|1=/etc/modprobe.d/ath9k.conf|2=<br />
# possibly fix for sound glitches<br />
options ath9k btcoex_enable=1<br />
}}<br />
<br />
Then restart.<br />
<br />
==== Connecting works, but I cannot play sound ====<br />
<br />
Make sure that you see the following messages in your system log:<br />
<br />
bluetoothd[5556]: Endpoint registered: sender=:1.83 path=/MediaEndpoint/A2DPSource<br />
bluetoothd[5556]: Endpoint registered: sender=:1.83 path=/MediaEndpoint/A2DPSink<br />
<br />
If you see a message similar to this, you can go on and investigate your PulseAudio configuration. Otherwise, go back and ensure the connection is successful.<br />
<br />
{{Move|PulseAudio/Troubleshooting|2=The following seems to be general issue: [https://wiki.archlinux.org/index.php?title=PulseAudio/Troubleshooting&diff=next&oldid=421986]}}<br />
<br />
When using [[GDM]], another instance of PulseAudio is started, which "captures" your bluetooth device connection. This can be prevented by [[mask]]ing the pulseaudio socket for the GDM user by doing the following:<br />
<br />
# mkdir -p /var/lib/gdm/.config/systemd/user<br />
# ln -s /dev/null /var/lib/gdm/.config/systemd/user/pulseaudio.socket<br />
<br />
On next reboot the second instance of PulseAudio will not be started.<br />
<br />
It may happen that bluez wrongly considers an headset as not a2dp capable. In this case, search the index of the bluetooth device with<br />
<br />
$ pacmd ls<br />
<br />
Among the output there should be a section related to the bluetooth headset, containing something similar to<br />
<br />
{{hc|1=$ pacmd ls|2=<br />
index: 2<br />
name: <bluez_card.XX_XX_XX_XX_XX_XX><br />
driver: <module-bluez5-device.c><br />
owner module: 27<br />
properties:<br />
device.description = "SONY MDR-100ABN"<br />
device.string = "XX:XX:XX:XX:XX:XX"<br />
device.api = "bluez"<br />
device.class = "sound"<br />
...<br />
}}<br />
<br />
To manually set the profile, run<br />
<br />
$ pacmd set-card-profile 2 a2dp_sink<br />
<br />
where 2 is the index of the device retrieved through {{ic|pacmd ls}}.<br />
<br />
==== Connecting works, sound plays fine until headphones become idle, then stutters ====<br />
<br />
If the headphones play sound correctly until they become idle and then stutter on resume (e.g. because the sound is paused, or because no sound is played for a while), try disabling PulseAudio's automatic sink/source suspension on idle.<br />
<br />
Some user [https://bbs.archlinux.org/viewtopic.php?id=117420 reports] huge delays or even no sound when the Bluetooth connection does not send any data. This is due to the {{ic|module-suspend-on-idle}} module, which automatically suspends sinks/sources on idle. As this can cause problems with headset, the responsible module can be deactivated.<br />
<br />
To disable loading of the {{ic|module-suspend-on-idle}} module, comment out the following line in the configuration file in use ({{ic|~/.config/pulse/default.pa}} or {{ic|/etc/pulse/default.pa}}):<br />
<br />
{{hc|~/.config/pulse/default.pa|<br />
### Automatically suspend sinks/sources that become idle for too long<br />
#load-module module-suspend-on-idle<br />
}}<br />
<br />
Finally restart PulseAudio to apply the changes.<br />
<br />
==== UUIDs has unsupported type ====<br />
<br />
During pairing you might see this output in ''bluetoothctl'':<br />
<br />
[CHG] Device 00:1D:43:6D:03:26 UUIDs has unsupported type<br />
<br />
This message is a very common one and can be ignored.<br />
<br />
==== PC shows device as paired, but is not recognized by device ====<br />
<br />
This might be due to the device not supporting bluetooth LE for pairing. <br />
<br />
Try setting {{ic|1=ControllerMode = bredr}} in {{ic|/etc/bluetooth/main.conf}}. See [https://unix.stackexchange.com/questions/292189/pairing-bose-qc-35-over-bluetooth-on-fedora].<br />
<br />
==== Device connects, then disconnects after a few moments ====<br />
<br />
If you see messages like the following in the [[journal]], and your device fails to connect or disconnects shortly after connecting:<br />
<br />
bluetoothd: Unable to get connect data for Headset Voice gateway: getpeername: Transport endpoint is not connected (107)<br />
bluetoothd: connect error: Connection refused (111)<br />
<br />
This may be because you have already paired the device with another operating system using the same bluetooth adapter (e.g., dual-booting). Some devices cannot handle multiple pairings associated with the same MAC address (i.e., bluetooth adapter). You can fix this by re-pairing the device. Start by removing the device:<br />
<br />
$ bluetoothctl<br />
[bluetooth]# devices<br />
Device XX:XX:XX:XX:XX:XX My Device<br />
[bluetooth]# remove XX:XX:XX:XX:XX:XX<br />
<br />
Then [[restart]] {{ic|bluetooth.service}}, turn on your bluetooth adapter, make your device discoverable, re-scan for devices, and re-pair your device. Depending on your bluetooth manager, you may need to perform a full reboot in order to re-discover the device.<br />
<br />
==== Apple AirPods have low volume ====<br />
<br />
Create a [[drop-in file]] for {{ic|bluetooth.service}} with the following contents:<br />
<br />
{{hc|/etc/systemd/system/bluetooth.service.d/noplugin-avrc.conf|2=<br />
[Service]<br />
ExecStart=<br />
ExecStart=/usr/lib/bluetooth/bluetoothd --noplugin=avrcp<br />
}}<br />
<br />
Then, [[restart]] {{ic|bluetooth.service}}, [[reload]] its configuration, and reconnect your headset.<br />
<br />
Additionally, for AirPods Pro, disable the spatial audio and enable Mono in the settings of your iPhone.<br />
<br />
This can also solve issues with some devices that are unable to be controlled through AVRCP.<br />
<br />
==== Apple AirPods Pro working with PulseAudio as A2DP Sink but not with HSP/HFP ====<br />
<br />
If you find that AirPods Pro are working with PulseAudio, but are incapable of using the HSP/HFP configurations (in ''pavucontrol''<nowiki/>'s ''Configurations'' tab, usually listed as unavailable), try switching to {{Pkg|pipewire-pulse}}.<br />
<br />
Note that switching to ''pipewire-pulse'' (and restarting your computer or the appropriate user-level ''systemd'' services) should enable HSP/HFP, but may also disable A2DP. (When selecting ''A2DP Sink'' in the ''Configurations'' tab, the option is instantly deselected and becomes ''Off''.) If you encounter this issue, try removing/renaming the {{ic|/var/lib/bluetooth}} folder like so:<br />
<br />
# mv /var/lib/bluetooth /var/lib/bluetooth.bak<br />
<br />
Re-pair your AirPods Pro (and other devices) afterwards. This should make all configurations (HSP/HFP and A2DP) available again and easily accessible from ''pavucontrol'' and ''pacmd''.<br />
<br />
==== HSP problem: the bluetooth sink and source are created, but no audio is being transmitted ====<br />
<br />
You may be missing firmware or the SCO (audio protocol of HSP and HFP) routing might be wrong. See [https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Bluetooth/#index10h3] - the firmware for BCM20702 can be installed via {{AUR|bcm20702a1-firmware}} or {{AUR|bcm20702b0-firmware}}.<br />
<br />
==== Error: Failed to start discovery org.bluez.Error.InProgress ====<br />
<br />
If your headset is discovered, but fails to connect with the error "Failed to start discovery org.bluez.Error.InProgress", install {{AUR|bluez-hciconfig}} and run<br />
<br />
$ hciconfig hci''X'' up<br />
$ hciconfig hci''X'' reset<br />
<br />
where ''X'' is the identifier of your computer's bluetooth device (typically 0).<br />
<br />
You should then be able to connect following the steps in [[#Configuration via CLI]].<br />
<br />
== Switch between HSP/HFP and A2DP setting ==<br />
<br />
This can easily be achieved by the following command where the {{ic|''card_number''}} can be obtained by running {{ic|pacmd list-cards}}.<br />
<br />
$ pacmd set-card-profile ''card_number'' a2dp_sink<br />
<br />
For enabling automatic profile switching from A2DP to HSP when a recording stream appears without any role set, you can append {{ic|1=auto_switch=2}} to {{ic|load-module module-bluetooth-policy}} in {{ic|/etc/pulse/default.pa}}.<br />
<br />
For more information about PulseAudio profiles, see [https://freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Bluetooth/#index1h2 PulseAudio Documentation].<br />
<br />
=== A2DP not working with PulseAudio ===<br />
<br />
==== Socket interface problem ====<br />
<br />
If PulseAudio fails when changing the profile to A2DP with bluez 4.1+ and PulseAudio 3.0+, you can try disabling the Socket interface from {{ic|/etc/bluetooth/main.conf}} by removing the line {{ic|1=Enable=Socket}} and adding line {{ic|1=Disable=Socket}}.<br />
<br />
==== A2DP sink profile is unavailable ====<br />
<br />
When the A2DP sink profile is unavailable it will not be possible to switch to the A2DP sink (output) with a PulseAudio front-end and the A2DP sink will not even be listed. This can be confirmed with {{ic|pactl}}.<br />
<br />
$ pactl list | grep -C2 A2DP<br />
Profiles:<br />
headset_head_unit: Headset Head Unit (HSP/HFP) (sinks: 1, sources: 1, priority: 30, available: yes)<br />
a2dp_sink: High Fidelity Playback (A2DP Sink) (sinks: 1, sources: 0, priority: 40, available: no)<br />
off: Off (sinks: 0, sources: 0, priority: 0, available: yes)<br />
Active Profile: headset_head_unit<br />
<br />
Trying to manually set the card profile with {{ic|pacmd}} will fail.<br />
<br />
$ pacmd set-card-profile bluez_card.C4_45_67_09_12_00 a2dp_sink<br />
Failed to set card profile to 'a2dp_sink'.<br />
<br />
This is known to happen from version 10.0 of Pulseaudio when connecting to Bluetooth headphones via Bluedevil or another BlueZ front-end. See [https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/525 related bug report.]<br />
<br />
This issue also appears after initial pairing of Headphones with some Bluetooth controllers (e.g. {{ic|0a12:0001, Cambridge Silicon Radio}}) which might default to the {{ic|Handsfree}} or {{ic|Headset - HS}} service and will not allow switching to the A2DP PulseAudio sink that requires the {{ic|AudioSink}} service.<br />
<br />
Possible solutions:<br />
<br />
* For some headsets, using the headset's volume or play/pause controls while connected can trigger the A2DP profile to become available.<br />
* It is possible that connecting to a headset via {{ic|bluetoothctl}} from {{pkg|bluez-utils}} will make the A2DP sink profile available. There is an automation for this every time a bluetooth device is connected: {{AUR|fix-bt-a2dp}} ([https://github.com/pastleo/fix-bt-a2dp#usage detailed usage])<br />
<br />
[bluetooth]# connect ''headset_MAC_address''<br />
<br />
* Manually switching to Bluetooth's {{ic|AudioSink}} service which would make the A2DP profile and its A2DP PulseAudio sink available. This can be done with blueman-manager which included in {{pkg|blueman}} or by registering the UUID of the AudioSink service with {{ic|bluetoothctl}}.<br />
<br />
$ bluetoothctl<br />
[bluetooth]# menu gatt<br />
[bluetooth]# register-service 0000110b-0000-1000-8000-00805f9b34fb<br />
[bluetooth]# quit<br />
<br />
* Disable the headset profile<br />
<br />
{{hc|/etc/bluetooth/main.conf|2=<br />
[General]<br />
Disable=Headset<br />
}}<br />
<br />
* Enable MultiProfile support. This may help with headsets that support A2DP as well as Headset audio.<br />
<br />
{{hc|/etc/bluetooth/main.conf|2=<br />
[General]<br />
MultiProfile=multiple<br />
}}<br />
<br />
* Sometimes, none of the steps above will work. You may have tried rebooting and powering bluetooth off and on to no avail. In this case, try [[restart]]ing the {{ic|bluetooth.service}}.<br />
* Alternatively, replacing {{Pkg|pulseaudio-bluetooth}} with {{AUR|pulseaudio-modules-bt}} or {{AUR|pulseaudio-modules-bt-git}}, which provides additional Bluetooth codecs, may resolve the issue.<br />
* For some headphone models with audio control panel, the A2DP profile must be enabled by pressing the ''Play/Pause'' button on the panel.<br />
<br />
==== Gnome with GDM ====<br />
<br />
{{Merge|#Connecting works, but I cannot play sound|duplicate instructions}}<br />
<br />
The instructions below were tested on Gnome 3.24.2 and PulseAudio 10.0 however they may still be applicable and useful for other versions.<br />
<br />
If PulseAudio fails when changing the profile to A2DP while using GNOME with GDM, you need to prevent GDM from starting its own instance of PulseAudio:<br />
<br />
* Prevent Pulseaudio clients from automatically starting a server if one is not running by adding the following:<br />
<br />
{{hc|/var/lib/gdm/.config/pulse/client.conf|2=<br />
autospawn = no<br />
daemon-binary = /bin/true<br />
}}<br />
<br />
* Prevent systemd from starting Pulseaudio anyway with socket activation:<br />
<br />
$ sudo -ugdm mkdir -p /var/lib/gdm/.config/systemd/user<br />
$ sudo -ugdm ln -s /dev/null /var/lib/gdm/.config/systemd/user/pulseaudio.socket<br />
<br />
* Restart, and check that there is no PulseAudio process for the {{ic|gdm}} user using:<br />
<br />
$ pgrep -u gdm pulseaudio<br />
<br />
Further discussion about this problem and alternative fixes can be found at [https://bbs.archlinux.org/viewtopic.php?id=194006] and [https://bbs.archlinux.org/viewtopic.php?id=196689]. Alternatively, one may try and install {{AUR|fix-bt-a2dp}}.<br />
<br />
=== HFP not working with PulseAudio ===<br />
<br />
HFP-only bluetooth headsets may not be usable in the standard configuration of PulseAudio. The respective profiles occur, but they are not available:<br />
<br />
* {{ic|bluetoothctl info}} output shows:<br />
<br />
UUID: Audio Sink (0000110b-0000-1000-8000-00805f9b34fb)<br />
UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)<br />
UUID: A/V Remote Control (0000110e-0000-1000-8000-00805f9b34fb)<br />
UUID: Handsfree (0000111e-0000-1000-8000-00805f9b34fb)<br />
<br />
* {{ic|pactl list}} of respective device shows:<br />
<br />
...<br />
Profiles:<br />
...<br />
headset_head_unit: Headset Head Unit (HSP/HFP) (sinks: 1, sources: 1, priority: 30, available: no)<br />
<br />
To solve the respective issue, update to pulseaudio (>=13) and potentially {{AUR|pulseaudio-modules-bt-git}} and bluez (>=5.5) to latest versions. Then install {{AUR|ofono}} (start and enable using systemctl) and {{AUR|phonesim}} and create / activate a fake modem as described here [https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Bluetooth/#index1h3]:<br />
<br />
{{Note|The steps following the creation of {{ic|phonesim.conf}} should be done ''every time'' you want to connect the headset.}}<br />
<br />
* Create {{ic|/etc/ofono/phonesim.conf}} with:<br />
<br />
[phonesim]<br />
Address=127.0.0.1<br />
Driver=phonesim<br />
Port=12345<br />
<br />
* Start as user:<br />
<br />
$ phonesim -p 12345 /usr/share/phonesim/default.xml &<br />
<br />
* [[Enable]] and [[start]] {{ic|ofono}} service.<br />
* Power modem:<br />
<br />
$ dbus-send --print-reply --system --dest=org.ofono /phonesim org.ofono.Modem.SetProperty string:"Powered" variant:boolean:true<br />
<br />
* Activate modem:<br />
<br />
$ dbus-send --print-reply --system --dest=org.ofono /phonesim org.ofono.Modem.SetProperty string:"Online" variant:boolean:true<br />
<br />
* To check the results, use the test commands from {{AUR|ofono}} installed in {{ic|/usr/lib/ofono/test/}}. To power, activate, and test the modem you can use:<br />
<br />
$ /usr/lib/ofono/test/enable-modem /phonesim<br />
$ /usr/lib/ofono/test/online-modem /phonesim<br />
$ /usr/lib/ofono/test/list-modems<br />
<br />
The output of the respective modem section should read like this:<br />
<br />
...<br />
[ /phonesim ]<br />
Online = 1<br />
Powered = 1<br />
Lockdown = 0<br />
Emergency = 0<br />
Manufacturer = MeeGo<br />
...<br />
<br />
* Finally, restart pulseaudio and reconnect headset. Now, HFP should be available:<br />
<br />
headset_head_unit: Headset Head Unit (HSP/HFP) (sinks: 1, sources: 1, priority: 30, available: yes)<br />
<br />
{{Note|HFP support is not stable and may cause glitches with switching to A2DP; try reconnecting, if the needed mode is not available.}}<br />
<br />
=== Disable auto switching headset to HSP/HFP ===<br />
<br />
When using a bluetooth headset that supports multiple profiles, some applications switch to HSP/HFP profile automatically. If this behaviour is undesired you can disable this by appending the auto_switch=false parameter to the bluetooth-policy module:<br />
<br />
{{hc|/etc/pulse/default.pa|2=<br />
load-module module-bluetooth-policy auto_switch=false<br />
}}</div>ENV25https://wiki.archlinux.org/index.php?title=Firefox&diff=699029Firefox2021-10-13T18:58:34Z<p>ENV25: /* KDE integration */ Tip for duplicate entries in Media Player widget or tray icon</p>
<hr />
<div>[[Category:Web browser]]<br />
[[Category:Mozilla]]<br />
[[ar:Firefox]]<br />
[[de:Firefox]]<br />
[[es:Firefox]]<br />
[[fr: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 />
== 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}} or {{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 plugins.|https://build.opensuse.org/package/show/mozilla:Factory/MozillaFirefox|{{AUR|firefox-kde-opensuse}}}}<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 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 with the {{ic|Location}} field using search URLs completed with %s in place of the query and the {{ic|Keyword}} field completed with user-defined characters:<br />
<br />
Location:<br />
https://duckduckgo.com/html/?q=%s<br />
Keyword:<br />
d<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 />
Also, you can use the [https://firefox.maltekraus.de/extensions/add-to-search-bar add-to-searchbar] extension to add a search to your search bar from any web site, by simply right clicking on the site's search field and selecting ''Add to Search Bar...''<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 config 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}}. 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 [http://kb.mozillazine.org/Locking_preferences Locking preferences]:<br />
<br />
1. Create {{ic|/usr/lib/firefox/defaults/pref/local-settings.js}}:<br />
<br />
pref("general.config.obscure_value", 0);<br />
pref("general.config.filename", "mozilla.cfg");<br />
<br />
2. Create {{ic|/usr/lib/firefox/mozilla.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 [http://demo.nimius.net/video_test/ 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 />
==== 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 ''Preferences > 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, you are now 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 preferences.<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. [[mpv|/usr/bin/mpv]]).<br />
# (Optional step) 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:<br />
#* See [[Hardware video acceleration]] for steps to verify and install VA-API drivers if required.<br />
# Use a compositor that supports hardware acceleration, either:<br />
#* WebRender from the new Servo browser engine, which can be enabled as explained in [[/Tweaks#Enable WebRender compositor]]. 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/]. Ensure you are not running Software WebRender as that won't work as of August 2021 [https://bugzilla.mozilla.org/show_bug.cgi?id=1723540#c1].<br />
#* Gecko's legacy OpenGL back-end, which can be enabled as explained in [[/Tweaks#Enable Legacy OpenGL compositor]].<br />
# Set the following flags in {{ic|about:config}}:<br />
#* {{ic|media.ffmpeg.vaapi.enabled}} to {{ic|true}} in order to enable the use of VA-API with FFmpeg.<br />
#* {{ic|media.ffvpx.enabled}} to {{ic|false}} to disable the internal decoders for VP8/VP9. This is necessary despite [https://bugzilla.mozilla.org/show_bug.cgi?id=1660336 this bug] being fixed [https://bugzilla.mozilla.org/show_bug.cgi?id=1720363#c6][https://bugzilla.mozilla.org/show_bug.cgi?id=1683808].<br />
#* {{ic|media.navigator.mediadatadecoder_vpx_enabled}} to {{ic|true}} to enable hardware VA-API decoding for WebRTC [https://bugzilla.mozilla.org/show_bug.cgi?id=1709009].<br />
#* {{ic|media.rdd-vpx.enabled}} to {{ic|false}} to disable the remote data decoder process for VP8/VP9. Firefox attempts to use the RDD process for VP8/VP9 but the RDD sandbox blocks VA-API access [https://bugzilla.mozilla.org/show_bug.cgi?id=1673184]. Disabling the remote data decoder for VP8/VP9 process means VA-API will run in the content process instead. The best solution is to move VA-API to the GPU process [https://bugzilla.mozilla.org/show_bug.cgi?id=1683808].<br />
#** Another possible workaround is to completely disable the RDD process by setting {{ic|media.rdd-process.enabled}} to {{ic|false}}, instead of just disabling it for VP8/VP9 as above.<br />
#* On Intel, in some cases VA-API might not work with the Intel iHD driver {{Pkg|intel-media-driver}}. This might be workaroundable by using the Intel i965 driver {{Pkg|libva-intel-driver}}. This workaround does not work anymore with Intel Iris Xe graphics, which are only supported by {{Pkg|intel-media-driver}}, only solution there is to wait until Firefox implements a GPU process for X11/Wayland (planned FF94) [https://bugzilla.mozilla.org/show_bug.cgi?id=1619585#c42] [https://bugzilla.mozilla.org/show_bug.cgi?id=1619585#c62] [https://bugzilla.mozilla.org/show_bug.cgi?id=1619585#c63].<br />
#** As a last resort, the content process sandbox can be disabled. However, this is a serious security risk and disables protection against attackers. It is recommended to leave the sandbox settings as default [https://bugzilla.mozilla.org/show_bug.cgi?id=1683808#c26]. Nevertheless, to disable the content sandbox set {{ic|security.sandbox.content.level}} to {{ic|0}} [https://bugzilla.mozilla.org/show_bug.cgi?id=1720363#c9].<br />
# Run Firefox with the following [[environment variable]] enabled:<br />
#* In Wayland, with {{ic|1=MOZ_ENABLE_WAYLAND=1}}, see [[#Wayland]].<br />
#* In X.org, with {{ic|1=MOZ_X11_EGL=1}} or set {{ic|gfx.x11-egl.force-enabled}} to {{ic|true}} and {{ic|gfx.x11-egl.force-disabled}} to {{ic|false}} in {{ic|about:config}}.<br />
<br />
{{Warning|Disabling the content process sandbox is a security risk, in the future VA-API will be moved to the GPU process so it is properly sandboxed.}}<br />
<br />
{{Tip|<br />
* As well as following [[Hardware video acceleration#Verification]], one can confirm VA-API usage by checking Firefox 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 />
* 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 />
{{Note|1=<nowiki/><br />
* NVIDIA's proprietary driver potentially has support for DMA-BUF in the 470 drivers [https://bugs.kde.org/show_bug.cgi?id=428089#c2][https://www.phoronix.com/scan.php?page=news_item&px=NVIDIA-DMA-BUF-Wayland-KDE]. DMA-BUF is necessary for hardware video acceleration in Firefox [https://bugzilla.mozilla.org/show_bug.cgi?id=1669189#c4]. If DMA-BUF support is present {{Pkg|libva-vdpau-driver}} will be necessary as Firefox does not natively support [[VDPAU]].<br />
* Currently Firefox's VA-API implementation can decode H.264/AVC, VP8 & VP9 encoded video. AV1 support may be added in the future [https://bugzilla.mozilla.org/show_bug.cgi?id=1652958].<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 />
* Some videos (e.g. YouTube VR) may show a black image after setting {{ic|media.ffvpx.enabled}} to {{ic|false}} [https://bugzilla.mozilla.org/show_bug.cgi?id=1667537].<br />
* To workaround VA-API not working correctly in the RDD process, the RDD process sandbox can be disabled instead of moving VA-API to the content process as suggested above. This is not recommended since disabling the sandbox is a large security risk and disables protection against attackers. Set the environment variable {{ic|1=MOZ_DISABLE_RDD_SANDBOX=1}} to disable RDD sandbox. <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 />
=== 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 to you have right click again and select your language from the ''Languages'' sub-menu.<br />
<br />
When 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 and just 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 apps (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}} to {{ic|true}} in {{ic|about:config}}.<br />
** Launch firefox with {{ic|1=GTK_USE_PORTAL=1}} [[environment variable]].<br />
::{{Note|1=Using {{ic|1=GTK_USE_PORTAL=1}} or setting {{ic|widget.use-xdg-desktop-portal}} to {{ic|true}} will result in [https://bugzilla.mozilla.org/show_bug.cgi?id=1516290 Firefox asking to set default browser every time Firefox starts].}}<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 false. This disables the media entry from Firefox and only uses the one from the Plasma integration add-on.}}<br />
<br />
== Tips and tricks ==<br />
<br />
For general enhancements see [[Firefox/Tweaks]], for privacy related enhancements see [[Firefox/Privacy]].<br />
<br />
=== Dark themes ===<br />
<br />
If a dark [[GTK]] theme is in use (e.g. Arc Dark), it is recommended to start Firefox with a brighter one (e.g. Adwaita). See [[GTK#Themes]] and [[Firefox/Tweaks#Unreadable input fields with dark GTK themes]] for more information.<br />
<br />
Alternatively, 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 />
=== 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 clicking the ''Page actions'' button (the three horizontal dots) in the address bar 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 [https://developer.mozilla.org/en-US/docs/Tools/Taking_screenshots Developer Tools].<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. To verify it worked check the ''Window Protocol'' again.<br />
<br />
You may enter {{ic|about:support}} in the URL bar to check the ''Window Protocol''. It should say ''wayland'' instead of ''x11'' or ''xwayland''.<br />
<br />
On native Wayland Firefox rendering performance can be significantly improved by setting {{ic|gfx.webrender.compositor.force-enabled}} to true in {{ic|about:config}}. As of Firefox 89, this feature is experimental and Firefox Nightly is recommended for testing.<br />
<br />
All rendering is allowed to occur in native compositor surfaces, resulting in more efficient rendering, improving performance and battery life [https://bugzilla.mozilla.org/show_bug.cgi?id=1617498]. Ensure [[/Tweaks#Enable WebRender compositor]] is also enabled and working. GNOME 40.1/3.38.5 or KDE 5.22 or later are considered testable compositors [https://bugzilla.mozilla.org/show_bug.cgi?id=1617498#c13].<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 />
=== 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.<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 ''Preferences > Home'' and under ''Homepage and new windows'' click the ''Use Current Pages'' button.<br />
<br />
Alternatively go directly to ''Preferences > 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 />
== Troubleshooting ==<br />
<br />
=== Safe Mode ===<br />
<br />
The command line switch {{ic|--safe-mode}} starts Firefox in [http://kb.mozillazine.org/Safe_Mode Safe Mode], which disables extensions, themes and some other features for this session.<br />
<br />
=== Disable hardware video acceleration ===<br />
<br />
To force disable hardware video acceleration in Firefox, e.g. in case of freezes, start Firefox in [[#Safe Mode|Safe Mode]] or set {{ic|layers.acceleration.disabled}} to {{ic|true}} in {{ic|about:config}}.<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).<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 />
=== 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 ''Twemoji Mozilla'' font. To use system emoji font set {{ic|font.name-list.emoji}} to {{ic|emoji}} in {{ic|about:config}}.<br />
<br />
Firefox has problems with [[Emoji]] presentation [https://bugzilla.mozilla.org/show_bug.cgi?id=1509988]. Set {{ic|gfx.font_rendering.fontconfig.max_generic_substitutions}} to {{ic|0}} as workaround.<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 ''Preferences > 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 />
=== Make plugins respect blocked pop-ups ===<br />
<br />
Some plugins can misbehave and bypass the default settings, such as the Flash plugin. You can prevent this by doing the following:<br />
<br />
# Type {{ic|about:config}} into the address bar.<br />
# Right-click on the page and select ''New > Integer''.<br />
# Name it {{ic|privacy.popups.disable_from_plugins}}.<br />
# Set the value to {{ic|2}}.<br />
<br />
The possible values are:<br />
<br />
* {{ic|'''0'''}}: Allow all popups from plugins.<br />
* {{ic|'''1'''}}: Allow popups, but limit them to {{ic|dom.popup_maximum}}.<br />
* {{ic|'''2'''}}: Block popups from plugins.<br />
* {{ic|'''3'''}}: Block popups from plugins, even on whitelisted sites.<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 />
=== Firefox detects the wrong version of my plugin ===<br />
<br />
When you close Firefox, the latter saves the current timestamp and version of your plugins inside {{ic|pluginreg.dat}} located in your profile folder, typically in {{ic|~/.mozilla/firefox/''xxxxxxxx''.default/}}.<br />
<br />
If you upgraded your plugin when Firefox was still running, you will thus have the wrong information inside that file. The next time you will restart Firefox you will get that message {{ic|Firefox has prevented the outdated plugin "XXXX" from running on ...}} when you will be trying to open content dedicated to that plugin on the web. This problem often appears with the official [[Browser plugins#Adobe Flash Player|Adobe Flash Player plugin]] which has been upgraded while Firefox was still running.<br />
<br />
The solution is to remove the file {{ic|pluginreg.dat}} from your profile and that is it. Firefox will not complain about the missing file as it will be recreated the next time Firefox will be closed. [https://bugzilla.mozilla.org/show_bug.cgi?id=1109795#c16]<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 />
=== Tearing video in fullscreen mode ===<br />
<br />
If you are using the Xorg Intel or Nouveau drivers and experience tearing video in fullscreen mode, try [[Firefox/Tweaks#Enable Legacy OpenGL compositor]].<br />
<br />
=== Tearing when scrolling ===<br />
<br />
Try disabling smooth scrolling in ''Preferences > 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 />
=== 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 />
=== Applications on Wayland can not launch Firefox ===<br />
<br />
Some applications running in XWayland mode try to launch the X11 edition of Firefox. If the browser already runs in Wayland native mode, the user will receive the error {{ic|Firefox is already running, but is not responding. To use Firefox, you must first close the existing Firefox process, restart your device, or use a different profile.}} while Firefox itself is fully operational. <br />
<br />
This can be worked around by setting the [[environment variable]] {{ic|1=MOZ_DBUS_REMOTE=1}}.<br />
<br />
{{Note|1=It is not sufficient to only set this variable in the ''.desktop'' file for Firefox, as it must be set for either the whole session or all XWayland applications. Consider additionally setting [[#Wayland]] globally. [https://bugzilla.mozilla.org/show_bug.cgi?id=1508803]}}<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 />
=== 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 />
== 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>ENV25https://wiki.archlinux.org/index.php?title=Talk:Init&diff=699027Talk:Init2021-10-13T18:26:03Z<p>ENV25: Undo revision 699010 by Stig124 (talk) redirect for no reason</p>
<hr />
<div></div>ENV25https://wiki.archlinux.org/index.php?title=Talk:Systemd-boot&diff=688675Talk:Systemd-boot2021-07-20T13:21:01Z<p>ENV25: /* Update systemd-boot#Configuration to use automatic tools bundled with systemd */ reply</p>
<hr />
<div>== $esp pseudo-var ==<br />
<br />
I'd suggest replacing {{ic|$esp}} that's prominent in the article with the standard {{ic|/boot}}, i.e. replace<br />
:{{ic|$esp}} is used to denote the mountpoint in this article. <br />
with<br />
:In this article, {{ic|/boot}} is used as the mountpoint.<br />
And replace {{ic|$esp}} instances accordingly. Changing the mountpoint is immediate to anyone who wants to do so, so another pseudo-var isn't required.<br />
<br />
In addition, it's confusing to those who wish to go with the recommended {{ic|/boot}} mountpoint. -- [[User:Alad|Alad]] ([[User talk:Alad|talk]]) 10:33, 5 January 2016 (UTC)<br />
<br />
:While that could make sense, we'd create an inconsistency with all the other boot loader articles, which do use $esp as well: [[GRUB]], [[Syslinux]], [[EFISTUB]] and [[rEFInd]]. Personally, I don't think that using a variable like that is creating confusion, especially after [https://wiki.archlinux.org/index.php?title=Beginners%27_guide&diff=414434&oldid=414433]. — [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 07:12, 9 January 2016 (UTC)<br />
<br />
== Keys inside the boot menu, clarification ==<br />
<br />
once you use keys to change timeout (-,T,+,t), this setting is saved in a non-volatile EFI variable;<br />
in this way `loader.conf` setting is overridden; a) how to clear the non-volatile EFI variable? b) how to show values of non-volatile EFI variables? --[[User:NTia89|nTia89]] ([[User talk:NTia89|talk]]) 14:22, 27 May 2016 (UTC)<br />
<br />
:https://bbs.archlinux.org/viewtopic.php?pid=1733461#p1733461<br />
:a) maybe reflashing the bios ^^ or efivar -w (be carefully you can brick your motherboard) b) also with efivar --name var -p<br />
:{{unsigned|21:13, 31 August 2017|Fallback}}<br />
<br />
== The section about Windows 8+ overriding boot settings is incorrect ==<br />
<br />
I have a dual boot with Windows 10 and it does not override your boot settings or make Windows the default at each boot as explained in the wiki (it might during a major upgrade that work more or less as a new install, like Windows 8 -> Windows 10).<br />
<br />
The fact is that, Windows normally manage the default boot efi file $esp\boot\efi\bootx64.efi and keep it identical to $esp/EFI/Microsoft/Boot/bootmgfw.efi . This file is often updated (I don't know if it is at every boot, but very often). The default installation of systemd-boot put also a copy of itself at the default $esp\boot\efi\bootx64.efi and this can gives a conflict because it will be overwritten by Windows. If we manage to correctly put a default boot entry in the firmware that is not $esp\boot\efi\bootx64.efi, there will be no problems. If we have a motherboard that can only boot $esp\boot\efi\bootx64.efi then and only then we are in trouble and the work around described in the wiki can make sense. It would be safer not touching $esp\boot\efi\bootx64.efi, I think Windows expect we do not touch this file.<br />
<br />
{{Unsigned|21:28, 1 July 2016 (UTC)|Olive}}<br />
<br />
== splash ==<br />
<br />
add a section which talks about splash feature. --[[User:NTia89|nTia89]] ([[User talk:NTia89|talk]]) 09:40, 9 July 2016 (UTC)<br />
<br />
== loader.conf: timeout 0? ==<br />
<br />
Missing (for me) is what happens when "timeout 0" is set in loader.conf<br />
<br />
{{unsigned|11:09, 22 November 2017|Probackup-nl}}<br />
<br />
== boot into windows once? ==<br />
<br />
Does anyone know whether there is a way to reboot into windows once from linux using a command line. I.e. instead of "reboot", but "reboot-windows", which will boot into windows without me choosing anything at the boot menu. And on next reboot reboot into linux as the default sets?<br />
<br />
{{unsigned|21:06, 28 January 2018|Minxu}}<br />
<br />
:run efibootmgr, note the number of the entry you want to boot next, run efibootmgr -n $number, that sets the boot entry as BootNext.[[User:Taifleh|Taifleh]] ([[User talk:Taifleh|talk]]) 11:20, 7 March 2018 (UTC)<br />
<br />
:You can use {{ic|1=systemctl reboot --boot-loader-entry=<entry name>}} to directly boot a specific entry. However, this does not work with the auto-detected Windows Boot Loader, you have to create a boot entry. To list available options, run {{ic|1=systemctl reboot --boot-loader-entry=help}}. The advantage is that you don't need {{ic|efibootmgr}} installed. Might be worth to include in [[Systemd-boot#Choosing next boot]]? {{ic|--help}} as mentioned there did not work for me. [[User:Qw3ry|Qw3ry]] ([[User talk:Qw3ry|talk]]) 08:58, 31 January 2020 (UTC)<br />
<br />
== objcopy use with intel-ucode.img ==<br />
<br />
as it is nowhere to be found, i am clueless.<br />
how do i integrate the intel-ucode-img within an efi file in that manner? [[User:Taifleh|Taifleh]] ([[User talk:Taifleh|talk]]) 01:35, 7 March 2018 (UTC)<br />
<br />
:See [[Microcode#EFI_boot_stub_.2F_EFI_handover]]. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 07:18, 7 March 2018 (UTC)<br />
<br />
:Well, this was a kind of obvious solution. Thank you for sharing! [[User:Taifleh|Taifleh]] ([[User talk:Taifleh|talk]]) 09:58, 7 March 2018 (UTC)<br />
<br />
I'm still having problems with this. Since we incorporate the ucode and initramfs within the binary EFI file, how do we reference it in the kernel-command-line.txt? What is the expected syntax for that file? Is it the same as /proc/cmdline contains? What about escaping the backslash character? I feel like this should be explained somewhere. When I try this, the kernel commandline is not being processed. Boot fails for my root partition cannot be mounted to /new_root. So initramfs is being loaded, and ucode is loaded as well. So it seems, it's not neccessary to mention initrd parameters in the kernel-command-line.txt. So how do I add my parameters (root=UUID=someuuid)... ? [[User:Taifleh|Taifleh]] ([[User talk:Taifleh|talk]]) 15:32, 7 March 2018 (UTC)<br />
<br />
All you need to do is to concatenate the ucode file and your initrd with the ucode file being first. Then you use that combined file as I initrd. No need to for kernel command line arguments or anything. [[User:Hunger|Hunger]]<br />
<br />
== arch.conf explanation could use some clearing up ==<br />
<br />
Wouldn't it make a lot more sense to have the example options as `options root=/dev/sdxY rw` as opposed to some label? Also, in the explanation above it says `initrd=efipath` is a required option but I have never used this and booting into Arch works fine. [[User:Tonij|Tonij]] ([[User talk:Tonij|talk]]) 10:12, 5 December 2018 (UTC)<br />
<br />
:That's usually not a good idea, see [[Persistent_block_device_naming]]. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 23:03, 5 December 2018 (UTC)<br />
<br />
== System Rescue CD on ESP ==<br />
<br />
Just like the already here "GRML on ESP" i tried to do the same with System Rescue CD (version 5.3.2).<br />
And '''''unexpectedly''''' it works! <br />
I followed the steps in the GRML section [https://wiki.archlinux.org/index.php/Systemd-boot#Grml_on_ESP]:<br />
<br />
- copied these files to<br />
<br />
/boot/srcd/initram.igz<br />
/boot/srcd/rescue64<br />
/boot/srcd/systemrescuecd-x86-5.3.2.iso<br />
<br />
- added an entry<br />
<br />
title SRCD<br />
linux /srcd/rescue64<br />
initrd /srcd/initram.igz<br />
options docache setkmap=it isoloop=srcd/systemrescuecd-x86-5.3.2.iso<br />
<br />
Before promoting to the main page, I'd like to have some feedback, thank you.<br />
<br />
[[User:NTia89|nTia89]] ([[User talk:NTia89|talk]]) 08:02, 23 September 2019 (UTC)<br />
<br />
: Let's not do this. As you have (unconsciously? why would you expect it not to work?) noticed yourself, the GRML section serves as an example that can be generalized easily enough. [[User:Robg|Robg]] ([[User talk:Robg|talk]]) 15:14, 23 September 2019 (UTC)<br />
:: It was unexpected to me because I have just used that instructions for SRCD but I do not know neither what those files do nor have a theoretical base... It could have been easily a fluke! That's the reason why I wrote here. If you know it is '''''logic''''' and '''''generic''''' to every other distro, I'd like to add it to the section: I do not want to add a section for SRCD, a section for another distro, etc. but ''rework'' the section making it generic and ''keep'' GRML as example, because currently the section does not talk about it is a generic procedure! [[User:NTia89|nTia89]] ([[User talk:NTia89|talk]]) 15:38, 23 September 2019 (UTC)<br />
<br />
:::It is not generic, but you can easily find out yourself what are the proper file names for the kernel image and initial ramdisk, as well as what are the required kernel options. This page certainly won't become what we had before on the [https://wiki.archlinux.org/index.php?diff=483850 Multiboot USB drive] page, one example is more than enough. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 20:59, 23 September 2019 (UTC)<br />
::::I absolutely agree with you Lahwaacz, a notice box is enough but needed as well. [[User:NTia89|nTia89]] ([[User talk:NTia89|talk]]) 21:08, 23 September 2019 (UTC)<br />
::::: I can live with a notice. Why don't you add one, NTia89, and me or Lahwaacz will adjust it if necessary. A single sentence of the kind "the below example can be generalized to..." should do. [[User:Robg|Robg]] ([[User talk:Robg|talk]]) 12:40, 24 September 2019 (UTC)<br />
:::::: Done [[User:NTia89|nTia89]] ([[User talk:NTia89|talk]]) 12:51, 24 September 2019 (UTC)<br />
<br />
== Installation update XBOOTLDR ==<br />
<br />
The current wiki page states the installation section is out of date<br />
<br />
--path is no longer referenced inside of the bootctl man pages.<br />
<br />
There are 2 new arguments to use instead (from the man pages of bootclt):<br />
--esp-path=<br />
Path to the EFI System Partition (ESP). If not specified, /efi/, /boot/, and /boot/efi/ are checked in turn. It is recommended to mount the ESP to /efi/, if possible.<br />
--boot-path=<br />
Path to the Extended Boot Loader partition, as defined in the Boot Loader Specification. If not specified, /boot/ is checked. It is recommended to mount the Extended Boot Loader partition to /boot/, if possible.<br />
<br />
the Extended boot loader is labeled guid bc13c2ff-59e6-4262-a352-b275fd6f7172 or Linux Extended Boot<br />
<br />
This --boot-path allows for a new partition to be created and systemd-boot can read from that as well as from the ESP<br />
<br />
This Linux Extended Boot partition should still be formatted to vfat, [https://github.com/systemd/systemd/pull/11701#issuecomment-463997319 though it should be able to read other file systems as well.]<br />
<br />
This means kernels are no longer required to be installed on the esp and can instead be held on the new /boot partition which systemd-boot is able to read<br />
<br />
You can now mount the ESP to /efi then mount the new Linux Extened Boot Partion to /boot and create a loader entry in /boot/loader/entries/arch.conf and systemd-boot will be able to read and boot it.<br />
<br />
Longer write ups written by me can be found [https://www.reddit.com/r/archlinux/comments/fv0eac/help_systemdboot_extended_boot_loader_partition/ on reddit] and [https://bbs.archlinux.org/viewtopic.php?id=254374 on the fourms]<br />
<br />
Info about XBOOTLDR can be found [https://systemd.io/BOOT_LOADER_SPECIFICATION/ here]<br />
<br />
[[User:Thegreatzach|Thegreatzach]] ([[User talk:Thegreatzach|talk]]) 19:40, 6 April 2020 (UTC)<br />
<br />
EDIT:<br />
<br />
The systemd gpt auto generator will only mount partitions that are on the same physical device.<br />
<br />
Meaning that the Extended Boot Loader partition must be on the same disk as the ESP<br />
<br />
[https://www.freedesktop.org/software/systemd/man/systemd-gpt-auto-generator.html source]<br />
<br />
[[User:Thegreatzach|Thegreatzach]] ([[User talk:Thegreatzach|talk]]) 13:30, 29 May 2020 (UTC)<br />
<br />
:A reference to formatting the XBOOTLDR as FAT would be helpful. I couldn't find reference to making it FAT on any other Wiki page. [[User:Callmejoe|Callmejoe]] ([[User talk:Callmejoe|talk]]) 05:46, 13 April 2021 (UTC)<br />
::https://wiki.archlinux.org/index.php/File_systems [[User:Scimmia|Scimmia]] ([[User talk:Scimmia|talk]]) 11:41, 13 April 2021 (UTC)<br />
::: nothing on that page that refers to linux extended boot partitions and how they should be formatted related to systemd-boot [[User:Callmejoe|Callmejoe]] ([[User talk:Callmejoe|talk]]) 13:25, 13 April 2021 (UTC)<br />
::::You said nothing told you how to make a FAT partition. That page does. And stop marking your edits as 'minor'. [[User:Scimmia|Scimmia]] ([[User talk:Scimmia|talk]]) 05:31, 14 April 2021 (UTC)<br />
<br />
== add link to aur:kernel-install-hook ==<br />
<br />
<br />
see {{man|8|kernel-install}}<br />
<br />
tldr - kernel-install runs scripts in {{ic|/usr/lib/kernel/install.d}} or {{ic|/etc/kernel/install.d}}. It automatically installs kernel and initramfs in<br />
{{ic|$BOOT/<MACHINE-ID>/<KERNEL-VERSION>/kernel}} and {{ic|$BOOT/<MACHINE-ID>/<KERNEL-VERSION>/initrd}} respectively. It also installs boot entry to<br />
{{ic|$BOOT/loader/entries/<MACHINE-ID>-<KERNEL-VERSION>.conf}}.<br />
<br />
The {{AUR|kernel-install-hook}} automatically runs {{ic|kernel-install}} when needed.<br />
<br />
This works well for me for with both dracut and mkinitcpio for initramfs.<br />
<br />
Also make sure you only have one initramfs generator installed, otherwise it might generate two initramfs.<br />
<br />
[[User:ENV25|ENV25]] ([[User talk:ENV25|talk]]) 16:00, 21 March 2021 (UTC)<br />
<br />
: I wrote a newer pacman hook. AUR: {{AUR|pacman-hook-kernel-install}}<br />
: [[User:ENV25|ENV25]] ([[User talk:ENV25|talk]]) 12:56, 20 July 2021 (UTC)<br />
<br />
== Update [[systemd-boot#Configuration]] to use automatic tools bundled with systemd ==<br />
<br />
Systemd bundles the [https://man.archlinux.org/man/kernel-install.8 kernel-install] tool (as noted by [[User:ENV25|ENV25]] above) which makes it very easy to manage multiple kernels among different installs on a single ESP. I propose we rewrite the current configuration section to include this as an automatic method in a subsection, and move the current contents to a subsection as a manual method. The automatic section would include topics like how to mask the default mkinitcpio pacman hook to stop the kernels installing to {{ic|/boot/vmlinuz}} and {{ic|/boot/initramfs.img}}, making/installing<sup>1</sup> pacman hooks to move new kernels on install, and how to make an initramfs (since {{ic|mkinitcpio -P}} will no longer work) and patch other scripts that may use {{ic|mkinitcpio -P}}.<br />
<br />
<sup>1</sup>My current intent is to use {{AUR|kernel-install-hook}} for the automation part because it includes {{ic|kernel-reconfigure}} which makes new initramfs for all kernels on the currently booted install, so users have a drop-in replacement for {{ic|mkinitcpio -P}}<br />
<br />
If there's any support for or objection to writing this section and moving the current content into a subsection I'd like to hear it.<br />
<br />
[[User:Lsdaniel|Lsdaniel]] ([[User talk:Lsdaniel|talk]]) 01:49, 20 July 2021 (UTC)<br />
:So you want to add a section on how to disable defaults, install unsupported packages, and edit scripts, all to make things *easier*? Doesn't make a lot of sense to me.<br />
:[[User:Scimmia|Scimmia]] ([[User talk:Scimmia|talk]]) 02:30, 20 July 2021 (UTC)<br />
::If all you're going to do is rant, just keep it to yourself. -- [[User:Alad|Alad]] ([[User talk:Alad|talk]]) 09:42, 20 July 2021 (UTC)<br />
:::Is kernel-install the officially suggested tool (by upstream) for kernel management with systemd-boot? If so, I suppose we can make it the main subsection under "Configuration". In any case, how about we include Lsdaniel's proposed explanations in a subsection following "Adding loaders"? We can always decide on making it the main subsection later on and for now focus on the content. Also, many thanks to Lsdaniel for the kind editorial offer! -- [[User:Robg|Robg]] ([[User talk:Robg|talk]]) 12:51, 20 July 2021 (UTC)<br />
:: The AUR package is only pacman hook to automatically run kernel-install every kernel upgrade. It can be installed without the package.<br />
:: "Editing scripts" is only needed to disable the mkinitcpio pacman hooks that genereate {{ic|/boot/initramfs-linux.img}}. You do the same when you install dracut.<br />
:: [[User:ENV25|ENV25]] ([[User talk:ENV25|talk]]) 13:20, 20 July 2021 (UTC)</div>ENV25https://wiki.archlinux.org/index.php?title=Talk:Systemd-boot&diff=688664Talk:Systemd-boot2021-07-20T12:57:20Z<p>ENV25: /* add link to aur:kernel-install-hook */ link newer aur pacman hook by me</p>
<hr />
<div>== $esp pseudo-var ==<br />
<br />
I'd suggest replacing {{ic|$esp}} that's prominent in the article with the standard {{ic|/boot}}, i.e. replace<br />
:{{ic|$esp}} is used to denote the mountpoint in this article. <br />
with<br />
:In this article, {{ic|/boot}} is used as the mountpoint.<br />
And replace {{ic|$esp}} instances accordingly. Changing the mountpoint is immediate to anyone who wants to do so, so another pseudo-var isn't required.<br />
<br />
In addition, it's confusing to those who wish to go with the recommended {{ic|/boot}} mountpoint. -- [[User:Alad|Alad]] ([[User talk:Alad|talk]]) 10:33, 5 January 2016 (UTC)<br />
<br />
:While that could make sense, we'd create an inconsistency with all the other boot loader articles, which do use $esp as well: [[GRUB]], [[Syslinux]], [[EFISTUB]] and [[rEFInd]]. Personally, I don't think that using a variable like that is creating confusion, especially after [https://wiki.archlinux.org/index.php?title=Beginners%27_guide&diff=414434&oldid=414433]. — [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 07:12, 9 January 2016 (UTC)<br />
<br />
== Keys inside the boot menu, clarification ==<br />
<br />
once you use keys to change timeout (-,T,+,t), this setting is saved in a non-volatile EFI variable;<br />
in this way `loader.conf` setting is overridden; a) how to clear the non-volatile EFI variable? b) how to show values of non-volatile EFI variables? --[[User:NTia89|nTia89]] ([[User talk:NTia89|talk]]) 14:22, 27 May 2016 (UTC)<br />
<br />
:https://bbs.archlinux.org/viewtopic.php?pid=1733461#p1733461<br />
:a) maybe reflashing the bios ^^ or efivar -w (be carefully you can brick your motherboard) b) also with efivar --name var -p<br />
:{{unsigned|21:13, 31 August 2017|Fallback}}<br />
<br />
== The section about Windows 8+ overriding boot settings is incorrect ==<br />
<br />
I have a dual boot with Windows 10 and it does not override your boot settings or make Windows the default at each boot as explained in the wiki (it might during a major upgrade that work more or less as a new install, like Windows 8 -> Windows 10).<br />
<br />
The fact is that, Windows normally manage the default boot efi file $esp\boot\efi\bootx64.efi and keep it identical to $esp/EFI/Microsoft/Boot/bootmgfw.efi . This file is often updated (I don't know if it is at every boot, but very often). The default installation of systemd-boot put also a copy of itself at the default $esp\boot\efi\bootx64.efi and this can gives a conflict because it will be overwritten by Windows. If we manage to correctly put a default boot entry in the firmware that is not $esp\boot\efi\bootx64.efi, there will be no problems. If we have a motherboard that can only boot $esp\boot\efi\bootx64.efi then and only then we are in trouble and the work around described in the wiki can make sense. It would be safer not touching $esp\boot\efi\bootx64.efi, I think Windows expect we do not touch this file.<br />
<br />
{{Unsigned|21:28, 1 July 2016 (UTC)|Olive}}<br />
<br />
== splash ==<br />
<br />
add a section which talks about splash feature. --[[User:NTia89|nTia89]] ([[User talk:NTia89|talk]]) 09:40, 9 July 2016 (UTC)<br />
<br />
== loader.conf: timeout 0? ==<br />
<br />
Missing (for me) is what happens when "timeout 0" is set in loader.conf<br />
<br />
{{unsigned|11:09, 22 November 2017|Probackup-nl}}<br />
<br />
== boot into windows once? ==<br />
<br />
Does anyone know whether there is a way to reboot into windows once from linux using a command line. I.e. instead of "reboot", but "reboot-windows", which will boot into windows without me choosing anything at the boot menu. And on next reboot reboot into linux as the default sets?<br />
<br />
{{unsigned|21:06, 28 January 2018|Minxu}}<br />
<br />
:run efibootmgr, note the number of the entry you want to boot next, run efibootmgr -n $number, that sets the boot entry as BootNext.[[User:Taifleh|Taifleh]] ([[User talk:Taifleh|talk]]) 11:20, 7 March 2018 (UTC)<br />
<br />
:You can use {{ic|1=systemctl reboot --boot-loader-entry=<entry name>}} to directly boot a specific entry. However, this does not work with the auto-detected Windows Boot Loader, you have to create a boot entry. To list available options, run {{ic|1=systemctl reboot --boot-loader-entry=help}}. The advantage is that you don't need {{ic|efibootmgr}} installed. Might be worth to include in [[Systemd-boot#Choosing next boot]]? {{ic|--help}} as mentioned there did not work for me. [[User:Qw3ry|Qw3ry]] ([[User talk:Qw3ry|talk]]) 08:58, 31 January 2020 (UTC)<br />
<br />
== objcopy use with intel-ucode.img ==<br />
<br />
as it is nowhere to be found, i am clueless.<br />
how do i integrate the intel-ucode-img within an efi file in that manner? [[User:Taifleh|Taifleh]] ([[User talk:Taifleh|talk]]) 01:35, 7 March 2018 (UTC)<br />
<br />
:See [[Microcode#EFI_boot_stub_.2F_EFI_handover]]. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 07:18, 7 March 2018 (UTC)<br />
<br />
:Well, this was a kind of obvious solution. Thank you for sharing! [[User:Taifleh|Taifleh]] ([[User talk:Taifleh|talk]]) 09:58, 7 March 2018 (UTC)<br />
<br />
I'm still having problems with this. Since we incorporate the ucode and initramfs within the binary EFI file, how do we reference it in the kernel-command-line.txt? What is the expected syntax for that file? Is it the same as /proc/cmdline contains? What about escaping the backslash character? I feel like this should be explained somewhere. When I try this, the kernel commandline is not being processed. Boot fails for my root partition cannot be mounted to /new_root. So initramfs is being loaded, and ucode is loaded as well. So it seems, it's not neccessary to mention initrd parameters in the kernel-command-line.txt. So how do I add my parameters (root=UUID=someuuid)... ? [[User:Taifleh|Taifleh]] ([[User talk:Taifleh|talk]]) 15:32, 7 March 2018 (UTC)<br />
<br />
All you need to do is to concatenate the ucode file and your initrd with the ucode file being first. Then you use that combined file as I initrd. No need to for kernel command line arguments or anything. [[User:Hunger|Hunger]]<br />
<br />
== arch.conf explanation could use some clearing up ==<br />
<br />
Wouldn't it make a lot more sense to have the example options as `options root=/dev/sdxY rw` as opposed to some label? Also, in the explanation above it says `initrd=efipath` is a required option but I have never used this and booting into Arch works fine. [[User:Tonij|Tonij]] ([[User talk:Tonij|talk]]) 10:12, 5 December 2018 (UTC)<br />
<br />
:That's usually not a good idea, see [[Persistent_block_device_naming]]. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 23:03, 5 December 2018 (UTC)<br />
<br />
== System Rescue CD on ESP ==<br />
<br />
Just like the already here "GRML on ESP" i tried to do the same with System Rescue CD (version 5.3.2).<br />
And '''''unexpectedly''''' it works! <br />
I followed the steps in the GRML section [https://wiki.archlinux.org/index.php/Systemd-boot#Grml_on_ESP]:<br />
<br />
- copied these files to<br />
<br />
/boot/srcd/initram.igz<br />
/boot/srcd/rescue64<br />
/boot/srcd/systemrescuecd-x86-5.3.2.iso<br />
<br />
- added an entry<br />
<br />
title SRCD<br />
linux /srcd/rescue64<br />
initrd /srcd/initram.igz<br />
options docache setkmap=it isoloop=srcd/systemrescuecd-x86-5.3.2.iso<br />
<br />
Before promoting to the main page, I'd like to have some feedback, thank you.<br />
<br />
[[User:NTia89|nTia89]] ([[User talk:NTia89|talk]]) 08:02, 23 September 2019 (UTC)<br />
<br />
: Let's not do this. As you have (unconsciously? why would you expect it not to work?) noticed yourself, the GRML section serves as an example that can be generalized easily enough. [[User:Robg|Robg]] ([[User talk:Robg|talk]]) 15:14, 23 September 2019 (UTC)<br />
:: It was unexpected to me because I have just used that instructions for SRCD but I do not know neither what those files do nor have a theoretical base... It could have been easily a fluke! That's the reason why I wrote here. If you know it is '''''logic''''' and '''''generic''''' to every other distro, I'd like to add it to the section: I do not want to add a section for SRCD, a section for another distro, etc. but ''rework'' the section making it generic and ''keep'' GRML as example, because currently the section does not talk about it is a generic procedure! [[User:NTia89|nTia89]] ([[User talk:NTia89|talk]]) 15:38, 23 September 2019 (UTC)<br />
<br />
:::It is not generic, but you can easily find out yourself what are the proper file names for the kernel image and initial ramdisk, as well as what are the required kernel options. This page certainly won't become what we had before on the [https://wiki.archlinux.org/index.php?diff=483850 Multiboot USB drive] page, one example is more than enough. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 20:59, 23 September 2019 (UTC)<br />
::::I absolutely agree with you Lahwaacz, a notice box is enough but needed as well. [[User:NTia89|nTia89]] ([[User talk:NTia89|talk]]) 21:08, 23 September 2019 (UTC)<br />
::::: I can live with a notice. Why don't you add one, NTia89, and me or Lahwaacz will adjust it if necessary. A single sentence of the kind "the below example can be generalized to..." should do. [[User:Robg|Robg]] ([[User talk:Robg|talk]]) 12:40, 24 September 2019 (UTC)<br />
:::::: Done [[User:NTia89|nTia89]] ([[User talk:NTia89|talk]]) 12:51, 24 September 2019 (UTC)<br />
<br />
== Installation update XBOOTLDR ==<br />
<br />
The current wiki page states the installation section is out of date<br />
<br />
--path is no longer referenced inside of the bootctl man pages.<br />
<br />
There are 2 new arguments to use instead (from the man pages of bootclt):<br />
--esp-path=<br />
Path to the EFI System Partition (ESP). If not specified, /efi/, /boot/, and /boot/efi/ are checked in turn. It is recommended to mount the ESP to /efi/, if possible.<br />
--boot-path=<br />
Path to the Extended Boot Loader partition, as defined in the Boot Loader Specification. If not specified, /boot/ is checked. It is recommended to mount the Extended Boot Loader partition to /boot/, if possible.<br />
<br />
the Extended boot loader is labeled guid bc13c2ff-59e6-4262-a352-b275fd6f7172 or Linux Extended Boot<br />
<br />
This --boot-path allows for a new partition to be created and systemd-boot can read from that as well as from the ESP<br />
<br />
This Linux Extended Boot partition should still be formatted to vfat, [https://github.com/systemd/systemd/pull/11701#issuecomment-463997319 though it should be able to read other file systems as well.]<br />
<br />
This means kernels are no longer required to be installed on the esp and can instead be held on the new /boot partition which systemd-boot is able to read<br />
<br />
You can now mount the ESP to /efi then mount the new Linux Extened Boot Partion to /boot and create a loader entry in /boot/loader/entries/arch.conf and systemd-boot will be able to read and boot it.<br />
<br />
Longer write ups written by me can be found [https://www.reddit.com/r/archlinux/comments/fv0eac/help_systemdboot_extended_boot_loader_partition/ on reddit] and [https://bbs.archlinux.org/viewtopic.php?id=254374 on the fourms]<br />
<br />
Info about XBOOTLDR can be found [https://systemd.io/BOOT_LOADER_SPECIFICATION/ here]<br />
<br />
[[User:Thegreatzach|Thegreatzach]] ([[User talk:Thegreatzach|talk]]) 19:40, 6 April 2020 (UTC)<br />
<br />
EDIT:<br />
<br />
The systemd gpt auto generator will only mount partitions that are on the same physical device.<br />
<br />
Meaning that the Extended Boot Loader partition must be on the same disk as the ESP<br />
<br />
[https://www.freedesktop.org/software/systemd/man/systemd-gpt-auto-generator.html source]<br />
<br />
[[User:Thegreatzach|Thegreatzach]] ([[User talk:Thegreatzach|talk]]) 13:30, 29 May 2020 (UTC)<br />
<br />
:A reference to formatting the XBOOTLDR as FAT would be helpful. I couldn't find reference to making it FAT on any other Wiki page. [[User:Callmejoe|Callmejoe]] ([[User talk:Callmejoe|talk]]) 05:46, 13 April 2021 (UTC)<br />
::https://wiki.archlinux.org/index.php/File_systems [[User:Scimmia|Scimmia]] ([[User talk:Scimmia|talk]]) 11:41, 13 April 2021 (UTC)<br />
::: nothing on that page that refers to linux extended boot partitions and how they should be formatted related to systemd-boot [[User:Callmejoe|Callmejoe]] ([[User talk:Callmejoe|talk]]) 13:25, 13 April 2021 (UTC)<br />
::::You said nothing told you how to make a FAT partition. That page does. And stop marking your edits as 'minor'. [[User:Scimmia|Scimmia]] ([[User talk:Scimmia|talk]]) 05:31, 14 April 2021 (UTC)<br />
<br />
== add link to aur:kernel-install-hook ==<br />
<br />
<br />
see {{man|8|kernel-install}}<br />
<br />
tldr - kernel-install runs scripts in {{ic|/usr/lib/kernel/install.d}} or {{ic|/etc/kernel/install.d}}. It automatically installs kernel and initramfs in<br />
{{ic|$BOOT/<MACHINE-ID>/<KERNEL-VERSION>/kernel}} and {{ic|$BOOT/<MACHINE-ID>/<KERNEL-VERSION>/initrd}} respectively. It also installs boot entry to<br />
{{ic|$BOOT/loader/entries/<MACHINE-ID>-<KERNEL-VERSION>.conf}}.<br />
<br />
The {{AUR|kernel-install-hook}} automatically runs {{ic|kernel-install}} when needed.<br />
<br />
This works well for me for with both dracut and mkinitcpio for initramfs.<br />
<br />
Also make sure you only have one initramfs generator installed, otherwise it might generate two initramfs.<br />
<br />
[[User:ENV25|ENV25]] ([[User talk:ENV25|talk]]) 16:00, 21 March 2021 (UTC)<br />
<br />
: I wrote a newer pacman hook. AUR: {{AUR|pacman-hook-kernel-install}}<br />
: [[User:ENV25|ENV25]] ([[User talk:ENV25|talk]]) 12:56, 20 July 2021 (UTC)<br />
<br />
== Update [[systemd-boot#Configuration]] to use automatic tools bundled with systemd ==<br />
<br />
Systemd bundles the [https://man.archlinux.org/man/kernel-install.8 kernel-install] tool (as noted by [[User:ENV25|ENV25]] above) which makes it very easy to manage multiple kernels among different installs on a single ESP. I propose we rewrite the current configuration section to include this as an automatic method in a subsection, and move the current contents to a subsection as a manual method. The automatic section would include topics like how to mask the default mkinitcpio pacman hook to stop the kernels installing to {{ic|/boot/vmlinuz}} and {{ic|/boot/initramfs.img}}, making/installing<sup>1</sup> pacman hooks to move new kernels on install, and how to make an initramfs (since {{ic|mkinitcpio -P}} will no longer work) and patch other scripts that may use {{ic|mkinitcpio -P}}.<br />
<br />
<sup>1</sup>My current intent is to use {{AUR|kernel-install-hook}} for the automation part because it includes {{ic|kernel-reconfigure}} which makes new initramfs for all kernels on the currently booted install, so users have a drop-in replacement for {{ic|mkinitcpio -P}}<br />
<br />
If there's any support for or objection to writing this section and moving the current content into a subsection I'd like to hear it.<br />
<br />
[[User:Lsdaniel|Lsdaniel]] ([[User talk:Lsdaniel|talk]]) 01:49, 20 July 2021 (UTC)<br />
:So you want to add a section on how to disable defaults, install unsupported packages, and edit scripts, all to make things *easier*? Doesn't make a lot of sense to me.<br />
:[[User:Scimmia|Scimmia]] ([[User talk:Scimmia|talk]]) 02:30, 20 July 2021 (UTC)<br />
::If all you're going to do is rant, just keep it to yourself. -- [[User:Alad|Alad]] ([[User talk:Alad|talk]]) 09:42, 20 July 2021 (UTC)<br />
:::Is kernel-install the officially suggested tool (by upstream) for kernel management with systemd-boot? If so, I suppose we can make it the main subsection under "Configuration". In any case, how about we include Lsdaniel's proposed explanations in a subsection following "Adding loaders"? We can always decide on making it the main subsection later on and for now focus on the content. Also, many thanks to Lsdaniel for the kind editorial offer! -- [[User:Robg|Robg]] ([[User talk:Robg|talk]]) 12:51, 20 July 2021 (UTC)</div>ENV25https://wiki.archlinux.org/index.php?title=Alacritty&diff=687713Alacritty2021-07-12T12:28:52Z<p>ENV25: /* "user@host:cwd" in window title bar */ Change alacritty to alacritty*. See `toe | grep alacritty`.</p>
<hr />
<div>[[Category:Terminal emulators]]<br />
[[ja:Alacritty]]<br />
[[pt:Alacritty]]<br />
[[ru:Alacritty]]<br />
[[tr:Alacritty]]<br />
[https://github.com/alacritty/alacritty Alacritty] is a simple, GPU-accelerated terminal emulator written in [[Rust]]. It supports scrollback, truecolor, copy/paste, clicking on URLS, and custom key bindings.<br />
<br />
== Installation ==<br />
<br />
Install the {{Pkg|alacritty}} package or {{AUR|alacritty-git}} for the development version.<br />
<br />
== Configuration ==<br />
<br />
''Alacritty'' searches for a configuration file at the following places in this order:<br />
<br />
* {{ic|$XDG_CONFIG_HOME/alacritty/alacritty.yml}}<br />
* {{ic|$XDG_CONFIG_HOME/alacritty.yml}}<br />
* {{ic|$HOME/.config/alacritty/alacritty.yml}}<br />
* {{ic|$HOME/.alacritty.yml}}<br />
<br />
Copy the example configuration file at {{ic|/usr/share/doc/alacritty/example/alacritty.yml}} to one of those places and uncomment the settings you want to change. Most settings take effect as soon as you save the file.<br />
<br />
=== Colors ===<br />
<br />
See [https://github.com/alacritty/alacritty/wiki/Color-schemes the upstream wiki] for a list of available color schemes. If your preferred color scheme is on the list, paste the provided code into your configuration file.<br />
<br />
=== Font ===<br />
<br />
If you do not want to use your system’s default font, you can specify a different font by changing the following lines:<br />
<br />
{{bc|<br />
font:<br />
normal:<br />
family: monospace<br />
style: Regular<br />
<br />
bold:<br />
family: monospace<br />
style: Bold<br />
<br />
italic:<br />
family: monospace<br />
style: Italic<br />
<br />
bold_italic:<br />
family: monospace<br />
style: Bold Italic<br />
<br />
size: 11<br />
}}<br />
<br />
Substitute {{ic|monospace}} with a font name from the output of <br />
<br />
$ fc-list : family style<br />
<br />
Note that some fonts do not provide an {{ic|Italic}} style but an {{ic|Oblique}} style instead.<br />
<br />
== Tips and tricks ==<br />
<br />
=== Spawn new instance in same directory ===<br />
<br />
Add the following lines to your configuration file to spawn a new instance of ''Alacritty'' in the current working directory by pressing {{ic|Ctrl+Shift+Enter}}:<br />
<br />
key_bindings:<br />
- { key: Return, mods: Control|Shift, action: SpawnNewInstance }<br />
<br />
=== "user@host:cwd" in window title bar ===<br />
<br />
The window title bar shows "Alacritty" unlike other terminal emulators under Arch, which by default show "user@host:cwd". See {{Bug|70752}}.<br />
<br />
If you want the Arch default behavior to apply to all your users in Alacritty, you need to edit your {{ic|/etc/bash.bashrc}} file.<br />
<br />
Find the case statements which sets the {{ic|$PROMPT_COMMAND}} for other terminals:<br />
<br />
case ${TERM} in<br />
<br />
xterm*|rxvt*|Eterm|aterm|kterm|gnome*)<br />
PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }'printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"'<br />
<br />
;;<br />
screen*)<br />
PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }'printf "\033_%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"'<br />
;;<br />
esac<br />
<br />
Then edit the line {{ic|xterm*{{!}}rxvt*{{!}}Eterm{{!}}aterm{{!}}kterm{{!}}gnome*)}} to add {{ic|alacritty*}} so that it reads {{ic|xterm*{{!}}rxvt*{{!}}Eterm{{!}}alacritty*{{!}}aterm{{!}}kterm{{!}}gnome*)}}.<br />
<br />
=== Vi mode and copy/paste ===<br />
<br />
The vi mode allows moving around Alacritty's viewport and scrollback using the keyboard. By default you can toggle it using {{ic|Ctrl+Shift+Space}}. To copy, you can either use a mouse to select and press {{ic|Ctrl+Shift+c}}, or enter Vi mode, start a selection using {{ic|v}}, move around with {{ic|hjkl}} like in vim, and copy the selection with {{ic|y}}. To paste, press {{ic|Ctrl+Shift+v}}. To copy/paste to/from X clipboard, you can use a mouse selection to copy and a middle mouse click to paste.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Mouse not working properly in Vim ===<br />
<br />
Add {{ic|1=ttymouse=sgr}} to your {{ic|.vimrc}} or switch to [[Neovim]]. Also see [https://github.com/alacritty/alacritty/issues/803 this issue].<br />
<br />
=== Transparent border in dwm ===<br />
<br />
With [[dwm]], [[alacritty]]'s borders become transparent. Adding this line to {{ic|drw.c}} in the [[dwm]] source directory and recompiling fixes the issue.<br />
<br />
if (!XftColorAllocName)...<br />
die("error, cannot allocate color '%s'", clrname); /* Find this line */<br />
dest->pixel |= 0xff << 24; /* Add this line */<br />
<br />
=== Terminal functionality unavailable in remote shells ===<br />
<br />
When connecting to a remote system from an Alacritty terminal, for instance over [[SSH]], it can occur that the system does not have an entry for Alacritty in its terminfo database ({{ic|/usr/share/terminfo/a/alacritty*}}). Therefore, all interactive terminal functionality does not work. This can be fixed by copying the terminfo for Alacritty to the remote server, as described [[termite#Terminal issues with SSH|here]].<br />
<br />
On the local host, using Alacritty:<br />
<br />
$ infocmp > alacritty.terminfo # export Alacritty's Terminfo<br />
$ scp alacritty.terminfo user@remote-host:~/ # or any other method to copy to the remote host<br />
<br />
On the remote host, in the directory where you copied {{ic|alacritty.terminfo}}:<br />
<br />
$ tic -x alacritty.terminfo # import Terminfo for current user<br />
$ rm alacritty.terminfo # optional: remove Terminfo file<br />
<br />
{{Note|After this, you will need to start a new SSH session to have the remote shell load the new Terminfo.}}<br />
<br />
<br />
Alternatively, one can set the value of {{ic|TERM}} in the configuration to {{ic|xterm-256color}} instead of the default {{ic|alacritty}}:<br />
<br />
{{bc|<br />
env:<br />
TERM: xterm-256color<br />
}}</div>ENV25https://wiki.archlinux.org/index.php?title=Konsole&diff=687708Konsole2021-07-12T12:12:22Z<p>ENV25: Add note that some programs may not work with konsole-direct, inform that konsole-256color can be used instead.</p>
<hr />
<div>[[Category:KDE]]<br />
[[Category:Terminal emulators]]<br />
[[ja:Konsole]]<br />
{{Related articles start}}<br />
{{Related|KDE}}<br />
{{Related|Yakuake}}<br />
{{Related articles end}}<br />
<br />
[https://apps.kde.org/en/konsole Konsole] is a terminal emulator for the KDE desktop.<br />
<br />
== Installation ==<br />
<br />
[[Install]] the {{Pkg|konsole}} package.<br />
<br />
== Troubleshooting ==<br />
<br />
=== True-color programs do not display correctly ===<br />
<br />
This is because, by default, konsole does not set the right {{ic|$TERM}} variable. To set it, either edit you konsole profile or make new one:<br />
<br />
{{hc|1=~/.local/share/konsole/konsole.profile|2=<br />
[General]<br />
Name=konsole<br />
Environment=TERM=konsole-direct,COLORTERM=truecolor<br />
}}<br />
<br />
{{Note|Some programs may not work correctly with {{ic|konsole-direct}} as {{ic|$TERM}}. If so, use {{ic|konsole-256color}} instead.}}</div>ENV25https://wiki.archlinux.org/index.php?title=Talk:Man_page&diff=685637Talk:Man page2021-07-05T08:50:08Z<p>ENV25: /* Regarding 5.2 Conversion to PDF */ documentation for -Tpdf is in groff(1)</p>
<hr />
<div>== Add missing Arch-specific man pages + new specific section ==<br />
<br />
It seems a lot of man pages from Arch Linux's projects are missing, which I believe that should be added. I generated a list running the following:<br />
<br />
{{bc|<nowiki><br />
pkgs="arch-install-scripts devtools mkinitcpio namcap netctl pacman pacman-contrib"<br />
for pkg in $pkgs; do<br />
echo ""<br />
echo "; {{Pkg|$pkg}}"<br />
mans=$(pacman -Ql $pkg | grep -E '/man/.*\.gz' | sed 's|.*/man/man[0-9]/||;s|\.gz||' | sort)<br />
for man in $mans; do<br />
name=${man%.*}<br />
num=${man##*.}<br />
echo "* {{man|$num|$name}}"<br />
done<br />
done<br />
</nowiki>}}<br />
<br />
Note how this command split man pages by package name, with an output e.g.:<br />
<br />
{{bc|<nowiki><br />
...<br />
; {{Pkg|namcap}}<br />
* {{man|1|namcap}}<br />
<br />
; {{Pkg|netctl}}<br />
* {{man|1|netctl}}<br />
...<br />
</nowiki>}}<br />
<br />
which is rendered as:<br />
<br />
; {{Pkg|namcap}}<br />
* {{man|1|namcap}}<br />
<br />
; {{Pkg|netctl}}<br />
* {{man|1|netctl}}<br />
<br />
IMHO, adding all of these man pages would increase too much the size of [[Man page#Noteworthy man pages|#Noteworthy man pages]]. Having that said, I'm considering to:<br />
<br />
# Add a specific section (maybe subsection?) for Arch Linux man pages<br />
# Update the list of Arch man pages with the output of the above command; preceded by a brief note regarding being split by package name<br />
<br />
Opinions, suggestions, objections?<br><br />
-- [[User:Josephgbr|Josephgbr]] ([[User talk:Josephgbr|talk]]) 19:16, 11 July 2020 (UTC)<br />
<br />
:Arch-specific or not, I don't see the point of showing manuals for projects like [[pacman]] or [[makepkg]] which have their own pages on the wiki. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 11:34, 12 July 2020 (UTC)<br />
<br />
== Regarding 5.2 Conversion to PDF ==<br />
<br />
In order to avoid depending on ghostscript, I think it's possible to instead use:<br />
{{bc|<nowiki><br />
man -Tpdf <manpage> > <pdf><br />
</nowiki>}}<br />
I'm new to editing wiki pages, and don't want to mess up, so I didn't actually make the change - but probably should?<br />
--[[User:Ferdinand|Ferdinand]] ([[User talk:Ferdinand|talk]]) 11:36, 4 July 2021 (UTC)<br />
<br />
:Don't be afraid and go for it. You can read [[ArchWiki:Contributing]] if you haven't already. -- [[User:Flyingpig|Flyingpig]] ([[User talk:Flyingpig|talk]]) 18:24, 4 July 2021 (UTC)<br />
<br />
Regarding the question about factual accuracy, about this being a feature of man in the [https://archlinux.org/packages/community/x86_64/mandoc/ mandoc] package, and not of the man in the [https://archlinux.org/packages/core/x86_64/man-db/ man-db] package, I notice that the [https://man.archlinux.org/man/man.1 Arch web-based man page for man from man-db version] is for version 2.9.4-2 and doesn't include PDF and html as output devices, but I only have man-db installed, not the mandoc package, and it works for me - and my /usr/share/man/man1/man.1.gz does indeed belong to man-db version 2.9.4-2, according to pacman -Qo. How can the Arch web-based man page be different?<br />
[[User:Ferdinand|Ferdinand]] ([[User talk:Ferdinand|talk]]) 08:07, 5 July 2021 (UTC)<br />
<br />
: Documentation for the {{ic|-Tpdf}} option is there in {{man|1|groff}}. -- [[User:ENV25|ENV25]] ([[User talk:ENV25|talk]]) 08:50, 5 July 2021 (UTC)</div>ENV25https://wiki.archlinux.org/index.php?title=Zsh&diff=671558Zsh2021-05-16T19:26:18Z<p>ENV25: Moved "command not found" handler using to `pacman -F` to Tips & Tricks</p>
<hr />
<div>[[Category:Command-line shells]]<br />
[[cs:Zsh]]<br />
[[de:Zsh]]<br />
[[es:Zsh]]<br />
[[fa:Zsh]]<br />
[[fr:Zsh]]<br />
[[ja:Zsh]]<br />
[[ru:Zsh]]<br />
[[zh-hans:Zsh]]<br />
[https://www.zsh.org/ Zsh] is a powerful [[shell]] that operates as both an interactive shell and as a scripting language interpreter. While being compatible with the POSIX sh (not by default, only if issuing {{ic|emulate sh}}), it offers advantages such as improved [http://zsh.sourceforge.net/Guide/zshguide06.html tab completion] and [http://zsh.sourceforge.net/Doc/Release/Expansion.html globbing].<br />
<br />
The [http://zsh.sourceforge.net/FAQ/zshfaq01.html#l4 Zsh FAQ] offers more reasons to use Zsh.<br />
<br />
== Installation ==<br />
<br />
Before starting, users may want to see what shell is currently being used:<br />
<br />
$ echo $SHELL<br />
<br />
[[Install]] the {{Pkg|zsh}} package. For additional completion definitions, install the {{pkg|zsh-completions}} package as well.<br />
<br />
=== Initial configuration ===<br />
<br />
Make sure that Zsh has been installed correctly by running the following in a terminal:<br />
<br />
$ zsh<br />
<br />
You should now see ''zsh-newuser-install'', which will walk you through some basic configuration. If you want to skip this, press {{ic|q}}. If you did not see it, you can invoke it manually with:<br />
<br />
$ autoload -Uz zsh-newuser-install<br />
$ zsh-newuser-install -f<br />
<br />
{{Note|Make sure your terminal's size is at least 72×15 otherwise ''zsh-newuser-install'' will not run.}}<br />
<br />
=== Making Zsh your default shell ===<br />
<br />
Change your shell to {{ic|/usr/bin/zsh}}. See [[Command-line shell#Changing your default shell]].<br />
<br />
{{Tip|If replacing {{Pkg|bash}}, users may want to move some code from {{ic|~/.bashrc}} to {{ic|~/.zshrc}} (e.g. the prompt and the [[Bash#Aliases|aliases]]) and from {{ic|~/.bash_profile}} to {{ic|~/.zprofile}} (e.g. [[xinit#Autostart X at login|the code that starts the X Window System]]).}}<br />
<br />
== Startup/Shutdown files ==<br />
<br />
{{Tip|<br />
* See [http://zsh.sourceforge.net/Guide/zshguide02.html A User's Guide to the Z-Shell] for explanation on interactive and login shells, and what to put in your startup files.<br />
* You could consider [[Command-line shell#Standardisation|implementing a standard path]] for your Zsh configuration files.<br />
}}<br />
<br />
{{Note|<br />
* If {{ic|$ZDOTDIR}} is not set, {{ic|$HOME}} is used instead.<br />
* If option {{ic|RCS}} is unset in any of the files, no configuration files will be read after that file.<br />
* If option {{ic|GLOBAL_RCS}} is unset in any of the files, no global configuration files ({{ic|/etc/zsh/*}}) will be read after that file.<br />
}}<br />
<br />
When starting, Zsh will read commands from the following files in this order by default, provided they exist. <br />
<br />
* {{ic|/etc/zsh/zshenv}} Used for setting [[environment variables]] for all users; it should not contain commands that produce output or assume the shell is attached to a TTY. When this file exists it will '''''always''''' be read, this cannot be overridden.<br />
* {{ic|$ZDOTDIR/.zshenv}} Used for setting user's environment variables; it should not contain commands that produce output or assume the shell is attached to a TTY. When this file exists it will '''''always''''' be read.<br />
* {{ic|/etc/zsh/zprofile}} Used for executing commands at start for all users, will be read when starting as a '''''login shell'''''. Please note that on Arch Linux, by default it contains [https://github.com/archlinux/svntogit-packages/blob/packages/zsh/trunk/zprofile one line] which sources {{ic|/etc/profile}}. See warning below before wanting to remove that!<br />
** {{ic|/etc/profile}} This file should be sourced by all POSIX sh-compatible shells upon login: it sets up {{ic|$PATH}} and other environment variables and application-specific ({{ic|/etc/profile.d/*.sh}}) settings upon login.<br />
* {{ic|$ZDOTDIR/.zprofile}} Used for executing user's commands at start, will be read when starting as a '''''login shell'''''. Typically used to autostart graphical sessions and to set session-wide environment variables.<br />
* {{ic|/etc/zsh/zshrc}} Used for setting interactive shell configuration and executing commands for all users, will be read when starting as an '''''interactive shell'''''.<br />
* {{ic|$ZDOTDIR/.zshrc}} Used for setting user's interactive shell configuration and executing commands, will be read when starting as an '''''interactive shell'''''.<br />
* {{ic|/etc/zsh/zlogin}} Used for executing commands for all users at ending of initial progress, will be read when starting as a '''''login shell'''''.<br />
* {{ic|$ZDOTDIR/.zlogin}} Used for executing user's commands at ending of initial progress, will be read when starting as a '''''login shell'''''. Typically used to autostart command line utilities. Should not be used to autostart graphical sessions, as at this point the session might contain configuration meant only for an interactive shell.<br />
* {{ic|$ZDOTDIR/.zlogout}} Used for executing commands when a '''''login shell''''' '''exits'''.<br />
* {{ic|/etc/zsh/zlogout}} Used for executing commands for all users when a '''''login shell''''' '''exits'''.<br />
<br />
See [https://blog.flowblok.id.au/2013-02/shell-startup-scripts.html#implementation the graphic representation].<br />
<br />
{{Note|<br />
* {{ic|$HOME/.profile}} is not a part of the Zsh startup files and '''is not sourced''' by Zsh unless Zsh is invoked as {{ic|sh}} or {{ic|ksh}} and started as a login shell. For more details about the sh and [[ksh]] compatibility modes refer to {{man|1|zsh|COMPATIBILITY}}.<br />
* The paths used in Arch's {{Pkg|zsh}} package are different from the default ones used in the [[man page]]s ({{Bug|48992}}).<br />
}}<br />
<br />
{{Warning|Do not remove the default [https://github.com/archlinux/svntogit-packages/blob/packages/zsh/trunk/zprofile one line] in {{ic|/etc/zsh/zprofile}}, otherwise it will break the integrity of other packages which provide some scripts in {{ic|/etc/profile.d/}}.}}<br />
<br />
== Configure Zsh ==<br />
<br />
Although Zsh is usable out of the box, it is almost certainly not set up the way most users would like to use it. But due to the sheer amount of customization available in Zsh, configuring Zsh can be a daunting and time-consuming experience.<br />
<br />
=== Simple .zshrc ===<br />
<br />
Included below is a sample configuration file. It provides a decent set of default options as well as giving examples of many ways that Zsh can be customized. In order to use this configuration save it as a file named {{ic|.zshrc}}.<br />
<br />
{{Tip|Apply the changes without needing to logout and then back in by running {{ic|source ~/.zshrc}}.}}<br />
<br />
Here is a simple {{ic|.zshrc}}:<br />
<br />
{{hc|~/.zshrc|<br />
autoload -Uz compinit promptinit<br />
compinit<br />
promptinit<br />
<br />
# This will set the default prompt to the walters theme<br />
prompt walters<br />
}}<br />
<br />
See [[#Prompt themes]] for more details about the prompt theme system.<br />
<br />
=== Configuring $PATH ===<br />
<br />
Zsh ties the {{ic|PATH}} variable to a {{ic|path}} array. They are automatically synchronized. This allows us to easily manipulate {{ic|PATH}} by simply modifying the array. See [http://zsh.sourceforge.net/Guide/zshguide02.html#l24 A User's Guide to the Z-Shell] for details.<br />
<br />
The line {{ic|typeset -U PATH path}}, where the {{ic|-U}} stands for unique, instructs the shell to discard duplicates from both {{ic|$PATH}} and {{ic|$path}}:<br />
<br />
{{hc|~/.zshenv|2=<br />
typeset -U PATH path<br />
path=("$HOME/.local/bin" ''/other/things/in/path'' "$path[@]")<br />
export PATH<br />
}}<br />
<br />
=== Command completion ===<br />
<br />
Perhaps the most compelling feature of Zsh is its advanced autocompletion abilities. At the very least, enable autocompletion in {{ic|.zshrc}}. To enable autocompletion, add the following to your {{ic|~/.zshrc}}:<br />
<br />
{{hc|~/.zshrc|<br />
autoload -Uz compinit<br />
compinit<br />
}}<br />
<br />
The above configuration includes ssh/scp/sftp hostnames completion but in order for this feature to work, users must not enable ssh's hostname hashing (i.e. option {{ic|HashKnownHosts}} in ssh client configuration).<br />
<br />
For autocompletion with an arrow-key driven interface, add the following to:<br />
<br />
{{hc|~/.zshrc|<br />
zstyle ':completion:*' menu select<br />
}}<br />
<br />
To activate the menu, press {{ic|Tab}} twice.<br />
<br />
For autocompletion of command line switches for aliases, add the following to:<br />
<br />
{{hc|~/.zshrc|<br />
setopt COMPLETE_ALIASES<br />
}}<br />
<br />
For enabling autocompletion of privileged environments in privileged commands (e.g. if you complete a command starting with [[sudo]], completion scripts will also try to determine your completions with sudo), include:<br />
<br />
{{hc|~/.zshrc|<br />
zstyle ':completion::complete:*' gain-privileges 1<br />
}}<br />
<br />
{{Warning|This will let Zsh completion scripts run commands with sudo privileges. You should not enable this if you use untrusted autocompletion scripts.}}<br />
<br />
{{Note|This special kind of context-aware completion is only available for a small number of commands.}}<br />
<br />
=== Key bindings ===<br />
<br />
Zsh does not use [[readline]], instead it uses its own and more powerful Zsh Line Editor (ZLE). It does not read {{ic|/etc/inputrc}} or {{ic|~/.inputrc}}. Read [https://sgeb.io/posts/2014/04/zsh-zle-custom-widgets/ A closer look at the zsh line editor and creating custom widgets] for an introduction to ZLE configuration.<br />
<br />
ZLE has an [[Emacs]] mode and a [[vi]] mode. If one of the {{ic|VISUAL}} or {{ic|EDITOR}} [[environment variables]] contain the string {{ic|vi}} then vi mode will be used; otherwise, it will default to Emacs mode. Set the mode explicitly with {{ic|bindkey -e}} or {{ic|bindkey -v}} respectively for Emacs mode or vi mode.<br />
<br />
Key bindings are assigned by mapping an escape sequence matching a keypress to a ZLE widget. The available widgets, with descriptions of their actions and their default keybindings, are listed in {{man|1|zshzle|STANDARD WIDGETS}} and {{man|1|zshcontrib|ZLE FUNCTIONS}}.<br />
<br />
The recommended way to set key bindings in Zsh is by using string capabilities from {{man|5|terminfo}}. For example[https://web.archive.org/web/20180704181216/http://zshwiki.org/home/zle/bindkeys][https://www.zsh.org/mla/users/2010/msg00065.html]:<br />
<br />
{{hc|~/.zshrc|2=<br />
# create a zkbd compatible hash;<br />
# to add other keys to this hash, see: man 5 terminfo<br />
typeset -g -A key<br />
<br />
key[Home]="${terminfo[khome]}"<br />
key[End]="${terminfo[kend]}"<br />
key[Insert]="${terminfo[kich1]}"<br />
key[Backspace]="${terminfo[kbs]}"<br />
key[Delete]="${terminfo[kdch1]}"<br />
key[Up]="${terminfo[kcuu1]}"<br />
key[Down]="${terminfo[kcud1]}"<br />
key[Left]="${terminfo[kcub1]}"<br />
key[Right]="${terminfo[kcuf1]}"<br />
key[PageUp]="${terminfo[kpp]}"<br />
key[PageDown]="${terminfo[knp]}"<br />
key[Shift-Tab]="${terminfo[kcbt]}"<br />
<br />
# setup key accordingly<br />
[[ -n "${key[Home]}" ]] && bindkey -- "${key[Home]}" beginning-of-line<br />
[[ -n "${key[End]}" ]] && bindkey -- "${key[End]}" end-of-line<br />
[[ -n "${key[Insert]}" ]] && bindkey -- "${key[Insert]}" overwrite-mode<br />
[[ -n "${key[Backspace]}" ]] && bindkey -- "${key[Backspace]}" backward-delete-char<br />
[[ -n "${key[Delete]}" ]] && bindkey -- "${key[Delete]}" delete-char<br />
[[ -n "${key[Up]}" ]] && bindkey -- "${key[Up]}" up-line-or-history<br />
[[ -n "${key[Down]}" ]] && bindkey -- "${key[Down]}" down-line-or-history<br />
[[ -n "${key[Left]}" ]] && bindkey -- "${key[Left]}" backward-char<br />
[[ -n "${key[Right]}" ]] && bindkey -- "${key[Right]}" forward-char<br />
[[ -n "${key[PageUp]}" ]] && bindkey -- "${key[PageUp]}" beginning-of-buffer-or-history<br />
[[ -n "${key[PageDown]}" ]] && bindkey -- "${key[PageDown]}" end-of-buffer-or-history<br />
[[ -n "${key[Shift-Tab]}" ]] && bindkey -- "${key[Shift-Tab]}" reverse-menu-complete<br />
<br />
# Finally, make sure the terminal is in application mode, when zle is<br />
# active. Only then are the values from $terminfo valid.<br />
if (( ${+terminfo[smkx]} && ${+terminfo[rmkx]} )); then<br />
autoload -Uz add-zle-hook-widget<br />
function zle_application_mode_start { echoti smkx }<br />
function zle_application_mode_stop { echoti rmkx }<br />
add-zle-hook-widget -Uz zle-line-init zle_application_mode_start<br />
add-zle-hook-widget -Uz zle-line-finish zle_application_mode_stop<br />
fi<br />
}}<br />
<br />
==== History search ====<br />
<br />
You need to set up the {{ic|key}} array and make sure that ZLE enters application mode to use the following instructions; see [[#Key bindings]].<br />
<br />
To enable history search add these lines to {{ic|.zshrc}} file:<br />
<br />
{{hc|~/.zshrc|<br />
autoload -Uz up-line-or-beginning-search down-line-or-beginning-search<br />
zle -N up-line-or-beginning-search<br />
zle -N down-line-or-beginning-search<br />
<br />
[[ -n "${key[Up]}" ]] && bindkey -- "${key[Up]}" up-line-or-beginning-search<br />
[[ -n "${key[Down]}" ]] && bindkey -- "${key[Down]}" down-line-or-beginning-search<br />
}}<br />
<br />
By doing this, only the past commands matching the current line up to the current cursor position will be shown when {{ic|Up}} or {{ic|Down}} keys are pressed.<br />
<br />
==== Shift, Alt, Ctrl and Meta modifiers ====<br />
<br />
xterm-compatible terminals can use extended key-definitions from {{man|5|user_caps}}. Those are combinations of {{ic|Shift}}, {{ic|Alt}}, {{ic|Ctrl}} and {{ic|Meta}} together with {{ic|Up}}, {{ic|Down}}, {{ic|Left}}, {{ic|Right}}, {{ic|PageUp}}, {{ic|PageDown}}, {{ic|Home}}, {{ic|End}} or {{ic|Del}}. Refer to the [https://sourceforge.net/p/zsh/code/ci/master/tree/Functions/Misc/zkbd zkbd source] for a list of recommended names for the modifier keys and key combinations.<br />
<br />
For example, for {{ic|Ctrl+Left}} to move to the beginning of the previous word and {{ic|Ctrl+Right}} to move to the beginning of the next word:<br />
<br />
{{hc|~/.zshrc|2=<br />
key[Control-Left]="${terminfo[kLFT5]}"<br />
key[Control-Right]="${terminfo[kRIT5]}"<br />
<br />
[[ -n "${key[Control-Left]}" ]] && bindkey -- "${key[Control-Left]}" backward-word<br />
[[ -n "${key[Control-Right]}" ]] && bindkey -- "${key[Control-Right]}" forward-word<br />
}}<br />
<br />
=== Prompts ===<br />
<br />
Zsh offers the options of using a prompt theme or, for users who are dissatisfied with the themes (or want to expand their usefulness), the possibility to build a custom prompt.<br />
<br />
==== Prompt themes ====<br />
<br />
Prompt themes are a quick and easy way to set up a colored prompt in Zsh. See {{man|1|zshcontrib|PROMPT THEMES}} for information about prompt themes and how to write your own theme.<br />
<br />
To use a theme, make sure that prompt theme system is set to autoload in {{ic|.zshrc}}. This can be done by adding these lines to:<br />
<br />
{{hc|~/.zshrc|<br />
autoload -Uz promptinit<br />
promptinit<br />
}}<br />
<br />
Available prompt themes are listed by running the command:<br />
<br />
$ prompt -l<br />
<br />
For example, to use the {{ic|walters}} theme, enter:<br />
<br />
$ prompt walters<br />
<br />
To preview all available themes, use this command:<br />
<br />
$ prompt -p<br />
<br />
===== Manually installing prompt themes =====<br />
<br />
It is possible to install themes manually, without external configuration manager tools. For a local installation, first create a folder and add it to the {{ic|fpath}} array, eg:<br />
<br />
$ mkdir ~/.zprompts<br />
$ fpath=("$HOME/.zprompts" "$fpath[@]")<br />
<br />
Now create a symbolic link of your theme file in this folder:<br />
<br />
$ ln -s mytheme.zsh ~/.zprompts/prompt_mytheme_setup<br />
<br />
If instead you wish to install a theme globally, do:<br />
<br />
# ln -s mytheme.zsh /usr/share/zsh/functions/Prompts/prompt_mytheme_setup<br />
<br />
Now you should be able to activate it using:<br />
<br />
$ prompt mytheme<br />
<br />
If everything works, you can edit your {{ic|.zshrc}} accordingly.<br />
<br />
===== Adding prompt themes without a separate file for each one =====<br />
<br />
In addition to adding a prompt theme through its own file, it is possible to add themes from within another file (like your {{ic|.zshrc}}), eg:<br />
<br />
{{hc|~/.zshrc|2=<br />
# Load promptinit<br />
autoload -Uz promptinit && promptinit<br />
<br />
# Define the theme<br />
prompt_mytheme_setup() {<br />
PS1="%~%# "<br />
}<br />
<br />
# Add the theme to promptsys<br />
prompt_themes+=( mytheme )<br />
<br />
# Load the theme<br />
prompt mytheme<br />
}}<br />
<br />
==== Customized prompt ====<br />
<br />
{{Expansion|Add a simple colorless {{ic|PROMPT}} example.}}<br />
<br />
Additionally to a primary left-sided prompt {{ic|PS1}} ({{ic|PROMPT}}, {{ic|prompt}}) that is common to all shells, Zsh also supports a right-sided prompt {{ic|RPS1}} ({{ic|RPROMPT}}). These two variables are the ones you will want to set to a custom value.<br />
<br />
Other special purpose prompts, such as {{ic|PS2}} ({{ic|PROMPT2}}), {{ic|PS3}} ({{ic|PROMPT3}}), {{ic|PS4}} ({{ic|PROMPT4}}), {{ic|RPS1}} ({{ic|RPROMPT}}), {{ic|RPS2}} ({{ic|RPROMPT2}}) and {{ic|SPROMPT}}, are explained in {{man|1|zshparam|PARAMETERS USED BY THE SHELL}}.<br />
<br />
All prompts can be customized with prompt escapes. The available prompt escapes are listed in {{man|1|zshmisc|EXPANSION OF PROMPT SEQUENCES}}.<br />
<br />
===== Colors =====<br />
<br />
Zsh sets colors differently than [[Bash/Prompt customization|Bash]], you do not need to use convoluted ANSI escape sequences or terminal capabilities from {{man|5|terminfo}}. Zsh provides convenient prompt escapes to set the foreground color, background color and other visual effects; see {{man|1|zshmisc|Visual effects}} for a list of them and their descriptions.<br />
<br />
[http://zsh.sourceforge.net/FAQ/zshfaq03.html#l42 Colors] can be specified using a decimal integer, the name of one of the eight most widely-supported colors or as a # followed by an RGB triplet in hexadecimal format. See the description of fg=colour in {{man|1|zshzle|CHARACTER HIGHLIGHTING}} for more details.<br />
<br />
Most terminals support the following colors by name:<br />
<br />
{| class="wikitable"<br />
|-<br />
! Name !! Number<br />
|-<br />
| {{ic|black}} || {{ic|0}}<br />
|-<br />
| {{ic|red}} || {{ic|1}}<br />
|-<br />
| {{ic|green}} || {{ic|2}}<br />
|-<br />
| {{ic|yellow}} || {{ic|3}}<br />
|-<br />
| {{ic|blue}} || {{ic|4}}<br />
|-<br />
| {{ic|magenta}} || {{ic|5}}<br />
|-<br />
| {{ic|cyan}} || {{ic|6}}<br />
|-<br />
| {{ic|white}} || {{ic|7}}<br />
|}<br />
<br />
Color numbers 0–255 for terminal emulators compatible with xterm 256 colors can be found in the [https://upload.wikimedia.org/wikipedia/commons/1/15/Xterm_256color_chart.svg xterm-256color chart].<br />
<br />
With a correctly set TERM environment variable, the terminal's supported maximum number of colors can be found from the {{man|5|terminfo}} database using {{ic|echoti colors}}. In the case of [https://gist.github.com/XVilka/8346728 24-bit colors], also check the COLORTERM environment variable with {{ic|print $COLORTERM}}. If it returns {{ic|24bit}} or {{ic|truecolor}} then your terminal supports 16777216 (2<sup>24</sup>) colors even if terminfo shows a smaller number.<br />
<br />
{{Note|<br />
* The colors 0–15 may differ between terminal emulators and their used color schemes.<br />
* Many terminal emulators display bold with a brighter color.<br />
}}<br />
<br />
{{Tip|<br />
* Prompt escapes can be tested with command {{ic|print -P ''"prompt escapes"''}}, for example: {{bc|$ print -P '%B%F{red}co%F{green}lo%F{blue}rs%f%b'}}<br />
* If you use 24-bit colors, you might want to load the {{ic|zsh/nearcolor}} module in terminals that do not support them. E.g.: {{bc|<nowiki>[[ "$COLORTERM" == (24bit|truecolor) || "${terminfo[colors]}" -eq '16777216' ]] || zmodload zsh/nearcolor</nowiki>}} See {{man|1|zshmodules|THE ZSH/NEARCOLOR MODULE}} for details about the {{ic|zsh/nearcolor}} module.<br />
}}<br />
<br />
===== Example =====<br />
<br />
This is an example of a two-sided prompt:<br />
<br />
PROMPT='%F{green}%n%f@%F{magenta}%m%f %F{blue}%B%~%b%f %# '<br />
RPROMPT='[%F{yellow}%?%f]'<br />
<br />
And here is how it will be displayed:<br />
<br />
<div style="font-family: monospace; white-space: pre; padding: 1em; background-color: #000; border: 1px solid #bcd; color: #c0c0c0; overflow: hidden;"><span style="float:left;"><span style="color: #008000;">username</span>@<span style="color: #800080;">host</span> <span style="color: #0000ff;">~</span> % </span><span style="float:right;">[<span style="color: #808000;">0</span>]</span></div><br />
<br />
To use colors from the 16-255 range and 24-bit true color, you can use the number from 0 to 255 assigned to the wanted color and its hexadecimal color code, respectively:<br />
<br />
PROMPT='%F{2}%n%f@%F{5}%m%f %F{4}%B%~%b%f %# '<br />
RPROMPT='[%F{3}%?%f]'<br />
<br />
PROMPT='%F{#c0c0c0}%n%f@%F{#008000}%m%f %F{#800080}%B%~%b%f %# '<br />
RPROMPT='[%F{#0000ff}%?%f]'<br />
<br />
=== Sample .zshrc files ===<br />
<br />
* To get the same setup as the [https://archlinux.org/download/ monthly ISO releases] (which use Zsh by default), install {{Pkg|grml-zsh-config}}. It includes the many tweaks and advanced optimizations from [https://grml.org/zsh/ grml].<br />
* https://github.com/MrElendig/dotfiles-alice/blob/master/.zshrc - basic setup, with dynamic prompt and window title/hardinfo.<br />
* https://github.com/slashbeast/conf-mgmt/blob/master/roles/home_files/files/DOTzshrc - zshrc with multiple features, be sure to check out comments into it. Notable features: confirm function to ensure that user want to run poweroff, reboot or hibernate, support for GIT in prompt (done without vcsinfo), tab completion with menu, printing current executed command into window's title bar and more.<br />
<br />
See [[dotfiles#User repositories]] for more.<br />
<br />
== Tips and tricks ==<br />
<br />
=== Autostart X at login ===<br />
<br />
See [[xinit#Autostart X at login]].<br />
<br />
=== Restore terminal settings after a program exits abnormally ===<br />
<br />
Many programs change the terminal state, and often do not restore terminal settings on exiting abnormally (e.g. when crashing or encountering SIGINT). <br />
<br />
This can typically be solved by executing {{man|1|reset}}:<br />
<br />
$ reset<br />
<br />
The following sections describe ways to avoid the need to manually reset the terminal.<br />
<br />
==== The ttyctl command ====<br />
<br />
The [http://zsh.sourceforge.net/Doc/Release/Shell-Builtin-Commands.html#index-tty_002c-freezing ttyctl] command can be used to "freeze/unfreeze" the terminal. To freeze the interactive shell on launch, use the following:<br />
<br />
{{hc|~/.zshrc|<br />
ttyctl -f<br />
}}<br />
<br />
==== Resetting the terminal with escape sequences ====<br />
<br />
[https://www.in-ulm.de/~mascheck/various/alternate_charset/ Alternate linedrawing character set] can screw up the terminal in a way which ttyctl cannot prevent.<br />
<br />
A simple solution is to output the escape sequences that reset the terminal from the {{ic|precmd}} hook function, so that they are executed every time before the prompt is drawn. For example, using [https://www.in-ulm.de/~mascheck/various/alternate_charset/#solution the escape sequence] {{ic|\e[0m\e(B\e)0\017\e[?5l\e7\e[0;0r\e8}}:<br />
<br />
{{hc|~/.zshrc|2=<br />
<br />
autoload -Uz add-zsh-hook<br />
<br />
function reset_broken_terminal () {<br />
printf '%b' '\e[0m\e(B\e)0\017\e[?5l\e7\e[0;0r\e8'<br />
}<br />
<br />
add-zsh-hook -Uz precmd reset_broken_terminal<br />
}}<br />
<br />
To test if it works, run: <br />
<br />
$ print '\e(0\e)B'<br />
<br />
=== Remembering recent directories ===<br />
<br />
==== Dirstack ====<br />
<br />
Zsh can be configured to remember the DIRSTACKSIZE last visited folders. This can then be used to ''cd'' them very quickly. You need to add some lines to your configuration file:<br />
<br />
{{hc|~/.zshrc|<nowiki><br />
autoload -Uz add-zsh-hook<br />
<br />
DIRSTACKFILE="${XDG_CACHE_HOME:-$HOME/.cache}/zsh/dirs"<br />
if [[ -f "$DIRSTACKFILE" ]] && (( ${#dirstack} == 0 )); then<br />
dirstack=("${(@f)"$(< "$DIRSTACKFILE")"}")<br />
[[ -d "${dirstack[1]}" ]] && cd -- "${dirstack[1]}"<br />
fi<br />
chpwd_dirstack() {<br />
print -l -- "$PWD" "${(u)dirstack[@]}" > "$DIRSTACKFILE"<br />
}<br />
add-zsh-hook -Uz chpwd chpwd_dirstack<br />
<br />
DIRSTACKSIZE='20'<br />
<br />
setopt AUTO_PUSHD PUSHD_SILENT PUSHD_TO_HOME<br />
<br />
## Remove duplicate entries<br />
setopt PUSHD_IGNORE_DUPS<br />
<br />
## This reverts the +/- operators.<br />
setopt PUSHD_MINUS<br />
</nowiki>}}<br />
<br />
Now use<br />
<br />
$ dirs -v<br />
<br />
to print the dirstack. Use {{ic|cd -<NUM>}} to go back to a visited folder. Use autocompletion after the dash. This proves very handy if using the autocompletion menu.<br />
<br />
{{Note|This will not work if you have more than one ''zsh'' session open, and attempt to {{ic|cd}}, due to a conflict in both sessions writing to the same file.}}<br />
<br />
==== cdr ====<br />
<br />
cdr allows you to change the working directory to a previous working directory from a list maintained automatically. It stores all entries in files that are maintained across sessions and (by default) between terminal emulators in the current session.<br />
<br />
See {{man|1|zshcontrib|REMEMBERING RECENT DIRECTORIES}} for setup instructions.<br />
<br />
=== Help command ===<br />
<br />
Unlike [[Bash]], Zsh does not enable a built in {{ic|help}} command, instead it provides {{ic|run-help}}. By default {{ic|run-help}} is an alias to {{ic|man}}, it can be either executed manually by prepending it to a command or it can be invoked for the currently typed command with the keyboard shortcuts {{ic|Alt+h}} or {{ic|Esc}} {{ic|h}}.<br />
<br />
Since by default it is just an alias to [[man]], it will only work on external commands. To improve its functionality, so that it works on shell builtins and other shell features, you need to use the {{ic|run-help}} function. See {{man|1|zshcontrib}} for more information on the {{ic|run-help}} and its assistant functions.<br />
<br />
First load the {{ic|run-help}} function and then remove the existing {{ic|run-help}} alias. For convenience {{ic|help}} can be aliased to {{ic|run-help}}. For example, add following to your {{ic|zshrc}}:<br />
<br />
autoload -Uz run-help<br />
(( ${+aliases[run-help]} )) && unalias run-help<br />
alias help=run-help<br />
<br />
Assistant functions have to be enabled separately:<br />
<br />
autoload -Uz run-help-git run-help-ip run-help-openssl run-help-p4 run-help-sudo run-help-svk run-help-svn<br />
<br />
For example, {{ic|run-help git commit}} command will now open the [[man page]] {{man|1|git-commit}} instead of {{man|1|git}}.<br />
<br />
=== Persistent rehash ===<br />
<br />
Typically, compinit will not automatically find new executables in the {{ic|$PATH}}. For example, after you install a new package, the files in {{ic|/usr/bin/}} would not be immediately or automatically included in the completion. Thus, to have these new executables included, one would run:<br />
<br />
$ rehash<br />
<br />
This 'rehash' can be set to happen automatically.[https://github.com/robbyrussell/oh-my-zsh/issues/3440] Simply include the following in your {{ic|zshrc}}:<br />
<br />
{{hc|~/.zshrc|<br />
zstyle ':completion:*' rehash true<br />
}}<br />
<br />
==== On-demand rehash ====<br />
<br />
As above, however [[pacman]] can be configured with [[Pacman#Hooks|hooks]] to automatically request a {{ic|rehash}}, which does not incur the performance penalty of constant rehashing as above. To enable this, create the {{ic|/etc/pacman.d/hooks}} directory, and a {{ic|/var/cache/zsh}} directory, then create a hook file:<br />
<br />
{{hc|head=/etc/pacman.d/hooks/zsh.hook|output=<br />
[Trigger]<br />
Operation = Install<br />
Operation = Upgrade<br />
Operation = Remove<br />
Type = Path<br />
Target = usr/bin/*<br />
[Action]<br />
Depends = zsh<br />
When = PostTransaction<br />
Exec = /usr/bin/install -Dm644 /dev/null /var/cache/zsh/pacman<br />
}}<br />
<br />
This keeps the modification date of the file {{ic|/var/cache/zsh/pacman}} consistent with the last time a package was installed, upgraded or removed. Then, {{ic|zsh}} must be coaxed into rehashing its own command cache when it goes out of date, by adding to your {{ic|~/.zshrc}}:<br />
<br />
{{hc|~/.zshrc|<nowiki><br />
zshcache_time="$(date +%s%N)"<br />
<br />
autoload -Uz add-zsh-hook<br />
<br />
rehash_precmd() {<br />
if [[ -a /var/cache/zsh/pacman ]]; then<br />
local paccache_time="$(date -r /var/cache/zsh/pacman +%s%N)"<br />
if (( zshcache_time < paccache_time )); then<br />
rehash<br />
zshcache_time="$paccache_time"<br />
fi<br />
fi<br />
}<br />
<br />
add-zsh-hook -Uz precmd rehash_precmd<br />
</nowiki>}}<br />
<br />
If the {{ic|precmd}} hook is triggered before {{ic|/var/cache/zsh/pacman}} is updated, completion may not work until a new prompt is initiated. Running an empty command, e.g. pressing {{ic|enter}}, should be sufficient.<br />
<br />
==== Alternative on-demand rehash using SIGUSR1 ====<br />
<br />
As above, however the hook file looks like this:<br />
<br />
{{hc|/etc/pacman.d/hooks/zsh-rehash.hook|output=<br />
[Trigger]<br />
Operation = Install<br />
Operation = Upgrade<br />
Operation = Remove<br />
Type = Path<br />
Target = usr/bin/*<br />
<br />
[Action]<br />
Depends = zsh<br />
Depends = procps-ng<br />
When = PostTransaction<br />
Exec = /usr/bin/pkill zsh --signal=USR1<br />
}}<br />
<br />
{{Warning|This sends SIGUSR1 to all running {{ic|zsh}} instances. Note that the default behavior for SIGUSR1 is terminate so when you first configure this all running {{ic|zsh}} instances of all users (including login shells) will terminate if they have not sourced the trap below.}}<br />
<br />
{{hc|~/.zshrc|<br />
TRAPUSR1() { rehash }<br />
}}<br />
<br />
The ''function trap'' above can be replaced with a ''list trap'' {{ic|trap 'rehash' USR1}}. See {{man|1|zshmisc|Trap Functions}} for differences between types of traps.<br />
<br />
This method will instantly {{ic|rehash}} all {{ic|zsh}} instances, removing the need to press enter to trigger {{ic|precmd}}.<br />
<br />
=== Bind key to ncurses application ===<br />
<br />
Bind a ncurses application to a keystroke, but it will not accept interaction. Use {{ic|BUFFER}} variable to make it work. The following example lets users open [[ncmpcpp]] using {{ic|Alt+\}}:<br />
<br />
{{hc|~/.zshrc|2=<br />
ncmpcppShow() {<br />
BUFFER="ncmpcpp"<br />
zle accept-line<br />
}<br />
zle -N ncmpcppShow<br />
bindkey '^[\' ncmpcppShow<br />
}}<br />
<br />
An alternate method, that will keep everything you entered in the line before calling application:<br />
<br />
{{hc|~/.zshrc|2=<br />
ncmpcppShow() {<br />
ncmpcpp <$TTY<br />
zle redisplay<br />
}<br />
zle -N ncmpcppShow<br />
bindkey '^[\' ncmpcppShow<br />
}}<br />
<br />
=== File manager key binds ===<br />
<br />
Key binds like those used in graphic file managers may come handy. The first comes back in directory history ({{ic|Alt+Left}}), the second let the user go to the parent directory ({{ic|Alt+Up}}). They also display the directory content.<br />
<br />
{{hc|~/.zshrc|<nowiki><br />
cdUndoKey() {<br />
popd<br />
zle reset-prompt<br />
print<br />
ls<br />
zle reset-prompt<br />
}<br />
<br />
cdParentKey() {<br />
pushd ..<br />
zle reset-prompt<br />
print<br />
ls<br />
zle reset-prompt<br />
}<br />
<br />
zle -N cdParentKey<br />
zle -N cdUndoKey<br />
bindkey '^[[1;3A' cdParentKey<br />
bindkey '^[[1;3D' cdUndoKey<br />
</nowiki>}}<br />
<br />
=== xterm title ===<br />
<br />
If your terminal emulator supports it, you can set its title from Zsh. This allows dynamically changing the title to display relevant information about the shell state, for example showing the user name and current directory or the currently executing command.<br />
<br />
The xterm title is set with the [https://www.tldp.org/HOWTO/Xterm-Title-3.html#ss3.1 xterm escape sequence] {{ic|\e]2;}}{{ic|\a}}. For example:<br />
<br />
$ print -n '\e]2;My xterm title\a'<br />
<br />
will set the title to<br />
<br />
My xterm title<br />
<br />
A simple way to have a dynamic title is to set the title in the {{ic|precmd}} and {{ic|preexec}} hook functions. See {{man|1|zshmisc|Hook Functions}} for a list of available hook functions and their descriptions.<br />
<br />
By using {{ic|print -P}} you can additionally take advantage of Zsh's prompt escapes.<br />
<br />
{{Tip|<br />
* Title printing can be split up in multiple commands as long as they are sequential.<br />
* [[GNU Screen]] sends the xterm title to the hardstatus ({{ic|%h}}). If you want to use Screen's [https://www.gnu.org/software/screen/manual/html_node/String-Escapes.html string escapes] (e.g. for colors) you should set the hardstatus with the {{ic|\e_}}{{ic|\e\\}} escape sequence. Otherwise, if string escapes are used in {{ic|\e]2;}}{{ic|\a}}, the terminal emulator will get a garbled title due to it being incapable of interpreting Screen's string escapes.<br />
}}<br />
<br />
{{Note|<br />
* Do not use the {{ic|-P}} option of {{ic|print}} when printing variables to prevent them from being parsed as prompt escapes.<br />
* Use the {{ic|q}} [http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion-Flags parameter expansion flag] when printing variables to prevent them from being parsed as escape sequences.<br />
}}<br />
<br />
{{hc|~/.zshrc|<nowiki><br />
autoload -Uz add-zsh-hook<br />
<br />
function xterm_title_precmd () {<br />
print -Pn -- '\e]2;%n@%m %~\a'<br />
[[ "$TERM" == 'screen'* ]] && print -Pn -- '\e_\005{g}%n\005{-}@\005{m}%m\005{-} \005{B}%~\005{-}\e\\'<br />
}<br />
<br />
function xterm_title_preexec () {<br />
print -Pn -- '\e]2;%n@%m %~ %# ' && print -n -- "${(q)1}\a"<br />
[[ "$TERM" == 'screen'* ]] && { print -Pn -- '\e_\005{g}%n\005{-}@\005{m}%m\005{-} \005{B}%~\005{-} %# ' && print -n -- "${(q)1}\e\\"; }<br />
}<br />
<br />
if [[ "$TERM" == (Eterm*|alacritty*|aterm*|gnome*|konsole*|kterm*|putty*|rxvt*|screen*|tmux*|xterm*) ]]; then<br />
add-zsh-hook -Uz precmd xterm_title_precmd<br />
add-zsh-hook -Uz preexec xterm_title_preexec<br />
fi<br />
</nowiki>}}<br />
<br />
==== Terminal emulator tab title ====<br />
<br />
Some terminal emulators and multiplexers support setting the title of the tab. The escape sequences depend on the terminal:<br />
<br />
{| class="wikitable sortable"<br />
! Terminal<br />
! Escape sequences<br />
! Description<br />
|-<br />
! [[GNU Screen]]<br />
| {{ic|\ek}}{{ic|\e\\}}<br />
| Screen's window title ({{ic|%t}}).<br />
|-<br />
! Konsole<br />
| {{ic|\e]30;}}{{ic|\a}}<br />
| Konsole's tab title.<br />
|}<br />
<br />
=== Shell environment detection ===<br />
<br />
See [https://gitlab.com/jdorel-documentation/shell-environment-detection a repository about shell environment detection] for tests to detect the shell environment. This includes login/interactive shell, Xorg session, TTY and SSH session.<br />
<br />
=== /dev/tcp equivalent: ztcp ===<br />
<br />
Use the {{ic|zsh/net/tcp}} module:<br />
<br />
$ zmodload zsh/net/tcp<br />
<br />
You can now establish TCP connections:<br />
<br />
$ ztcp example.com 80<br />
<br />
=== Shortcut to exit shell on partial command line ===<br />
<br />
By default, {{ic|Ctrl+d}} will not close your shell if the command line is filled, this fixes it:<br />
<br />
{{hc|.zshrc|<br />
exit_zsh() { exit }<br />
zle -N exit_zsh<br />
bindkey '^D' exit_zsh<br />
}}<br />
<br />
=== pacman -F "command not found" handler ===<br />
<br />
[[pacman]] includes functionality to search for packages containing a file. The following command-not-found handler will use pacman directly to search for matching packages when an unknown command is executed.<br />
<br />
{{hc|1=~/.zshrc|2=<br />
...<br />
function command_not_found_handler {<br />
local purple='\e[1;35m' bright='\e[0;1m' green='\e[1;32m' reset='\e[0m'<br />
printf 'zsh: command not found: %s\n' "$1"<br />
local entries=(<br />
${(f)"$(/usr/bin/pacman -F --machinereadable -- "/usr/bin/$1")"}<br />
)<br />
if (( ${#entries[@]} ))<br />
then<br />
printf "${bright}$1${reset} may be found in the following packages:\n"<br />
local pkg<br />
for entry in "${entries[@]}"<br />
do<br />
# (repo package version file)<br />
local fields=(<br />
${(0)entry}<br />
)<br />
if [[ "$pkg" != "${fields[2]}" ]]<br />
then<br />
printf "${purple}%s/${bright}%s ${green}%s${reset}\n" "${fields[1]}" "${fields[2]}" "${fields[3]}"<br />
fi<br />
printf ' /%s\n' "${fields[4]}"<br />
pkg="${fields[2]}"<br />
done<br />
fi<br />
}<br />
...<br />
}}<br />
<br />
{{Note|The files database of pacman is separate from the normal sync database and it needs to be fetched using {{ic|pacman -Fy}}. See [[pacman#Search for a package that contains a specific file]] for details.}}<br />
<br />
== Third-party extensions ==<br />
<br />
=== Configuration frameworks ===<br />
<br />
{{Note|Frameworks introduce a level of abstraction and complexity. They can, and often do, introduce undefined behavior. In case of shell breakage, the ''first'' debugging step should be to revert to the plain shell.}}<br />
<br />
* {{App|oh-my-zsh|A popular, community-driven framework for managing your Zsh configuration. It comes bundled with a ton of helpful functions, helpers, plugins, themes.|https://github.com/ohmyzsh/ohmyzsh|{{AUR|oh-my-zsh-git}}}}<br />
* {{App|Prezto|A configuration framework for Zsh. It comes with modules, enriching the command line interface environment with sane defaults, aliases, functions, auto completion, and prompt themes.|https://github.com/sorin-ionescu/prezto|{{AUR|prezto-git}}}}<br />
* {{App|ZIM|A configuration framework with blazing speed and modular extensions. Zim is very easy to customize, and comes with a rich set of modules and features without compromising on speed or functionality.|https://github.com/zimfw/zimfw|{{AUR|zsh-zim-git}}}}<br />
<br />
=== Plugin managers ===<br />
<br />
* {{App|Antibody|A performance-focused plugin manager similar to Antigen.|https://github.com/getantibody/antibody|{{AUR|antibody}}}}<br />
* {{App|zinit (previously "zplugin")|Flexible Zsh plugin manager with clean fpath, reports, completion management, turbo mode|https://github.com/zdharma/zinit|{{AUR|zsh-zplugin-git}}}}<br />
* {{App|Antigen|A plugin manager for Zsh, inspired by oh-my-zsh and vundle. [https://github.com/zsh-users/antigen/issues/673 ABANDONED]|https://github.com/zsh-users/antigen|{{AUR|antigen-git}}}}<br />
* {{App|zgen|A lightweight and simple plugin manager for Zsh. [https://github.com/tarjoilija/zgen/issues/123 ABANDONED]|https://github.com/tarjoilija/zgen|{{AUR|zgen-git}}}}<br />
* {{App|zplug|A next-generation plugin manager for Zsh. [https://github.com/zplug/zplug/issues/403#issuecomment-477520784 ABANDONED]|https://github.com/zplug/zplug|{{AUR|zplug}}}}<br />
<br />
=== Fish-like syntax highlighting and autosuggestions ===<br />
<br />
[[Fish]] provides very powerful shell syntax highlighting and autosuggestions. To use both in Zsh, you can install {{pkg|zsh-syntax-highlighting}}, {{pkg|zsh-autosuggestions}}, and finally [[source]] one or both of the provided scripts from your zshrc:<br />
<br />
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh<br />
source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh<br />
<br />
=== pkgfile "command not found" handler ===<br />
<br />
[[pkgfile]] includes a Zsh script file that provides a {{ic|command_not_found_handler}} function that will automatically search the pkgfile database when entering an unrecognized command.<br />
<br />
You need to [[source]] the script to enable it. For example:<br />
<br />
{{hc|1=~/.zshrc|2=<br />
source /usr/share/doc/pkgfile/command-not-found.zsh<br />
}}<br />
<br />
{{Note|The pkgfile database may need to be updated before this will work. See [[pkgfile#Installation]] for details.}}<br />
<br />
== Uninstallation ==<br />
<br />
Change the default shell before removing the {{Pkg|zsh}} package.<br />
<br />
{{Warning|Failure to follow the below procedure may result in users no longer having access to a working shell.}}<br />
<br />
Run following command:<br />
<br />
$ chsh -s /bin/bash ''user''<br />
<br />
Use it for every user with ''zsh'' set as their login shell (including root if needed). When completed, the {{Pkg|zsh}} package can be removed.<br />
<br />
Alternatively, change the default shell back to Bash by editing {{ic|/etc/passwd}} as root.<br />
<br />
{{Warning|It is strongly recommended to use {{man|8|vipw}} when editing {{ic|/etc/passwd}} as it helps prevent invalid entries and/or syntax errors.}}<br />
<br />
For example, change the following:<br />
<br />
''username'':x:1000:1000:''Full Name'',,,:/home/''username'':/usr/bin/zsh<br />
<br />
To this:<br />
<br />
''username'':x:1000:1000:''Full Name'',,,:/home/''username'':/bin/bash<br />
<br />
== See also ==<br />
<br />
* [[Wikipedia:Zsh]]<br />
* [http://zsh.sourceforge.net/Intro/intro_toc.html An Introduction to the Z Shell]<br />
* [http://zsh.sourceforge.net/Guide/zshguide.html A User's Guide to ZSH]<br />
* [http://zsh.sourceforge.net/Doc/Release/index-frame.html The Z Shell Manual] (different format available [http://zsh.sourceforge.net/Doc/ here])<br />
* [http://zsh.sourceforge.net/FAQ/zshfaq01.html Zsh FAQ]<br />
* [https://zshwiki.org/home/ Zsh Wiki]<br />
* {{man|1|zsh-lovers}} (available as {{pkg|zsh-lovers}} package)<br />
* [[Gentoo: Zsh/Guide]]<br />
* [http://www.bash2zsh.com/zsh_refcard/refcard.pdf Bash2Zsh Reference Card]</div>ENV25https://wiki.archlinux.org/index.php?title=User_talk:Nl6720&diff=661067User talk:Nl67202021-04-17T09:30:31Z<p>ENV25: /* Konsole true color */ new section</p>
<hr />
<div>__NOINDEX__{{Template:Lowercase title}}<br />
<br />
== <s>Linking a category</s> ==<br />
<br />
Regarding [https://wiki.archlinux.org/index.php?title=GUID_Partition_Table&curid=9539&diff=447822&oldid=447821], you can use a colon to link categories:<br />
{{Merge|:Category:Boot loaders|foo bar}}<br />
See: [[mw:Help:Categories#Linking_to_a_category]] -- [[User:Alad|Alad]] ([[User talk:Alad|talk]]) 12:50, 25 August 2016 (UTC)<br />
<br />
:Thanks! --&#160;[[User:nl6720|<span style="font-family:serif; font-weight:bold; color:#800080;">nl6720</span>]]&#8239;[[User talk:nl6720|<span style="color:#808080; vertical-align:super; font-size:smaller; font-weight:lighter;">talk</span>]] 12:57, 25 August 2016 (UTC)<br />
<br />
== <s>Email address</s> ==<br />
<br />
Hey Nl6720,<br />
<br />
You've [[Special:EmailUser/Nl6720|disabled]] email from other users, but I'd like to send you a private message. If interested, would you mind contacting me on {{ic|alad <at> archlinux <dot> info}} (address in [[ArchWiki:Administrators]])?<br />
<br />
Cheers -- [[User:Alad|Alad]] ([[User talk:Alad|talk]]) 11:50, 2 October 2016 (UTC)<br />
<br />
:I re-enabled email from other users. --&#160;[[User:nl6720|<span style="font-family:serif; font-weight:bold; color:#800080;">nl6720</span>]]&#8239;[[User talk:nl6720|<span style="color:#808080; vertical-align:super; font-size:smaller; font-weight:lighter;">talk</span>]] 13:54, 2 October 2016 (UTC)<br />
== <s>Clarification for: [https://wiki.archlinux.org/index.php?title=Zsh&diff=next&oldid=452490 The content seems questionable too, but I know nothing about these frameworks]</s> ==<br />
<br />
It's a problem I met, for which I couldn't find a solution with googling, so I had to retreat to asking at IRC. In short, it's that the default Archlinux config shipped somewhere in /etc/ overwrites variables for runtime, i.e. one can't even overwrite them manually. I thought it would be useful to many others. Probably, it may cause problems not only with "oh-my-zsh", but I decided to put info in that paragraph because I'm not sure if there is a better place.<br />
<br />
And sorry for html formatting, markup is pretty unusual, and [https://wiki.archlinux.org/index.php/Help:Style/Formatting_and_punctuation the formatting page] is surprisingly unhelpful. I.e. how to write a link I figured out only because I thought, perhaps wikipedia.org using the same markup formatting; which turned out to be right. [[User:Hi-Angel|Hi-Angel]] ([[User talk:Hi-Angel|talk]]) 10:23, 6 October 2016 (UTC)<br />
<br />
:User's files are sourced after their system-wide counterparts (i.e. {{ic|~/.zshrc}} is sourced after {{ic|/etc/zsh/zshrc}}), so things set in {{ic|~/.zshrc}} should ''normally'' not be undone by {{ic|/etc/zsh/zshrc}}. But I guess it's possible for {{ic|/etc/zsh/zshrc}} to define a function that changes {{ic|$PROMPT}} under certain conditions. I probably shouldn't have called the content questionable.<br />
:About formatting, start with [[Help:Editing]] then [[Help:Style]], [[Help:Style/Formatting and punctuation]] and [[Help:Style/White space]]. There is also [[Help:Cheatsheet]]. --&#160;[[User:nl6720|<span style="font-family:serif; font-weight:bold; color:#800080;">nl6720</span>]]&#8239;[[User talk:nl6720|<span style="color:#808080; vertical-align:super; font-size:smaller; font-weight:lighter;">talk</span>]] 10:48, 6 October 2016 (UTC)<br />
<br />
== <s>GRUB UEFI install</s> ==<br />
We were amending the page at the same time, can you review my latest change to see if it is consistent with your definition of esp? -- [[User:Kewl|Kewl]] ([[User talk:Kewl|talk]]) 13:04, 5 March 2018 (UTC)<br />
<br />
:Looks good to me. -- [[User:nl6720|nl6720]] ([[User talk:nl6720|talk]]) 14:35, 5 March 2018 (UTC)<br />
<br />
== <s>rEFInd</s> ==<br />
[[User:nl6720|nl6720]] rEFInd is able to:<br />
* auto-detect the kernels if the file system drivers are there<br />
* launch the last one booted - for this to work it needs to list all unfolded<br />
so the following minimal configuration works:<br />
# cp /usr/share/refind/refind_x64.efi /esp/EFI/Boot/bootx64.efi<br />
# cp -r /usr/share/refind/drivers_x64/ /esp/EFI/Boot/<br />
# echo 'extra_kernel_version_strings linux,linux-lts,linux-git;' > /esp/EFI/Boot/refind.conf<br />
# echo 'fold_linux_kernels false' >> /esp/EFI/Boot/refind.conf<br />
<br />
rod smith was so kind to add the "extra_kernel_version_strings" option end of 2017 so rEFInd could handle the kernel naming conventions in arch. and with it, rEFInds problem of finding the correct fallback image was fixed, and the necessity to provide a configuration. there is no editing of a file necessary, no additional boot parameters, no tinkering with nvram, etc. currently i find really hard to detect out of the description that this works. i am inclined to break up the text slightly different - not focussing on "manual" and "scripted", and "configuration" but more in "install into EFI default location", "install in rEFInd location", "secure boot". currently the section "scripted" contains secure boot, shim, editing files. what you think? --[[User:Soloturn|Soloturn]] ([[User talk:Soloturn|talk]]) 03:40, 14 March 2018 (UTC)<br />
<br />
:The first sentence of the section mentions the {{ic|refind-install}} script so it should be obvious that the whole section is about using the script. Just in case I've now [[Special:Diff/513615|renamed]] the section to avoid any confusion. Secure boot is under the "Scripted installation" section because {{ic|refind-install}} provides a way to automate installation on Secure Boot enabled systems. I'll repeat, the whole section is about {{ic|refind-install}} and its provided options.<br />
:{{ic|extra_kernel_version_strings}} was added to support multiple kernels without version numbers in their filenames, unless I've missed something rEFInd still doesn't support automatically detecting and matching '''fallback''' initramfs images with their respective kernels.<br />
:I've removed your "minimal configuration" because it mixed installation (i.e. getting rEFInd binary to the ESP) and configuration (editing {{ic|refind.conf}}), those sections are split for a good reason. Before drastically changing an article, you '''must''' first discuss it in the article talk page ([[Talk:REFInd]] in this case), please read [[ArchWiki:Contributing#Announce article rewrites in a talk page]]. Also I would not accept adding {{ic|echo 'extra_kernel_version_strings linux,linux-lts,linux-git;' > /esp/EFI/Boot/refind.conf}} to [[rEFInd]], the {{ic|/usr/share/refind/refind.conf-sample}} file has a lot of comments explaining its content, it's more useful to copy the sample and edit it. -- [[User:nl6720|nl6720]] ([[User talk:nl6720|talk]]) 07:20, 14 March 2018 (UTC)<br />
ok, will try. i had enough difficulties with boot loader installation. so much that i took the time to address it with the software itself, and the wiki page. i even asked rod if he would be able to adjust refind a little to make it configuration-less. but he thought using the 2 lines are appropriately minimal - and no editing of a config file would be necessary. while coding arch kernel names into rEFInd would be a bad idea. --[[User:Soloturn|Soloturn]] ([[User talk:Soloturn|talk]]) 06:18, 19 March 2018 (UTC)<br />
<br />
:Closing. Any further discussion will be in [[Talk:REFInd#add a paragraph with simple installation]]. -- [[User:nl6720|nl6720]] ([[User talk:nl6720|talk]]) 08:47, 19 March 2018 (UTC)<br />
<br />
== <s>Firewall Limiting</s> ==<br />
<br />
Hi Nl6720,<br />
<br />
Thank you for the improvements to my solution to the firewall. Could I just ask, why is it you chose to explicitly list most the packet types opposed to allowing them all? Is there a security concern when the ones you omitted?<br />
<br />
[[User:Sainty|Sainty]] ([[User talk:Sainty|talk]]) 17:42, 1 July 2018 (UTC)<br />
<br />
:I compared [[Wikipedia:Internet Control Message Protocol#Control messages]] and [[Wikipedia:Internet Control Message Protocol for IPv6#Types]] with the ICMP types with names in [https://git.netfilter.org/nftables/tree/src/proto.c nftables proto.c]. I skipped those listed as deprecated and the one I didn't think should be needed. AFAIK only the redirects ''can potentially have'' security issues, so I skipped those too. I doubt it's really that much ''safer'' to specify only those ICMP types so it could just be considered a personal preference to allow only those that could be needed. -- [[User:nl6720|nl6720]] ([[User talk:nl6720|talk]]) 15:19, 2 July 2018 (UTC)<br />
<br />
== <s>Closing of several discussions in one edit</s> ==<br />
<br />
Please use one edit per discussion removal. See [https://wiki.archlinux.org/index.php?title=Help_talk:Discussion&oldid=329134] -- [[User:Alad|Alad]] ([[User talk:Alad|talk]]) 11:47, 20 September 2018 (UTC)<br />
<br />
:Sorry! Somehow I overlooked that rule in [[Help:Discussion#Closing a discussion]]. -- [[User:nl6720|nl6720]] ([[User talk:nl6720|talk]]) 11:55, 20 September 2018 (UTC)<br />
<br />
== <s>dm-crypt hooks</s> ==<br />
<br />
https://wiki.archlinux.org/index.php/Dm-crypt/Encrypting_an_entire_system#LVM_on_LUKS<br />
<br />
>that is obvious since the examples provide full HOOK lines and "udev" is not listed in the example with the "systemd" hook<br />
<br />
It is not obvious. The obvious ones are the ones that are highlighted.<br />
<br />
How about highlighting udev too so it becomes obvious?<br />
{{Unsigned|09:55, 27 December 2018 (UTC)|C0rn3j}}<br />
<br />
:I think it would actually be better to remove bold from {{ic|systemd}}, it's not a hook that needs to be '''added''' when using full system encryption. Also, you [[Special:Diff/560528|added the note]] to only one "Configuring mkinitcpio" section, while all of them have the same issue. -- [[User:nl6720|nl6720]] ([[User talk:nl6720|talk]]) 10:15, 27 December 2018 (UTC)<br />
<br />
:The style of the HOOK examples now match ([[Special:Diff/560861]], [[Special:Diff/560863]]). Closing. -- [[User:nl6720|nl6720]] ([[User talk:nl6720|talk]]) 08:04, 30 December 2018 (UTC)<br />
<br />
== <s>firefox edit</s> ==<br />
<br />
[[special:diff/572054]] you could save yourself some writing and link to [[Desktop_entries#Modify_environment_variables]] instead -- [[User:Ubone|Ubone]] ([[User talk:Ubone|talk]]) 17:04, 27 April 2019 (UTC)<br />
<br />
: I didn't notice that section. Thanks! -- [[User:nl6720|nl6720]] ([[User talk:nl6720|talk]]) 04:07, 28 April 2019 (UTC)<br />
<br />
== <s>Regarding "Undo revision 574893" and "Undo revision 574894"</s> ==<br />
<br />
I mistakenly had "fixed" the link syntax on the "Persistent block device naming page". Thanks for mentioning the specific style page rule that was in violation ([[Help:Style#Hypertext_metaphor]]), that was quite helpful. If you could do that in the future as well for any mistakes I make, I'd greatly appreciate it. In the meantime I'm going to make sure I extensively read over the [[Help:Style]] page before attempting to correct style usage, but given how extensive the styling rules are, there's a decent chance I'll make a few mistakes along the way. Linking to the specific rule definitely provides me with good constructive feedback. --[[User:Aeros167|Aeros167]] ([[User talk:Aeros167|talk]]) 07:46, 9 June 2019 (UTC)<br />
<br />
:I usually link the rule of the style issue I'm fixing, unless I'm feeling lazy, but I can't just write "style" in the summary when undoing an edit. And having a proper edit summary is also a wiki rule: [[ArchWiki:Contributing#Always properly use the edit summary]].<br />
:You don't need to memorize all the rules, just know where to find them. The related articles box in [[Help:Style]] links to most of the relevant pages.<br />
: -- [[User:nl6720|nl6720]] ([[User talk:nl6720|talk]]) 08:12, 9 June 2019 (UTC)<br />
<br />
== Improving style on external github links ==<br />
<br />
This might be a question better directed at the bureaucrats or site admins, but I'm curious as to your opinion on this as one of the most active maintainers of the site, and you seem to be particularly involved when it comes to link styling. According to [[Help:Editing#Links]], "It is often more useful to give the link an alternative label rather than displaying the URL." (regarding external site links). However, I noticed that on any section that lists a number of applications, such as [[List of applications]], virtually every single one of the external links uses the URL instead of an alternative label.<br />
<br />
For sites that are specific to an individual application, I think it is appropriate to show the full url. However, for common sites that are used as a homepage for a number of applications, such as github repositories, it might be a better styling practice to set an alternative label like "github" or "github repository". [[Help:Editing#Links]] is not particularly strict on external links, but I personally think it would look significantly cleaner this way. Let me know what you think, I'd like to potentially bring this up with others as well. Also let me know if there's someone specific (such as a bureaucrat or admin that specializes in styling) I should discuss this with.<br />
<br />
If the others are on board with this suggestion, I'd be more than willing to start applying this to a number of different pages. I think it would make for a good starter project for me to work on. As a long term aspiration of sorts, I am interested in prospect of eventually becoming a maintainer (I know that I have a long ways to go). I think it'd be a great way to improve my skills at technical documentation, while contributing to one of the most useful sites for linux documentation. -- [[User:Aeros167|Aeros167]] ([[User talk:Aeros167|talk]]) 21:32, 9 June 2019 (UTC)<br />
<br />
:The [[List of applications]] page uses [[Template:App]], so you can propose changes in [[Template talk:App]] or [[Help talk:Style]]. Personally I don't agree to this change, I don't see a need to hide the URL by using a link title in [[Template:App]]. If the link was in a block of text, then I could agree to it, but not when specifically listing the URL. -- [[User:nl6720|nl6720]] ([[User talk:nl6720|talk]]) 07:20, 10 June 2019 (UTC)<br />
<br />
::Ah no problem, it was just an idea. If the current template is already well established with a fairly recent dedicated page, it will likely stay the same. I'll keep that in mind though for replacing the URL with the substitute if it's in a block of text, I find the text substitutions to be quite useful within those contexts especially. Are there any other frequently used Template pages that would be useful to be aware of? I checked [[Template]] (similar to how [[Help]] directs to all pages in the help category) but that seems to be a dead end. -- [[User:Aeros167|Aeros167]] ([[User talk:Aeros167|talk]]) 09:40, 10 June 2019 (UTC)<br />
<br />
:::AFAIK templates are not categorized so you can find a list of them in [[Special:UncategorizedTemplates]]. A more useful list, separating them by usage, is available in [[Help:Template#List of templates]]. -- [[User:nl6720|nl6720]] ([[User talk:nl6720|talk]]) 10:13, 10 June 2019 (UTC)<br />
<br />
== Is there any reason why you chose to remove the note about ISO Image mode? ==<br />
<br />
https://wiki.archlinux.org/index.php/USB_flash_installation_media#Using_Rufus<br />
<br />
The note that says DD Image mode has to be used is not correct. ISO image mode will work for most people. You only need to use DD Image mode if the drive doesn't boot.<br />
[[User:Tonij|Tonij]] ([[User talk:Tonij|talk]]) 17:12, 2 August 2019 (UTC)<br />
<br />
:DD Image mode writes the iso to the drive as it was intended by Arch developers while using ISO image mode means trusting that Rufus correctly copies the bootloader configuration. Any messing with the boot setup is bound to result in some incompatibilities, which is exactly what happens with the crap known as UNetbootin, luckily Rufus has not deteriorated to such extent. I restored [[Special:Diff/578638]] in [[Special:Diff/578856]]. Frankly, I'm not a fan of Rufus since it keeps hiding useful features. [https://github.com/pbatard/rufus/issues/1148][https://github.com/pbatard/rufus/wiki/FAQ#why-doesnt-rufus-create-a-windows-installation-usb-that-can-be-booted-in-dual-biosuefi-mode] -- [[User:nl6720|nl6720]] ([[User talk:nl6720|talk]]) 18:51, 2 August 2019 (UTC)<br />
<br />
Also if someone is using GPT, they never had any intention of booting in BIOS. What is the point of saying that they should use MBR in that situation? [[User:Tonij|Tonij]] ([[User talk:Tonij|talk]]) 17:22, 2 August 2019 (UTC)<br />
<br />
:That's an unfounded claim. The installation media should be bootable for both BIOS and UEFI systems and that means using MBR in Rufus. Any other specialization is outside the scope of the [[USB flash installation media]] article. -- [[User:nl6720|nl6720]] ([[User talk:nl6720|talk]]) 18:51, 2 August 2019 (UTC)<br />
<br />
Read this: https://www.reddit.com/r/ManjaroLinux/comments/b5fzj4/make_sure_you_burned_the_iso_in_dd_mode/ejdcz9y?utm_source=share&utm_medium=web2x [[User:Tonij|Tonij]] ([[User talk:Tonij|talk]]) 17:32, 2 August 2019 (UTC)<br />
<br />
== dm-crypt/Encrypting an entire system ==<br />
<br />
About the revert: Ok, thanks. I also had problems with some kind of "escape template-breaking characters" that I couldn't solve before you reverted very fast (so I was looking into changing something wrong with the link, but you very too fast). In the future, there will be a release where LUKS2 can be used... Then the wiki could be updated, I guess. I wasn't sure about how often people updated the wiki (and am not used to this, one time has to be the first), but it seems very frequently you guys update the wiki and thanks a lot for that. I also didn't remove the LUKS1-warning, because some people will use old versions for a long time. Thanks and I'll leave it here until we have a release and people begin using that new release with LUKS2-support (but then you or someone else probably updates the wiki before). Cheers! :-) [[User:Newsboost|Newsboost]] ([[User talk:Newsboost|talk]]) 17:51, 26 January 2020 (UTC)<br />
<br />
:The template-breaking character issue was because of {{ic|1==}} in the Phoronix URL. Since the URL was in [[Template:Warning]], normally you would need to escape it with e.g. {{ic|<nowiki>{{Warning|1=text text [https://www.phoronix.com/scan.php?page=news_item&px=GRUB-Boots-LUKS2-Disk-Encrypt]}}</nowiki>}}, but since it starts with a list, it becomes a little more annoying:<br />
{{bc|<nowiki><br />
{{Warning|1&#61;&lt;nowiki&gt;&lt;/nowiki&gt;<br />
* list item<br />
* list item [https://www.phoronix.com/scan.php?page=news_item&px=GRUB-Boots-LUKS2-Disk-Encrypt]<br />
}}<br />
</nowiki>}}<br />
:Without {{ic|&lt;nowiki&gt;&lt;/nowiki&gt;}} the first item would not get parsed as a list item.<br />
:About GRUB, when a new release with LUKS2 support lands in the stable repos, feel free to update the warnings (or remove them if GRUB miraculously gains Argon2 support), until then I think that the dm-crypt pages should retain the current warnings. I'm certain I'm not the only one with such opinion.<br />
:That said, this does not prevent you from editing [[GRUB#Encrypted /boot]]. Currently it does not give a clear solution for using LUKS2, but only hints about PBKDFs. It ''should'' be possible to use GRUB from git with LUKS2 created with the {{ic|cryptsetup luksFormat --pbkdf pbkdf2}}, but I couldn't test it since {{AUR|grub-git}} didn't build for me when I tried it a few weeks ago.<br />
:Anyway, don't get discouraged from editing the wiki just because one of your edits was undone :) <br />
: -- [[User:nl6720|nl6720]] ([[User talk:nl6720|talk]]) 07:11, 27 January 2020 (UTC)<br />
::Yeah, frontend web-devel isn't really my thing, this template-breaking character stuff confused me a lot. So thanks a lot for explaining some details about this, I had major challenges "fixing" that broken template-stuff. About GRUB and LUKS2: I think I'll also skip the grub-git-method (I don't want to risk anything, but after a new release has been out for some weeks it'll be safer to test). I've been so unlucky for the past year that I for various reasons had to reinstall Arch Linux and therefore have been through the encrypted boot-procedure (too) many times recently. I takes me around 30 hours to fully setup an Arch Linux to my taste, incl. getting packages setup, window managers etc up and running so I hope I won't have to do it too many times again in year 2020 (this time I'll take an image with clonezilla and hopefully that can be used to save time in the future). I use luks1 for boot partition /boot, which after unlocking, unlocks my root-partition which is actually contained in a luks2-container with detached header and LVM inside. So I guess I'm not a normal user, anyway, maybe other people could use that procedure I've gathered and am using with the detached header... I'll watch out and hopefully soon I can use luks2 (and maybe detached header, e.g. on USB-stick) for the boot-partition. Once GRUB with LUKS2-support is stable, I'll see if I can contribute a bit about the detached header-setup, which I think is really nice. There are some details I'm not fully into, e.g. Argon2 and pbkdf2 but I'll see if I can contribute somewhere in the future, when something strikes my eyes. So I fully understand you, I think, this just serves as a bit of practice for me so I better know how things work the next time. Thanks a lot for your feedback, I'll have that in mind when I in the future browse and use the wiki! [[User:Newsboost|Newsboost]] ([[User talk:Newsboost|talk]]) 20:32, 27 January 2020 (UTC)<br />
<br />
:::Just in case you don't know, the setup for LUKS with a detached header is documented in [[dm-crypt/Specialties#Encrypted system using a detached LUKS header]]. -- [[User:nl6720|nl6720]] ([[User talk:nl6720|talk]]) 10:26, 28 January 2020 (UTC)<br />
<br />
::::I'm not sure if I've seen that (can't remember). I usually have a folder with text-files that contain instructions for how to setup things and once I've done things a few times, that becomes my only source of "truth" or information (unless a new version of something causes unforeseen problems, in which case I try to solve it and update the instructions again till next time). That being said, I think the arch linux wiki is a great source and many of my own rewritten instructions are based on info from the wiki in some form (sometimes I extend things with detailed examples, I think the wiki isn't suited for that). I'll have in mind that if I notice something on the wiki that other users could benefit from, I'll see if I can contribute. I also copied your comment about the template-stuff to my own https://wiki.archlinux.org/index.php/User_talk:Newsboost (+ a reference to the broken url), so I guess I can always easily find that info again, if something similar appears, i.e. I would then be less dependent on remembering where to find the this conversation)... Now I went through the process of editing here a few times, I think I'll feel more comfortable the next time, thanks :-) [[User:Newsboost|Newsboost]] ([[User talk:Newsboost|talk]]) 17:01, 28 January 2020 (UTC)<br />
<br />
== F2FS warning ==<br />
<br />
Hello, I see you reverted my F2FS warning. Fair point for the doc. I have this link [https://web.archive.org/web/20200925120546/https://archived.forum.manjaro.org/t/record-fsync-data-failed-on-f2fs-file-system-how-to-fix-foregt-the-help-i-reinstalled-its-just-easier/121051] which gives a lot of details on what is going on. Basically, if you shut down your system improperly at the wrong time, F2FS will be corrupt <i>beyond repair</i>. Even {{ic|fsck.f2fs}} will error out. I had found a weird, temporary fix allowing to mount the filesystem read only and even to allow the system to boot for a day or so. I've got a write-up (in French) about that on my blog ([https://lesviallon.fr/p/f2fs-record-fsync-data-failed-469431])<br />
This has happened to several users before, and most smartphone manufacturers, Samsung itself included (they created F2FS), don't use it on their phones because of the stability issues. Do you think this data is sufficient? [[User:Aviallon|Aviallon]] ([[User talk:Aviallon|talk]]) 12:34, 25 September 2020 (UTC)<br />
<br />
:I didn't doubt that the issue with F2FS is real. I've had my own issues with this file system ({{Bug|63839}}) which made me switch to [[XFS|a different one]]. It's just that without any sort of reference that warning was fairly useless. Your links look good and there's even a kernel bugzilla link in you blog. If you can create a section in [[F2FS]] based on you blog post (adjusted for the wiki's style, of course) then it would be perfect :) -- [[User:nl6720|nl6720]] ([[User talk:nl6720|talk]]) 13:23, 25 September 2020 (UTC)<br />
<br />
::Understood! I will do that right away! Does that mean I should only put this information in Known Issues, and that I shouldn't put a warning like with [[Btrfs]] ? [[User:Aviallon|Aviallon]] ([[User talk:Aviallon|talk]]) 13:56, 25 September 2020 (UTC)<br />
<br />
:::You should definitely document your issue in "Known issues". Now whether it should be also linked from a warning in the intro, I'd say go by the consensus of [[Talk:F2FS#Adding warning about F2FS potentially being unsafe?]] -- [[User:nl6720|nl6720]] ([[User talk:nl6720|talk]]) 14:05, 25 September 2020 (UTC)<br />
<br />
== TPM/Data-at-rest encryption with LUKS ==<br />
<br />
Hello, I'm curious about a recent edit you made to [[TPM#Data-at-rest_encryption_with_LUKS]]. I am the one who wrote the part that you edited, but I'm fine with most of your changes. The only thing I take issue with is the statement "This means that access to data is not protected in case the hardware gets stolen." This seems to imply that if the hardware is stolen, the data is as good as unencrypted. Given that full disk encryption is mostly useful in the case that the hardware is stolen, this implies that using a TPM to unlock your drive is as good as not encrypting it at all, which I don't think is fair to say.<br />
<br />
Cold boot attacks, bus sniffing attacks, and other potential ways of circumventing a TPM are not trivial to perform, and are no comparison at all to the ease with which one can access an unencrypted drive. Furthermore, in the (admittedly unlikely) case where an attacker steals only the drive and not the entire computer, the fact that a TPM was set up to unlock the drive won't help them at all. Perhaps this could be changed to something like "This increases the number of options an attacker has to attempt to steal the data," or even "This makes the data significantly less secure."<br />
<br />
Thoughts?<br />
<br />
[[User:Forgonewarrior|Forgonewarrior]] ([[User talk:Forgonewarrior|talk]]) 08:37, 10 April 2021 (UTC)<br />
<br />
:By "hardware" I meant the whole PC not just the drive. If TPM automatically unlocks the the LUKS encrypted root volume on boot, then the thief just needs to power on the PC to get access to the data. So yes, it is almost as good as unencrypted. Getting passed user login is out of scope, and, while I can't think of a way to sidestep it, relying on it for data safety would be naive. See also https://github.com/systemd/systemd/issues/19229. -- [[User:nl6720|nl6720]] ([[User talk:nl6720|talk]]) 08:46, 10 April 2021 (UTC)<br />
<br />
== Konsole true color ==<br />
<br />
I have seen your edit in [[Konsole]]. You changed {{ic|1=TERM=konsole-256color}} to {{ic|1=TERM=konsole-direct}}. I was the one who added that section.<br />
<br />
It seems {{ic|1=TERM=konsole-direct}} is broken. {{ic|vim}} and {{ic|nvim}} don't display correctly and {{ic|vis}} simply segfaults.<br />
<br />
But you were right {{ic|1=TERM=konsole-256color}} is not for true color.<br />
<br />
I think we should undo your last edit and change the section title from "True-color programs do not display correctly" to "Some color programs do not display correctly".</div>ENV25https://wiki.archlinux.org/index.php?title=User_talk:Lahwaacz&diff=659058User talk:Lahwaacz2021-04-11T10:03:35Z<p>ENV25: /* Re: Show how to use systemd/Timers with wg-quick@.service */ new section</p>
<hr />
<div>== bot checking links after move ==<br />
<br />
Hi, re [[Talk:Touchpad Synaptics#adding libinput alternative]]. [[Touchpad Synaptics]] has 100+ backlinks and the more important ones - a bit tedious task. I was just glancing over your clever github bot scripts. It would be handy to have a script after such moves: walk over the backlinks of [[Touchpad Synaptics]] and just replace "[[Touchpad Synaptics" with "[[Synaptics" from the links. That would leave all links to subsections intact. Leaving out the translations to handle manually, there would not be much to go wrong, or? --[[User:Indigo|Indigo]] ([[User talk:Indigo|talk]]) 07:36, 26 September 2015 (UTC)<br />
<br />
:Hi, thanks for the suggestion. It would be indeed handy in this case, but most likely not generally. Imagine that there was a [[UUID]] page, which was later generalized and renamed to [[Persistent block device naming]] and content about UUID is now only a section on the page. In this case using the naive replacement would likely change the meaning of many sentences, and using shorter redirects for convenience is actually encouraged. There would have to be a list of whitelisted "harmless" replacements, which could even help to replace <nowiki>[[pacman|Install]]</nowiki> with <nowiki>[[Install]]</nowiki> etc. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 08:01, 26 September 2015 (UTC)<br />
<br />
::Yes, good examples, but you are thinking universal already :) I did not mean it could be that. For example, if you take the time when the bulk of the title case moves were done. With such a script one could avoid a lot of internal redirects as well. E.g. [https://wiki.archlinux.org/index.php/Special:WhatLinksHere/Beginners'_Guide]. But it's ok, just an idea. Please close this, if you think it's too singular cases with a simple enough replacement where it could be applied. --[[User:Indigo|Indigo]] ([[User talk:Indigo|talk]]) 10:02, 26 September 2015 (UTC)<br />
<br />
== mkosi ==<br />
<br />
Hi, about your [https://wiki.archlinux.org/index.php?title=Systemd-nspawn&diff=0&oldid=491975 revert]: You can use mkosi also to create a container/directory tree (-t directory). So it can do the same and more. -- [[User:Nudin|Nudin]] ([[User talk:Nudin|talk]]) 11:33, 1 October 2017 (UTC)<br />
<br />
:Alright, how is the "more" relevant to systemd-nspawn though? -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 17:30, 3 October 2017 (UTC)<br />
<br />
::Hi, mkosi let's you create images (or directory trees) of various different distributions and allows you to do things like setting the root-password or installing additional packages. systemd-nspawn alows you to boot such images/directory trees. So I thought mentioning mkosi as alternative to manually creating a container with pacstrap or debootstrap would be worth it. -- [[User:Nudin|Nudin]] ([[User talk:Nudin|talk]]) 22:23, 5 October 2017 (UTC)<br />
<br />
== Waking from suspend with USB device ==<br />
<br />
Hi Lahwaacz, thanks for your input on this topic.<br />
Can you help me a bit further, I know the USB host controller and the USB device are different things but I thought that enabling the host controller was not necessary anymore, see [https://www.spinics.net/lists/linux-usb/msg53661.html].<br />
In my case all the {{ic|driver/*/power/wakeup}} are all enabled by default and the {{ic|/proc/acpi/wakeup}} as well.<br />
Anyway I have added a step in my explanations to identify the path awaiting for more clarity.<br />
<br />
[[User:Kewl|Kewl]] ([[User talk:Kewl|talk]]) 21:57, 16 January 2018 (UTC)<br />
<br />
:Hi, thanks for the link, it's entirely possible that something changed since the section was written. However, in my case only the keyboard device has wakeup enabled by default: {{bc|<nowiki><br />
$ for f in /sys/bus/usb/drivers/usb/*/power/wakeup; do echo "$f: $(cat $f)"; done<br />
/sys/bus/usb/drivers/usb/1-1/power/wakeup: disabled<br />
/sys/bus/usb/drivers/usb/2-1/power/wakeup: disabled<br />
/sys/bus/usb/drivers/usb/3-11/power/wakeup: disabled<br />
/sys/bus/usb/drivers/usb/3-12/power/wakeup: enabled<br />
/sys/bus/usb/drivers/usb/3-13/power/wakeup: disabled<br />
/sys/bus/usb/drivers/usb/4-3/power/wakeup: disabled<br />
/sys/bus/usb/drivers/usb/4-4/power/wakeup: disabled<br />
/sys/bus/usb/drivers/usb/usb1/power/wakeup: disabled<br />
/sys/bus/usb/drivers/usb/usb2/power/wakeup: disabled<br />
/sys/bus/usb/drivers/usb/usb3/power/wakeup: disabled<br />
/sys/bus/usb/drivers/usb/usb4/power/wakeup: disabled<br />
</nowiki>}}<br />
:But in practice it seems to wake up the system even without the host controllers enabled for wakeup... It might also depend on some BIOS/firmware settings but if it works by default on most systems then I think the host controller settings could be removed again.<br />
:-- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 19:14, 19 January 2018 (UTC)<br />
<br />
== Are supported local/remote destinations important for choosing a backup program? ==<br />
<br />
You [[Special:Diff/525550|reverted]] my edit adding supported backup destinations to [[Synchronization_and_backup_programs]]. This is puzzling to me. Here are some thoughts:<br />
* if choosing any backup program, the ability to send the backup off-site vs only on a local disk is a key feature consideration. Perhaps *the* key feature: one helps me recover in case my house gets burglarized or burns down, and the other does not. This is a much more important feature consideration than, say, whether the program is written in Go or Mono (something that has a full column). I think it's hard to disagree on that.<br />
* Given this, I am very puzzled you would use the term "useless" in the revert message.<br />
* I assume you didn't like that the table got even bigger (it didn't fit into the layout even before). I don't like it either, but perhaps the revert should have said "can you put this somewhere else, not in this already-too-big table?"<br />
* On a personal note, when I provide feedback or give opinion on somebody else's work, I'd like to be constructive and kind, instead of aggressive and putting people down. Just a thought. Thanks for listening.<br />
<br />
[[User:Jernst|Jernst]] ([[User talk:Jernst|talk]]) 17:38, 11 June 2018 (UTC)<br />
<br />
:No because you can use any remote back-end with any backup application by just running one command / writing the backups to a [[FUSE]] (if available).--[[User:Larivact|Larivact]] ([[User talk:Larivact|talk]]) 04:39, 12 June 2018 (UTC)<br />
<br />
::Hmm, by that reasoning we don't need the Arch package repository, as long as we have source code and makepkg. Or Perl, if we have bash and awk. But even then, and if all the fuse backends existed (I doubt they do), and if it were easy to set all of them up (another thing I doubt), do you indeed believe that running something written to read/write local files will be just as efficient backing up gigabytes of data to a remote repository as something that is specifically optimized for that use case? Note that backing up, say, daily, a typical hard drive via tpyical consumer broadband is still quite a bandwidth challenge in many places today. What about we add this info, and remove (or merge) some other columns to make the table smaller? {{Unsigned|18:08, 12 June 2018|Jernst}}<br />
<br />
:::Your comparisons don't make sense. Mind the slash in my response, you do not need a FUSE implementation, a simple CLI suffices. You do not need to "set all of them up", you only need one. --[[User:Larivact|Larivact]] ([[User talk:Larivact|talk]]) 18:47, 12 June 2018 (UTC)<br />
<br />
::::If you ever attempt to help a normal user set up a reliably-working off-site backup strategy, think of this discussion. In the meantime, this is all the time I'm going to spend on a discussion that has such repeated gems in it as "makes no sense" without explaining why you think so. Have a nice day. [[User:Jernst|Jernst]] ([[User talk:Jernst|talk]]) 18:54, 12 June 2018 (UTC)<br />
<br />
== The pip section in [[Python package guidelines]] ==<br />
<br />
Hi, you wanted the warning about using pip or wheels restored but accidentally(?) reverted my whole set of changes. I redid them, leaving the warning in place. – [[User:Flying sheep|flying sheep]] 08:17, 8 March 2019 (UTC)<br />
<br />
:Full revert was intentional, because the "wheel" section is not a full replacement for "pip" because there are packages which don't provide wheel files. As I said in the edit summary, there is no reason to recommend one or the other due to the warning. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 19:21, 8 March 2019 (UTC)<br />
::That still doesn’t explain why you reverted the first part, that had nothing to do with the pip/wheel section and simple improves the files.pythonhosted.org URLs. I restored that one while we’re discussing the pip/wheel section. And about that: There’s no reason to use pip for anything else, and pip is only used because some people (me included) didn’t understand that you can install most wheels by just extracting them to the correct location. So what do you think is missing from my wheels section that the former pip section had? – [[User:Flying_sheep|flying sheep]] 11:41, 11 March 2019 (UTC)<br />
<br />
:::If you didn't notice, the page includes "guidelines" in the title. So the page should contain only common and recommended ways to do things, not everything that is possible to do. If you think that your way to install "wheels" should be followed by everybody, feel free to discuss it on the talk page. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 13:26, 11 March 2019 (UTC)<br />
::::Well, extracting static archives sounds much more recommended than running pip with like 7 options to make it behave. I added a talk item: [[Talk:Python package guidelines#Remove_pip_section_in_favor_of_wheels_section?]] – [[User:Flying_sheep|flying sheep]]<br />
<br />
== wpa_supplicant ==<br />
<br />
Regarding https://wiki.archlinux.org/index.php?title=WPA_supplicant&diff=577215&oldid=577167, one person ran into this problem in March of this year and spent too much time diagnosing it:<br />
<br />
https://bbs.archlinux.org/viewtopic.php?id=244950<br />
<br />
It took me a few days to find the problem. I want to make sure the next time someone encounters it, they easily find relevant information about what the cause is. Since you've reverted my edits to both netctl and wpa_supplicant, what do you suggest?<br />
<br />
--<br />
<br />
[[User:Pooryorick|Pooryorick]] ([[User talk:Pooryorick|talk]]) 08:24, 18 July 2019 (UTC)<br />
<br />
== F2FS and GRUB ==<br />
<br />
Hello. :) I'm here to address a recent disagreement. I noticed a reversion of my edit regarding the F2FS filesystem, in particular regarding the configuration file to edit (with you representing /boot/grub/grub.cfg and me representing /etc/default/grub). I run F2FS on my daily driver with an encrypted root filesystem and encrypted boot on a separate partition, and have never had to touch grub.cfg. I only automatically generate it. It's possible to use either, but /etc/default/grub would make more sense as a recommendation in my mind because grub.cfg has the potential to be overwritten during updates, whereas /etc/default/grub doesn't. <br />
<br />
If there's a compelling reason to use grub.cfg over /etc/default/grub, please let me know. ^^ I'm always eager to learn more about Arch. I don't want to get in a reversion war so I've left your change untouched for the time being.<br />
<br />
[[User:Eurydice|Eurydice]] ([[User talk:Eurydice|talk]]) 00:17, 8 September 2019 (UTC)<br />
<br />
:The reason is explained in the section: "If GRUB is used with an unsupported filesystem it is not able to extract the UUID of your drive so it uses classic non-persistent /dev/sdXx names instead." If it does not apply to F2FS, it should be made clear. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 06:29, 8 September 2019 (UTC)<br />
<br />
::You can specify UUID's in GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub, so my proposed solution would work for F2FS and other unsupported filesystems, without the burden of manually editing grub.cfg. If there's anything I need to clarify or something else I'm missing, just let me know. :) [[User:Eurydice|Eurydice]] ([[User talk:Eurydice|talk]]) 19:37, 8 September 2019 (UTC)<br />
<br />
:::The {{ic|1=root=}} parameter is not supposed to be in GRUB_CMDLINE_LINUX_DEFAULT, regardless if UUID is used or not. ''grub-mkconfig'' automatically detects the root filesystem and adds the appropriate {{ic|1=root=}} parameter based on GRUB_DISABLE_LINUX_UUID. In any case, your change to the paragraph does not make sense. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 20:02, 8 September 2019 (UTC)<br />
<br />
::::It could simply be because I use full disk encryption, and adding a kernel parameter for the encrypted disk's UUID is correct in that situation. You're more experienced with contributing to the wiki, so I guess I'll defer to your judgment. It felt like a reasonable edit and solution to me and I don't see the downside to including it in GRUB_CMDLINE_LINUX_DEFAULT. [[User:Eurydice|Eurydice]] ([[User talk:Eurydice|talk]]) 05:38, 9 September 2019 (UTC)<br />
<br />
== dracut executable link ==<br />
<br />
Hello, your last edit on the dracut page (https://wiki.archlinux.org/index.php?title=Dracut&oldid=596388) that undid my 'Link to direct "make executable" section for executable link' commit states: "the redirect executable points exactly to that section", but it doesn't. Following the [[executable]] link just points to the top of the Help:Reading page.<br />
<br />
{{unsigned|17:06, 28 January 2020|Krathalan}}<br />
<br />
:In that case your browser probably does not work correctly, because the redirect [https://wiki.archlinux.org/index.php?title=Executable&redirect=no really points to the section]. Or MediaWiki, there was a bug several years ago... -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 19:41, 28 January 2020 (UTC)<br />
<br />
:: How strange... thanks for pointing that out. It does indeed appear to be some issue with my Firefox configuration. [[User:Krathalan|Krathalan]] ([[User talk:Krathalan|talk]]) 19:51, 28 January 2020 (UTC)<br />
<br />
== Getting install.php work in DokuWiki ==<br />
<br />
Hi, than you for having undone my contribution and pointed to the right solution on [[Dokuwiki#Configuration]]. Indeed I had read this solution before, but I was misled by the condition "if you are using lighttpd or nginx and your PHP version is lower than 7": as I use Apache with php v. 7.4.3 I didn't take it into account. Do you know what a correct rephrasing could be? Maybe it should be deleted?<br />
<br />
Also, I think that, at the end of this same section, one should add something like "verify that {{Pkg|php-gd}} is installed and restart {{ic|php-fpm.service}}".<br />
<br />
Naturally I can do it myself, but I prefer to ask before.<br />
[[User:BDumont|BDumont]] ([[User talk:BDumont|talk]]) 17:31, 19 February 2020 (UTC)<br />
<br />
:Hi, apparently it depends on whether you had {{ic|open_basedir}} set previously or not. I've changed the page, feel free to update the gd extension. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 21:16, 19 February 2020 (UTC)<br />
<br />
::Thank you! However, while, I didn't have {{ic|open_basedir}} set previously, I couldn't access ''install.php''. I suspect there is another thing to do, since the configuration editor in DokuWiki complains that it cannot modify the configuration files although ownership and permissions are correctly set for the relevant symlinks, directories and files, and so is {{ic|open_basedir}}. However I can edit my pages. Maybe a return from a new user with a fresh installation would be more useful, though. [[User:BDumont|BDumont]] ([[User talk:BDumont|talk]]) 08:20, 20 February 2020 (UTC)<br />
<br />
== Dead link in Simple stateful firewall#See Also ==<br />
<br />
Hi, Jakub. I am about [https://wiki.archlinux.org/index.php?title=Simple_stateful_firewall&diff=599725&oldid=599717 this] edit. I tried to follow that link one more time and it is not require entering captcha. I am not see any content limitations and my colleague (he uses Tor) does not see them too. I am not sure how it works, so I leave it on your descision. -- [[User:Duodai|Duodai]] ([[User talk:Duodai|talk]]) 14:29, 1 March 2020 (UTC)<br />
<br />
:Well, maybe it depends on the location from which the request comes. But I don't know how it works either... -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 14:33, 1 March 2020 (UTC)<br />
<br />
::my guess is it returns captcha for crawlers only -- [[User:Ubone|Ubone]] ([[User talk:Ubone|talk]]) 01:59, 2 March 2020 (UTC)<br />
<br />
:::I'm getting it in my browser... -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 07:14, 2 March 2020 (UTC)<br />
<br />
== SystemD user units depending on graphical session ==<br />
Hi,<br />
regarding reverting my addition to [[Systemd/User]], could you please explain why? I referenced [[https://www.freedesktop.org/software/systemd/man/systemd.special.html]] which directly contradicts what you said in your summary.<br />
<br />
{{unsigned|19:53, 5 May 2020|Fuero}}<br />
<br />
:The note in [[Systemd/User#How it works]] still applies - systemd services are never per-session, but per-user. The service does not magically get the correct DISPLAY or WAYLAND_DISPLAY variable, it does not work if you have multiple sessions per user, etc. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 12:45, 6 May 2020 (UTC)<br />
<br />
== Plymouth ==<br />
<br />
Actually with just Plymouth it does not work properly. Even 0dd17y had the same issue in https://bbs.archlinux.org/viewtopic.php?id=220900.<br />
<br />
The reason I did not file a bug report is that it is anyway fixed in the git version and the latest release (0.9.4) is around 2 years behind master<br />
<br />
{{unsigned|09:50, 6 May 2020|M.Srikanth}}<br />
<br />
:So if you don't have to file a bug report, add a full troubleshooting entry or at least properly reference your inline note instead of resorting to plain "if that does not work, try this instead". -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 12:15, 6 May 2020 (UTC)<br />
<br />
== [Bitcoin core] build the code and run the test suites ==<br />
<br />
Hello,<br />
<br />
This week, I managed to build the Bitcoin code and run all the test suites with the help of this page: https://jonatack.github.io/articles/how-to-compile-bitcoin-core-and-run-the-tests<br />
<br />
Archlinux has two particularities:<br />
* being in rolling release, it takes to manually use the library {{ic|Berkeley DB (BDB) v4.8}}<br />
* the {{ic|/tmp}} directory is by default limited to half the size of the Ram<br />
<br />
For these reason, maybe it could be interesting to have a page in the wiki to explain how to build the Bitcoin core?<br />
<br />
Cheers,<br />
<br />
Thomas<br />
<br />
[[User:Thomasb|Thomasb]] ([[User talk:Thomasb|talk]]) 20:29, 9 May 2020 (UTC)<br />
<br />
:I don't think that this is useful. There is the {{AUR|bitcoin-core-git}} package and nothing more should be needed. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 16:53, 26 May 2020 (UTC)<br />
<br />
== Double linefeed results in extra line ==<br />
<br />
If you look at templates that end with double linefeed before noinclude this would result in extra line in resulting page.<br />
<br />
It may be a minor point but since you are perfectionist about wikitext I should mention this is a tradeoff and it results in slightly worse result.<br />
<br />
Removing just one linefeed removes the problem while still allowing it to not jumble all the tags into same line.<br />
<br />
-- [[User:Svito|Svito]] ([[User talk:Svito|talk]]) 16:30, 11 May 2020 (UTC)<br />
<br />
:If this is about [https://wiki.archlinux.org/index.php?title=Template:Cat_main&diff=next&oldid=612179], the spaces I added back are not included when the template is used elsewhere, because the spaces are inside the noinclude tags. The extra space is only on the template page itself, but it does not result from template inclusion. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 20:41, 11 May 2020 (UTC)<br />
<br />
::OFC, I mean the template page render has extra line. -- [[User:Svito|Svito]] ([[User talk:Svito|talk]]) 21:21, 11 May 2020 (UTC)<br />
<br />
:::I agree with [[User:Svito|Svito]], isn't it good to delete the extra blank lines? -- [[User:Blackteahamburger|Blackteahamburger]] ([[User talk:Blackteahamburger|talk]]) 05:39, 12 May 2020 (UTC)<br />
<br />
::::OK, let's do it. [https://wiki.archlinux.org/index.php?title=Template:Cat_main&diff=616382&oldid=612181] -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 16:47, 26 May 2020 (UTC)<br />
<br />
== Re: lighttpd: remove python2 version ==<br />
<br />
Instead of removing the example we could as well add an example using a Python3 library like https://pypi.org/project/flup6/.<br />
<br />
{{unsigned|15:23, 18 May 2020|Gruentee}}<br />
<br />
:Feel free to add it if you find it useful. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 20:56, 18 May 2020 (UTC)<br />
<br />
== Xbindkeys removal ==<br />
<br />
Hi, just wondering why you [https://wiki.archlinux.org/index.php?title=Xbindkeys&diff=617675&oldid=617670 removed my edit] from [[Xbindkeys]]? The xbindkeys page has a number of quick tips but no mention of how to bind anything to the Print Screen key so I thought it would be useful to add. -- [[User:Malvineous|Malvineous]] ([[User talk:Malvineous|talk]]) 02:27, 3 June 2020 (UTC)<br />
<br />
:Giving examples for all keys on the keyboard is useless, there is [[Xbindkeys#Identifying keycodes]] which teaches how to find the keycodes and keysyms of any key. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 06:37, 3 June 2020 (UTC)<br />
<br />
:: So how come you left the examples for the volume up/down and brightness? What is different between those examples and a screenshot example? Aren't more examples better to save people from hunting all over the place trying to piece things together themselves? -- [[User:Malvineous|Malvineous]] ([[User talk:Malvineous|talk]]) 14:03, 4 June 2020 (UTC)<br />
<br />
:::The difference is that when it comes to volume control, there are 1 or 2 options for the 99% most common cases, but for screenshot taking there are dozens of different options. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 15:15, 12 August 2020 (UTC)<br />
<br />
== Re: Revert for edit to XDG Base Directory page regarding python_history ==<br />
<br />
I understand the justification for reverting the change I made, however I would like to point out that similar entries on the page (such as Maven) also have instructions for what contents to put in files (even though there is native documentation for those settings). Additionally, it took me a bit of re-reading on the linked Python documentation to reason out how the documentation's example needed to be modified, since it's not clear from the Python documentation whether placing such code in the PYTHONSTARTUP file will actually ''override'' the default behavior. [[User:Varriount|Varriount]] ([[User talk:Varriount|talk]]) 20:44, 20 June 2020 (UTC)<br />
<br />
:Even maven's note can be [https://wiki.archlinux.org/index.php?title=XDG_Base_Directory&diff=631704&oldid=631630 shortened]. The notes in the table must be as short as possible, there is no place for extended explanations or long code snippets like in the upstream documentation. If the Python's documentation is not clear enough, I don't think any note in a massive convoluted table will ever be better. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 10:47, 12 August 2020 (UTC)<br />
<br />
== Re: Revert for Backlight page ==<br />
<br />
Hi, you reverted my change to [[Backlight]] page that mentioned WIP patches for controlling OLED panel brightness. I don't really understand justification for reverting it since currently the page says that OLED brightness can be controlled only by changing gamma ramp. That is wrong - since it's not the only way - these panels can control brightness with a PWM. Moreover controlling brightness with gamma ramp is not optimal - it essentially reduces dynamic range, i.e. at 50% you have 7 bits per pixel, at 25% - 6 bit per pixel, etc. That results in banding artifacts at lower brightness level.<br />
<br />
As far waiting for the patches to be merged before mentioning it there - it'll take ~3-6 months (yes, that's the process) and I haven't found *any* reference to these changes on the internet - everyone recommends using gamma ramp instead of fixing it properly. I'm absolutely sure that having information about these patches would not hurt [[User:Anarsoul|Anarsoul]] ([[User talk:Anarsoul|talk]]) 15:56, 30 June 2020 (UTC)<br />
<br />
:Linking to a repo which which has 2 custom commits on top of some arbitrary development version of the Linux kernel tree is not helpful for users. Nobody will compile directly from this repo which is already significantly outdated compared to recent kernel versions and there is no indication if the patches actually work with newer (or older) kernels. We can mention the PWM control as a general concept though. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 10:32, 12 August 2020 (UTC)<br />
<br />
== Automatic template correction ==<br />
<br />
Per [[Help:Template#Style]], templates should be used with the capitalization shown in the examples in their pages, so {{ic|&#123;{AUR&#124;...}} is correct, while {{ic|&#123;{aur&#124;...}} is not.<br />
<br />
However, there are pages that don't respect that rule (e.g. [[Android_Debug_Bridge]] until recently).<br />
<br />
I beleive this correction should be easy to implement using a bot. What do you think?<br />
<br />
{{unsigned|07:24, 25 August 2020|Relrel}}<br />
<br />
:Yes, this should be easy, but the bot should not make a huge amount of simple style-only changes - they should be combined with corrections for more complex rules. Anyway, there is an idea to create a [https://github.com/lahwaacz/wiki-scripts/issues/22 style linter] for the ArchWiki rules. Would you like to help? ;-) – [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 09:21, 25 August 2020 (UTC)<br />
<br />
== Failed to create tun device ==<br />
<br />
I don't understand your reason for [[https://wiki.archlinux.org/index.php?title=NetworkManager&diff=0&oldid=634880 removing my section in NetworkManager]]. Could you elaborate?--[[User:Egils|Egils]] ([[User talk:Egils|talk]]) 07:40, 11 September 2020 (UTC)<br />
<br />
:You can't use [[systemd-networkd]] and [[NetworkManager]] at the same time. Even if you don't have any ''.network'' file for systemd-networkd, you can't solve NetworkManager's problems with systemd-networkd. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 07:43, 11 September 2020 (UTC)<br />
<br />
::Ok, thanks, in this case it solved the error I got. Now the VPN works. Do you have an idea about how to solve it without systemd-networkd?--[[User:Egils|Egils]] ([[User talk:Egils|talk]]) 22:27, 11 September 2020 (UTC)<br />
<br />
:::You should really fix the permission problem for {{Pkg|networkmanager-openvpn}}. The tun interface should be managed by OpenVPN which needs rights to create it. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 06:37, 12 September 2020 (UTC)<br />
<br />
::I don't think this statement is entirely correct. [[systemd-networkd]] and [[NetworkManager]] can happily co-exist together if they are managing different interfaces. I unfortunately don't have a reference to point to this, but I came across this being mentioned a couple of times on forums. I personally use [[NetworkManager]] on my laptop to handle wifi, while [[systemd-networkd]] is in control of virtual ethernet and bridges for all my [[systemd-nspawn]] instances. [[User:Romstor|Romstor]] ([[User talk:Romstor|talk]]) 03:24, 12 September 2020 (UTC)<br />
<br />
== [https://wiki.archlinux.org/index.php?title=XDG_Base_Directory&oldid=636526/ XDG Base Directory]: Undo revision 636525 ==<br />
<br />
Dear Lahwaacz,<br />
<br />
maybe my changes were to rushed and from my point of view only. But I have two points to consider:<br />
<br />
# If I put the quotes around my vimrc and source it from my .bash_profile, I get the vim-error E471 (Argument required). Without quotes, this doesn't happen. So this change based on experience.<br />
# The rtp should includes directories, which are needed at runtime. (in plain vim e.g. ~/.vim). This is not a typical configuration directory. My mistake was, that I supposed that everyone put their vim plug-ins in $XDG_DATA_HOME and not in $XDG_CONFIG_HOME, because from my point of view a plug-in doesn't belong to the configuration. Maybe it is a good idea to add a remark, which explains the addition of $XDG_CONFIG_HOME to the rtp.<br />
<br />
[[User:Grrr|Grrr]] ([[User talk:Grrr|talk]]) 13:53, 26 September 2020 (UTC)<br />
<br />
# Quotes are there because $XDG_CONFIG_HOME may contain spaces.<br />
# It's not only about quotes - the runtimepath has subdirectories for color schemes, keymaps, autoload scripts etc.<br />
-- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 14:22, 26 September 2020 (UTC)<br />
<br />
== Readability in Wiki ==<br />
<br />
I noticed that you and the other admins and moderators often want sentences to continue endlessly, without line breaks.<br />
For example in the introduction of [[Wayland]].<br />
<br />
I think it would be better to have more seperated sentences, so it is easier to read and "important" information is easier visible for people.<br />
I don't know who is responsible, but maybe some options in MediaWiki (or whatever this wiki software is) could be changed as well, to make make line breaks etc. easier and reduce the height-space (if you know what I mean) between sentences, so it looks better, even though line breaks are used.<br />
<br />
[[User:G3ro|G3ro]] ([[User talk:G3ro|talk]]) 14:38, 15 October 2020 (UTC) G3ro<br />
<br />
:I don't know exactly what you mean. Is it about the readability of the rendered HTML or the "source code" of the page? -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 19:15, 15 October 2020 (UTC)<br />
<br />
:: Well I guess it can be about both. But mainly it is about what people see on the page.<br />
:: There are three seperate topics I mentioned:<br />
<br />
:: 1. Use line breaks: I would like to use more line breaks, because if you have long sentences that are written after each other without line breaks, it gets "harder" to recognize when the next sentence starts.<br />
:: While I agree to what you said somewhere, that sentences that belong directly together, should be written in one "paragraph", it would be useful for sentences that cover (slightly) different "topics" to be visibly parted.<br />
<br />
:: 2. Adjust margin options: I notice that when line breaks are used, there is a vertical space added between two sentences. Just like in this post. If you would use line breaks more often, this is a little too much spacing in my oppinion.<br />
<br />
:: 3. Potential options to make line breaks easier: It would be very convenient if a line break in the source code would lead to a line break in displayed text as well, instead of needing to add an empty line.<br />
<br />
:: [[User:G3ro|G3ro]] ([[User talk:G3ro|talk]]) 20:33, 15 October 2020 (UTC) G3ro<br />
<br />
:::OK, now I understand. I agree that splitting different topics usually improves legibility, but they should be split into separate paragraphs and not just by line breaks (e.g. using the &lt;br> tags). Paragraphs are semantic units whereas line breaks inside a paragraph are usually typographic errors.<br />
:::Also note that such splitting alone may not be enough to improve the text flow. For example, if we consider the intro for [[Wayland]], the second sentence about XWayland would not constitute a good paragraph - it is just a plain statement and the new topic is not nicely introduced. Ideally, you'd split the topic and make some wording changes for the second paragraph.<br />
:::As for the margin options, that is the difference between paragraph splitting and non-semantic line breaks. In my opinion, the styling is correct in this respect, as paragraphs should be discernible. You mentioned that you like line breaks to easily recognize where a sentence ends - but reading should be based on whole paragraphs, not sentences. There should be no reason to skip anything in the middle of a paragraph, otherwise it should be probably split into multiple paragraphs or otherwise rephrased.<br />
:::If you find it hard to follow a long sentence horizontally on a wide screen, we might consider enforcing some maximum width for the whole content. I think the readability would be better, since there would be more top-to-bottom eye movement at the cost of left-to-right-and-back.<br />
:::-- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 20:59, 15 October 2020 (UTC)<br />
<br />
== Xorg parentheses ==<br />
<br />
I actually think that X(org) is very useful to imply that it is one and the same thing.<br />
<br />
It might even be more confusing now, as we use both Xorg and X, because the wiki title and the package titles are Xorg.<br />
<br />
[[User:G3ro|G3ro]] ([[User talk:G3ro|talk]]) 13:30, 17 October 2020 (UTC) G3ro<br />
<br />
:Well the conventions should be established on the [[Xorg]] page, not anywhere else... -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 13:36, 17 October 2020 (UTC)<br />
<br />
:: Imo the conventions are established by upstream and they use a wide variety of X, X.org, X(org), Xorg etc.<br />
:: As I said I always prefer X(org) because then it is clear, that both are same thing.<br />
:: But ultimately it's your decision. <br />
:: [[User:G3ro|G3ro]] ([[User talk:G3ro|talk]]) 13:43, 17 October 2020 (UTC) G3ro<br />
<br />
:::When upstream is not capable of making a unambiguous decision, it makes sense that other projects pick some option and stick with it wherever they can to keep at least some consistency. So for this wiki, pages should use the same style as the [[Xorg]] page. But feel free to start a discussion about this in [[Talk:Xorg]]. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 13:56, 17 October 2020 (UTC)<br />
<br />
== SSHFS - systemd edit ==<br />
<br />
The edit was removed because "there is no advantage over using fstab entries".<br />
<br />
Is not only about the dis/advantages of the systemd option, is about that it is another possibility to achieve the task, that is why it was created in another level and the fstab section was left alone.<br />
<br />
Reconsider the edit as it presents another option which people can use.<br />
<br />
[[User:Garnica|Garnica]] ([[User talk:Garnica|talk]]) 16:22, 22 October 2020 (UTC)<br />
<br />
:There is no need to use anything else, fstab just works well enough. Configuring mounts with systemd services is not a good idea - it is much more bloated than fstab and not the right tool for it. If anything, a different type of systemd units should be used: {{man|5|systemd.mount}}. But creating the mount units manually is still pretty useless since everything can be configured in fstab and systemd will generate the unit for you. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 19:22, 22 October 2020 (UTC)<br />
<br />
:: It is about the ability to use the user's .config file and all the proper options that are saved there. Also systemd gives the possibility to use different targets, so the user could mount it when an specific user logs in or when a graphical session starts. I could argue that bad a modification of fstab could lead to a system that doesnt boot, but such poorly configured systemd unit file just fails and the system is fine. Just give the user the information and let it decide what they can use depending on their use case. [[User:Garnica|Garnica]] ([[User talk:Garnica|talk]]) 08:08, 24 October 2020 (UTC)<br />
<br />
:::You can configure systemd targets in fstab using the {{ic|x-systemd.wanted-by}} and {{ic|x-systemd.required-by}} options, there are also {{ic|nofail}} and {{ic|noauto}} options. Please read the {{man|5|systemd.mount}} manual.<br />
:::Using hosts from the user's {{ic|.ssh/config}} is the only thing which is not possible with fstab, but this does not warrant using the wrong tool for the task. Simple copy the full {{ic|user@hostname}} into fstab and you're done.<br />
:::-- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 08:47, 24 October 2020 (UTC)<br />
<br />
== [[Self-encrypting drives]] ==<br />
<br />
Hi, I'd like to respectfully disagree with the rollback. It's specific to sedutil that with most commands you need to input /dev/nvme0 (when encrypting the device) but for the sleep commands it requires /dev/nvme0n1 or it fails with a very unspecific error (Error saving the password to the kernel errno = 25), as found out in the discussion https://github.com/Drive-Trust-Alliance/sedutil/issues/90<br />
<br />
All in all I believe that it is important to keep this piece of information which was found out in a long discussion between the reporter and the developers. I ran into it and I believe many people may run into it, considering most of the new SSD will be NVMe. Best, [[User:Przemub|Przemub]] ([[User talk:Przemub|talk]]) 13:34, 28 October 2020 (UTC)<br />
<br />
:OK, then it makes sense. But it should be probably explained before, not in the section about the sleep command. Also please add the link to the note as a reference. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 14:27, 28 October 2020 (UTC)<br />
<br />
== Nvidia Installation ==<br />
<br />
The whole guide is unnecessary long and overcomplicated formulated.<br />
Shorter is better, most people will know their graphic card for example, so the determination etc. is only optional.<br />
<br />
[[User:G3ro|G3ro]] ([[User talk:G3ro|talk]]) 20:21, 10 November 2020 (UTC) G3ro<br />
<br />
:Moving some info to some other page and leaving a tip behind does not make it shorter, but harder to follow. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 20:36, 10 November 2020 (UTC)<br />
<br />
== Btrfs layout ==<br />
<br />
Hi, Lahwaacz<br />
<br />
Thanks for maintaining [[Snapper]]! However I think the layout is not openSUSE specific and beneficial to all btrfs users. Can you elaborate your reason of undoing the edits? IMO the previous 'simple layout' complicates the rollback procedure.<br />
<br />
Cheers,<br />
[[User:I2Oc9|I2Oc9]] ([[User talk:I2Oc9|talk]]) 07:26, 3 December 2020 (UTC)<br />
<br />
:It is not overcomplicated, it is just doing things right. You can read about that in the forum thread, see the first note in [[Snapper#Suggested filesystem layout]]. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 08:24, 3 December 2020 (UTC)<br />
<br />
::Anyway I've moved the guides to my user page. It's not that I haven't read the 5-year-old forum post, it's that before the current layout I followed that post and resulted in a not fully rolled-back system. That post also sourced (then current) information from openSUSE. openSUSE has since massively overhauled the layout, as I pointed out in an edit you undid earlier.[[User:I2Oc9|I2Oc9]] ([[User talk:I2Oc9|talk]]) 09:02, 3 December 2020 (UTC)<br />
<br />
::Since last message I've extensively documented the new layout at [[User:I2Oc9/Btrfs_subvolumes]] and [[User:I2Oc9/Root_on_Btrfs_with_LUKS_full_disk_encryption]]. Have a look for yourself. Nothing new really, but IMO [[User:I2Oc9/Root_on_Btrfs_with_LUKS_full_disk_encryption#Rollback_/_&_system_recovery|my take]] is much more simpler and complete than the supposedly [[Snapper#Restoring_/_to_a_previous_snapshot_of_@|simpler one]]. That one does not leverage native {{ic|snapper rollback}} or {{Pkg|grub-btrfs}}, among other things. I strongly suggest you try if you have time. [[User:I2Oc9|I2Oc9]] ([[User talk:I2Oc9|talk]]) 11:55, 3 December 2020 (UTC)<br />
<br />
::Actually if you look closely, none of [[User:I2Oc9/Root_on_Btrfs_with_LUKS_full_disk_encryption#Rollback_/_&_system_recovery|my recovery methods]] is specific to [[User:I2Oc9/Btrfs_subvolumes#A_new_kind_of_layout|the new 'complex' layout]], it will work totally fine with the old one. I just don't think moving @ around in live environment is appropriate.<br />
<br />
::On the other hand, the layout recommendation has been updated by openSUSE [https://en.opensuse.org/SDB:BTRFS], why stick with the old one? [[User:I2Oc9|I2Oc9]] ([[User talk:I2Oc9|talk]]) 12:37, 3 December 2020 (UTC)<br />
<br />
:::The main reasons why I reverted your edits on the [[Snapper]] page are: 1) it was a huge change which was not discussed previously as required by [[ArchWiki:Contributing#The 3 fundamental rules]], and 2) it has some elements which do not apply to Arch (see below). If you wish to propose a better layout of the subvolumes, it should be discussed in [[Talk:Snapper]] first. Your user pages would serve as great drafts.<br />
:::Note that the current suggested layout is not ''flat'' in the sense of [[User:I2Oc9/Btrfs subvolumes#Snapper on flatly-installed system subvolume|your section]] - it has a separate subvolume for {{ic|.snapshots}} so it does not lead to the recursive mess. So your proposed layout seemed very similar to the current suggested layout. The real difference is which subvolume gets mounted at {{ic|/}}, but I did not find it explained anywhere on the Snapper page before I reverted the changes (I get it now from your user page). I also did not find a proper documentation of the openSUSE's layout - it seems to be just the product of their installer and the documentation only deals with the result, saying at most that [https://doc.opensuse.org/documentation/leap/reference/html/book.opensuse.reference/cha-snapper.html#sec-snapper-snapshot-boot the subvolume configuration must not be changed] for rollbacks to work.<br />
:::Now the openSUSE-specific elements: some Arch packages actually install software into {{ic|/opt}}, so the recommended layout should not suggest a separate subvolume for this path. Even more importantly, the pacman database is located at {{ic|/var/lib/pacman/local/}} and it must be rolled back along with the system, so there should be no separate subvolume for {{ic|/var}}. Instead, users should be encouraged to create (even nested) subvolumes for specific data directories under {{ic|/var}}, such as {{ic|/var/log}}, {{ic|/var/tmp}}, {{ic|/var/cache/pacman}}, {{ic|/var/lib/machines}}, etc.<br />
:::Finally, the suggested layout should not be GRUB-specific, there should be no recommendations regarding a boot loader. Sure it is useful to include non-trivial tips, but people may actually use a different boot loader.<br />
:::-- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 09:31, 4 December 2020 (UTC)<br />
<br />
::::Thanks for your detailed reply. I admit that I'm not knowledgeable on the intricate differences between distributions and shouldn't have made the changes without properly discussing them first.<br />
::::Yes, I get that the current layout is not [[User:I2Oc9/Btrfs subvolumes#Snapper on flatly-installed system subvolume|the one described in this section]] and indeed properly separates {{ic|/.snapshot}} and {{ic|/}}. The layout I proposed attempts to add some "niceties" such as supporting multi-distribution installations (complex and unnecessary, I agree) and bring the openSUSE layout here, which is a mistake, as you've pointed out.<br />
::::As for GRUB, since I use LUKS all the time and it's the only bootloader supporting encrypted {{ic|/boot}} on Btrfs on LUKS1, I really didn't think of any other possibilities.<br />
::::I will incorporate your recommendations to my user page and add a new section in [[Talk:Snapper]] pointing to those pages.<br />
::::Cheers -- [[User:S0x9v|S0x9v]] ([[User talk:S0x9v|talk]]) 10:09, 4 December 2020 (UTC)<br />
<br />
:::::I've adopted [[Install_Arch_Linux_on_ZFS#System_datasets|Archlinux Root on ZFS layout]] to [[User:I2Oc9/Root_on_Btrfs_with_LUKS_full_disk_encryption#Create_subvolumes|my proposal]]. [[User:S0x9v|S0x9v]] ([[User talk:S0x9v|talk]]) 10:56, 4 December 2020 (UTC)<br />
<br />
== Reflector Revert ==<br />
<br />
Hi Lahwaacz, about your [https://wiki.archlinux.org/index.php?title=Reflector&oldid=643749 revert], it seems like there's precedence for including AUR packages that replicate the code on the wiki. For example, in [[dash#Relinking /bin/sh]].<br />
<br />
In addition, I believe that there's value for linking the AUR package because it allows a simpler user experience where the AUR package is maintained for them. That way, if it is ever updated, they can easily fetch the update instead of religiously checking the wiki page (which most users probably don't do).<br />
<br />
Thanks!<br />
<br />
[[User:Denton-l|Denton-l]] ([[User talk:Denton-l|talk]]) 01:52, 7 December 2020 (UTC)<br />
<br />
== firefox zoom ==<br />
<br />
"no reason to zoom manually, see HiDPI)" - fractional scaling doesn't work [[User:Ubone|Ubone]] ([[User talk:Ubone|talk]]) 02:38, 26 December 2020 (UTC)<br />
<br />
:That should be explained in [[HiDPI#Firefox]] anyway. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 10:48, 26 December 2020 (UTC)<br />
<br />
::it's good to have this mentioned somewhere clearly so people know about it before they say "fonts on linux suck" [[User:Ubone|Ubone]] ([[User talk:Ubone|talk]]) 15:51, 29 December 2020 (UTC)<br />
<br />
== Intel GVT-g edits ==<br />
<br />
Hello Lahwaacz,<br />
<br />
I have noticed that you reverted one of the edits I have performed on [[Intel_GVT-g]].<br />
<br />
About this revert: [https://wiki.archlinux.org/index.php?title=Intel_GVT-g&oldid=648062 Windows problems are out of scope]<br />
<br />
While I understand that the ArchWiki is about ArchLinux, this article in particular mentions Windows in the introduction, and already includes another troubleshooting point about Windows. The issue I have encountered with the black bars is somewhat common, as I have found other people discussing it online, and I really fail to see why not including this piece of information in this article would be better than including it.<br />
<br />
Please, let me know your thoughts. If you think that the point can be improved, I will be happy to do that.<br />
<br />
Ciao,<br />
<br />
[[User:Wilcomir|Wilcomir]] ([[User talk:Wilcomir|talk]]) 09:14, 3 January 2021 (UTC)<br />
<br />
:Well, the existing section about a Windows problem is actually solved by configuring the Linux host. I think anything involving configuration or installation of programs in Windows is not appropriate for long troubleshooting sections. At most, they could be mentioned in a short reference to other sites which describe the problem in detail. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 10:34, 3 January 2021 (UTC)<br />
<br />
== XDG configuration for Vim ==<br />
<br />
Hi Lahwaacz,<br />
<br />
You have reverted the updated Notes for Vim on [[XDG Base Directory]], because "copy-pasted from a blog post".<br />
<br />
The problem is, not only is the configuration presented currently also copied from a blog post too, but is already 10 years old.<br />
<br />
Would it be OK, if we bring back the more up to date version? Or at least remove the obsolete one and leave link to newer?<br><br />
(Although I think a copy on wiki would be beneficial in case my blog ceases to exist)<br />
<br />
[[User:Jorengarenar|Jorengarenar]] ([[User talk:Jorengarenar|talk]]) 02:05, 12 January 2021 (UTC)<br />
<br />
== Root on ZFS draft ==<br />
<br />
Hi, I submitted [https://github.com/openzfs/openzfs-docs/pull/104 a Root on ZFS draft] to official doc repo.<br />
<br />
In the draft, the following directories are separated from root filesystem:<br />
home,root,srv,usr/local,var/log,var/spool,var/tmp<br />
<br />
Is this appropriate for Arch Linux? Or do you have any suggestion on the draft?<br />
Any comment is appreciated.<br />
[[User:M0p|M0p]] ([[User talk:M0p|talk]]) 01:28, 23 January 2021 (UTC)<br />
<br />
== Re: undo GRUB - Common installation errors ==<br />
<br />
Concerning your undo of [https://wiki.archlinux.org/index.php?title=GRUB&diff=next&oldid=649799 Add the error message `Could not prepare Boot variable: No space left on device`)]<br />
Is there a better place to for this Information? One can find the solution in various forums, but I thought it could be helpful to have it in this wiki somewhere. [[User:ModProg|ModProg]] ([[User talk:ModProg|talk]]) 12:51, 25 January 2021 (UTC)<br />
<br />
:The error message is not specific to the {{ic|/sys/fs/pstore/}} filesystem (which does not even seem to be used by default on Arch...) Where did you find that? -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 13:16, 25 January 2021 (UTC)<br />
<br />
::I did not find anything Arch specific, but this post about Debian helped: [https://donjajo.com/fix-grub-efibootmgr-not-set-variable-no-space-left-device/ Post]. I also found something about [https://askubuntu.com/questions/1072618/could-not-prepare-boot-variable-no-space-left-on-device-grub-install-error-ef /sys/fs/efi/efivars/dump-*] The problem is that the actual efi-partition does not seam to be the problem, there is more than 70% space left. If there is better information to guide the user in the right direction that wuld be more helpful. This is what I found worked, but I admit that I don't know much about how grub operates. [[User:ModProg|ModProg]] ([[User talk:ModProg|talk]]) 16:20, 25 January 2021 (UTC)<br />
<br />
:::This wiki ''is'' Arch specific so old posts about Debian or Ubuntu do not apply. Even if they did, this is hardly a ''common'' installation problem. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 07:29, 26 January 2021 (UTC)<br />
<br />
::::I know that, and would not have put it there if it didn't occur on my Arch Linux installation. If this is something that should not be documented in this wiki, I understand that. Is there any other place you would recommend? An issue for grub-install maybe? [[User:ModProg|ModProg]] ([[User talk:ModProg|talk]]) 22:24, 26 January 2021 (UTC)<br />
<br />
== Kernel Compilation time ==<br />
<br />
Reference: [https://wiki.archlinux.org/index.php?title=Kernel&diff=next&oldid=650896 link]<br />
<br />
I don't think we should judge information by what is obvious to experts.<br />
People might have experience with compilation of other programs, which mostly is fast, and then there is the kernel which takes forever to compile.<br />
I think it does not hurt anyone to make people aware of it.<br />
<br />
[[User:G3ro|G3ro]] ([[User talk:G3ro|talk]]) 14:03, 6 February 2021 (UTC)<br />
<br />
:It is an unnecessary information without a definite answer which can even be [https://html.duckduckgo.com/html?q=how%20long%20does%20it%20take%20to%20compile%20Linux%20kernel searched elsewhere]. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 14:23, 6 February 2021 (UTC)<br />
<br />
:: I disagree, with that argument nearly any tip and note is unnecessary. These things are intended to inform users about things that should be taken into consideration and that are different from the norm.<br />
:: Also do you search for the compilation time for every program you intend to compile? I don't.<br />
:: Furthermore this info is included, why not tell it to people directly on the start, so they don't read over it? <br />
:: [[User:G3ro|G3ro]] ([[User talk:G3ro|talk]]) 14:36, 6 February 2021 (UTC)<br />
<br />
:::If someone wants to compile the Linux kernel, they should obviously expect that it will take ''some time''. Stating that it "can take up to several hours" does not make sense without referring to a specific hardware. Obviously, it will take much longer on a poor laptop than on a powerful workstation with a many-core processor, but people can assume that themselves. Without a reference to a specific hardware, the note is unnecessarily discouraging because the compilation can be as fast as some tens of minutes - it is by far not the most expensive package to compile...<br />
:::As you said, people can find better notes later along with advices to enable parallel build etc. which is all that's needed IMO.<br />
:::-- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 15:03, 6 February 2021 (UTC)<br />
<br />
== Wayland style ==<br />
<br />
Reference: [https://wiki.archlinux.org/index.php?title=Wayland&diff=prev&oldid=650979 link]<br />
<br />
I think in the old version it was much easier to read the "source code", so I don't see why there can't be spaces between it.<br />
Things shouldn't be complicated more than necessary.<br />
<br />
[[User:G3ro|G3ro]] ([[User talk:G3ro|talk]]) 14:11, 6 February 2021 (UTC)<br />
<br />
:Most templates on the wiki are written without spaces around the |. When we [https://github.com/archlinux/archwiki/pull/32 switch the editor], there will even be syntax highlighting. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 14:25, 6 February 2021 (UTC)<br />
<br />
== Bluetooth keyboard ==<br />
<br />
Reference: [https://wiki.archlinux.org/index.php/Bluetooth_keyboard link]<br />
<br />
On your last change you said "not specific to keyboards, all of this is already mentioned on the Bluetooth page", the point is that this is extremely relevant for bluetooth keyboard since it is required to perform the login! If this little piece cannot be duplicated I would suggest at least to leave a link saying "If you want to autoconnect at boot please refer to...". I'm new here and I would not touch it further, but please evaluate the suggestion (this is because after reading bluetooth keyboard page and not finding the solution I had to look for it on forums)<br />
<br />
{{unsigned|21:17, 20 February 2021|Stevexyz}}<br />
<br />
:Well, basically the whole page is flagged to be merged with the main [[Bluetooth]] page, so it's expected to be incomplete. Other tips may always be found on a more general page. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 08:40, 21 February 2021 (UTC)<br />
<br />
== Re: Steam Needs to be online error ==<br />
<br />
Reference: [https://wiki.archlinux.org/index.php?title=Steam/Troubleshooting&diff=next&oldid=653073 link]<br />
<br />
The problem here is that DNS resolution in general works already (yes even outside browsers), i.e. <br />
<br />
dig media.steampowered.com<br />
<br />
would run successfully, but the Steam client couldn’t resolve it. The DNS request from 'dig' shows up in my nameserver’s log, the one Steam should send doesn’t. This indicates it might indeed a problem specific to Steam, and it’s not as easy as just say "go fix your DNS resolution", as it already may work correctly for everything but Steam.<br />
<br />
Additionally, at no point does [[Domain name resolution]] even mention nscd, so you effectively removed a fix/workaround for the problem from the Wiki. So I was definitely not "duplicating an article" here. [[User:Irimi1|Irimi1]] ([[User talk:Irimi1|talk]]) 08:12, 22 February 2021 (UTC)<br />
<br />
:Could I please hear your opinion on this? I’d be happy to just add something along the lines of "if you made sure DNS resolution works but Steam still can’t resolve it, try additionally enabling the nscd service" to the Steam troubleshooting page. Unfortounately I don’t know why running the service helps, but I’d still like to give others an easier time finding this solution than I had myself. -- [[User:Irimi1|Irimi1]] ([[User talk:Irimi1|talk]]) 09:15, 28 February 2021 (UTC)<br />
<br />
::Hi, I'm sorry for the delay. Could you test if using a different program for DNS caching (e.g. [[systemd-resolved]]) instead of {{ic|nscd.service}} fixes the problem? If not, then it's probably not due to DNS - {{man|8|nscd}} actually caches more than just DNS. Also if you have a reference to some website where you found about nscd, it would be nice to add it. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 14:22, 28 February 2021 (UTC)<br />
<br />
:::No worries. Using [[systemd-resolved]] for DNS resolution (and caching I guess, I wasn’t aware it does that, too) was a thing I did try, but that didn’t fix it for me. The place I found out about nscd fixing it was actually the [https://bbs.archlinux.org/viewtopic.php?id=263356 Arch forums]. When I search the web for Steam in combination with nscd, all I can seem to find are more forum entries of people that don’t know why that fixes it either. I can try a bit to find out what nscd does to make it work, but I’m not too confident I will be successful. -- [[User:Irimi1|Irimi1]] ([[User talk:Irimi1|talk]]) 14:51, 28 February 2021 (UTC)<br />
<br />
::::Okay, so {{ic|nscd}} allows to [https://man7.org/linux/man-pages/man5/nscd.conf.5.html dis-/enable caching per service], and it’s indeed enabling it for {{ic|hosts}} that makes it work. That’s weird though, since [[systemd-resolved]] has caching enabled by default, and using it for resolution didn’t make {{ic|steam}} work for me. Leads me to think that I didn’t set it up correctly, although resolving via {{ic|dig}} *did* work. Since [[steam]] depends on [[Name Service Switch]], I tried resolving using {{ic|getent}} manually with nscd disabled, but that worked while steam did not. I’m not really sure what to make of this, since I have no idea how this low level networking/resolving stuff works really. -- [[User:Irimi1|Irimi1]] ([[User talk:Irimi1|talk]]) 15:39, 28 February 2021 (UTC)<br />
<br />
:::::Hmm, I don't know the details either. Steam needs the multilib packages so maybe that's part of the problem. Could you add your findings to the section and use [[Template:Expansion]] for the missing details? Maybe someone can figure it out. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 17:44, 28 February 2021 (UTC)<br />
<br />
::::::Sure, I can do that. I’ll probably need a minute to figure out how to use the template though, but I should have the time later today. Thanks for your input on this. -- [[User:Irimi1|Irimi1]] ([[User talk:Irimi1|talk]]) 17:56, 28 February 2021 (UTC)<br />
<br />
== Removal of website link ==<br />
<br />
Refers to this: https://wiki.archlinux.org/index.php?title=PipeWire&diff=next&oldid=653701<br />
<br />
I don't understand why that has to be removed. The official website should be always worth a mention, even if it is somehow mentioned in the text already.<br />
[[User:G3ro|G3ro]] ([[User talk:G3ro|talk]]) 20:02, 28 February 2021 (UTC)<br />
<br />
:The "See also" section is for additional links, it is not intended as a collection of all links used on a page. Adding links which are clearly mentioned in the appropriate place only clutters the list. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 20:24, 28 February 2021 (UTC)<br />
<br />
:: There are just three links and only one of them is really useful, the others could maybe even be removed as they link to old blog posts.<br />
:: I can only repeat myself, that things don't always have to be made more complicated than necessary.<br />
:: The official website is a central point which links to many more useful ressources, so it's one link for much information.<br />
:: [[User:G3ro|G3ro]] ([[User talk:G3ro|talk]]) 20:34, 28 February 2021 (UTC)<br />
<br />
== Removal of bootia32.efi generation procedure from X205TA install page. ==<br />
<br />
Those [https://wiki.archlinux.org/index.php?title=ASUS_x205ta&diff=596239&oldid=562734 instructions] were really straightforward and useful, imho in comparison present ones require too much material to be confident with. I think it's (paradoxically) way easier to generate the file than to configure a `grub.cfg` from zero to boot a live cd. Can we undo the edit? Otherwise we could put them in a new page or section in the GRUB page and link to them maybe. [[User:Tallero|Tallero]] ([[User talk:Tallero|talk]]) 05:07, 4 March 2021 (UTC)<br />
<br />
:If there is something wrong with the information on the [https://wiki.archlinux.org/index.php/Unified_Extensible_Firmware_Interface#Booting_64-bit_kernel_on_32-bit_UEFI general page], it should be improved instead of describing the same procedure in a different way on a completely unrelated page. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 18:16, 6 March 2021 (UTC)<br />
<br />
:: I didn't know we had that info in the UEFI article. I think it could be appropriate to insert the [https://en.wikipedia.org/wiki/Template:See_also#Examples See also] archwiki equivalent (which I couldn't find) for UEFI page on top of the aforementioned section, what do you think? [[User:Tallero|Tallero]] ([[User talk:Tallero|talk]]) 13:28, 7 March 2021 (UTC)<br />
<br />
:::Well, the removed section was previously flagged with "Duplicates [[Unified Extensible Firmware Interface#Booting 64-bit kernel on 32-bit UEFI]]"...<br />
:::Also the laptops pages are usually related to most of the general pages on this wiki, adding all of them would be pretty useless. Users should not expect to find everything on a single laptop page, they should always check if there is a general page for their topic with more details.<br />
:::-- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 13:58, 7 March 2021 (UTC)<br />
<br />
== Re: Show how to use systemd/Timers with wg-quick@.service ==<br />
<br />
I don't think using service is the appropriate when you want to start Wireguard at boot. For most people connecting to a VPN is not exactly part system startup.<br />
A timer should more appropriate.<br />
[[User:ENV25|ENV25]] ([[User talk:ENV25|talk]]) 10:03, 11 April 2021 (UTC)</div>ENV25https://wiki.archlinux.org/index.php?title=WireGuard&diff=659034WireGuard2021-04-11T07:23:06Z<p>ENV25: /* wg-quick */ Show how to use systemd/Timers with wg-quick@.service .</p>
<hr />
<div>[[Category:Virtual Private Network]]<br />
[[ja:WireGuard]]<br />
[[pl:WireGuard]]<br />
[[zh-hans:WireGuard]]<br />
From the [https://www.wireguard.com/ WireGuard] project homepage: <br />
:WireGuard is an extremely simple yet fast and modern VPN that utilizes state-of-the-art cryptography. It aims to be faster, simpler, leaner, and more useful than IPsec, while avoiding the massive headache. It intends to be considerably more performant than OpenVPN. WireGuard is designed as a general purpose VPN for running on embedded interfaces and super computers alike, fit for many different circumstances. Initially released for the Linux kernel, it is now cross-platform (Windows, macOS, BSD, iOS, Android) and widely deployable.<br />
<br />
A rough introduction to the main concepts used in this article can be found on [https://www.wireguard.com/ WireGuard] project homepage. Wireguard is in the Linux kernel since March 2020. <br />
<br />
== Installation ==<br />
<br />
For recent kernels (≥ 5.6) and if using [[#systemd-networkd|systemd-networkd]] or [[#NetworkManager|NetworkManager]] as network manager, no additional tools are required to set up a WireGuard interface. Else, [[install]] {{Pkg|wireguard-tools}}.<br />
<br />
If using a Linux [[kernel]] older than 5.6, additionally install {{Pkg|wireguard-dkms}} for the kernel module.<br />
<br />
=== Graphical clients ===<br />
<br />
* {{App|Qomui|OpenVPN Gui with advanced features and support for multiple providers|https://github.com/corrad1nho/qomui|{{aur|qomui}}}}<br />
<br />
== Usage ==<br />
<br />
The commands below demonstrate how to set up a basic tunnel between two or more peers with the following settings:<br />
<br />
{| class="wikitable"<br />
! rowspan="2" |<br />
! colspan="3" | External (public) addresses<br />
! colspan="2" | Internal IP addresses<br />
! rowspan="2" | Port<br />
|-<br />
! Domain name<br />
! IPv4 address<br />
! IPv6 address<br />
! IPv4 address<br />
! IPv6 address<br />
|-<br />
! Peer A<br />
| <br />
| 198.51.100.101<br />
| 2001:db8:a85b:70a:ffd4:ec1b:4650:a001<br />
| 10.0.0.1/24<br />
| fdc9:281f:04d7:9ee9::1/64<br />
| UDP/51871<br />
|-<br />
! Peer B<br />
| peer-b.example<br />
| 203.0.113.102<br />
| 2001:db8:40f0:147a:80ad:3e88:f8e9:b002<br />
| 10.0.0.2/24<br />
| fdc9:281f:04d7:9ee9::2/64<br />
| UDP/51902<br />
|-<br />
! Peer C<br />
| <br />
| ''dynamic''<br />
| ''dynamic''<br />
| 10.0.0.3/24<br />
| fdc9:281f:04d7:9ee9::3/64<br />
| UDP/51993<br />
|}<br />
<br />
{{Tip|The same UDP port can be used for all peers.}}<br />
<br />
The external addresses should already exist. For example, if ICMP echo requests are not blocked, peer A should be able to [[ping]] peer B via its public IP address(es) and vice versa.<br />
<br />
The internal addresses will be new addresses, created either manually using the {{man|8|ip}} utility or by network management software, which will be used internally within the new WireGuard network. The following examples will use 10.0.0.0/24 and fdc9:281f:04d7:9ee9::/64 as the internal network. The {{ic|/24}} and {{ic|/64}} in the IP addresses is the [[Wikipedia:Classless Inter-Domain Routing#CIDR notation|CIDR]].<br />
<br />
=== Key generation ===<br />
<br />
Create a private and public key for each peer. If connecting dozens of peers optionally consider a vanity keypair to personalize the Base64 encoded public key string. See [[#Vanity keys]].<br />
<br />
To create a private key run:<br />
<br />
$ (umask 0077; wg genkey > peer_A.key)<br />
<br />
{{Note|It is recommended to only allow reading and writing access for the owner. The above alters the [[umask]] temporarily within a sub-shell to ensure that access (read/write permissions) is restricted to the owner.}}<br />
<br />
To create a public key:<br />
<br />
$ wg pubkey < peer_A.key > peer_A.pub<br />
<br />
Alternatively, do this all at once:<br />
<br />
$ wg genkey | tee peer_A.key | wg pubkey > peer_A.pub<br />
<br />
One can also generate a pre-shared key to add an additional layer of symmetric-key cryptography to be mixed into the already existing public-key cryptography, for post-quantum resistance. A pre-shared key should be generated for each peer pair and should not be reused. For example, three interconnected peers, A, B, and, C will need three separate pre-shared keys, one for each peer pair.<br />
<br />
Generate a pre-shared key for each peer pair using the following command:<br />
<br />
$ wg genpsk > peer_A-peer_B.psk<br />
$ wg genpsk > peer_A-peer_C.psk<br />
$ wg genpsk > peer_B-peer_C.psk<br />
<br />
=== Manual WireGuard setup ===<br />
<br />
==== Peer setup ====<br />
<br />
Manual setup is accomplished by using {{man|8|ip}} and {{man|8|wg}}.<br />
<br />
'''Peer A setup:'''<br />
<br />
In this example peer A will listen on UDP port 51871 and will accept connection from peer B and C.<br />
<br />
# ip link add dev wg0 type wireguard<br />
# ip addr add 10.0.0.1/24 dev wg0<br />
# ip addr add fdc9:281f:04d7:9ee9::1/64 dev wg0<br />
# wg set wg0 listen-port 51871 private-key ''/path/to/''peer_A.key<br />
# wg set wg0 peer ''PEER_B_PUBLIC_KEY'' preshared-key ''/path/to/''peer_A-peer_B.psk endpoint peer-b.example:51902 allowed-ips 10.0.0.2/32,fdc9:281f:04d7:9ee9::2/128<br />
# wg set wg0 peer ''PEER_C_PUBLIC_KEY'' preshared-key ''/path/to/''peer_A-peer_C.psk allowed-ips 10.0.0.3/32,fdc9:281f:04d7:9ee9::3/128<br />
# ip link set wg0 up<br />
<br />
{{ic|''PEER_X_PUBLIC_KEY''}} should have the same format as {{ic|1=EsnHH9m6RthHSs+sd9uM6eCHe/mMVFaRh93GYadDDnM=}}.<br />
<br />
The keyword {{ic|allowed-ips}} is a list of addresses that will get routed to the peer. Make sure to specify at least one address range that contains the WireGuard connection's internal IP address(es).<br />
<br />
'''Peer B setup:'''<br />
<br />
# ip link add dev wg0 type wireguard<br />
# ip addr add 10.0.0.2/24 dev wg0<br />
# ip addr add fdc9:281f:04d7:9ee9::2/64 dev wg0<br />
# wg set wg0 listen-port 51902 private-key ''/path/to/''peer_B.key<br />
# wg set wg0 peer ''PEER_A_PUBLIC_KEY'' preshared-key ''/path/to/''peer_A-peer_B.psk endpoint 198.51.100.101:51871 allowed-ips 10.0.0.1/32,fdc9:281f:04d7:9ee9::1/128<br />
# wg set wg0 peer ''PEER_C_PUBLIC_KEY'' preshared-key ''/path/to/''peer_B-peer_C.psk allowed-ips 10.0.0.3/32,fdc9:281f:04d7:9ee9::3/128<br />
# ip link set wg0 up<br />
<br />
'''Peer C setup:'''<br />
<br />
# ip link add dev wg0 type wireguard<br />
# ip addr add 10.0.0.3/24 dev wg0<br />
# ip addr add fdc9:281f:04d7:9ee9::3/64 dev wg0<br />
# wg set wg0 listen-port 51993 private-key ''/path/to/''peer_C.key<br />
# wg set wg0 peer ''PEER_A_PUBLIC_KEY'' preshared-key ''/path/to/''peer_A-peer_C.psk endpoint 198.51.100.101:51871 allowed-ips 10.0.0.1/32,fdc9:281f:04d7:9ee9::1/128<br />
# wg set wg0 peer ''PEER_B_PUBLIC_KEY'' preshared-key ''/path/to/''peer_B-peer_C.psk endpoint peer-b.example:51902 allowed-ips 10.0.0.2/32,fdc9:281f:04d7:9ee9::2/128<br />
# ip link set wg0 up<br />
<br />
==== Additional routes ====<br />
<br />
To establish connections more complicated than point-to-point, additional setup is necessary.<br />
<br />
===== Point-to-site =====<br />
<br />
To access the network of a peer, specify the network subnet(s) in {{ic|allowed-ips}} in the configuration of the peers who should be able to connect to it. E.g. {{ic|allowed-ips 10.0.0.2/32,fdc9:281f:04d7:9ee9::2/128,'''192.168.35.0/24,fd7b:d0bd:7a6e::/64'''}}.<br />
<br />
Make sure to also set up the [[Network configuration#Routing table|routing table]] with {{man|8|ip-route}}. E.g.:<br />
<br />
# ip route add 192.168.35.0/24 dev wg0<br />
# ip route add fd7b:d0bd:7a6e::/64 dev wg0<br />
<br />
===== Site-to-point =====<br />
<br />
{{Expansion|Add {{ic|ip route}} examples; add alternative using NAT; mention the situation when the ''site''-peer is the network's gateway.}}<br />
<br />
If the intent is to connect a device to a network with WireGuard peer(s), set up routes on each device so they know that the peer(s) are reachable via the device.<br />
<br />
{{Tip|Deploy routes network-wide by configuring them in the router.}}<br />
<br />
Enable IP forwarding on the peer through which other devices on the network will connect to WireGuard peer(s):<br />
<br />
# sysctl -w net.ipv4.ip_forward=1<br />
# sysctl -w net.ipv6.conf.all.forwarding=1<br />
<br />
{{Warning|Enabling IP forwarding without a properly configured [[firewall]] is a security risk.}}<br />
<br />
See [[sysctl#Configuration]] for instructions on how to set the ''sysctl'' parameters on boot.<br />
<br />
===== Site-to-site =====<br />
<br />
To connect two (or more) networks, apply both [[#Point-to-site]] and [[#Site-to-point]] on all ''sites''.<br />
<br />
===== Routing all traffic over WireGuard =====<br />
<br />
{{Expansion|Add instructions on how to ''route everything over VPN''.[https://www.wireguard.com/netns/] There is [[#systemd-networkd: routing all traffic over WireGuard]] already.}}<br />
<br />
==== DNS ====<br />
<br />
To use a peer as a DNS server, add its WireGuard tunnel IP address(es) to [[:/etc/resolv.conf]]. For example, to use peer B as the DNS server:<br />
<br />
{{hc|/etc/resolv.conf|<br />
nameserver fdc9:281f:04d7:9ee9::2<br />
nameserver 10.0.0.2<br />
}}<br />
<br />
{{Note|If a peer will act as a DNS server, make sure to use its WireGuard tunnel address(es) as the DNS server address(es) instead of another of its addresses from allowed IPs. Otherwise DNS lookups may fail.}}<br />
<br />
=== Basic checkups ===<br />
<br />
Invoking the {{man|8|wg}} command without parameters will give a quick overview of the current configuration.<br />
<br />
As an example, when peer A has been configured we are able to see its identity and its associated peers:<br />
<br />
{{hc|[user@peer-a]# wg|2=<br />
interface: wg0<br />
public key: UguPyBThx/+xMXeTbRYkKlP0Wh/QZT3vTLPOVaaXTD8=<br />
private key: (hidden)<br />
listening port: 51871<br />
<br />
peer: 9jalV3EEBnVXahro0pRMQ+cHlmjE33Slo9tddzCVtCw=<br />
endpoint: 203.0.113.102:51902<br />
allowed ips: 10.0.0.2/32, fdc9:281f:04d7:9ee9::2<br />
<br />
peer: 2RzKFbGMx5g7fG0BrWCI7JIpGvcwGkqUaCoENYueJw4=<br />
endpoint: 192.0.2.103:51993<br />
allowed ips: 10.0.0.3/32, fdc9:281f:04d7:9ee9::3<br />
}}<br />
<br />
At this point one could reach the end of the tunnel. If the peers do not block ICMP echo requests, try [[ping]]ing a peer to test the connection between them.<br />
<br />
Using ICMPv4:<br />
<br />
[user@peer-a]$ ping 10.0.0.2<br />
<br />
Using ICMPv6:<br />
<br />
[user@peer-a]$ ping fdc9:281f:04d7:9ee9::2<br />
<br />
After transferring some data between peers, the {{ic|wg}} utility will show additional information:<br />
<br />
{{hc|[root@peer-a]# wg|2=<br />
interface: wg0<br />
public key: UguPyBThx/+xMXeTbRYkKlP0Wh/QZT3vTLPOVaaXTD8=<br />
private key: (hidden)<br />
listening port: 51871<br />
<br />
peer: 9jalV3EEBnVXahro0pRMQ+cHlmjE33Slo9tddzCVtCw=<br />
endpoint: 203.0.113.102:51902<br />
allowed ips: 10.0.0.2/32, fdc9:281f:04d7:9ee9::2<br />
latest handshake: 5 seconds ago<br />
transfer: 1.24 KiB received, 1.38 KiB sent<br />
<br />
peer: 2RzKFbGMx5g7fG0BrWCI7JIpGvcwGkqUaCoENYueJw4=<br />
allowed ips: 10.0.0.3/32, fdc9:281f:04d7:9ee9::3<br />
}}<br />
<br />
=== Persistent configuration ===<br />
<br />
Persistent configuration can be achieved using {{ic|wg-quick@.service}}, which is shipped with {{Pkg|wireguard-tools}}, or using a network manager. Network managers that support WireGuard are—[[systemd-networkd]], [[netctl]][https://git.archlinux.org/netctl.git/tree/docs/examples/wireguard], [[NetworkManager]] and [[ConnMan]][https://git.kernel.org/pub/scm/network/connman/connman.git/tree/doc/vpn-config-format.txt].<br />
<br />
{{Note|1=<nowiki></nowiki><br />
* [[netctl]] relies on {{man|8|wg}} from {{Pkg|wireguard-tools}} and {{ic|/etc/wireguard/''interfacename''.conf}} configuration files for establishing WireGuard connections.<br />
* [[ConnMan]] has a very limited support for WireGuard. It can connect to only one peer.[https://git.kernel.org/pub/scm/network/connman/connman.git/commit/?id=95b25140bec7c4d9b6ae4e479dc1b94b7d409b39]<br />
}}<br />
<br />
==== wg-quick ====<br />
<br />
{{man|8|wg-quick}} configures WireGuard tunnels using configuration files from {{ic|/etc/wireguard/''interfacename''.conf}}.<br />
<br />
The current WireGuard configuration can be saved by utilizing the {{man|8|wg}} utility's {{ic|showconf}} command. For example:<br />
<br />
# wg showconf ''interfacename'' > /etc/wireguard/wg0.conf<br />
<br />
To start a tunnel with a configuration file, use<br />
<br />
# wg-quick up ''interfacename''<br />
<br />
or use the systemd service—{{ic|wg-quick@''interfacename''.service}}. To start the tunnel at boot, [[enable]] the unit. Alternatively if the service starts too soon use [[systemd/Timers]]:<br />
<br />
# systemctl edit --full --force wg-quick@.timer<br />
<br />
{{hc|1=/etc/systemd/system/wg-quick@.timer|2=<br />
[Unit]<br />
Description=%i at boot<br />
<br />
[Timer]<br />
OnBootSec=1min<br />
<br />
[Install]<br />
WantedBy=timers.target<br />
}}<br />
<br />
{{Note|<br />
* Users configuring the WireGuard interface using ''wg-quick'', should make sure that no other [[network management]] software tries to manage it. To use [[NetworkManager]] and to not configure WireGuard interfaces with it, see [[#Routes are periodically reset]].<br />
* ''wg-quick'' adds additional configuration options to the configuration file format thus making it incompatible with {{man|8|wg|CONFIGURATION FILE FORMAT}}. See the {{man|8|wg-quick|CONFIGURATION}} man page for the configuration values in question. A ''wg''-compatible configuration file can be produced by using {{ic|wg-quick strip}}.<br />
* ''wg-quick'' does not provide a way to instruct [[resolvconf]] to set the WireGuard interface as ''private''. Even if there are search domains specified, all DNS queries from the system, not just those that match the search domains, will be sent to the DNS servers which are set in the WireGuard configuration.<br />
}}<br />
<br />
'''Peer A setup:'''<br />
<br />
{{hc|1=/etc/wireguard/wg0.conf|2=<br />
[Interface]<br />
Address = 10.0.0.1/24, fdc9:281f:04d7:9ee9::1/64<br />
ListenPort = 51871<br />
PrivateKey = ''PEER_A_PRIVATE_KEY''<br />
MTU = 1420<br />
<br />
[Peer]<br />
PublicKey = ''PEER_B_PUBLIC_KEY''<br />
PresharedKey = ''PEER_A-PEER_B-PRESHARED_KEY''<br />
AllowedIPs = 10.0.0.2/32, fdc9:281f:04d7:9ee9::2/128<br />
Endpoint = peer-b.example:51902<br />
<br />
[Peer]<br />
PublicKey = ''PEER_C_PUBLIC_KEY''<br />
PresharedKey = ''PEER_A-PEER_C-PRESHARED_KEY''<br />
AllowedIPs = 10.0.0.3/32, fdc9:281f:04d7:9ee9::3/128<br />
}}<br />
<br />
* To ''route all traffic'' through the tunnel to a specific peer, add the [[Wikipedia:Default route|default route]] ({{ic|0.0.0.0/0}} for IPv4 and {{ic|::/0}} for IPv6) to {{ic|AllowedIPs}}. E.g. {{ic|1=AllowedIPs = 0.0.0.0/0, ::/0}}. wg-quick will automatically take care of setting up correct routing and fwmark[https://www.wireguard.com/netns/#routing-all-your-traffic] so that networking still functions.<br />
* To use a peer as a DNS server, set {{ic|1=DNS = ''wireguard_internal_ip_address_of_peer''}} in the {{ic|[Interface]}} section. [[Wikipedia:Search domain|Search domains]] are also set with the {{ic|1=DNS = }} option. Separate all values in the list with commas. <br />
<br />
'''Peer B setup:'''<br />
<br />
{{hc|1=/etc/wireguard/wg0.conf|2=<br />
[Interface]<br />
Address = 10.0.0.2/24, fdc9:281f:04d7:9ee9::2/64<br />
ListenPort = 51902<br />
PrivateKey = ''PEER_B_PRIVATE_KEY''<br />
MTU = 1420<br />
<br />
[Peer]<br />
PublicKey = ''PEER_A_PUBLIC_KEY''<br />
PresharedKey = ''PEER_A-PEER_B-PRESHARED_KEY''<br />
AllowedIPs = 10.0.0.1/32, fdc9:281f:04d7:9ee9::1/128<br />
Endpoint = 198.51.100.101:51871<br />
<br />
[Peer]<br />
PublicKey = ''PEER_C_PUBLIC_KEY''<br />
PresharedKey = ''PEER_B-PEER_C-PRESHARED_KEY''<br />
AllowedIPs = 10.0.0.3/32, fdc9:281f:04d7:9ee9::3/128<br />
}}<br />
<br />
'''Peer C setup:'''<br />
<br />
{{hc|1=/etc/wireguard/wg0.conf|2=<br />
[Interface]<br />
Address = 10.0.0.3/24, fdc9:281f:04d7:9ee9::3/64<br />
ListenPort = 51993<br />
PrivateKey = ''PEER_C_PRIVATE_KEY''<br />
MTU = 1420<br />
<br />
[Peer]<br />
PublicKey = ''PEER_A_PUBLIC_KEY''<br />
PresharedKey = ''PEER_A-PEER_C-PRESHARED_KEY''<br />
AllowedIPs = 10.0.0.1/32, fdc9:281f:04d7:9ee9::1/128<br />
Endpoint = 198.51.100.101:51871<br />
<br />
[Peer]<br />
PublicKey = ''PEER_B_PUBLIC_KEY''<br />
PresharedKey = ''PEER_B-PEER_C-PRESHARED_KEY''<br />
AllowedIPs = 10.0.0.2/32, fdc9:281f:04d7:9ee9::2/128<br />
Endpoint = peer-b.example:51902<br />
}}<br />
<br />
==== systemd-networkd ====<br />
<br />
[[systemd-networkd]] has native support for setting up WireGuard interfaces. An example is provided in the {{man|5|systemd.netdev|EXAMPLES}} man page.<br />
<br />
{{Note|<br />
* Routing all DNS over WireGuard (i.e. {{ic|1=Domains=~.}}) will prevent the DNS resolution of endpoints.<br />
* systemd-networkd does not automatically create routes for subnets specified in AllowedIPs. See [https://github.com/systemd/systemd/issues/14176 systemd issue 14176]. This will not affect the connectivity between peers since they exist in the subnet that is specified with the {{ic|1=Address=}} option in the ''.network'' file.<br />
}}<br />
<br />
'''Peer A setup:'''<br />
<br />
{{hc|/etc/systemd/network/99-wg0.netdev|2=<br />
[NetDev]<br />
Name=wg0<br />
Kind=wireguard<br />
Description=WireGuard tunnel wg0<br />
<br />
[WireGuard]<br />
ListenPort=51871<br />
PrivateKey=''PEER_A_PRIVATE_KEY''<br />
<br />
[WireGuardPeer]<br />
PublicKey=''PEER_B_PUBLIC_KEY''<br />
PresharedKey=''PEER_A-PEER_B-PRESHARED_KEY''<br />
AllowedIPs=10.0.0.2/32<br />
AllowedIPs=fdc9:281f:04d7:9ee9::2/128<br />
Endpoint=peer-b.example:51902<br />
<br />
[WireGuardPeer]<br />
PublicKey=''PEER_C_PUBLIC_KEY''<br />
PresharedKey=''PEER_A-PEER_C-PRESHARED_KEY''<br />
AllowedIPs=10.0.0.3/32<br />
AllowedIPs=fdc9:281f:04d7:9ee9::3/128<br />
}}<br />
<br />
{{hc|/etc/systemd/network/99-wg0.network|2=<br />
[Match]<br />
Name=wg0<br />
<br />
[Network]<br />
Address=10.0.0.1/24<br />
Address=fdc9:281f:04d7:9ee9::1/64<br />
}}<br />
<br />
* To use a peer as a DNS server, specify its WireGuard tunnel's IP address(es) in the ''.network'' file using the {{ic|1=DNS=}} option. For [[Wikipedia:Search domain|search domains]] use the {{ic|1=Domains=}} option. See {{man|5|systemd.network|<nowiki>[NETWORK] SECTION OPTIONS</nowiki>|fragment=%5BNETWORK%5D_SECTION_OPTIONS}} for details.<br />
* To use a peer as the '''only''' DNS server, then in the ''.network'' file's {{ic|[Network]}} section set {{ic|1=DNSDefaultRoute=true}} and add {{ic|~.}} to {{ic|1=Domains=}} option.<br />
* To route additional subnets add them as {{ic|[Route]}} sections in the ''.network'' file. For example:<br />
<br />
{{hc|/etc/systemd/network/99-wg0.network|2=<br />
...<br />
[Route]<br />
Destination=192.168.35.0/24<br />
Scope=link<br />
<br />
[Route]<br />
Destination=fd7b:d0bd:7a6e::/64<br />
Scope=link<br />
}}<br />
<br />
{{Warning|In order to prevent the leaking of private keys, it is recommended to set the permissions of the ''.netdev'' file:<br />
<br />
# chown root:systemd-network /etc/systemd/network/99-*.netdev<br />
# chmod 0640 /etc/systemd/network/99-*.netdev<br />
<br />
}}<br />
<br />
'''Peer B setup:'''<br />
<br />
{{hc|/etc/systemd/network/99-wg0.netdev|2=<br />
[NetDev]<br />
Name=wg0<br />
Kind=wireguard<br />
Description=WireGuard tunnel wg0<br />
<br />
[WireGuard]<br />
ListenPort=51902<br />
PrivateKey=''PEER_B_PRIVATE_KEY''<br />
<br />
[WireGuardPeer]<br />
PublicKey=''PEER_A_PUBLIC_KEY''<br />
PresharedKey=''PEER_A-PEER_B-PRESHARED_KEY''<br />
AllowedIPs=10.0.0.1/32<br />
AllowedIPs=fdc9:281f:04d7:9ee9::1/128<br />
Endpoint=198.51.100.101:51871<br />
<br />
[WireGuardPeer]<br />
PublicKey=''PEER_C_PUBLIC_KEY''<br />
PresharedKey=''PEER_B-PEER_C-PRESHARED_KEY''<br />
AllowedIPs=10.0.0.3/32<br />
AllowedIPs=fdc9:281f:04d7:9ee9::3/128<br />
}}<br />
<br />
{{hc|/etc/systemd/network/99-wg0.network|2=<br />
[Match]<br />
Name=wg0<br />
<br />
[Network]<br />
Address=10.0.0.2/24<br />
Address=fdc9:281f:04d7:9ee9::2/64<br />
}}<br />
<br />
'''Peer C setup:'''<br />
<br />
{{hc|/etc/systemd/network/99-wg0.netdev|2=<br />
[NetDev]<br />
Name=wg0<br />
Kind=wireguard<br />
Description=WireGuard tunnel wg0<br />
<br />
[WireGuard]<br />
ListenPort=51993<br />
PrivateKey=''PEER_C_PRIVATE_KEY''<br />
<br />
[WireGuardPeer]<br />
PublicKey=''PEER_A_PUBLIC_KEY''<br />
PresharedKey=''PEER_A-PEER_C-PRESHARED_KEY''<br />
AllowedIPs=10.0.0.1/32<br />
AllowedIPs=fdc9:281f:04d7:9ee9::1/128<br />
Endpoint=198.51.100.101:51871<br />
<br />
[WireGuardPeer]<br />
PublicKey=''PEER_B_PUBLIC_KEY''<br />
PresharedKey=''PEER_B-PEER_C-PRESHARED_KEY''<br />
AllowedIPs=10.0.0.2/32<br />
AllowedIPs=fdc9:281f:04d7:9ee9::2/128<br />
Endpoint=peer-b.example:51902<br />
}}<br />
<br />
{{hc|/etc/systemd/network/99-wg0.network|2=<br />
[Match]<br />
Name=wg0<br />
<br />
[Network]<br />
Address=10.0.0.3/24<br />
Address=fdc9:281f:04d7:9ee9::3/64<br />
}}<br />
<br />
==== systemd-networkd: routing all traffic over WireGuard ====<br />
<br />
In this example Peer B connects to peer A with public IP address 89.0.99.9. Peer B routes all its traffic over WireGuard tunnel and uses Peer A for handling DNS requests.<br />
<br />
'''Peer A setup'''<br />
<br />
{{hc|/etc/systemd/network/20-wired.network|2=<br />
[Match]<br />
Name=en*<br />
<br />
[Network]<br />
DHCP=ipv4<br />
IPForward=ipv4<br />
}}<br />
<br />
{{hc|/etc/systemd/network/50-wg0.netdev|2=<br />
[NetDev]<br />
Name=wg0<br />
Kind=wireguard<br />
Description=WireGuard peer 10.50.0.1<br />
<br />
[WireGuard]<br />
ListenPort=59998<br />
PrivateKey=''PEER_A_PRIVATE_KEY''<br />
<br />
[WireGuardPeer]<br />
PublicKey=''PEER_B_PUBLIC_KEY''<br />
PresharedKey=''PEER_A-PEER_B-PRESHARED_KEY''<br />
AllowedIPs=10.50.0.2/32<br />
}}<br />
<br />
{{hc|/etc/systemd/network/50-wg0.network|2=<br />
[Match]<br />
Name=wg0<br />
<br />
[Network]<br />
Address=10.50.0.1/24<br />
}}<br />
<br />
'''Peer B setup:'''<br />
<br />
{{hc|/etc/systemd/network/50-wg0.netdev|2=<br />
[NetDev]<br />
Name=wg0<br />
Kind=wireguard<br />
Description=WireGuard peer 10.50.0.2<br />
<br />
[WireGuard]<br />
FirewallMark=0x8888<br />
PrivateKey=''PEER_B_PRIVATE_KEY''<br />
<br />
[WireGuardPeer]<br />
PublicKey=''PEER_A_PUBLIC_KEY''<br />
PresharedKey=''PEER_A-PEER_B-PRESHARED_KEY''<br />
AllowedIPs=0.0.0.0/0<br />
Endpoint=89.0.99.9:59998<br />
}}<br />
<br />
{{hc|/etc/systemd/network/50-wg0.network|2=<br />
[Match]<br />
Name=wg0<br />
<br />
[Network]<br />
Address=10.50.0.2/24<br />
DNS=10.50.0.1<br />
DNSDefaultRoute=true<br />
Domains=~.<br />
<br />
[RoutingPolicyRule]<br />
FirewallMark=0x8888<br />
InvertRule=true<br />
Table=1000<br />
Priority=10<br />
<br />
[Route]<br />
Gateway=10.50.0.1<br />
GatewayOnLink=true<br />
Table=1000<br />
}}<br />
<br />
{{Warning|You must still enable IP Forwarding and IP masquerading rules in order to provide working internet to Peer B.<br />
<br />
Assumes [[Uncomplicated_Firewall|ufw]], but you could do the same with [[Iptables|iptables]] by using the rules outlined in the [[#Server_config|Server config]] section:<br />
<br />
$ ufw route allow in on wg0 out on enp5s0<br />
<br />
{{hc|/etc/ufw/before.rules|2=<br />
*nat<br />
:POSTROUTING ACCEPT [0:0]<br />
-A POSTROUTING -s 10.0.0.0/24 -o enp5s0 -j MASQUERADE<br />
COMMIT<br />
}}<br />
<br />
}}<br />
<br />
==== Netctl ====<br />
<br />
[[Netctl]] has native support for setting up WireGuard interfaces. At least Netctl version ≥ 1.23 is recommended as previous versions had various bugs around WireGuard implementation. A typical set of WireGuard netctl profile configuration files would look like this.<br />
<br />
'''Peer A setup:'''<br />
<br />
{{hc|/etc/netctl/wg0|2=<br />
Description="WireGuard tunnel on peer A"<br />
Interface=wg0<br />
Connection=wireguard<br />
WGConfigFile=/etc/wireguard/wg0.conf<br />
<br />
IP=static<br />
Address=('10.0.0.1/24')<br />
}}<br />
<br />
{{hc|/etc/wireguard/wg0.conf|2=<br />
[Interface]<br />
ListenPort = 51871<br />
PrivateKey = ''PEER_A_PRIVATE_KEY''<br />
<br />
[Peer]<br />
PublicKey = ''PEER_B_PUBLIC_KEY''<br />
AllowedIPs = 10.0.0.2/32<br />
Endpoint = peer-b.example:51902<br />
<br />
[Peer]<br />
PublicKey = ''PEER_C_PUBLIC_KEY''<br />
AllowedIPs = 10.0.0.3/32<br />
}}<br />
<br />
'''Peer B setup:'''<br />
<br />
{{hc|/etc/netctl/wg0|2=<br />
Description="WireGuard tunnel on peer B"<br />
Interface=wg0<br />
Connection=wireguard<br />
WGConfigFile=/etc/wireguard/wg0.conf<br />
<br />
IP=static<br />
Address=('10.0.0.2/24')<br />
}}<br />
<br />
{{hc|/etc/wireguard/wg0.conf|2=<br />
[Interface]<br />
ListenPort = 51902<br />
PrivateKey = ''PEER_B_PRIVATE_KEY''<br />
<br />
[Peer]<br />
PublicKey = ''PEER_A_PUBLIC_KEY''<br />
AllowedIPs = 10.0.0.1/32<br />
Endpoint = peer-a.example:51871<br />
<br />
[Peer]<br />
PublicKey = ''PEER_C_PUBLIC_KEY''<br />
AllowedIPs = 10.0.0.3/32<br />
}}<br />
<br />
'''Peer C setup:'''<br />
<br />
{{hc|/etc/netctl/wg0|2=<br />
Description="WireGuard tunnel on peer C"<br />
Interface=wg0<br />
Connection=wireguard<br />
WGConfigFile=/etc/wireguard/wg0.conf<br />
<br />
IP=static<br />
Address=('10.0.0.3/24')<br />
}}<br />
<br />
{{hc|/etc/wireguard/wg0.conf|2=<br />
[Interface]<br />
ListenPort = 51993<br />
PrivateKey = ''PEER_C_PRIVATE_KEY''<br />
<br />
[Peer]<br />
PublicKey = ''PEER_A_PUBLIC_KEY''<br />
AllowedIPs = 10.0.0.1/32<br />
Endpoint = peer-a.example:51871<br />
<br />
[Peer]<br />
PublicKey = ''PEER_B_PUBLIC_KEY''<br />
AllowedIPs = 10.0.0.2/32<br />
Endpoint = peer-b.example:51902<br />
}}<br />
<br />
Then start and/or enable wg0 interface on every participating peer as needed, ie.<br />
<br />
# netctl start wg0<br />
<br />
To implement persistent site-to-peer, peer-to-site or site-to-site type of connection with WireGuard and Netctl, just add appropriate {{ic|1=Routes=}} line into netctl profile config file and add this network to {{ic|AllowedIPs}} in WireGuard profile, eg. {{ic|1=Routes=('192.168.10.0/24 dev wg0')}} in the {{ic|/etc/netctl/wg0}} and {{ic|1=AllowedIPs=10.0.0.1/32, 192.168.10.0/24}} in {{ic|/etc/wireguard/wg0.conf}} and then do not forget to enable [[Internet sharing#Enable packet forwarding|IP forwarding]].<br />
<br />
==== NetworkManager ====<br />
<br />
[[NetworkManager]] has native support for setting up WireGuard interfaces. For all details about WireGuard usage in NetworkManager, read Thomas Haller's blog post—[https://blogs.gnome.org/thaller/2019/03/15/wireguard-in-networkmanager/ WireGuard in NetworkManager].<br />
<br />
{{Tip|NetworkManager can import a wg-quick configuration file. E.g.: {{bc|# nmcli connection import type wireguard file /etc/wireguard/wg0.conf}}}}<br />
<br />
{{Note|nmcli can create a WireGuard connection profile, but it does not support configuring peers. See [https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/358 NetworkManager issue 358].}}<br />
<br />
The following examples configure WireGuard via the keyfile format ''.nmconnection'' files. See {{man|5|nm-settings-keyfile}} and {{man|5|nm-settings}} for a explanation on the syntax and available options.<br />
<br />
'''Peer A setup:'''<br />
<br />
{{hc|/etc/NetworkManager/system-connections/wg0.nmconnection|2=<br />
[connection]<br />
id=wg0<br />
type=wireguard<br />
interface-name=wg0<br />
<br />
[wireguard]<br />
listen-port=51871<br />
private-key=''PEER_A_PRIVATE_KEY''<br />
private-key-flags=0<br />
<br />
[wireguard-peer.''PEER_B_PUBLIC_KEY'']<br />
endpoint=peer-b.example:51902<br />
preshared-key=''PEER_A-PEER_B-PRESHARED_KEY''<br />
preshared-key-flags=0<br />
allowed-ips=10.0.0.2/32;fdc9:281f:04d7:9ee9::2/128;<br />
<br />
[wireguard-peer.''PEER_C_PUBLIC_KEY'']<br />
preshared-key=''PEER_A-PEER_C-PRESHARED_KEY''<br />
preshared-key-flags=0<br />
allowed-ips=10.0.0.3/32;fdc9:281f:04d7:9ee9::3/128;<br />
<br />
[ipv4]<br />
address1=10.0.0.1/24<br />
method=manual<br />
<br />
[ipv6]<br />
address1=fdc9:281f:04d7:9ee9::1/64<br />
method=manual<br />
}}<br />
<br />
* To ''route all traffic'' through the tunnel to a specific peer, add the [[Wikipedia:Default route|default route]] ({{ic|0.0.0.0/0}} for IPv4 and {{ic|::/0}} for IPv6) to {{ic|wireguard-peer.''PEER_X_PUBLIC_KEY''.allowed-ips}}. E.g. {{ic|1=wireguard-peer.''PEER_B_PUBLIC_KEY''.allowed-ips=0.0.0.0/0;::/0;}}. Special handling of the default route in WireGuard connections is supported since NetworkManager 1.20.0.<br />
* To use a peer as a DNS server, specify its WireGuard tunnel's IP address(es) with the {{ic|ipv4.dns}} and {{ic|ipv6.dns}} settings. [[Wikipedia:Search domain|Search domains]] can be specified with the {{ic|1=ipv4.dns-search=}} and {{ic|1=ipv6.dns-search=}} options. See {{man|5|nm-settings}} for more details. For example, using the keyfile format:<br />
<br />
{{bc|1=<br />
...<br />
[ipv4]<br />
...<br />
dns=10.0.0.2;<br />
dns-search=corp;<br />
...<br />
[ipv6]<br />
...<br />
dns=fdc9:281f:04d7:9ee9::2;<br />
dns-search=corp;<br />
...<br />
}}<br />
<br />
To use a peer as the '''only''' DNS server, set a negative DNS priority (e.g. {{ic|1=dns-priority=-1}}) and add {{ic|~.}} to the {{ic|1=dns-search=}} settings.<br />
<br />
'''Peer B setup:'''<br />
<br />
{{hc|/etc/NetworkManager/system-connections/wg0.nmconnection|2=<br />
[connection]<br />
id=wg0<br />
type=wireguard<br />
interface-name=wg0<br />
<br />
[wireguard]<br />
listen-port=51902<br />
private-key=''PEER_B_PRIVATE_KEY''<br />
private-key-flags=0<br />
<br />
[wireguard-peer.''PEER_A_PUBLIC_KEY'']<br />
endpoint=198.51.100.101:51871<br />
preshared-key=''PEER_A-PEER_B-PRESHARED_KEY''<br />
preshared-key-flags=0<br />
allowed-ips=10.0.0.1/32;fdc9:281f:04d7:9ee9::1/128;<br />
<br />
[wireguard-peer.''PEER_C_PUBLIC_KEY'']<br />
preshared-key=''PEER_B-PEER_C-PRESHARED_KEY''<br />
preshared-key-flags=0<br />
allowed-ips=10.0.0.3/32;fdc9:281f:04d7:9ee9::3/128;<br />
<br />
[ipv4]<br />
address1=10.0.0.2/24<br />
method=manual<br />
<br />
[ipv6]<br />
address1=fdc9:281f:04d7:9ee9::2/64<br />
method=manual<br />
}}<br />
<br />
'''Peer C setup:'''<br />
<br />
{{hc|/etc/NetworkManager/system-connections/wg0.nmconnection|2=<br />
[connection]<br />
id=wg0<br />
type=wireguard<br />
interface-name=wg0<br />
<br />
[wireguard]<br />
listen-port=51993<br />
private-key=''PEER_C_PRIVATE_KEY''<br />
private-key-flags=0<br />
<br />
[wireguard-peer.''PEER_A_PUBLIC_KEY'']<br />
endpoint=198.51.100.101:51871<br />
preshared-key=''PEER_A-PEER_C-PRESHARED_KEY''<br />
preshared-key-flags=0<br />
allowed-ips=10.0.0.1/32;fdc9:281f:04d7:9ee9::1/128;<br />
<br />
[wireguard-peer.''PEER_B_PUBLIC_KEY'']<br />
endpoint=peer-b.example:51902<br />
preshared-key=''PEER_B-PEER_C-PRESHARED_KEY''<br />
preshared-key-flags=0<br />
allowed-ips=10.0.0.2/32;fdc9:281f:04d7:9ee9::2/128;<br />
<br />
[ipv4]<br />
address1=10.0.0.3/24<br />
method=manual<br />
<br />
[ipv6]<br />
address1=fdc9:281f:04d7:9ee9::3/64<br />
method=manual<br />
}}<br />
<br />
== Specific use-case: VPN server ==<br />
<br />
{{Merge|#Routing all traffic over WireGuard|Same use case.}}<br />
<br />
{{Note|Usage of the terms "server" and "client" were purposefully chosen in this section specifically to help new users/existing OpenVPN users become familiar with the construction of WireGuard's configuration files. WireGuard documentation simply refers to both of these concepts as "peers."}}<br />
<br />
The purpose of this section is to setup a WireGuard "server" and generic "clients" to enable access to the server/network resources through an encrypted and secured tunnel like [[OpenVPN]] and others. The "server" runs on Linux and the "clients" can run on any number of platforms (the WireGuard Project offers apps on both iOS and Android platforms in addition to Linux, Windows and MacOS). See the official project [https://www.wireguard.com/install/ install link] for more.<br />
<br />
{{Tip|Instead of using {{pkg|wireguard-tools}} for server/client configuration, one may also use [[#systemd-networkd|systemd-networkd]] native WireGuard support.}}<br />
<br />
=== Server ===<br />
<br />
{{Merge|#Site-to-point|Same use case.}}<br />
<br />
On the peer that will act as the "server", first enable IPv4 forwarding using [[sysctl]]:<br />
<br />
# sysctl -w net.ipv4.ip_forward=1<br />
<br />
To make the change permanent, add {{ic|1=net.ipv4.ip_forward = 1}} to {{ic|/etc/sysctl.d/99-sysctl.conf}}.<br />
<br />
A properly configured [[firewall]] is ''HIGHLY recommended'' for any Internet-facing device.<br />
<br />
If the server has a public IP configured, be sure to:<br />
<br />
* Allow UDP traffic on the specified port(s) on which WireGuard will be running (for example allowing traffic on {{ic|51820/UDP}}).<br />
* Setup the forwarding policy for the firewall if it is not included in the WireGuard config for the interface itself {{ic|/etc/wireguard/wg0.conf}}. The example below should have the iptables rules and work as-is.<br />
<br />
If the server is behind NAT, be sure to forward the specified port(s) on which WireGuard will be running (for example, {{ic|51820/UDP}}) from the router to the WireGuard server.<br />
<br />
=== Key generation ===<br />
<br />
Generate key pairs for the server and for each client as explained in [[#Key generation]].<br />
<br />
=== Server config ===<br />
<br />
Create the "server" config file:<br />
<br />
{{hc|/etc/wireguard/wg0.conf|2=<br />
[Interface]<br />
Address = 10.200.200.1/24<br />
ListenPort = 51820<br />
PrivateKey = ''SERVER_PRIVATE_KEY''<br />
<br />
# substitute ''eth0'' in the following lines to match the Internet-facing interface<br />
# if the server is behind a router and receives traffic via NAT, these iptables rules are not needed<br />
PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -A FORWARD -o %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE<br />
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -D FORWARD -o %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE<br />
<br />
[Peer]<br />
# foo<br />
PublicKey = ''PEER_FOO_PUBLIC_KEY''<br />
PresharedKey = ''PRE-SHARED_KEY''<br />
AllowedIPs = 10.200.200.2/32<br />
<br />
[Peer]<br />
# bar<br />
PublicKey = ''PEER_BAR_PUBLIC_KEY''<br />
PresharedKey = ''PRE-SHARED_KEY''<br />
AllowedIPs = 10.200.200.3/32<br />
}}<br />
<br />
Additional peers ("clients") can be listed in the same format as needed. Each peer requires the {{ic|PublicKey}} to be set. However, specifying {{ic|PresharedKey}} is optional.<br />
<br />
Notice that the {{ic|Address}} has a netmask of {{ic|/24}} and the clients on {{ic|AllowedIPs}} {{ic|/32}}. The clients only use their IP and the server only sends back their respective address.<br />
<br />
The interface can be managed manually using {{man|8|wg-quick}} or using a [[systemd]] service managed via {{man|1|systemctl}}.<br />
<br />
The interface may be brought up using {{ic|wg-quick up wg0}} respectively by [[start|starting]] and potentially [[enable|enabling]] the interface via {{ic|wg-quick@''interface''.service}}, e.g. {{ic|wg-quick@wg0.service}}. To close the interface use {{ic|wg-quick down wg0}} respectively [[stop]] {{ic|wg-quick@''interface''.service}}.<br />
<br />
=== Client config ===<br />
<br />
Create the corresponding "client" config file(s):<br />
<br />
{{hc|foo.conf|2=<br />
[Interface]<br />
Address = 10.200.200.2/32<br />
PrivateKey = ''PEER_FOO_PRIVATE_KEY''<br />
DNS = 10.200.200.1<br />
<br />
[Peer]<br />
PublicKey = ''SERVER_PUBLICKEY''<br />
PresharedKey = ''PRE-SHARED_KEY''<br />
Endpoint = my.ddns.example.com:51820<br />
AllowedIPs = 0.0.0.0/0, ::/0<br />
}}<br />
<br />
{{hc|bar.conf|2=<br />
[Interface]<br />
Address = 10.200.200.3/32<br />
PrivateKey = ''PEER_BAR_PRIVATE_KEY''<br />
DNS = 10.200.200.1<br />
<br />
[Peer]<br />
PublicKey = ''SERVER_PUBLICKEY''<br />
PresharedKey = ''PRE-SHARED KEY''<br />
Endpoint = my.ddns.example.com:51820<br />
AllowedIPs = 0.0.0.0/0, ::/0<br />
}}<br />
<br />
Using the catch-all {{ic|1=AllowedIPs = 0.0.0.0/0, ::/0}} will forward all IPv4 ({{ic|0.0.0.0/0}}) and IPv6 ({{ic|::/0}}) traffic over the VPN.<br />
<br />
{{Note|Users of [[NetworkManager]], may need to [[enable]] the {{ic|NetworkManager-wait-online.service}} and users of [[systemd-networkd]] may need to [[enable]] the {{ic|systemd-networkd-wait-online.service}} to wait until devices are network ready before attempting wireguard connection.}}<br />
<br />
== Testing the tunnel ==<br />
<br />
Once a tunnel has been established, one can use [[netcat]] to send traffic through it to test out throughput, CPU usage, etc.<br />
On one side of the tunnel, run {{ic|nc}} in listen mode and on the other side, pipe some data from {{ic|/dev/zero}} into {{ic|nc}} in sending mode.<br />
<br />
In the example below, port 2222 is used for the traffic (be sure to allow traffic on port 2222 if using a firewall).<br />
<br />
On one side of the tunnel listen for traffic:<br />
<br />
$ nc -vvlnp 2222<br />
<br />
On the other side of the tunnel, send some traffic:<br />
<br />
$ dd if=/dev/zero bs=1024K count=1024 | nc -v 10.0.0.203 2222<br />
<br />
Status can be monitored using {{ic|wg}} directly.<br />
<br />
{{hc|# wg|2=<br />
interface: wg0<br />
public key: UguPyBThx/+xMXeTbRYkKlP0Wh/QZT3vTLPOVaaXTD8=<br />
private key: (hidden)<br />
listening port: 51820<br />
<br />
peer: 9jalV3EEBnVXahro0pRMQ+cHlmjE33Slo9tddzCVtCw=<br />
preshared key: (hidden)<br />
endpoint: 192.168.1.216:53207<br />
allowed ips: 10.0.0.0/0<br />
latest handshake: 1 minutes, 17 seconds ago<br />
transfer: 56.43 GiB received, 1.06 TiB sent<br />
}}<br />
<br />
== Troubleshooting ==<br />
<br />
=== Routes are periodically reset ===<br />
<br />
Users of [[NetworkManager]] should make sure that it [[NetworkManager#Ignore specific devices|is not managing]] the WireGuard interface(s). For example, create the following configuration file:<br />
<br />
{{hc|/etc/NetworkManager/conf.d/unmanaged.conf|2=<br />
[keyfile]<br />
unmanaged-devices=type:wireguard<br />
}}<br />
<br />
=== Broken DNS resolution ===<br />
<br />
When tunneling all traffic through a WireGuard interface, the connection can become seemingly lost after a while or upon new connection. This could be caused by a [[network manager]] or [[DHCP]] client overwriting {{ic|/etc/resolv.conf}}.<br />
<br />
By default ''wg-quick'' uses ''resolvconf'' to register new [[DNS]] entries (from the {{ic|DNS}} keyword in the configuration file). This will cause issues with [[network manager]]s and [[DHCP]] clients that do not use ''resolvconf'', as they will overwrite {{ic|/etc/resolv.conf}} thus removing the DNS servers added by wg-quick.<br />
<br />
The solution is to use networking software that supports [[resolvconf]].<br />
<br />
{{Note|Users of [[systemd-resolved]] should make sure that {{Pkg|systemd-resolvconf}} is [[install]]ed.}}<br />
<br />
Users of [[NetworkManager]] should know that it does not use resolvconf by default. It is recommended to use [[systemd-resolved]]. If this is undesirable, [[install]] {{Pkg|openresolv}} and configure NetworkManager to use it: [[NetworkManager#Use openresolv]].<br />
<br />
=== Low MTU ===<br />
<br />
Due to too low MTU (lower than 1280), wg-quick may have failed to create the WireGuard interface. This can be solved by setting the MTU value in WireGuard configuration in Interface section on client.<br />
{{hc|/foo.config|2=<br />
[Interface]<br />
Address = 10.200.200.2/24<br />
MTU = 1420<br />
PrivateKey = ''PEER_FOO_PRIVATE_KEY''<br />
DNS = 10.200.200.1<br />
}}<br />
<br />
=== Key is not the correct length or format ===<br />
<br />
To avoid the following error, put the key value in the configuration file and not the path to the key file.<br />
<br />
{{hc|# wg-quick up wg0|<br />
[#] ip link add wg0 type wireguard<br />
[#] wg setconf wg0 /dev/fd/63<br />
Key is not the correct length or format: `''/path/example.key'''<br />
Configuration parsing error<br />
[#] ip link delete dev wg0<br />
}}<br />
<br />
=== Unable to establish a persistent connection behind NAT / firewall ===<br />
<br />
By default WireGuard peers remain silent while they do not need to communicate, so peers located behind a NAT and/or [[firewall]] may be unreachable from other peers until they reach out to other peers themselves (or the connection may time out). Adding {{ic|1=PersistentKeepalive = 25}} to the {{ic|[Peer]}} setting of a peer located behind a NAT and/or firewall can ensure that the connection remains open. <br />
<br />
{{hc|# Set the persistent-keepalive via command line (temporarily)|<br />
[#] wg set wg0 peer $PUBKEY persistent-keepalive 25<br />
}}<br />
<br />
== Known issues ==<br />
<br />
=== Loop routing ===<br />
<br />
Adding the endpoint IP to the allowed IPs list, the kernel will attempt to send handshakes to said device binding, rather than using the original route. This results in failed handshake attempts.<br />
<br />
As a workaround, the correct route to the endpoint needs to be manually added using<br />
<br />
ip route add <endpoint ip> via <gateway> dev <network interface><br />
<br />
e.g. for peer B from above in a standard LAN setup:<br />
<br />
ip route add 203.0.113.102 via 192.168.0.1 dev eth0<br />
<br />
To make this route persistent the command can be added as {{ic|1=PostUp = ip route ...}} to the {{ic|[Interface]}} section of {{ic|wg0.conf}}. However, on certain setups (e.g. using {{ic|wg-quick@.service}} in combination with NetworkManager) this might fail on resume. Furthermore, this only works for a static network setup and fails if gateways or devices change (e.g. using ethernet or wifi on a laptop).<br />
<br />
Using NetworkManager, a more flexible solution is to start wireguard using an dispatcher script. As root, create<br />
{{hc|/etc/NetworkManager/dispatcher.d/50-wg0.sh|2=<br />
#!/bin/sh<br />
case $2 in<br />
up)<br />
wg-quick up wg0<br />
ip route add <endpoint ip> via $IP4_GATEWAY dev $DEVICE_IP_IFACE<br />
;;<br />
pre-down)<br />
wg-quick down wg0<br />
;;<br />
esac<br />
}}<br />
If not already running, start and enable {{ic|NetworkManager-dispatcher.service}}.<br />
Also, make sure that NetworkManager is not manging routes for {{ic|wg0}} ([[#Routes are periodically reset|see above]]).<br />
<br />
== Tips and tricks ==<br />
<br />
=== Vanity keys ===<br />
<br />
Currently, Wireguard does not support comments or attaching human-memorable names to keys. This makes identifying the key's owner difficult particularly when multiple keys are in use. One solution is to generate a public key that contains some familiar characters (perhaps the first few letters of the owner's name or of the hostname etc.), {{AUR|wireguard-vanity-address}} does this.<br />
<br />
=== Store private keys in encrypted form ===<br />
<br />
It may be desirable to store private keys in encrypted form, such as through use of {{pkg|pass}}. Just replace the PrivateKey line under [Interface] in the configuration file with:<br />
<br />
PostUp = wg set %i private-key <(su user -c "export PASSWORD_STORE_DIR=/path/to/your/store/; pass WireGuard/private-keys/%i")<br />
<br />
where ''user'' is the Linux username of interest. See the {{man|8|wg-quick}} man page for more details.<br />
<br />
=== Endpoint with changing IP ===<br />
<br />
After resolving a server's domain, WireGuard [https://lists.zx2c4.com/pipermail/wireguard/2017-November/002028.html will not check for changes in DNS again].<br />
<br />
If the WireGuard server is frequently changing its IP-address due DHCP, Dyndns, IPv6, etc., any WireGuard client is going to lose its connection, until its endpoint is updated via something like {{ic|wg set "$INTERFACE" peer "$PUBLIC_KEY" endpoint "$ENDPOINT"}}.<br />
<br />
Also be aware, if the endpoint is ever going to change its address (for example when moving to a new provider/datacenter), just updating DNS will not be enough, so periodically running reresolve-dns might make sense on any DNS-based setup.<br />
<br />
Luckily, {{Pkg|wireguard-tools}} provides an example script {{ic|/usr/share/wireguard-tools/examples/reresolve-dns/reresolve-dns.sh}}, that parses WG configuration files and automatically resets the endpoint address.<br />
<br />
One needs to run the {{ic|/usr/share/wireguard-tools/examples/reresolve-dns/reresolve-dns.sh /etc/wireguard/wg.conf}} periodically to recover from an endpoint that has changed its IP.<br />
<br />
One way of doing so is by updating all WireGuard endpoints once every thirty seconds[https://git.zx2c4.com/WireGuard/tree/contrib/examples/reresolve-dns/README] via a systemd timer:<br />
<br />
{{hc|/etc/systemd/system/wireguard_reresolve-dns.timer|2=<br />
[Unit]<br />
Description=Periodically reresolve DNS of all WireGuard endpoints<br />
<br />
[Timer]<br />
OnCalendar=*:*:0/30<br />
<br />
[Install]<br />
WantedBy=timers.target<br />
}}<br />
<br />
{{hc|/etc/systemd/system/wireguard_reresolve-dns.service|2=<br />
[Unit]<br />
Description=Reresolve DNS of all WireGuard endpoints<br />
Wants=network-online.target<br />
After=network-online.target<br />
<br />
[Service]<br />
Type=oneshot<br />
ExecStart=/bin/sh -c 'for i in /etc/wireguard/*.conf; do /usr/share/wireguard-tools/examples/reresolve-dns/reresolve-dns.sh "$i"; done'<br />
}}<br />
<br />
Afterwards [[enable]] and [[start]] {{ic|wireguard_reresolve-dns.timer}}<br />
<br />
=== Generate QR code ===<br />
<br />
If the client is a mobile device such as a phone, {{Pkg|qrencode}} can be used to generate client's configuration QR code and display it in terminal:<br />
<br />
$ qrencode -t ansiutf8 -r ''client.conf''<br />
<br />
=== Enable debug logs ===<br />
<br />
When using the Linux kernel module on a kernel that supports dynamic debugging, debugging information can be written into the kernel ring buffer (viewable with [[dmesg]] and [[journalctl]]) by running:<br />
<br />
# modprobe wireguard <br />
# echo module wireguard +p > /sys/kernel/debug/dynamic_debug/control<br />
<br />
=== Reload peer (server) configuration ===<br />
<br />
In case the WireGuard peer (mostly server) adding or removing another peers from its configuration and wants to reload it without stopping any active sessions, one can execute the following command to do it:<br />
<br />
# wg syncconf ${WGNET} <(wg-quick strip ${WGNET})<br />
<br />
Where {{ic|$WGNET}} is WireGuard interface name or configuration base name, for example {{ic|wg0}} (for server) or {{ic|client}} (without the .conf extension, for client).<br />
<br />
== See also ==<br />
<br />
* [[Wikipedia:WireGuard]]<br />
* [https://www.wireguard.com/presentations/ Presentations by Jason Donenfeld].<br />
* [https://lists.zx2c4.com/mailman/listinfo/wireguard Mailing list]<br />
* [https://docs.sweeting.me/s/wireguard Unofficial WireGuard Documentation]<br />
* [[Debian:Wireguard]]</div>ENV25https://wiki.archlinux.org/index.php?title=Yakuake&diff=657493Yakuake2021-04-03T19:14:40Z<p>ENV25: Added "Troubleshooting" section about true-color.</p>
<hr />
<div>[[Category:KDE]]<br />
[[Category:Terminal emulators]]<br />
[[es:Yakuake]]<br />
[[ja:Yakuake]]<br />
[[ru:Yakuake]]<br />
[[zh-hans:Yakuake]]<br />
{{Related articles start}}<br />
{{Related|KDE}}<br />
{{Related articles end}}<br />
[https://kde.org/applications/system/org.kde.yakuake Yakuake] is a top-down terminal for [[KDE]] in the style of [[Guake]] for [[GNOME]], [[Tilda]] or the terminal used in Quake.<br />
<br />
== Installation ==<br />
<br />
[[Install]] the {{Pkg|yakuake}} package.<br />
<br />
== Usage ==<br />
<br />
Once installed, you can start Yakuake from the terminal with:<br />
<br />
$ yakuake<br />
<br />
After Yakuake has started you can click on configure Yakuake by clicking on the ''Open Menu'' button (middle button on the bottom right hand side of the interface) and select ''Configure Shortcuts'' to change the hotkey to drop/retract the terminal automatically, by default it is set to F12.<br />
<br />
== Configuration ==<br />
<br />
=== Background transparency and blur on Plasma ===<br />
<br />
While most configuration options can be changed from Yakuake GUI, there are some options only accessible from modifying the configuration file, e.g. the option to use blur background under [[Plasma]].<br />
<br />
{{Note|1=Enabling the ''Blur background'' option in Yakuake's Konsole profile will not enable blur for Yakuake's window, and will show a warning as {{ic|Konsole was started before desktop effects were enabled. You need to restart Konsole to see transparent background.}}. There are [https://bugs.kde.org/show_bug.cgi?id=395520 bug reports on upstream about this warning] . The warning is somewhat misleading because Yakuake uses KonsolePart which does not have support for blur/transparency, but Yakuake itself can apply such effects to its window.}}<br />
<br />
In order to apply blur background for Yakuake, edit the following file:<br />
<br />
{{hc|~/.config/yakuakerc|2=<br />
[Appearance]<br />
Blur=true<br />
Translucency=true<br />
}}<br />
<br />
Then restart Yakuake to apply the change.<br />
<br />
== Troubleshooting ==<br />
<br />
=== True-color programs don't display correctly ===<br />
<br />
See [[Konsole#True-color programs don't display correctly]].<br />
<br />
== Yakuake scripting ==<br />
<br />
Like [[Guake]], Yakuake allows to control itself at runtime by sending the [[D-Bus]] messages. Thus it can be used to start Yakuake in a user defined session. You can create tabs, assign names for them and also ask to run any specific command in any opened tab or just to show/hide Yakuake window, manually in a terminal or by creating a custom script for it.<br />
<br />
Example of such a script is given below. This includes opening tabs, renaming tabs, splitting shells, and running commands.<br />
<br />
#!/bin/bash<br />
# Starting Yakuake based on user preferences. Information based on http://forums.gentoo.org/viewtopic-t-873915-start-0.html<br />
# Adding sessions from previous website is broken, use this: http://pawelkoston.pl/blog/sublime-text-3-cheatsheet-modules-web-develpment/<br />
<br />
# This line is needed in case Yakuake does not accept fcitx inputs.<br />
/usr/bin/yakuake --im /usr/bin/fcitx --inputstyle onthespot &<br />
<br />
# gives Yakuake a couple seconds before sending dbus commands<br />
sleep 2 <br />
<br />
# Start htop in tab and split to user terminal and run iotop <br />
TERMINAL_ID_0=$(qdbus org.kde.yakuake /yakuake/sessions org.kde.yakuake.terminalIdsForSessionId 0)<br />
qdbus org.kde.yakuake /yakuake/tabs setTabTitle 0 "user"<br />
qdbus org.kde.yakuake /yakuake/sessions runCommandInTerminal 0 "htop"<br />
qdbus org.kde.yakuake /yakuake/sessions org.kde.yakuake.splitTerminalLeftRight "$TERMINAL_ID_0"<br />
qdbus org.kde.yakuake /yakuake/sessions runCommandInTerminal 1 "iotop<br />
<br />
# Start split root sessions (password prompt) top and bottom <br />
SESSION_ID_1=$(qdbus org.kde.yakuake /yakuake/sessions org.kde.yakuake.addSession)<br />
TERMINAL_ID_1=$(qdbus org.kde.yakuake /yakuake/sessions org.kde.yakuake.terminalIdsForSessionId "$SESSION_ID_1")<br />
qdbus org.kde.yakuake /yakuake/tabs setTabTitle 1 "root"<br />
qdbus org.kde.yakuake /yakuake/sessions runCommandInTerminal 2 "su"<br />
qdbus org.kde.yakuake /yakuake/sessions org.kde.yakuake.splitTerminalTopBottom "$TERMINAL_ID_1"<br />
qdbus org.kde.yakuake /yakuake/sessions runCommandInTerminal 3 "su" <br />
<br />
# Start irssi in its own tab. <br />
qdbus org.kde.yakuake /yakuake/sessions org.kde.yakuake.addSession<br />
qdbus org.kde.yakuake /yakuake/tabs setTabTitle 2 "irssi"<br />
qdbus org.kde.yakuake /yakuake/sessions runCommandInTerminal 4 "ssh home -t 'tmux attach -t irssi; bash -l'" <br />
<br />
# Start split ssh shells in own tab. <br />
SESSION_ID_2=$(qdbus org.kde.yakuake /yakuake/sessions org.kde.yakuake.addSession)<br />
TERMINAL_ID_2=$(qdbus org.kde.yakuake /yakuake/sessions org.kde.yakuake.terminalIdsForSessionId "$SESSION_ID_2")<br />
qdbus org.kde.yakuake /yakuake/tabs setTabTitle 3 "work server"<br />
qdbus org.kde.yakuake /yakuake/sessions runCommandInTerminal 5 "ssh work"<br />
qdbus org.kde.yakuake /yakuake/sessions org.kde.yakuake.splitTerminalLeftRight "$TERMINAL_ID_2"<br />
qdbus org.kde.yakuake /yakuake/sessions runCommandInTerminal 6 "ssh work" <br />
<br />
=== dbus-send instead of qdbus ===<br />
<br />
You can replace ''qdbus'' bundled with [[Qt]] with more common ''dbus-send''. For example, to show/hide Yakuake:<br />
<br />
$ dbus-send --type=method_call --dest=org.kde.yakuake /yakuake/window org.kde.yakuake.toggleWindowState<br />
<br />
== See also ==<br />
<br />
* [https://coderwall.com/p/kq9ghg/yakuake-scripting Yakuake scripting on coderwall.com]</div>ENV25https://wiki.archlinux.org/index.php?title=Konsole&diff=657492Konsole2021-04-03T19:11:40Z<p>ENV25: Added "Related Articles" entry for yakuake.</p>
<hr />
<div>[[Category:KDE]]<br />
[[Category:Terminal emulators]]<br />
{{Related articles start}}<br />
{{Related|KDE}}<br />
{{Related|Yakuake}}<br />
{{Related articles end}}<br />
<br />
[https://apps.kde.org/en/konsole Konsole] is a terminal emulator for the KDE desktop.<br />
<br />
== Installation ==<br />
<br />
[[Install]] the {{Pkg|konsole}} package.<br />
<br />
== Troubleshooting ==<br />
<br />
=== True-color programs don't display correctly ===<br />
<br />
This is because, by default, konsole doesn't set the right {{ic|$TERM}} variable. To set it, either edit you konsole profile or make new one:<br />
<br />
{{hc|1=~/.local/share/konsole/konsole.profile|2=<br />
[General]<br />
Name=konsole<br />
Environment=TERM=konsole-256color,COLORTERM=truecolor<br />
}}</div>ENV25https://wiki.archlinux.org/index.php?title=Konsole&diff=657491Konsole2021-04-03T19:10:13Z<p>ENV25: Created konsole page. Added "Troubleshooting" section about true-color.</p>
<hr />
<div>[[Category:KDE]]<br />
[[Category:Terminal emulators]]<br />
{{Related articles start}}<br />
{{Related|KDE}}<br />
{{Related articles end}}<br />
<br />
[https://apps.kde.org/en/konsole Konsole] is a terminal emulator for the KDE desktop.<br />
<br />
== Installation ==<br />
<br />
[[Install]] the {{Pkg|konsole}} package.<br />
<br />
== Troubleshooting ==<br />
<br />
=== True-color programs don't display correctly ===<br />
<br />
This is because, by default, konsole doesn't set the right {{ic|$TERM}} variable. To set it, either edit you konsole profile or make new one:<br />
<br />
{{hc|1=~/.local/share/konsole/konsole.profile|2=<br />
[General]<br />
Name=konsole<br />
Environment=TERM=konsole-256color,COLORTERM=truecolor<br />
}}</div>ENV25https://wiki.archlinux.org/index.php?title=NetworkManager&diff=657210NetworkManager2021-04-02T15:08:28Z<p>ENV25: /* Secrets were required, but not provided */ Added mention of disabling MAC address randomization.</p>
<hr />
<div>[[Category:Network managers]]<br />
[[Category:Red Hat]]<br />
[[cs:NetworkManager]]<br />
[[de:Networkmanager]]<br />
[[es:NetworkManager]]<br />
[[fr:NetworkManager]]<br />
[[it:NetworkManager]]<br />
[[ja:NetworkManager]]<br />
[[pt:NetworkManager]]<br />
[[zh-hans:NetworkManager]]<br />
{{Related articles start}}<br />
{{Related|Network configuration}}<br />
{{Related|Wireless network configuration}}<br />
{{Related articles end}}<br />
[https://networkmanager.dev/ NetworkManager] is a program for providing detection and configuration for systems to automatically connect to networks. NetworkManager's functionality can be useful for both wireless and wired networks. For wireless networks, NetworkManager prefers known wireless networks and has the ability to switch to the most reliable network. NetworkManager-aware applications can switch from online and offline mode. NetworkManager also prefers wired connections over wireless ones, has support for modem connections and certain types of VPN. NetworkManager was originally developed by Red Hat and now is hosted by the [[GNOME]] project.<br />
<br />
{{Expansion|Clear text storage of secrets is not limited to just Wi-Fi passwords. The secrets are stored in files (and folder) only accesible to root.}}<br />
<br />
{{Warning|By default, Wi-Fi passwords are stored in clear text, see [[#Encrypted Wi-Fi passwords]].}}<br />
<br />
== Installation ==<br />
<br />
NetworkManager can be [[install]]ed with the package {{Pkg|networkmanager}}, which contains a daemon, a command line interface ({{ic|nmcli}}) and a curses‐based interface ({{ic|nmtui}}). <br />
<br />
=== Enable NetworkManager ===<br />
<br />
After installation, you should [[start/enable]] {{ic|NetworkManager.service}}. Once the NetworkManager daemon is started, it will automatically connect to any available "system connections" that have already been configured. Any "user connections" or unconfigured connections will need ''nmcli'' or an applet to configure and connect.<br />
<br />
{{Note|If [[systemd-resolved]] is not [[started]], an error message will start flooding your logs. See [[#Unit dbus-org.freedesktop.resolve1.service not found]] for more info.}}<br />
<br />
=== Additional interfaces ===<br />
<br />
* {{Pkg|nm-connection-editor}} for a graphical user interface,<br />
* {{Pkg|network-manager-applet}} for a system tray applet ({{ic|nm-applet}}).<br />
<br />
{{Note|You must ensure that no other service that wants to configure the network is running; in fact, multiple networking services will conflict. You can find a list of the currently running services with {{ic|1=systemctl --type=service}} and then [[stop]] them. See [[#Configuration]] to enable the NetworkManager service.}}<br />
<br />
=== Mobile broadband support ===<br />
<br />
NetworkManager uses [[ModemManager]] for mobile broadband connection support.<br />
<br />
[[Install]] {{Pkg|modemmanager}} and {{Pkg|usb_modeswitch}}. Afterwards [[enable]] and [[start]] {{ic|ModemManager.service}}.<br />
<br />
It may necessary to [[restart]] {{ic|NetworkManager.service}} for it to detect ModemManager. After you restart it, re-plug the modem again and it should be recognized. <br />
<br />
Add connections from a front-end (e.g. {{Pkg|nm-connection-editor}}) and select mobile broadband as the connection type. After selecting your ISP and billing plan, [[Wikipedia:Access Point Name|APN]] and other settings should be filled in automatically using information from {{Pkg|mobile-broadband-provider-info}}.<br />
<br />
=== PPPoE / DSL support ===<br />
<br />
[[Install]] {{Pkg|rp-pppoe}} package for PPPoE / DSL connection support. To actually add PPPoE connection, use {{ic|1=nm-connection-editor}} and add new DSL/PPPoE connection.<br />
<br />
=== VPN support ===<br />
<br />
NetworkManager since version 1.16 has native support for [[WireGuard]], all it needs is the {{ic|wireguard}} kernel module. Read the [https://blogs.gnome.org/thaller/2019/03/15/wireguard-in-networkmanager/ WireGuard in NetworkManager blog post] for details.<br />
<br />
Support for other VPN types is based on a plug-in system. They are provided in the following packages:<br />
<br />
* {{Pkg|networkmanager-openconnect}} for [[OpenConnect]]<br />
* [[networkmanager-openvpn]] for [[OpenVPN]]<br />
* {{Pkg|networkmanager-pptp}} for [[PPTP Client]]<br />
* {{Pkg|networkmanager-vpnc}} for [[Vpnc]]<br />
* {{Pkg|networkmanager-strongswan}} for [[strongSwan]]<br />
* {{AUR|networkmanager-fortisslvpn-git}}<br />
* {{AUR|networkmanager-iodine-git}}<br />
* {{AUR|networkmanager-libreswan}}<br />
* {{Pkg|networkmanager-l2tp}}<br />
* {{AUR|networkmanager-ssh-git}}<br />
* {{Pkg|network-manager-sstp}}<br />
<br />
{{Warning|1=There are a lot of [https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues?search=VPN&state=opened bugs] (and [https://bugzilla.gnome.org/buglist.cgi?bug_status=__open__&content=VPN&product=NetworkManager old bugs]) related to VPN support. Check the daemon processes options set via the GUI correctly and double-check with each package release.}}<br />
<br />
{{Note|To have fully functioning DNS resolution when using VPN, you should set up [[#DNS caching and conditional forwarding|conditional forwarding]].}}<br />
<br />
== Usage ==<br />
<br />
NetworkManager comes with {{man|1|nmcli}} and {{man|1|nmtui}}.<br />
<br />
=== nmcli examples ===<br />
<br />
List nearby Wi-Fi networks:<br />
<br />
$ nmcli device wifi list<br />
<br />
Connect to a Wi-Fi network:<br />
<br />
$ nmcli device wifi connect ''SSID_or_BSSID'' password ''password''<br />
<br />
Connect to a hidden Wi-Fi network:<br />
<br />
$ nmcli device wifi connect ''SSID_or_BSSID'' password ''password'' hidden yes<br />
<br />
Connect to a Wi-Fi on the {{ic|wlan1}} interface:<br />
<br />
$ nmcli device wifi connect ''SSID_or_BSSID'' password ''password'' ifname wlan1 ''profile_name''<br />
<br />
Disconnect an interface:<br />
<br />
$ nmcli device disconnect ifname eth0<br />
<br />
Get a list of connections with their names, UUIDs, types and backing devices:<br />
<br />
$ nmcli connection show<br />
<br />
Activate a connection (i.e. connect to a network with an existing profile):<br />
<br />
$ nmcli connection up ''name_or_uuid''<br />
<br />
Delete a connection:<br />
<br />
$ nmcli connection delete ''name_or_uuid''<br />
<br />
See a list of network devices and their state:<br />
<br />
$ nmcli device<br />
<br />
Turn off Wi-Fi:<br />
<br />
$ nmcli radio wifi off<br />
<br />
=== Edit a connection ===<br />
<br />
For a comprehensive list of settings, see {{man|5|nm-settings}}.<br />
<br />
Firstly you need to get list of connections:<br />
<br />
{{hc|$ nmcli connection|<nowiki><br />
NAME UUID TYPE DEVICE<br />
Wired connection 2 e7054040-a421-3bef-965d-bb7d60b7cecf ethernet enp5s0<br />
Wired connection 1 997f2782-f0fc-301d-bfba-15421a2735d8 ethernet enp0s25<br />
MY-HOME-WIFI-5G 92a0f7b3-2eba-49ab-a899-24d83978f308 wifi --<br />
</nowiki>}}<br />
<br />
Here you can use the first column as connection-id used later. In this example we pick {{ic|Wired connection 2}} as a connection-id.<br />
<br />
You have three methods to configure a connection {{ic|Wired connection 2}} after it has been created:<br />
<br />
; nmcli interactive editor<br />
: {{ic|nmcli connection edit 'Wired connection 2'}}.<br> Usage is well documented from the editor.<br />
<br />
; nmcli command line interface<br />
: {{ic|nmcli connection modify 'Wired connection 2' ''setting''.''property'' ''value''}}. See {{man|1|nmcli}} for usage. For example you can change its IPv4 route metric to 200 using {{ic|nmcli connection modify 'Wired connection 2' ipv4.route-metric 200}} command.<br />
To remove a setting pass an empty field ("") to it like this:<br />
: {{ic|nmcli connection modify 'Wired connection 2' ''setting''.''property'' ""}}<br />
<br />
; Connection file<br />
: In {{ic|/etc/NetworkManager/system-connections/}}, modify the corresponding {{ic|Wired connection 2.nmconnection}} file .<br> Do not forget to reload the configuration file with {{ic|nmcli connection reload}}.<br />
<br />
== Front-ends ==<br />
<br />
To configure and have easy access to NetworkManager, most users will want to install an applet. This GUI front-end usually resides in the system tray (or notification area) and allows network selection and configuration of NetworkManager. Various desktop environments have their own applet. Otherwise you can use [[#nm-applet]].<br />
<br />
=== GNOME ===<br />
<br />
[[GNOME]] has a built-in tool, accessible from the Network settings.<br />
<br />
=== KDE Plasma ===<br />
<br />
[[Install]] the {{Pkg|plasma-nm}} package. After that, add it to the KDE taskbar via the ''Panel options > Add widgets > Networks'' menu.<br />
<br />
=== nm-applet ===<br />
<br />
{{Pkg|network-manager-applet}} is a GTK 3 front-end which works under Xorg environments with a systray.<br />
<br />
To store connection secrets install and configure [[GNOME/Keyring]].<br />
<br />
Be aware that after enabling the tick-box option {{ic|Make available to other users}} for a connection, NetworkManager stores the password in plain-text, though the respective file is accessible only to root (or other users via {{ic|nm-applet}}). See [[#Encrypted Wi-Fi passwords]].<br />
<br />
In order to run {{ic|nm-applet}} without a systray, you can use {{Pkg|trayer}} or {{Pkg|stalonetray}}. For example, you can add a script like this one in your path:<br />
<br />
{{hc|nmgui|<nowiki><br />
#!/bin/sh<br />
nm-applet 2>&1 > /dev/null &<br />
stalonetray 2>&1 > /dev/null<br />
killall nm-applet<br />
</nowiki>}}<br />
<br />
When you close the ''stalonetray'' window, it closes {{ic|nm-applet}} too, so no extra memory is used once you are done with network settings.<br />
<br />
The applet can show notifications for events such as connecting to or disconnecting from a WiFi network. For these notifications to display, ensure that you have a notification server installed - see [[Desktop notifications]]. If you use the applet without a notification server, you might see some messages in stdout/stderr, and the app might hang. See [https://bugzilla.gnome.org/show_bug.cgi?id=788313].<br />
<br />
In order to run {{ic|nm-applet}} with such notifications disabled, start the applet with the following command:<br />
<br />
$ nm-applet --no-agent<br />
<br />
{{Tip|{{ic|nm-applet}} might be started automatically with a [[XDG Autostart|autostart desktop file]], to add the --no-agent option modify the Exec line there, i.e.<br />
<br />
{{bc|1=Exec=nm-applet --no-agent}}<br />
<br />
}}<br />
<br />
{{Warning|On [[i3]], if nm-applet is started with the {{ic|--no-agent}} option, it is not possible to connect to a new encrypted WiFi network by clicking on the item list because no password input dialogue window will pop out. [[journal]] will show {{ic|no secrets: No agents were available for this request}}.}}<br />
<br />
==== Appindicator ====<br />
<br />
As of version 1.18.0 Appindicator support is [https://github.com/archlinux/svntogit-packages/commit/7640a2bd557fe84813207ef4d5e35bb5aece6c54 available] in the official {{Pkg|network-manager-applet}} package. To use nm-applet in an Appindicator environment start the applet with the following command:<br />
<br />
$ nm-applet --indicator<br />
<br />
=== networkmanager-dmenu ===<br />
<br />
Alternatively there is {{AUR|networkmanager-dmenu-git}} which is a small script to manage NetworkManager connections with [[dmenu]] or [[rofi]] instead of {{ic|nm-applet}}. It provides all essential features such as connection to existing NetworkManager wifi or wired connections, connect to new wifi connections, requests passphrase if required, connect to existing VPN connections, enable/disable networking, launch ''nm-connection-editor'' GUI, connect to Bluetooth networks.<br />
<br />
== Configuration ==<br />
<br />
NetworkManager will require some additional steps to be able run properly. Make sure you have configured {{ic|/etc/hosts}} as described in [[Network configuration#Set the hostname]] section.<br />
<br />
NetworkManager has a global configuration file at {{ic|/etc/NetworkManager/NetworkManager.conf}}. Additional configuration files can be placed in {{ic|/etc/NetworkManager/conf.d/}}. Usually no configuration needs to be done to the global defaults.<br />
<br />
After editing a configuration file, the changes can be applied by running:<br />
<br />
# nmcli general reload<br />
<br />
=== Enable NetworkManager Wait Online ===<br />
<br />
{{Out of date|{{ic|NetworkManager.service}} has {{ic|1=Also=NetworkManager-wait-online.service}} in the {{ic|[Install]}} section.[https://gitlab.freedesktop.org/NetworkManager/NetworkManager/commit/167e42a87e97ed7fb26a4263c22f1774716ac51b] If {{ic|NetworkManager.service}} was [[enable]]d before the change, it needs to be [[enable|reenabled]].}}<br />
<br />
If you have services which fail if they are started before the network is up, you may use {{ic|NetworkManager-wait-online.service}} in addition to {{ic|NetworkManager.service}}. This is, however, rarely necessary because most networked daemons start up okay, even if the network has not been configured yet.<br />
<br />
In some cases, the service will still fail to start successfully on boot due to the timeout setting in {{ic|/usr/lib/systemd/system/NetworkManager-wait-online.service}} being too short. Change the default timeout from 30 to a higher value.<br />
<br />
=== Set up PolicyKit permissions ===<br />
<br />
See [[General troubleshooting#Session permissions]] for setting up a working session.<br />
<br />
With a working session, you have several options for granting the necessary privileges to NetworkManager:<br />
<br />
* ''Option 1.'' Run a [[Polkit]] authentication agent when you log in, such as {{ic|/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1}} (part of {{Pkg|polkit-gnome}}). You will be prompted for your password whenever you add or remove a network connection.<br />
* ''Option 2.'' [[Users and groups#Group management|Add]] yourself to the {{ic|wheel}} group. You will not have to enter your password, but your user account may be granted other permissions as well, such as the ability to use [[sudo]] without entering the root password.<br />
* ''Option 3.'' [[Users and groups#Group management|Add]] yourself to the {{ic|network}} group and create the following file:<br />
<br />
{{hc|/etc/polkit-1/rules.d/50-org.freedesktop.NetworkManager.rules|<nowiki><br />
polkit.addRule(function(action, subject) {<br />
if (action.id.indexOf("org.freedesktop.NetworkManager.") == 0 && subject.isInGroup("network")) {<br />
return polkit.Result.YES;<br />
}<br />
});<br />
</nowiki>}}<br />
<br />
: All users in the {{ic|network}} group will be able to add and remove networks without a password. This will not work under [[systemd]] if you do not have an active session with ''systemd-logind''.<br />
<br />
=== Proxy settings ===<br />
<br />
NetworkManager does not directly handle proxy settings, but if you are using [[GNOME]] or [[KDE]], you could use [http://marin.jb.free.fr/proxydriver/ proxydriver] which handles proxy settings using NetworkManager's information. proxydriver is found in the package {{AUR|proxydriver}}.<br />
<br />
In order for ''proxydriver'' to be able to change the proxy settings, you would need to execute this command, as part of the GNOME startup process (see [[GNOME#Autostart]]).<br />
<br />
xhost +si:localuser:''username''<br />
<br />
See also [[Proxy settings]].<br />
<br />
=== Checking connectivity ===<br />
<br />
NetworkManager can try to reach a webserver after connecting to a network in order to determine if it is e.g behind a captive portal. The default host (configured in {{ic|/usr/lib/NetworkManager/conf.d/20-connectivity.conf}}) is [https://ping.archlinux.org ping.archlinux.org]. To use a different webserver or to disable connectivity checking, create {{ic|/etc/NetworkManager/conf.d/20-connectivity.conf}}, see {{man|5|NetworkManager.conf|CONNECTIVITY SECTION}}. Below is an example of using GNOME servers (it does not require the use of [[GNOME]]):<br />
<br />
{{hc|/etc/NetworkManager/conf.d/20-connectivity.conf|<nowiki><br />
[connectivity]<br />
uri=http://nmcheck.gnome.org/check_network_status.txt<br />
</nowiki>}}<br />
<br />
{{Note|Although automatic connectivity checks are a potential privacy leak, Arch Linux's default connectivity URL is committed to not logging any access. See [https://gitlab.archlinux.org/archlinux/infrastructure/-/commit/fabccd0f61e5dea3925e8a0c6a46d56d5750c121#a4f34381bbb18ea77bfb3dd11a8aeca707078fca_0_26].}}<br />
<br />
=== Captive portals ===<br />
<br />
{{Style|Complex scripts should not be maintained on the wiki.}}<br />
<br />
For those behind a [[Wikipedia:Captive portal|captive portal]], the desktop manager may automatically open a window asking for credentials. If your desktop does not, you can use {{Pkg|capnet-assist}} package (however, it currently it has a broken NetworkManager dispatcher script). Alternatively, you can create a NetworkManager dispatcher script with the following content:<br />
<br />
{{hc|/etc/NetworkManager/dispatcher.d/90-open_captive_portal|<nowiki><br />
#!/bin/sh -e<br />
# Script to dispatch NetworkManager events<br />
#<br />
# Runs shows a login webpage on walled garden networks.<br />
# See NetworkManager(8) for further documentation of the dispatcher events.<br />
<br />
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin<br />
<br />
if [ -x "/usr/bin/logger" ]; then<br />
logger="/usr/bin/logger -s -t captive-portal"<br />
else<br />
logger=":"<br />
fi<br />
<br />
wait_for_process() {<br />
PNAME=$1<br />
while [ -z "$(/usr/bin/pgrep $PNAME)" ]; do<br />
sleep 3;<br />
done<br />
}<br />
<br />
#launch the browser, but on boot we need to wait that nm-applet starts<br />
start_browser() {<br />
local user="$1"<br />
local display="$2"<br />
<br />
export DISPLAY="$display"<br />
wait_for_process nm-applet<br />
<br />
export XAUTHORITY="/home/$user/.Xauthority"<br />
<br />
$logger "Running browser as '$user' with display '$display' to login in captive portal"<br />
sudo -u "$user" --preserve-env=DISPLAY,XAUTHORITY -H xdg-open http://capnet.elementary.io 2>&1 > /dev/null<br />
}<br />
<br />
# Run the right scripts<br />
case "$2" in<br />
connectivity-change)<br />
$logger -p user.debug "dispatcher script triggered on connectivity change: $CONNECTIVITY_STATE"<br />
if [ "$CONNECTIVITY_STATE" = "PORTAL" ]; then<br />
# Match last column of who's output with ' :[at least one digit] '<br />
who | awk '$NF ~ /\(:[0-9]+\)/ { print $1 " " substr($NF, 2, length($NF)-2) };' | \<br />
while read user display; do<br />
start_browser $user $display || $logger -p user.err "Failed for user: '$user' display: '$display'"<br />
done<br />
fi<br />
;;<br />
*)<br />
# In a down phase<br />
exit 0<br />
;;<br />
esac<br />
</nowiki>}}<br />
<br />
You will need to [[restart]] {{ic|NetworkManager.service}} or reboot for this to start working. Once you do, the dispatcher script should open a login window once it detects you are behind a captive portal.<br />
<br />
Another solution is {{AUR|captive-browser-git}} based on Google Chrome.<br />
<br />
=== DHCP client ===<br />
<br />
By default NetworkManager uses its internal DHCP client. The internal DHCPv4 plugin is based on the [https://nettools.github.io/n-dhcp4/ nettools' n-dhcp4] library, while the internal DHCPv6 plugin is made from code based on systemd-networkd.<br />
<br />
To use ISC’s DHCP client, [[install]] {{Pkg|dhclient}}. To change the DHCP client backend, set the option {{ic|1=main.dhcp=''dhcp_client_name''}} with a configuration file in {{ic|/etc/NetworkManager/conf.d/}}. E.g.:<br />
<br />
{{hc|1=/etc/NetworkManager/conf.d/dhcp-client.conf|2=<br />
[main]<br />
dhcp=dhclient<br />
}}<br />
<br />
{{Note|<br />
* Do not enable the systemd units shipped with the {{Pkg|dhclient}} and {{Pkg|dhcpcd}} packages. They will conflict with NetworkManager, see the note in [[#Installation]] for details.<br />
* NetworkManger does not support dhcpcd ≥ 9.0.0. See {{Bug|66231}}.<br />
}}<br />
<br />
=== DNS management ===<br />
<br />
NetworkManager's DNS management is described in the GNOME project's wiki page—[https://wiki.gnome.org/Projects/NetworkManager/DNS Projects/NetworkManager/DNS].<br />
<br />
==== DNS caching and conditional forwarding ====<br />
<br />
NetworkManager has a plugin to enable DNS caching and conditional forwarding ([https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/143 previously] called "split DNS" in NetworkManager's documentation) using [[dnsmasq]] or [[systemd-resolved]]. The advantages of this setup is that DNS lookups will be cached, shortening resolve times, and DNS lookups of VPN hosts will be routed to the relevant VPN's DNS servers. This is especially useful if you are connected to more than one VPN.<br />
<br />
===== dnsmasq =====<br />
<br />
Make sure {{Pkg|dnsmasq}} has been installed. Then set {{ic|1=main.dns=dnsmasq}} with a configuration file in {{ic|/etc/NetworkManager/conf.d/}}:<br />
<br />
{{hc|/etc/NetworkManager/conf.d/dns.conf|2=<br />
[main]<br />
dns=dnsmasq<br />
}}<br />
<br />
Now run {{ic|nmcli general reload}} as root. NetworkManager will automatically start dnsmasq and add {{ic|127.0.0.1}} to {{ic|/etc/resolv.conf}}. The original DNS servers can be found in {{ic|/run/NetworkManager/no-stub-resolv.conf}}. You can verify dnsmasq is being used by doing the same DNS lookup twice with {{ic|drill example.com}} and verifying the server and query times.<br />
<br />
{{Note|<br />
* You do not need to start {{ic|dnsmasq.service}} or edit {{ic|/etc/dnsmasq.conf}}. NetworkManager will start dnsmasq without using the systemd service and without reading the dnsmasq's default configuration file(s).<br />
* The dnsmasq instance started by NetworkManager will bind to {{ic|127.0.0.1:53}}, you cannot run any other software (including {{ic|dnsmasq.service}}) on the same address and port.<br />
}}<br />
<br />
====== Custom dnsmasq configuration ======<br />
<br />
Custom configurations can be created for ''dnsmasq'' by creating configuration files in {{ic|/etc/NetworkManager/dnsmasq.d/}}. For example, to change the size of the DNS cache (which is stored in RAM):<br />
<br />
{{hc|/etc/NetworkManager/dnsmasq.d/cache.conf|2=<br />
cache-size=1000<br />
}}<br />
<br />
You can check the configuration file syntax with:<br />
<br />
dnsmasq --test --conf-file=/dev/null --conf-dir=/etc/NetworkManager/dnsmasq.d<br />
<br />
See {{man|8|dnsmasq}} for all available options.<br />
<br />
====== IPv6 ======<br />
<br />
{{Accuracy|This does not solve the issue because NetworkManager does not add {{ic|::1}} to {{ic|/etc/resolv.conf}}. Unless {{ic|@::1}} is manually passed to drill, it will still fail with {{ic|Error: error sending query: No (valid) nameservers defined in the resolver}}.}}<br />
<br />
Enabling {{ic|dnsmasq}} in NetworkManager may break IPv6-only DNS lookups (i.e. {{ic|drill -6 [hostname]}}) which would otherwise work. In order to resolve this, creating the following file will configure ''dnsmasq'' to also listen to the IPv6 loopback:<br />
<br />
{{hc|/etc/NetworkManager/dnsmasq.d/ipv6-listen.conf|2=<br />
listen-address=::1<br />
}}<br />
<br />
In addition, {{ic|dnsmasq}} also does not prioritize upstream IPv6 DNS. Unfortunately NetworkManager does not do this ([https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/936712 Ubuntu Bug]). A workaround would be to disable IPv4 DNS in the NetworkManager config, assuming one exists.<br />
<br />
====== DNSSEC ======<br />
<br />
The dnsmasq instance started by NetworkManager by default will not validate [[DNSSEC]] since it is started with the {{ic|--proxy-dnssec}} option. It will trust whatever DNSSEC information it gets from the upstream DNS server.<br />
<br />
For dnsmasq to properly validate DNSSEC, thus breaking DNS resolution with name servers that do not support it, create the following configuration file:<br />
<br />
{{hc|/etc/NetworkManager/dnsmasq.d/dnssec.conf|2=<br />
conf-file=/usr/share/dnsmasq/trust-anchors.conf<br />
dnssec<br />
}}<br />
<br />
===== systemd-resolved =====<br />
<br />
{{Expansion|NetworkManager 1.16 adds a new setting {{ic|main.systemd-resolved}}[https://gitlab.freedesktop.org/NetworkManager/NetworkManager/commit/d4eb4cb45f41b1751cacf71da558bf8f0988f383] (enabled by default). It unconditionally sends DNS configuration to systemd-resolved. Related to "Preserving resolv.conf" from [[systemd-resolved#DNS]]?}}<br />
<br />
NetworkManager can use [[systemd-resolved]] as a DNS resolver and cache. Make sure that ''systemd-resolved'' is properly configured and that {{ic|systemd-resolved.service}} is [[started]] before using it.<br />
<br />
systemd-resolved will be used automatically if {{ic|/etc/resolv.conf}} is a [[Systemd-resolved#DNS|symlink]] to {{ic|/run/systemd/resolve/stub-resolv.conf}}, {{ic|/run/systemd/resolve/resolv.conf}} or {{ic|/usr/lib/systemd/resolv.conf}}.<br />
<br />
You can enable it explicitly by setting {{ic|1=main.dns=systemd-resolved}} with a configuration file in {{ic|/etc/NetworkManager/conf.d/}}:<br />
<br />
{{hc|/etc/NetworkManager/conf.d/dns.conf|2=<br />
[main]<br />
dns=systemd-resolved<br />
}}<br />
<br />
===== DNS resolver with an openresolv subscriber =====<br />
<br />
If [[openresolv]] has a subscriber for your local [[DNS resolver]], set up the subscriber and [[#Use openresolv|configure NetworkManager to use openresolv]].<br />
<br />
Because NetworkManager advertises a single "interface" to ''resolvconf'', it is not possible to implement conditional forwarding between two NetworkManager connections. See [https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/153 NetworkManager issue 153].<br />
<br />
This can be partially mitigated if you set {{ic|1=private_interfaces="*"}} in {{ic|/etc/resolvconf.conf}}[https://roy.marples.name/projects/openresolv/configuration/]. Any queries for domains that are not in search domain list will not get forwarded. They will be handled according to the local resolver's configuration, for example, forwarded to another DNS server or resolved recursively from the DNS root.<br />
<br />
==== Custom DNS servers ====<br />
<br />
===== Setting custom global DNS servers =====<br />
<br />
To set DNS servers for all connections, specify them in {{man|5|NetworkManager.conf}} using the syntax {{ic|1=servers=''serveripaddress1'',''serveripaddress2'',''serveripaddress3''}} in a section named {{ic|[global-dns-domain-*]}}. For example:<br />
<br />
{{hc|/etc/NetworkManager/conf.d/dns-servers.conf|2=<br />
[global-dns-domain-*]<br />
servers=::1,127.0.0.1<br />
}}<br />
<br />
{{Note|<br />
* If you use [[#DNS caching and conditional forwarding|NetworkManager's dnsmasq or systemd-resolved plugin]] or [[#DNS resolver with an openresolv subscriber|openresolv subscribers]], then do not specify loopback addresses with the {{ic|1=servers=}} option, it can break DNS resolution.<br />
* The specified servers do not get sent to [[systemd-resolved]], the connection's DNS servers are used instead.<br />
}}<br />
<br />
===== Setting custom DNS servers in a connection =====<br />
<br />
====== Setting custom DNS servers in a connection (GUI) ======<br />
<br />
Setup will depend on the type of front-end used; the process usually involves right-clicking on the applet, editing (or creating) a profile, and then choosing DHCP type as ''Automatic (specify addresses)''. The DNS addresses will need to be entered and are usually in this form: {{ic|127.0.0.1, ''DNS-server-one'', ...}}.<br />
<br />
====== Setting custom DNS servers in a connection (nmcli / connection file) ======<br />
<br />
To setup DNS Servers per connection, you can use the {{ic|dns}} field (and the associated {{ic|dns-search}} and {{ic|dns-options}}) in the [[#Edit a connection|connection settings]]. <br />
<br />
If {{ic|method}} is set to {{ic|auto}} (when you use DHCP), you need to set {{ic|ignore-auto-dns}} to {{ic|yes}}.<br />
<br />
==== /etc/resolv.conf ====<br />
<br />
NetworkManager's {{ic|/etc/resolv.conf}} management mode is configured with the {{ic|main.rc-manager}} setting. {{Pkg|networkmanager}} sets it to {{ic|symlink}} as apposed to the upstream default {{ic|auto}}. The setting and its values are documented in the {{man|5|NetworkManager.conf}} man page.<br />
<br />
{{Tip|Using openresolv allows NetworkManager to coexists with other ''resolvconf'' supporting software or, for example, to run a local DNS caching and split-DNS resolver for which openresolv has a [[openresolv#Subscribers|subscriber]]. Note that conditional forwarding is [https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/153 not yet fully supported] when using NetworkManager with openresolv.}}<br />
<br />
''NetworkManager'' also offers hooks via so called dispatcher scripts that can be used to alter the {{ic|/etc/resolv.conf}} after network changes. See [[#Network services with NetworkManager dispatcher]] and {{man|8|NetworkManager}} for more information.<br />
<br />
{{Note|<br />
* If NetworkManager is configured to use either [[#dnsmasq|dnsmasq]] or [[#systemd-resolved|systemd-resolved]], then the appropriate loopback addresses will be written to {{ic|/etc/resolv.conf}}.<br />
* The {{ic|resolv.conf}} file NetworkManager writes or would write to {{ic|/etc/resolv.conf}} can be found at {{ic|/run/NetworkManager/resolv.conf}}.<br />
* A {{ic|resolv.conf}} file with the acquired name servers and search domains can be found at {{ic|/run/NetworkManager/no-stub-resolv.conf}}.<br />
}}<br />
<br />
===== Unmanaged /etc/resolv.conf =====<br />
<br />
To stop NetworkManager from touching {{ic|/etc/resolv.conf}}, set {{ic|1=main.dns=none}} with a configuration file in {{ic|/etc/NetworkManager/conf.d/}}:<br />
<br />
{{hc|/etc/NetworkManager/conf.d/dns.conf|2=<br />
[main]<br />
dns=none<br />
}}<br />
<br />
{{Tip|You might also want to set {{ic|1=main.systemd-resolved=false}}, so that NetworkManager does not send the DNS configuration to [[systemd-resolved]].}}<br />
<br />
{{Note|See [[#DNS caching and conditional forwarding]], to configure NetworkManager using other DNS backends like [[dnsmasq]] and [[systemd-resolved]], instead of using {{ic|1=main.dns=none}}.}}<br />
<br />
After that {{ic|/etc/resolv.conf}} might be a broken symlink that you will need to remove. Then, just create a new {{ic|/etc/resolv.conf}} file.<br />
<br />
===== Use openresolv =====<br />
<br />
{{Note|NetworkManager does not support using systemd-resolved's ''resolvconf'' interface ({{man|1|resolvectl|COMPATIBILITY WITH RESOLVCONF(8)}}) which is provided by {{Pkg|systemd-resolvconf}}.<br />
* Do not set {{ic|1=main.rc-manager=resolvconf}} when using [[systemd-resolved]], instead make sure to [[systemd-resolved#DNS|correctly create the /etc/resolv.conf symlink]] or [[#systemd-resolved|configure NetworkManager to use systemd-resolved explicitly]].<br />
* Make sure the {{Pkg|systemd-resolvconf}} package is not installed when systemd-resolved is not used. Unless {{ic|systemd-resolved.service}} started, it will break all networking software (not just NetworkManager) that use resolvconf.<br />
}}<br />
<br />
To configure NetworkManager to use [[openresolv]], set {{ic|1=main.rc-manager=resolvconf}} with a configuration file in {{ic|/etc/NetworkManager/conf.d/}}:<br />
<br />
{{hc|/etc/NetworkManager/conf.d/rc-manager.conf|2=<br />
[main]<br />
rc-manager=resolvconf<br />
}}<br />
<br />
=== Firewall ===<br />
<br />
You can assign a [[firewalld]] zone based on your current connection. For example a restrictive firewall when at work, and a less restrictive one when at home.<br />
<br />
This can also be done with [[#Network services with NetworkManager dispatcher|NetworkManager dispatcher]].<br />
<br />
== Network services with NetworkManager dispatcher ==<br />
<br />
There are quite a few network services that you will not want running until NetworkManager brings up an interface. NetworkManager has the ability to start services when you connect to a network and stop them when you disconnect (e.g. when using [[NFS]], [[SMB]] and [[NTPd]]).<br />
<br />
To activate the feature you need to [[enable]] and [[start]] the {{ic|NetworkManager-dispatcher.service}}.<br />
<br />
Once the service is active, scripts can be added to the {{ic|/etc/NetworkManager/dispatcher.d}} directory.<br />
<br />
Scripts must be owned by '''root''', otherwise the dispatcher will not execute them. For added security, set group [[ownership]] to root as well:<br />
<br />
# chown root:root /etc/NetworkManager/dispatcher.d/''10-script.sh''<br />
<br />
Make sure the file has correct permissions:<br />
<br />
# chmod 755 /etc/NetworkManager/dispatcher.d/''10-script.sh''<br />
<br />
The scripts will be run in alphabetical order at connection time, and in reverse alphabetical order at disconnect time. To ensure what order they come up in, it is common to use numerical characters prior to the name of the script (e.g. {{ic|10-portmap}} or {{ic|30-netfs}} (which ensures that the ''portmapper'' is up before NFS mounts are attempted).<br />
<br />
Scripts will receive the following arguments:<br />
<br />
* '''Interface name:''' e.g. {{ic|eth0}}<br />
* '''Interface status:''' ''up'' or ''down''<br />
* '''VPN status:''' ''vpn-up'' or ''vpn-down''<br />
<br />
{{Warning|If you connect to foreign or public networks, be aware of what services you are starting and what servers you expect to be available for them to connect to. You could make a security hole by starting the wrong services while connected to a public network.}}<br />
<br />
=== Avoiding the dispatcher timeout ===<br />
<br />
If the above is working, then this section is not relevant. However, there is a general problem related to running dispatcher scripts which take longer to be executed. Initially an internal timeout of three seconds only was used. If the called script did not complete in time, it was killed. Later the timeout was extended to about 20 seconds (see the [https://bugzilla.redhat.com/show_bug.cgi?id=982734 Bugtracker] for more information). If the timeout still creates the problem, a work around may be to modify the dispatcher service file {{ic|/usr/lib/systemd/system/NetworkManager-dispatcher.service}} to remain active after exit: <br />
<br />
{{hc|/etc/systemd/system/NetworkManager-dispatcher.service.d/remain_after_exit.conf|2=<br />
[Service]<br />
RemainAfterExit=yes<br />
}}<br />
<br />
Now start and enable the modified {{ic|NetworkManager-dispatcher}} service.<br />
<br />
{{Warning|Adding the {{ic|RemainAfterExit}} line to it will prevent the dispatcher from closing. Unfortunately, the dispatcher '''has''' to close before it can run your scripts again. With it the dispatcher will not time out but it also will not close, which means that the scripts will only run once per boot. Therefore, do not add the line unless the timeout is definitely causing a problem.}}<br />
<br />
=== Dispatcher examples ===<br />
<br />
==== Mount remote folder with sshfs ====<br />
<br />
As the script is run in a very restrictive environment, you have to export {{ic|SSH_AUTH_SOCK}} in order to connect to your SSH agent. There are different ways to accomplish this, see [https://bbs.archlinux.org/viewtopic.php?pid=1042030#p1042030 this message] for more information. The example below works with [[GNOME Keyring]], and will ask you for the password if not unlocked already. In case NetworkManager connects automatically on login, it is likely ''gnome-keyring'' has not yet started and the export will fail (hence the sleep). The {{ic|UUID}} to match can be found with the command {{ic|nmcli connection status}} or {{ic|nmcli connection list}}. <br />
<br />
{{bc|<nowiki><br />
#!/bin/sh<br />
USER='username'<br />
REMOTE='user@host:/remote/path'<br />
LOCAL='/local/path'<br />
<br />
interface=$1 status=$2<br />
if [ "$CONNECTION_UUID" = "</nowiki>''uuid''<nowiki>" ]; then<br />
case $status in<br />
up)<br />
SSH_AUTH_SOCK=$(find /tmp -maxdepth 1 -type s -user "$USER" -name 'ssh')<br />
export SSH_AUTH_SOCK<br />
su "$USER" -c "sshfs $REMOTE $LOCAL"<br />
;;<br />
down)<br />
fusermount -u "$LOCAL"<br />
;;<br />
esac<br />
fi<br />
</nowiki>}}<br />
<br />
==== Mounting of SMB shares ====<br />
<br />
Some [[SMB]] shares are only available on certain networks or locations (e.g. at home). You can use the dispatcher to only mount SMB shares that are present at your current location.<br />
<br />
The following script will check if we connected to a specific network and mount shares accordingly:<br />
<br />
{{hc|/etc/NetworkManager/dispatcher.d/30-mount-smb.sh|<nowiki><br />
#!/bin/sh<br />
<br />
# Find the connection UUID with "nmcli connection show" in terminal.<br />
# All NetworkManager connection types are supported: wireless, VPN, wired...<br />
if [ "$2" = "up" ]; then<br />
if [ "$CONNECTION_UUID" = "uuid" ]; then<br />
mount /your/mount/point & <br />
# add more shares as needed<br />
fi<br />
fi<br />
</nowiki>}}<br />
<br />
The following script will unmount all SMB shares before a software initiated disconnect from a specific network:<br />
<br />
{{hc|/etc/NetworkManager/dispatcher.d/pre-down.d/30-umount-smb.sh|<nowiki><br />
#!/bin/sh<br />
<br />
if [ "$CONNECTION_UUID" = "uuid" ]; then<br />
umount -a -l -t cifs<br />
fi<br />
</nowiki>}}<br />
<br />
{{Note|Make sure this script is located in the {{ic|pre-down.d}} sub-directory as shown above, otherwise it will unmount all shares on any connection state change.}}<br />
<br />
The following script will attempt to unmount all SMB shares following an unexpected disconnect from a specific network:<br />
<br />
{{hc|/etc/NetworkManager/dispatcher.d/40-umount-smb.sh|<nowiki><br />
#!/bin/sh<br />
<br />
if [ "$CONNECTION_UUID" = "uuid" ]; then<br />
if [ "$2" = "down" ]; then<br />
umount -a -l -t cifs<br />
fi<br />
fi<br />
</nowiki>}}<br />
<br />
{{Note|<br />
* Since NetworkManager 0.9.8, the ''pre-down'' and ''down'' events are not executed on shutdown or restart, see [https://bugzilla.gnome.org/show_bug.cgi?id&#61;701242 this bug report] for more info.<br />
* The previous ''umount'' scripts are still prone to leaving applications actually accessing the mount to 'hang'.<br />
}}<br />
<br />
An alternative is to use the script as seen in [[NFS#Using a NetworkManager dispatcher]]:<br />
<br />
{{hc|/etc/NetworkManager/dispatcher.d/30-smb.sh|<nowiki><br />
#!/bin/bash<br />
<br />
# Find the connection UUID with "nmcli con show" in terminal.<br />
# All NetworkManager connection types are supported: wireless, VPN, wired...<br />
WANTED_CON_UUID="CHANGE-ME-NOW-9c7eff15-010a-4b1c-a786-9b4efa218ba9"<br />
<br />
if [[ "$CONNECTION_UUID" == "$WANTED_CON_UUID" ]]; then<br />
<br />
# Script parameter $1: NetworkManager connection name, not used<br />
# Script parameter $2: dispatched event<br />
<br />
case "$2" in<br />
"up")<br />
mount -a -t cifs<br />
;;<br />
"pre-down");&<br />
"vpn-pre-down")<br />
umount -l -a -t cifs >/dev/null<br />
;;<br />
esac<br />
fi<br />
</nowiki>}}<br />
<br />
{{Note|This script ignores mounts with the {{ic|noauto}} option, remove this mount option or use {{ic|auto}} to allow the dispatcher to manage these mounts.}}<br />
<br />
Create a symlink inside {{ic|/etc/NetworkManager/dispatcher.d/pre-down/}} to catch the {{ic|pre-down}} events:<br />
<br />
# ln -s ../30-smb.sh /etc/NetworkManager/dispatcher.d/pre-down.d/30-smb.sh<br />
<br />
==== Mounting of NFS shares ====<br />
<br />
See [[NFS#Using a NetworkManager dispatcher]].<br />
<br />
==== Use dispatcher to automatically toggle wireless depending on LAN cable being plugged in ====<br />
<br />
The idea is to only turn Wi-Fi on when the LAN cable is unplugged (for example when detaching from a laptop dock), and for Wi-Fi to be automatically disabled, once a LAN cable is plugged in again. <br />
<br />
Create the following dispatcher script[https://superuser.com/questions/233448/disable-wlan-if-wired-cable-network-is-available], replacing {{ic|1=LAN_interface}} with yours.<br />
<br />
{{hc|/etc/NetworkManager/dispatcher.d/wlan_auto_toggle.sh|<nowiki><br />
#!/bin/sh<br />
<br />
if [ "$1" = "LAN_interface" ]; then<br />
case "$2" in<br />
up)<br />
nmcli radio wifi off<br />
;;<br />
down)<br />
nmcli radio wifi on<br />
;;<br />
esac<br />
fi<br />
</nowiki>}}<br />
<br />
{{Note|You can get a list of interfaces using [[#nmcli examples|nmcli]]. The ethernet (LAN) interfaces start with {{ic|en}}, e.g. {{ic|1=enp0s5}}}}<br />
<br />
==== Use dispatcher to connect to a VPN after a network connection is established ====<br />
<br />
In this example we want to connect automatically to a previously defined VPN connection after connecting to a specific Wi-Fi network. First thing to do is to create the dispatcher script that defines what to do after we are connected to the network.<br />
<br />
{{Note|This script will require {{Pkg|wireless_tools}} in order to use {{ic|iwgetid}}.}}<br />
<br />
{{hc|/etc/NetworkManager/dispatcher.d/vpn-up|<nowiki><br />
#!/bin/sh<br />
VPN_NAME="name of VPN connection defined in NetworkManager"<br />
ESSID="Wi-Fi network ESSID (not connection name)"<br />
<br />
interface=$1 status=$2<br />
case $status in<br />
up|vpn-down)<br />
if iwgetid | grep -qs ":\"$ESSID\""; then<br />
nmcli connection up id "$VPN_NAME"<br />
fi<br />
;;<br />
down)<br />
if iwgetid | grep -qs ":\"$ESSID\""; then<br />
if nmcli connection show --active | grep "$VPN_NAME"; then<br />
nmcli connection down id "$VPN_NAME"<br />
fi<br />
fi<br />
;;<br />
esac<br />
</nowiki>}}<br />
<br />
If you would like to attempt to automatically connect to VPN for all Wi-Fi networks, you can use the following definition of the ESSID: {{ic|1=ESSID=$(iwgetid -r)}}. Remember to set the script's permissions [[#Network services with NetworkManager dispatcher|accordingly]]. <br />
<br />
Trying to connect with the above script may still fail with {{ic|NetworkManager-dispatcher.service}} complaining about 'no valid VPN secrets', because of [https://developer.gnome.org/NetworkManager/0.9/secrets-flags.html the way VPN secrets are stored]. Fortunately, there are different options to give the above script access to your VPN password.<br />
<br />
1: One of them requires editing the VPN connection configuration file to make NetworkManager store the secrets by itself rather than inside a keyring [https://bugzilla.redhat.com/show_bug.cgi?id=710552 that will be inaccessible for root]: open up {{ic|/etc/NetworkManager/system-connections/''name of your VPN connection''}} and change the {{ic|password-flags}} and {{ic|secret-flags}} from {{ic|1}} to {{ic|0}}.<br />
<br />
If that alone does not work, you may have to create a {{ic|passwd-file}} in a safe location with the same permissions and ownership as the dispatcher script, containing the following:<br />
<br />
{{hc|/path/to/passwd-file|<br />
vpn.secrets.password:YOUR_PASSWORD<br />
}}<br />
<br />
The script must be changed accordingly, so that it gets the password from the file:<br />
<br />
{{hc|/etc/NetworkManager/dispatcher.d/vpn-up|<nowiki><br />
#!/bin/sh<br />
VPN_NAME="name of VPN connection defined in NetworkManager"<br />
ESSID="Wi-Fi network ESSID (not connection name)"<br />
<br />
interface=$1 status=$2<br />
case $status in<br />
up|vpn-down)<br />
if iwgetid | grep -qs ":\"$ESSID\""; then<br />
nmcli connection up id "$VPN_NAME" passwd-file /path/to/passwd-file<br />
fi<br />
;;<br />
down)<br />
if iwgetid | grep -qs ":\"$ESSID\""; then<br />
if nmcli connection show --active | grep "$VPN_NAME"; then<br />
nmcli connection down id "$VPN_NAME"<br />
fi<br />
fi<br />
;;<br />
esac<br />
</nowiki>}}<br />
<br />
2: Alternatively, change the {{ic|password-flags}} and put the password directly in the configuration file adding the section {{ic|vpn-secrets}}:<br />
<br />
[vpn]<br />
....<br />
password-flags=0<br />
<br />
[vpn-secrets]<br />
password=''your_password''<br />
<br />
{{Note|It may now be necessary to re-open the NetworkManager connection editor and save the VPN passwords/secrets again.}}<br />
<br />
==== Use dispatcher to disable IPv6 on VPN provider connections ====<br />
<br />
Many [[:Category:VPN providers|commercial VPN providers]] support only IPv4. That means all IPv6 traffic bypasses the VPN and renders it virtually useless. To avoid this, dispatcher can be used to disable all IPv6 traffic for the time a VPN connection is up.<br />
<br />
{{hc|/etc/NetworkManager/dispatcher.d/10-vpn-ipv6|<nowiki><br />
#!/bin/sh<br />
<br />
case "$2" in<br />
vpn-up)<br />
echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6<br />
;;<br />
vpn-down)<br />
echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6<br />
;;<br />
esac<br />
</nowiki>}}<br />
<br />
==== OpenNTPD ====<br />
<br />
See [[OpenNTPD#Using NetworkManager dispatcher]].<br />
<br />
== Testing ==<br />
<br />
NetworkManager applets are designed to load upon login so no further configuration should be necessary for most users. If you have already disabled your previous network settings and disconnected from your network, you can now test if NetworkManager will work. The first step is to [[start]] {{ic|NetworkManager.service}}.<br />
<br />
Some applets will provide you with a {{ic|.desktop}} file so that the NetworkManager applet can be loaded through the application menu. If it does not, you are going to either have to discover the command to use or logout and login again to start the applet. Once the applet is started, it will likely begin polling network connections with for auto-configuration with a DHCP server.<br />
<br />
To start the GNOME applet in non-xdg-compliant window managers like [[awesome]]:<br />
<br />
nm-applet --sm-disable &<br />
<br />
For static IP addresses, you will have to configure NetworkManager to understand them. The process usually involves right-clicking the applet and selecting something like 'Edit Connections'.<br />
<br />
== Tips and tricks ==<br />
<br />
=== Encrypted Wi-Fi passwords ===<br />
<br />
By default, NetworkManager stores passwords in clear text in the connection files at {{ic|/etc/NetworkManager/system-connections/}}. To print the stored passwords, use the following command:<br />
<br />
# grep -r '^psk=' /etc/NetworkManager/system-connections/<br />
<br />
The passwords are accessible to the root user in the filesystem and to users with access to settings via the GUI (e.g. {{ic|nm-applet}}). <br />
<br />
It is preferable to save the passwords in encrypted form in a keyring instead of clear text. The downside of using a keyring is that the connections have to be set up for each user.<br />
<br />
==== Using GNOME Keyring ====<br />
<br />
The keyring daemon has to be started and the keyring needs to be unlocked for the following to work.<br />
<br />
Furthermore, NetworkManager needs to be configured not to store the password for all users. Using GNOME {{ic|nm-applet}}, run {{ic|nm-connection-editor}} from a terminal, select a network connection, click {{ic|Edit}}, select the {{ic|Wifi-Security}} tab and click on the right icon of password and check {{ic|Store the password only for this user}}.<br />
<br />
==== Using KDE Wallet ====<br />
<br />
Using KDE's {{Pkg|plasma-nm}}, click the applet, click on the top right {{ic|Settings}} icon, click on a network connection, in the {{ic|General settings}} tab, untick {{ic|all users may connect to this network}}. If the option is ticked, the passwords will still be stored in clear text, even if a keyring daemon is running.<br />
<br />
If the option was selected previously and you un-tick it, you may have to use the {{ic|reset}} option first to make the password disappear from the file. Alternatively, delete the connection first and set it up again.<br />
<br />
=== Sharing internet connection over Wi-Fi ===<br />
<br />
You can share your internet connection (e.g. 3G or wired) with a few clicks. Please note that a [[firewall]] may interfere with internet sharing.<br />
<br />
You will need a Wi-Fi card which supports AP mode, see [[Software access point#Wi-Fi device must support AP mode]] for details.<br />
<br />
[[Install]] the {{Pkg|dnsmasq}} package to be able to actually share the connection.<br />
<br />
Create the shared connection:<br />
<br />
* Click on applet and choose ''Create new wireless network''.<br />
* Follow wizard (choose WPA2 or higher, be sure to use at least 8 character long password, lower lengths will fail).<br />
** Choose either [[Fedora:Features/RealHotspot|Hotspot]] or Ad-hoc as Wi-Fi mode.<br />
<br />
The connection will be saved and remain stored for the next time you need it.<br />
<br />
{{Note|Android does not support connecting to Ad-hoc networks. To share a connection with Android use infrastructure mode (i.e. set Wi-Fi mode to "Hotspot").}}<br />
<br />
=== Sharing internet connection over Ethernet ===<br />
<br />
Scenario: your device has internet connection over wi-fi and you want to share the internet connection to other devices over ethernet.<br />
<br />
Requirements:<br />
<br />
* [[Install]] the {{Pkg|dnsmasq}} package to be able to actually share the connection.<br />
* Your internet connected device and the other devices are connected over a suitable ethernet cable (this usually means a cross over cable or a switch in between).<br />
* Internet sharing is not blocked by a [[firewall]].<br />
<br />
Steps:<br />
<br />
{{Style|{{Pkg|nm-connection-editor}} is not a dependency of {{Pkg|networkmanager}} and needs to be installed separately.}}<br />
<br />
* Run {{ic|nm-connection-editor}} from terminal.<br />
* Add a new ethernet connection.<br />
* Give it some sensible name. For example "Shared Internet"<br />
* Go to "IPv4 Settings".<br />
* For "Method:" select "Shared to other computers".<br />
* Save<br />
<br />
Now you should have a new option "Shared Internet" under the Wired connections in NetworkManager.<br />
<br />
=== Checking if networking is up inside a cron job or script ===<br />
<br />
{{Out of date|''nm-tool'' was remove from NetworkManager for long time now[https://gitlab.freedesktop.org/NetworkManager/NetworkManager/commit/bb8c75bd536d4f8fb80a4366025a279078f0ec81]. ''nmcli'' should be used instead.}}<br />
<br />
Some ''cron'' jobs require networking to be up to succeed. You may wish to avoid running these jobs when the network is down. To accomplish this, add an '''if''' test for networking that queries NetworkManager's ''nm-tool'' and checks the state of networking. The test shown here succeeds if any interface is up, and fails if they are all down. This is convenient for laptops that might be hardwired, might be on wireless, or might be off the network.<br />
<br />
{{bc|<nowiki><br />
if [ $(nm-tool|grep State|cut -f2 -d' ') == "connected" ]; then<br />
#Whatever you want to do if the network is online<br />
else<br />
#Whatever you want to do if the network is offline - note, this and the else above are optional<br />
fi<br />
</nowiki>}}<br />
<br />
This useful for a {{ic|cron.hourly}} script that runs ''fpupdate'' for the F-Prot virus scanner signature update, as an example. Another way it might be useful, with a little modification, is to differentiate between networks using various parts of the output from ''nm-tool''; for example, since the active wireless network is denoted with an asterisk, you could grep for the network name and then grep for a literal asterisk.<br />
<br />
=== Connect to network with secret on boot ===<br />
<br />
By default, NetworkManager will not connect to networks requiring a secret automatically on boot. This is because it locks such connections to the user who makes it by default, only connecting after they have logged in. To change this, do the following:<br />
<br />
# Right click on the {{ic|nm-applet}} icon in your panel and select Edit Connections and open the Wireless tab<br />
# Select the connection you want to work with and click the Edit button<br />
# Check the boxes “Connect Automatically” and “Available to all users”<br />
# Additionally, ensure that under "Wi-Fi Security", "Store password for all users (not encrypted)" is selected<br />
<br />
Log out and log back in to complete.<br />
<br />
=== OpenConnect with password in KWallet ===<br />
<br />
While you may type both values at connection time, {{Pkg|plasma-nm}} 0.9.3.2-1 and above are capable of retrieving OpenConnect username and password directly from [[KWallet]].<br />
<br />
Open "KDE Wallet Manager" and look up your OpenConnect VPN connection under "Network Management|Maps". Click "Show values" and <br />
enter your credentials in key "VpnSecrets" in this form (replace ''username'' and ''password'' accordingly):<br />
<br />
form:main:username%SEP%''username''%SEP%form:main:password%SEP%''password''<br />
<br />
Next time you connect, username and password should appear in the "VPN secrets" dialog box.<br />
<br />
=== Ignore specific devices ===<br />
<br />
Sometimes it may be desired that NetworkManager ignores specific devices and does not try to configure addresses and routes for them. You can quickly and easily ignore devices by MAC or interface-name by using the following in {{ic|/etc/NetworkManager/conf.d/unmanaged.conf}}:<br />
<br />
[keyfile]<br />
unmanaged-devices=mac:00:22:68:1c:59:b1;mac:00:1E:65:30:D1:C4;interface-name:eth0<br />
<br />
After editing the file, run {{ic|nmcli general reload}} as root. Afterwards you should be able to configure interfaces without NetworkManager altering what you have set.<br />
<br />
=== Configuring MAC address randomization ===<br />
<br />
{{Note|1=Disabling MAC address randomization may be needed to get (stable) link connection [https://bbs.archlinux.org/viewtopic.php?id=220101] and/or networks that restrict devices based on their MAC Address or have a limit network capacity.}}<br />
<br />
MAC randomization can be used for increased privacy by not disclosing your real MAC address to the network.<br />
<br />
NetworkManager supports two types MAC Address Randomization: randomization during scanning, and for network connections. Both modes can be configured by modifying {{ic|/etc/NetworkManager/NetworkManager.conf}} or by creating a separate configuration file in {{ic|/etc/NetworkManager/conf.d/}} which is recommended since the aforementioned config file may be overwritten by NetworkManager.<br />
<br />
Randomization during Wi-Fi scanning is enabled by default, but it may be disabled by adding the following lines to {{ic|/etc/NetworkManager/NetworkManager.conf}} or a dedicated configuration file under {{ic|/etc/NetworkManager/conf.d}}:<br />
<br />
{{hc|/etc/NetworkManager/conf.d/wifi_rand_mac.conf|2=<br />
[device]<br />
wifi.scan-rand-mac-address=no<br />
}}<br />
<br />
MAC randomization for network connections can be set to different modes for both wireless and ethernet interfaces. See the [https://blogs.gnome.org/thaller/2016/08/26/mac-address-spoofing-in-networkmanager-1-4-0/ GNOME blog post] for more details on the different modes. <br />
<br />
In terms of MAC randomization the most important modes are {{ic|stable}} and {{ic|random}}. {{ic|stable}} generates a random MAC address when you connect to a new network and associates the two permanently. This means that you will use the same MAC address every time you connect to that network. In contrast, {{ic|random}} will generate a new MAC address every time you connect to a network, new or previously known. You can configure the MAC randomization by adding the desired configuration under {{ic|/etc/NetworkManager/conf.d}}:<br />
<br />
{{hc|/etc/NetworkManager/conf.d/wifi_rand_mac.conf|2=<br />
[device-mac-randomization]<br />
# "yes" is already the default for scanning<br />
wifi.scan-rand-mac-address=yes<br />
<br />
[connection-mac-randomization]<br />
# Randomize MAC for every ethernet connection<br />
ethernet.cloned-mac-address=random<br />
# Generate a random MAC for each WiFi and associate the two permanently.<br />
wifi.cloned-mac-address=stable<br />
}}<br />
<br />
See the following [https://blogs.gnome.org/thaller/2016/08/26/mac-address-spoofing-in-networkmanager-1-4-0/ GNOME blog post] for more details.<br />
<br />
=== Enable IPv6 Privacy Extensions ===<br />
<br />
See [[IPv6#NetworkManager]].<br />
<br />
=== Working with wired connections ===<br />
<br />
By default, NetworkManager generates a connection profile for each wired ethernet connection it finds. At the point when generating the connection, it does not know whether there will be more ethernet adapters available. Hence, it calls the first wired connection "Wired connection 1". You can avoid generating this connection, by configuring {{ic|no-auto-default}} (see {{man|5|NetworkManager.conf}}), or by simply deleting it. Then NetworkManager will remember not to generate a connection for this interface again.<br />
<br />
You can also edit the connection (and persist it to disk) or delete it. NetworkManager will not re-generate a new connection. Then you can change the name to whatever you want. You can use something like nm-connection-editor for this task.<br />
<br />
=== Using iwd as the Wi-Fi backend ===<br />
<br />
{{Note|1=Consider [https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues?scope=all&utf8=%E2%9C%93&state=opened&search=iwd existing issues] before switching to iwd.}}<br />
<br />
Enable the [https://iwd.wiki.kernel.org/networkmanager experimental] [[iwd]] backend creating the following configuration file:<br />
<br />
{{hc|/etc/NetworkManager/conf.d/wifi_backend.conf|2=<br />
[device]<br />
wifi.backend=iwd<br />
}}<br />
<br />
Alternatively, you can install {{AUR|networkmanager-iwd}}, a modified package configured to build ''NetworkManager'' working exclusively with ''iwd'', with the main difference being that ''iwd'' is required and ''wpa_supplicant'' can be uninstalled after building.<br />
<br />
=== Running in a network namespace ===<br />
<br />
If you would like to run NetworkManager inside a network namespace (e.g., to manage a specific device which should be use by selected applications), bring the device down before moving it to the namespace:<br />
<br />
$ ip link set dev ''MY_DEVICE'' down<br />
$ ip link set dev ''MY_DEVICE'' netns ''MY_NAMESPACE''<br />
$ ip netns exec ''MY_NAMESPACE'' NetworkManager<br />
...<br />
$ ip netns exec ''MY_NAMESPACE'' killall NetworkManager<br />
<br />
otherwise NetworkManager will later fail to establish the connection with a {{ic|device is strictly unmanaged}} error.<br />
<br />
=== Automatically connect to VPN ===<br />
<br />
NetworkManager can be set to automatically connect to a VPN when connecting to the internet, on a per network basis. The VPN connection itself can be added in GNOME's NetworkManager front-end, but to make it automatically use the VPN {{ic|nmcli}} must be used. Other front-ends might not have this limitation.<br />
<br />
First, make sure to make the VPN connection available to all users. In the GNOME this is a matter of checking a box under the {{ic|details}} tab. Under the {{ic|Identity}} tab, in the password field, click the icon on the right side in the field, and set it to {{ic|Store the password for all users}}.<br />
<br />
Then find the UUID of the VPN connection, and add that to {{ic|connection.secondaries}} of the Internet connection:<br />
<br />
# UUID=$(nmcli --get-values connection.uuid connection show ''name-of-VPN-connection'')<br />
# nmcli connection modify ''name-of-Internet-connection'' connection.secondaries "$UUID"<br />
<br />
Now when NetworkManager is restarted and you connect to the Internet connection you have configured, you should automatically get connected to the VPN.<br />
<br />
== Troubleshooting ==<br />
<br />
=== No prompt for password of secured Wi-Fi networks ===<br />
<br />
When trying to connect to a secured Wi-Fi network, no prompt for a password is shown and no connection is established. This happens when no keyring package is installed. An easy solution is to install {{Pkg|gnome-keyring}}. If you want the passwords to be stored in encrypted form, follow [[GNOME Keyring]] to set up the ''gnome-keyring-daemon''.<br />
<br />
=== Network management disabled ===<br />
<br />
When NetworkManager shuts down but the pid (state) file is not removed, you will see a {{ic|Network management disabled}} message. If this happens, remove the file manually:<br />
<br />
# rm /var/lib/NetworkManager/NetworkManager.state<br />
<br />
=== Problems with internal DHCP client ===<br />
<br />
If you have problems with getting an IP address using the internal DHCP client, consider using another DHCP client, see [[#DHCP client]] for instructions. This workaround might solve problems in big wireless networks like eduroam.<br />
<br />
=== DHCP problems with dhclient ===<br />
<br />
If you have problems with getting an IP address via DHCP, try to add the following to your {{ic|/etc/dhclient.conf}}:<br />
<br />
interface "eth0" {<br />
send dhcp-client-identifier 01:''aa:bb:cc:dd:ee:ff'';<br />
}<br />
<br />
Where {{ic|''aa:bb:cc:dd:ee:ff''}} is the MAC address of this NIC. The MAC address can be found using the {{ic|ip link show ''interface''}} command from the {{Pkg|iproute2}} package.<br />
<br />
=== 3G modem not detected ===<br />
<br />
See [[USB 3G Modem#NetworkManager]].<br />
<br />
=== Switching off WLAN on laptops ===<br />
<br />
Sometimes NetworkManager will not work when you disable your Wi-Fi adapter with a switch on your laptop and try to enable it again afterwards. This is often a problem with ''rfkill''. To check if the driver notifies ''rfkill'' about the wireless adapter's status, use:<br />
<br />
$ watch -n1 rfkill list all<br />
<br />
If one identifier stays blocked after you switch on the adapter you could try to manually unblock it with (where X is the number of the identifier provided by the above output):<br />
<br />
# rfkill event unblock X<br />
<br />
=== Static IP address settings revert to DHCP ===<br />
<br />
Due to an unresolved bug, when changing default connections to a static IP address, {{ic|nm-applet}} may not properly store the configuration change, and will revert to automatic DHCP.<br />
<br />
To work around this issue you have to edit the default connection (e.g. "Auto eth0") in {{ic|nm-applet}}, change the connection name (e.g. "my eth0"), uncheck the "Available to all users" checkbox, change your static IP address settings as desired, and click '''Apply'''. This will save a new connection with the given name.<br />
<br />
Next, you will want to make the default connection not connect automatically. To do so, run {{ic|nm-connection-editor}} ('''not''' as root). In the connection editor, edit the default connection (e.g. "Auto eth0") and uncheck "Connect automatically". Click '''Apply''' and close the connection editor.<br />
<br />
=== Cannot edit connections as normal user ===<br />
<br />
See [[#Set up PolicyKit permissions]].<br />
<br />
=== Forget hidden wireless network ===<br />
<br />
Since hidden networks are not displayed in the selection list of the Wireless view, they cannot be forgotten (removed) with the GUI. You can delete one with the following command:<br />
<br />
# rm /etc/NetworkManager/system-connections/''SSID''<br />
<br />
This works for any other connection.<br />
<br />
=== VPN not working in GNOME ===<br />
<br />
When setting up OpenConnect or vpnc connections in NetworkManager while using GNOME, you will sometimes never see the dialog box pop up and the following error appears in {{ic|/var/log/errors.log}}:<br />
<br />
localhost NetworkManager[399]: <error> [1361719690.10506] [nm-vpn-connection.c:1405] get_secrets_cb(): Failed to request VPN secrets #3: (6) No agents were available for this request.<br />
<br />
This is caused by the GNOME NM Applet expecting dialog scripts to be at {{ic|/usr/lib/gnome-shell}}, when NetworkManager's packages put them in {{ic|/usr/lib/networkmanager}}.<br />
As a "temporary" fix (this bug has been around for a while now), make the following symlink(s):<br />
<br />
* For OpenConnect: {{ic|ln -s /usr/lib/networkmanager/nm-openconnect-auth-dialog /usr/lib/gnome-shell/}}<br />
* For VPNC (i.e. Cisco VPN): {{ic|ln -s /usr/lib/networkmanager/nm-vpnc-auth-dialog /usr/lib/gnome-shell/}}<br />
<br />
This may need to be done for any other NM VPN plugins as well, but these are the two most common.<br />
<br />
=== Unable to connect to visible European wireless networks ===<br />
<br />
WLAN chips are shipped with a default [[Wireless network configuration#Respecting the regulatory domain|regulatory domain]]. If your access point does not operate within these limitations, you will not be able to connect to the network. Fixing this is easy:<br />
<br />
# [[Install]] {{Pkg|crda}}<br />
# Uncomment the correct Country Code in {{ic|/etc/conf.d/wireless-regdom}}<br />
# Reboot the system, because the setting is only read on boot<br />
<br />
=== Automatic connect to VPN on boot is not working ===<br />
<br />
The problem occurs when the system (i.e. NetworkManager running as the root user) tries to establish a VPN connection, but the password is not accessible because it is stored in the GNOME keyring of a particular user. <br />
<br />
A solution is to keep the password to your VPN in plaintext, as described in step (2.) of [[#Use dispatcher to connect to a VPN after a network connection is established]]. <br />
<br />
You do not need to use the dispatcher described in step (1.) to auto-connect anymore, if you use the new "auto-connect VPN" option from the {{ic|nm-applet}} GUI.<br />
<br />
=== Systemd Bottleneck ===<br />
<br />
Over time the log files ({{ic|/var/log/journal}}) can become very large. This can have a big impact on boot performance when using NetworkManager, see: [[Systemd#Boot time increasing over time]].<br />
<br />
=== Regular network disconnects, latency and lost packets (WiFi) ===<br />
<br />
NetworkManager does a scan every 2 minutes.<br />
<br />
Some WiFi drivers have issues when scanning for base stations whilst connected/associated. Symptoms include VPN disconnects/reconnects and lost packets, web pages failing to load and then refresh fine.<br />
<br />
Running {{ic|journalctl -f}} will indicate that this is taking place, messages like the following will be contained in the logs at regular intervals.<br />
<br />
NetworkManager[410]: <info> (wlp3s0): roamed from BSSID 00:14:48:11:20:CF (my-wifi-name) to (none) ((none))<br />
<br />
There is a patched version of NetworkManager which should prevent this type of scanning: {{AUR|networkmanager-noscan}}.<br />
<br />
Alternatively, if roaming is not important, the periodic scanning behavior can be disabled by locking the BSSID of the access point in the WiFi connection profile.<br />
<br />
=== Unable to turn on wi-fi with Lenovo laptop (IdeaPad, Legion, etc.) ===<br />
<br />
There is an issue with the {{ic|ideapad_laptop}} module on some Lenovo models due to the wi-fi driver incorrectly reporting a soft block. The card can still be manipulated with {{ic|netctl}}, but managers like NetworkManager break. You can verify that this is the problem by checking the output of {{ic|rfkill list}} after toggling your hardware switch and seeing that the soft block persists.<br />
<br />
{{Accuracy|Try to use {{ic|rfkill.default_state}} and {{ic|rfkill.master_switch_mode}} (see [https://github.com/torvalds/linux/blob/master/Documentation/admin-guide/kernel-parameters.txt kernel-parameters.txt]) to fix the rfkill problem.}}<br />
<br />
[[modprobe|Unloading]] the {{ic|ideapad_laptop}} module should fix this. ('''warning''': this may disable the laptop keyboard and touchpad also!).<br />
<br />
=== Turn off hostname sending ===<br />
<br />
NetworkManager by default sends the hostname to the DHCP server. Hostname sending can only be disabled per connection not globally ([https://bugzilla.gnome.org/show_bug.cgi?id=768076 GNOME Bug 768076]).<br />
<br />
To disable sending your hostname to the DHCP server for a specific connection, add the following to your network connection file:<br />
<br />
{{hc|/etc/NetworkManager/system-connections/''your_connection_file''|2=<br />
...<br />
[ipv4]<br />
dhcp-send-hostname=false<br />
...<br />
[ipv6]<br />
dhcp-send-hostname=false<br />
...<br />
}}<br />
<br />
=== nm-applet disappears in i3wm ===<br />
<br />
If you use the {{ic|xfce4-notifyd.service}} for notifications you must [[edit]] the unit and add the following:<br />
<br />
{{hc|/etc/systemd/user/xfce4-notifyd.service.d/display_env.conf|2=<br />
[Service]<br />
Environment="DISPLAY=:0.0"<br />
}}<br />
<br />
After reloading the daemons [[restart]] {{ic|xfce4-notifyd.service}}. Exit i3 and start it back up again and the applet should show on the tray.<br />
<br />
=== nm-applet tray icons display wrongly ===<br />
<br />
Currently the tray icons of nm-applet are drawn on top of one another, i.e. the icon displaying wireless strength might show on top of the icon indicating no wired connection.<br />
This is apparently a GTK3 bug/problem: https://gitlab.gnome.org/GNOME/gtk/issues/1280 .<br />
<br />
A patched version of GTK3 exists in AUR, which apparently fixes the tray icon bug: {{AUR|gtk3-classic}}.<br />
<br />
=== Unit dbus-org.freedesktop.resolve1.service not found ===<br />
<br />
If {{ic|systemd-resolved.service}} is not started, NetworkManager will try to start it using D-Bus and fail:<br />
<br />
dbus-daemon[991]: [system] Activating via systemd: service name='org.freedesktop.resolve1' unit='dbus-org.freedesktop.resolve1.service' requested by ':1.23' (uid=0 pid=1012 comm="/usr/bin/NetworkManager --no-daemon ")<br />
dbus-daemon[991]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.resolve1.service': Unit dbus-org.freedesktop.resolve1.service not found.<br />
dbus-daemon[991]: [system] Activating via systemd: service name='org.freedesktop.resolve1' unit='dbus-org.freedesktop.resolve1.service' requested by ':1.23' (uid=0 pid=1012 comm="/usr/bin/NetworkManager --no-daemon ")<br />
<br />
This is because NetworkManager will try to send DNS information to [[systemd-resolved]] regardless of the {{ic|1=main.dns=}} setting in {{man|5|NetworkManager.conf}}.[https://gitlab.freedesktop.org/NetworkManager/NetworkManager/commit/d4eb4cb45f41b1751cacf71da558bf8f0988f383]<br />
<br />
This can be disabled with a configuration file in {{ic|/etc/NetworkManager/conf.d/}}:<br />
<br />
{{hc|/etc/NetworkManager/conf.d/no-systemd-resolved.conf|2=<br />
[main]<br />
systemd-resolved=false<br />
}}<br />
<br />
See {{Bug|62138}}.<br />
<br />
=== Secrets were required, but not provided ===<br />
<br />
If you attempt to connect to a network using {{ic|nmcli device wifi connect ''SSID'' password ''password''}} and received the following error:<br />
<br />
Error: Connection activation failed: (7) Secrets were required, but not provided<br />
<br />
The error can be resolved by deleting the connection profile and creating a new one:<br />
<br />
$ nmcli connection delete ''SSID''<br />
$ nmcli device wifi connect ''SSID'' password ''password''<br />
<br />
You can also try disabling MAC address randomization:<br />
<br />
{{hc|1=/etc/NetworkManager/NetworkManager.conf|2=<br />
[device]<br />
...<br />
wifi.scan-rand-mac-address=no<br />
...<br />
}}<br />
<br />
=== WPA Enterprise connection with NetworkManager ===<br />
<br />
If you try to connect to an WPA Enterprise network like 'eduroam' with NetworkManager with the [[iwd]] backend then you will get the following error from NetworkManager:<br />
<br />
Connection 'eduroam' is not avialable on device wlan0 because profile is not compatible with device (802.1x connections must have IWD provisioning files)<br />
<br />
This is because NetworkManager can not configure a WPA Enterprise network. Therefore you have to configure it using an iwd config file {{ic|/var/lib/iwd/''essid''.8021x}} like described in [[iwd#WPA Enterprise]].<br />
<br />
=== Failed to request VPN secrets ===<br />
<br />
If you get this error:<br />
Failed to request VPN secrets #1: No agents were available for this request.<br />
<br />
It is either because the password is empty or you have to [[#Set up PolicyKit permissions|set up PolicyKit permissions]].<br />
<br />
== See also ==<br />
<br />
* [https://blogs.gnome.org/dcbw/2015/02/16/networkmanager-for-administrators-part-1/ NetworkManager for Administrators Part 1]<br />
* [[Wikipedia:NetworkManager]]</div>ENV25