https://wiki.archlinux.org/api.php?action=feedcontributions&user=Zlatin&feedformat=atomArchWiki - User contributions [en]2024-03-29T12:42:34ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Lenovo_ThinkPad_T480s&diff=583997Lenovo ThinkPad T480s2019-09-27T12:19:29Z<p>Zlatin: Removed broken link to AUR package lenovo-throttling-fix-git</p>
<hr />
<div>[[Category:Lenovo]]<br />
[[ja:Lenovo ThinkPad T480s]]<br />
{| class="wikitable" style="float: right;"<br />
| '''Device''' || '''Status''' <br />
|-<br />
| [[Intel graphics]] || {{Yes}} <br />
|-<br />
| [[Wireless]] || {{Yes}}<br />
|-<br />
| [[ALSA]] || {{Y|no beep}}<br />
|-<br />
| [[TrackPoint]] || {{Yes}}<br />
|-<br />
| [[Touchpad]] || {{Yes}}<br />
|-<br />
| [[Webcam]] || {{Yes}}<br />
|-<br />
| Fingerprint Sensor || {{No}}<br />
|-<br />
| [[ThinkPad mobile Internet|Mobile Broadband]] || {{Yes}}<br />
|-<br />
| [[Bluetooth]] || {{Yes}}<br />
|-<br />
| Smartcard Reader || {{Yes}}<br />
|-<br />
| PrivacyGuard || {{No}}<br />
|-<br />
|}<br />
<br />
This article covers the installation and configuration of Arch Linux on a Lenovo T480s laptop. Everything seems to work pretty much out the box.<br />
<br />
For a general overview of laptop-related articles and recommendations, see [[Laptop]].<br />
<br />
== Hardware ==<br />
<br />
Using kernel 4.15.7-1-ARCH.<br />
<br />
Release Date: 01/22/2018<br />
Product Name: 20L7CTO1WW<br />
SKU Number: LENOVO_MT_20L7_BU_Think_FM_ThinkPad T480s<br />
Product Name: 20L7CTO1WW<br />
<br />
{{ic|lspci}} returns something like:<br />
<br />
00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v6/7th Gen Core Processor Host Bridge/DRAM Registers (rev 08)<br />
00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 620 (rev 07)<br />
00:04.0 Signal processing controller: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Thermal Subsystem (rev 08)<br />
00:08.0 System peripheral: Intel Corporation Xeon E3-1200 v5/v6 / E3-1500 v5 / 6th/7th Gen Core Processor Gaussian Mixture Model<br />
00:14.0 USB controller: Intel Corporation Sunrise Point-LP USB 3.0 xHCI Controller (rev 21)<br />
00:14.2 Signal processing controller: Intel Corporation Sunrise Point-LP Thermal subsystem (rev 21)<br />
00:15.0 Signal processing controller: Intel Corporation Sunrise Point-LP Serial IO I2C Controller #0 (rev 21)<br />
00:16.0 Communication controller: Intel Corporation Sunrise Point-LP CSME HECI #1 (rev 21)<br />
00:1c.0 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port #1 (rev f1)<br />
00:1c.4 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port #5 (rev f1)<br />
00:1c.6 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port #7 (rev f1)<br />
00:1d.0 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port #9 (rev f1)<br />
00:1f.0 ISA bridge: Intel Corporation Device 9d4e (rev 21)<br />
00:1f.2 Memory controller: Intel Corporation Sunrise Point-LP PMC (rev 21)<br />
00:1f.3 Audio device: Intel Corporation Sunrise Point-LP HD Audio (rev 21)<br />
00:1f.4 SMBus: Intel Corporation Sunrise Point-LP SMBus (rev 21)<br />
00:1f.6 Ethernet controller: Intel Corporation Ethernet Connection (4) I219-V (rev 21)<br />
04:00.0 PCI bridge: Intel Corporation JHL6240 Thunderbolt 3 Bridge (Low Power) [Alpine Ridge LP 2016] (rev 01)<br />
05:00.0 PCI bridge: Intel Corporation JHL6240 Thunderbolt 3 Bridge (Low Power) [Alpine Ridge LP 2016] (rev 01)<br />
05:01.0 PCI bridge: Intel Corporation JHL6240 Thunderbolt 3 Bridge (Low Power) [Alpine Ridge LP 2016] (rev 01)<br />
05:02.0 PCI bridge: Intel Corporation JHL6240 Thunderbolt 3 Bridge (Low Power) [Alpine Ridge LP 2016] (rev 01)<br />
06:00.0 System peripheral: Intel Corporation JHL6240 Thunderbolt 3 NHI (Low Power) [Alpine Ridge LP 2016] (rev 01)<br />
3c:00.0 USB controller: Intel Corporation Device 15c1 (rev 01)<br />
3d:00.0 Network controller: Intel Corporation Wireless 8265 / 8275 (rev 78)<br />
3e:00.0 Non-Volatile memory controller: Samsung Electronics Co Ltd Device a808<br />
<br />
<br />
{{ic|lsusb}} returns something like:<br />
<br />
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub<br />
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<br />
Bus 002 Device 013: ID 0bda:0316 Realtek Semiconductor Corp. <br />
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub<br />
Bus 001 Device 004: ID 5986:2113 Acer, Inc <br />
Bus 001 Device 003: ID 8087:0a2b Intel Corp. <br />
Bus 001 Device 005: ID 046d:c246 Logitech, Inc. Gaming Mouse G300<br />
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<br />
<br />
=== Fingerprint reader ===<br />
Fingerprint sensor 06cb:009a is not supported by libfprint right now. There is a project to reverse enginer windows driver - https://github.com/nmikhailov/Validity90 .<br />
<br />
== Powersaving ==<br />
Without special configuration and with default firmware settings, power usage is a bit high (around 7,5W in idle). There are a few knobs to improve battery life:<br />
<br />
{{Warning|Changing Thunderbolt BIOS options has been reported to irreversibly brick ThinkPads [https://forums.lenovo.com/t5/ThinkPad-P-and-W-Series-Mobile/Lenovo-P52-bricked-by-selecting-BIOS-thunderbolt-support-for/td-p/4207538] [https://www.notebookcheck.net/Some-recent-ThinkPads-can-be-destroyed-by-changing-a-UEFI-BIOS-setting.346156.0.html] [https://www.reddit.com/r/thinkpad/comments/9qmqd2/thinkpad_p1_serious_issue_with_bricked_bios/]. This is a BIOS bug. Until there is more information available on that matter (or a fix underway), use these options with care.}} <br />
* Set "Thunderbolt BIOS Assist Mode" to "Enabled" in the EFI firmware interface. This seems to reduce number of idle wakeups.<br />
* Disable unused peripherals under "Security" -> "I/O port access" in the firmware. This especially applies to the SD/MMC-cardreader, which seems to drain some power even when idle<br />
<br />
As of Kernel 4.15, DisplayPort PSR (Panel self refresh) is disabled by default and broken when forcibly enabled (system hangs after a few seconds, display lag). 4.17-rc1 seems to improve a lot in this regard, but PSR still sometimes causes the screen to freeze for a few seconds.<br />
<br />
=== SD Card Reader ===<br />
<br />
According to various reports the SD card reader drains several watts of power. If you don't want to disable it in bios because you use it semi-regularly, you can turn it off by unbinding its driver using this command:<br />
<br />
echo "2-3" | sudo tee /sys/bus/usb/drivers/usb/unbind<br />
<br />
You can then turn the reader back on by running:<br />
<br />
echo "2-3" | sudo tee /sys/bus/usb/drivers/usb/bind<br />
<br />
== Thermal Throttling Fix ==<br />
<br />
Workaround for Linux throttling issues on Lenovo T480 / T480s / X1C6 notebooks as described [https://www.reddit.com/r/thinkpad/comments/870u0a/t480s_linux_throttling_bug/ here].<br />
<br />
This script forces the CPU package power limit (PL1/2) to 44 W (29 W on battery) and the temperature trip point to 95 'C (85 'C on battery) by overriding default values in MSR and MCHBAR every 5 seconds (30 on battery) to block the Embedded Controller from resetting these values to default.<br />
<br />
Install it using the {{Pkg|throttled}} package.<br />
<br />
https://github.com/erpalma/throttled<br />
<br />
== USB-C DisplayPort ==<br />
The following adapters were tested<br />
<br />
[https://www.dell.com/en-au/shop/dell-usb-c-mobile-adapter-da300/apd/492-bcjf/pc-accessories Dell DA300] - Ethernet/HDMI/USB-A/DisplayPort all work. Display output maxes out at 2560x1440@60Hz / 3840x2160@30Hz. 4k@60Hz wasn't possible even with a modeline generated with cvt.<br />
<br />
[https://www.moshi.com/en/product/usb-c-to-hdmi-adapter/silver Moshi USB-C to HDMI Adapter] - Up to 4k@60Hz Works out of the box with xrandr<br />
<br />
== PrivacyGuard ==<br />
This optional feature is currently not yet supported by the vanilla kernel. There is a [https://patchwork.kernel.org/patch/11109239/ kernel patch available].<br />
<br />
== See also ==<br />
<br />
* [https://www.youtube.com/watch?v=gRvYTLntgv4&list=PLiKgVPlhUNuz9k0xIp7PGUV5mmDdTS1vJ T480s install video playlist]</div>Zlatinhttps://wiki.archlinux.org/index.php?title=Spotify&diff=581272Spotify2019-08-31T09:07:55Z<p>Zlatin: changed link to spotifywm from github to AUR</p>
<hr />
<div>[[Category:Music]]<br />
[[Category:Streaming]]<br />
[[ja:Spotify]]<br />
[[Wikipedia:Spotify|Spotify]] is a digital music streaming service with a freemium business model. This article is mainly about the semi-official, proprietary '''Spotify for Linux''' client, which is developed by Spotify's engineers in their spare time and not actively supported by Spotify.[https://www.spotify.com/us/download/linux/] Alternatively, there is an [https://open.spotify.com/ online player] and a couple of open source [[#Third-party clients|third-party clients]].<br />
<br />
== Installation ==<br />
<br />
[https://www.spotify.com/us/download/linux/ Spotify for Linux] can be [[install]]ed with the {{AUR|spotify}} package. If you wish to play local files you will need to additionally install {{Pkg|zenity}} and {{AUR|ffmpeg-compat-57}}.<br />
<br />
=== Third-party clients ===<br />
<br />
* {{App|Spotifyd|An open source Spotify client running as a UNIX daemon. Spotifyd streams music just like the official client, but is more lightweight and supports more platforms. Spotifyd also supports the Spotify Connect protocol which makes it show up as a device that can be controlled from the official clients.|https://github.com/Spotifyd/spotifyd|{{AUR|spotifyd}}}}<br />
* {{App|[[Wikipedia:Clementine (software)|Clementine]]|Able to stream from Spotify with a premium account after activating (downloading) a plugin in the settings.|https://www.clementine-player.org/|{{Pkg|clementine}}}}<br />
* {{App|Mopidy|An alternative plug-in based implementation of [[Music Player Daemon]] is able to stream from Spotify with an extension.|https://www.mopidy.com/|{{Pkg|mopidy}}+ {{AUR|mopidy-spotify}} or {{AUR|despotify-svn}}{{Broken package link|package not found}}}}<br />
* {{App|Librespot|An open source client library for Spotify. It enables applications to use Spotify's service (streaming), without using the official closed-source ''libspotify''.|https://github.com/librespot-org/librespot|{{AUR|librespot-git}}}}<br />
* {{App|Tomahawk|A Music Player App written in C++/Qt. '''No longer actively developed'''. |https://www.tomahawk-player.org/|{{AUR|tomahawk}} {{AUR|tomahawk-git}} {{AUR|tomahawk-qt5}}}}<br />
<br />
== Tips & tricks ==<br />
<br />
=== Limit storage size ===<br />
<br />
Spotify automatically manage a storage size for caching, however one may want to force the size limit preventing the [[filesystem]] from filling up.<br />
<br />
[[Append]] {{ic|storage.size}} (measured in MB) to {{ic|/home/''user''/.config/spotify/prefs}}, e.g. a storage size of 3072MB:<br />
<br />
{{hc|~/.config/spotify/prefs|2=<br />
storage.size=3072<br />
}}<br />
<br />
=== Global media hotkeys ===<br />
<br />
{{Tip|Many [[desktop environments]] come with keyboard shortcuts which work with the Spotify client out of the box e.g. under [[Cinnamon]] (Preferences -> Keyboard -> Shortcuts -> Sound and Media), several default bindings are set up to control the player, and these can easily be changed by pressing the preferred keys.}}<br />
<br />
For environments in which controlling Spotify via the keyboard doesn't work automatically, the official Linux client has support for media keys like {{ic|XF86AudioPlay}}. We can use for example [[xbindkeys]] to catch the global media keypresses, and then forward them to Spotify using one of the methods below. If you use xbindkeys, ensure that Spotify is restarted after installation and key configuration otherwise the key events will not be properly caught.<br />
<br />
==== MPRIS ====<br />
<br />
The Spotify client implements the [https://specifications.freedesktop.org/mpris-spec/latest/ MPRIS2] D-Bus interface which allows external control.<br />
<br />
===== Playerctl =====<br />
<br />
The {{Pkg|playerctl}} utility provides a command line tool to send commands to MPRIS clients. The only commands you will likely need to bind globally are {{ic|play-pause}}, {{ic|next}} and {{ic|previous}}<br />
<br />
$ playerctl play-pause<br />
$ playerctl next<br />
$ playerctl previous<br />
<br />
Playerctl will send the command to the first player it finds, so this method will also work with others players such as [[vlc]]. To ignore other players, pass {{ic|--player&#61;spotify}} as an argument.<br />
<br />
===== D-Bus =====<br />
<br />
An alternative to the above is to manually use [[D-Bus]], which should be available by default as it is a dependency of [[systemd]].<br />
<br />
To play or pause the current song in Spotify:<br />
<br />
$ dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause<br />
<br />
In order to bind this and the other commands to the media keys you need to install [[Xbindkeys]] and edit your .xbindkeysrc and add the following lines:<br />
<br />
# Play/Pause<br />
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause"<br />
XF86AudioPlay<br />
<br />
# Next<br />
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next"<br />
XF86AudioNext<br />
<br />
# Previous<br />
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous"<br />
XF86AudioPrev<br />
<br />
# Stop<br />
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop"<br />
XF86AudioStop<br />
<br />
If the above commands do not work, try setting the dbus address:<br />
<br />
USER=`whoami`<br />
PROCESS=spotify<br />
PID=`pgrep -o -u $USER $PROCESS`<br />
ENVIRON=/proc/$PID/environ<br />
if [ -e $ENVIRON ]<br />
then<br />
export `grep -z DBUS_SESSION_BUS_ADDRESS $ENVIRON`<br />
else<br />
echo "Unable to set DBUS_SESSION_BUS_ADDRESS."<br />
exit 1<br />
fi<br />
<br />
==== pactl (pulseaudio) ====<br />
<br />
As you might have noticed, MPRIS protocol commands don't include volume control. This is broken within spotify itself, which ignores volume change requests. However, there is a possibility to control volume via pulseaudio's input sink:<br />
<br />
$ pactl set-sink-input-volume "$current_sink_num" +1% #volume up by 1%<br />
$ pactl set-sink-input-volume "$current_sink_num" -1% #volume down by 1%<br />
$ pactl set-sink-input-mute "$current_sink_num" toggle #mute toggler<br />
<br />
The sink number for "$current_sink_num" can be found in the output of command:<br />
{{hc|head=$ pactl list sink-inputs|2=<br />
Sink Input #'''3''' << here<br />
Driver: protocol-native.c<br />
[...]<br />
application.name = "Spotify"}}<br />
<br />
You can create a script for changing volume and bind it for example to keyboard shortcut via [[desktop environments]] configuration or xdotool described in next section. Here are some examples:<br />
<br />
Bash:<br />
#!/bin/bash<br />
LANGUAGE="en_US"<br />
app_name="Spotify"<br />
current_sink_num=''<br />
sink_num_check=''<br />
app_name_check=''<br />
pactl list sink-inputs |while read line; do \<br />
sink_num_check=$(echo "$line" |sed -rn 's/^Sink Input #(.*)/\1/p')<br />
if [ "$sink_num_check" != "" ]; then<br />
current_sink_num="$sink_num_check"<br />
else<br />
app_name_check=$(echo "$line" \<br />
|sed -rn 's/application.name = "([^"]*)"/\1/p')<br />
if [ "$app_name_check" = "$app_name" ]; then<br />
pactl set-sink-input-volume "$current_sink_num" +1%<br />
fi<br />
fi<br />
done<br />
This script is based on work done by user [https://unix.stackexchange.com/users/52126/miko%c5%82ak Mikołak] in [https://unix.stackexchange.com/questions/208784/command-line-per-application-volume-maybe-amixer-or-pactl/209047#209047 this post].<br />
<br />
Unfortunately this script is not the fastest solution and if you execute it multiple times via keyboard hotkey, it might become laggy.<br />
<br />
Faster (like 10 times) Python code (requires at least Python 3.7 to be installed):<br />
#!/usr/bin/env python3<br />
#Author: Marcin Kocur, attribution license: https://creativecommons.org/licenses/by/4.0/<br />
import subprocess<br />
import os<br />
x=0<br />
y=0<br />
env = os.environ<br />
env['LANG'] = 'en_US'<br />
app = '"Spotify"'<br />
pactl = subprocess.check_output(['pactl', 'list', 'sink-inputs'], env=env).decode().strip().split()<br />
if app in pactl:<br />
for e in pactl:<br />
x += 1<br />
if e == app:<br />
break<br />
for i in pactl[0 : x -1 ]:<br />
y += 1<br />
if i == 'Sink' and pactl[y] == 'Input' and '#' in pactl[y + 1]:<br />
sink_id = pactl[y+1]<br />
if i == 'Volume:' and '%' in pactl[y + 3]:<br />
volume = pactl[y + 3]<br />
sink_id = sink_id[1: ]<br />
volume = volume[ : -1 ]<br />
if int(volume) < 100:<br />
subprocess.run(['pactl', 'set-sink-input-volume', sink_id, '+1%'])<br />
<br />
You can save it to a .py file. The last line does the actual job, so you can adjust the command to lower the volume or toggle mute.<br />
<br />
==== xdotool ====<br />
<br />
With the help of {{ic|xdotool}} it is possible to send your hotkeys to the application. The following script is an example of how to control Spotify from the outside:<br />
<br />
#!/bin/sh<br />
<br />
case $1 in<br />
"play")<br />
key="XF86AudioPlay"<br />
;;<br />
"next")<br />
key="XF86AudioNext"<br />
;;<br />
"prev")<br />
key="XF86AudioPrev"<br />
;;<br />
*)<br />
echo "Usage: $0 play|next|prev"<br />
exit 1<br />
;;<br />
esac<br />
xdotool key --window $(xdotool search --name "Spotify (Premium |Unlimited |Free )?- Linux Preview"|head -n1) $key<br />
exit 0<br />
<br />
Let us call it {{ic|musickeys.sh}}. Make the script executable:<br />
<br />
$ chmod +x musickeys.sh<br />
<br />
By executing {{ic|./musickeys.sh play}} you can now toggle playing a song. Now you can bind this script to any tool that catches keypresses, such as [[xbindkeys]].<br />
<br />
=== Disable track notifications===<br />
<br />
{{note|It is worth noting that if you have a {{AUR|SpotCommander}} [http://olejon.github.io/spotcommander/ Server] running alongside Spotify, and you disable track notifications by following the instructions below, the [https://play.google.com/store/apps/details?id&#61;net.olejon.spotcommander&hl&#61;en SpotCommander Client] running on your mobile device will display that “No Music is Playing” and will [http://askubuntu.com/questions/472325/remove-spotify-pop-up-notification-when-a-song-starts/472329#472329 fail to display track info] such as title, artist, album art, etc. Apart from that, the mobile client still works fine though, and is still able to skip, play, pause, control volume, etc.}}<br />
<br />
After version 0.9.10, track change notifications were enabled by default. They can be quite intrusive. To disable them, add the following line to {{ic|~/.config/spotify/Users/<spotifylogin>-user/prefs}}<br />
<br />
ui.track_notifications_enabled=false<br />
<br />
It is also possible to launch spotify with the {{ic|--ui.track_notifications_enabled&#61;false}} option.<br />
<br />
=== Show track notifications===<br />
<br />
{{Pkg|playerctl}} provides a library you can use with {{pkg|python-gobject}} and a notification daemon such as {{pkg|dunst}} to show the artist and title in a notification when the track changes.<br />
<br />
#!/usr/bin/env python3<br />
<br />
from gi.repository import Playerctl, GLib<br />
from subprocess import Popen<br />
<br />
player = Playerctl.Player()<br />
<br />
def on_track_change(player, e):<br />
track_info = '{artist} - {title}'.format(artist=player.get_artist(), title=player.get_title())<br />
Popen(['notify-send', track_info])<br />
<br />
player.on('metadata', on_track_change)<br />
<br />
GLib.MainLoop().run()<br />
<br />
=== Skip overplayed radio tracks===<br />
<br />
Another use of the {{Pkg|playerctl}} library is to skip tracks that are played too much on radio when you do not necessarily want to downvote these tracks because you may want to hear them again later on that station.<br />
<br />
#!/usr/bin/env python3<br />
<br />
from gi.repository import Playerctl, GLib<br />
<br />
player = Playerctl.Player()<br />
<br />
played_out = ['Zu Fuss', 'Walk And Talk', 'Neuland']<br />
<br />
def on_track_change(player, e):<br />
if player.get_title() in played_out:<br />
player.next()<br />
<br />
player.on('metadata', on_track_change)<br />
<br />
GLib.MainLoop().run()<br />
<br />
=== Mute commercials ===<br />
<br />
{{Warning|Muting commercials is not supported by Spotify and may result in a temporary ban [https://www.theverge.com/2018/3/5/17080920/spotify-cracking-down-pirating-premium-free-account]}}<br />
<br />
==== blockify ====<br />
<br />
With [https://github.com/mikar/blockify blockify] you can mute commercials. It is available in the [[AUR]] as {{AUR|blockify}}.<br />
<br />
To have this start and run in the background every time Spotify starts you will need to automate this yourself:<br />
<br />
{{bc|<nowiki><br />
#!/bin/sh<br />
<br />
spotify=/usr/bin/spotify<br />
<br />
if [[ -x $spotify && -x /usr/bin/blockify ]];<br />
then<br />
blockify &<br />
block_pid=$!<br />
$spotify<br />
trap "kill -9 $block_pid" SIGINT SIGTERM EXIT<br />
fi<br />
</nowiki>}}<br />
<br />
By placing this script at {{ic|/usr/local/bin/spotify}}, it gets preferred to {{ic|/usr/bin/spotify}} everytime you start Spotify, so there's nothing else to change and updates won't break it.<br />
<br />
==== spotblock ====<br />
<br />
[https://github.com/mahkoh/spotblock spotblock] ({{AUR|spotblock-git}}) is a resource-efficient ad blocker that runs as a systemd daemon.<br />
<br />
==== Spotify-AdKiller ====<br />
<br />
[https://github.com/SecUpwN/Spotify-AdKiller Spotify-AdKiller] ({{AUR|spotify-adkiller-git}}) is another alternative to block Spotify ads.<br />
<br />
==== Hosts file ====<br />
<br />
You may also add the following lines to your hosts file to block ads in Spotify :<br />
<br />
{{hc|/etc/hosts|<nowiki><br />
# Block spotify ads<br />
127.0.0.1 media-match.com<br />
127.0.0.1 adclick.g.doublecklick.net<br />
127.0.0.1 www.googleadservices.com<br />
127.0.0.1 open.spotify.com<br />
127.0.0.1 pagead2.googlesyndication.com<br />
127.0.0.1 desktop.spotify.com<br />
127.0.0.1 googleads.g.doubleclick.net<br />
127.0.0.1 pubads.g.doubleclick.net<br />
127.0.0.1 audio2.spotify.com<br />
127.0.0.1 www.omaze.com<br />
127.0.0.1 omaze.com<br />
127.0.0.1 bounceexchange.com<br />
#127.0.0.1 spclient.wg.spotify.com<br />
127.0.0.1 securepubads.g.doubleclick.net<br />
127.0.0.1 8.126.154.104.bc.googleusercontent.com<br />
127.0.0.1 104.154.126.8<br />
<br />
</nowiki>}}<br />
spclient.wg.spotify.com now appears to block radio and daily mixes, as well as recently played songs.<br />
<br />
=== Remote Control ===<br />
<br />
==== Send commands via SSH ====<br />
<br />
If you set up ssh on the server, you can send controls from a client to a remote Spotify instance with<br />
<br />
$ ssh user@host ''yourcommand''<br />
<br />
where ''yourcommand'' can be [https://code.google.com/p/spotifycmd/ spotifycmd] that you installed on the server, or a dbus script for the linux version, as described above.<br />
<br />
==== Grab the Spotify window via SSH ====<br />
<br />
Aside from grabbing the whole desktop with TeamViewer or VNC to remotely control your server, you can also only grab the Spotify Window from the server to your client.<br />
<br />
To do that, you need to configure sshd on your server and install x11vnc on both server and client as well as tigervnc on the client. Then you can use these scripts to grab either the complete dektop or only the Spotify window, which essentially gets you GUI client-like behavior as with MPD.<br />
<br />
{{bc|<nowiki><br />
#!/bin/bash<br />
# vncget.sh<br />
<br />
if [[ $1 == all ]];then<br />
ssh -f -t -L 5900:localhost:5900 user@host "x11vnc -q -display :0 -auth .Xauthority"<br />
else<br />
ssh -f -t -L 5900:localhost:5900 user@host ".bin/vncgetspotify.sh"<br />
fi<br />
<br />
for i in {1..4}; do<br />
sleep 2<br />
if vncviewer localhost:0; then break; fi<br />
done<br />
</nowiki>}}<br />
<br />
{{bc|<nowiki><br />
#!/bin/bash<br />
# vncgetspotify.sh<br />
<br />
export DISPLAY=:0<br />
<br />
id=$(wmctrl -lx | awk '/spotify.exe.Wine/ {print $1}')<br />
[[ -z $id ]] && id=$(wmctrl -lx | awk '/spotify.Spotify/ {print $1}')<br />
<br />
x11vnc -sid $id -display :0 -auth .Xauthority<br />
</nowiki>}}<br />
<br />
You will need to copy the second script to ~/.bin/vncgetspotify.sh on the server and the first script to any place on your client.<br />
<br />
Finally, to grab the spotify window, run on the client:<br />
<br />
$ sh vncget.sh<br />
<br />
or, for the whole desktop:<br />
<br />
$ sh vncget.sh all<br />
<br />
===HiDPI Mode===<br />
As the current Spotify build is not DPI aware, the amount to scale the interface by can be specified using the terminal command:<br />
$ spotify --force-device-scale-factor='''X'''<br />
<br />
where X is the amount to scale the interface by, e.g 2.<br />
<br />
This change can be added to the {{ic|spotify.desktop}} file in order to apply the scaling when launching from the desktop.<br />
<br />
To make sure the file does not get overwritten when the package is updated, copy it to you local applications folder:<br />
$ cp /usr/share/applications/spotify.desktop ~/.local/share/applications/<br />
<br />
Now edit {{ic|~/.local/share/applications/spotify.desktop}} and add the {{ic|--force-device-scale-factor}} option:<br />
<br />
{{hc|spotify.desktop|2=<br />
[Desktop Entry]<br />
Name=Spotify<br />
GenericName=Music Player<br />
Comment=Spotify streaming music client<br />
Icon=spotify-client<br />
Exec=spotify '''--force-device-scale-factor=2''' %U<br />
TryExec=spotify<br />
Terminal=false<br />
Type=Application<br />
Categories=Audio;Music;Player;AudioVideo<br />
MimeType=x-scheme-handler/spotify<br />
}}<br />
<br />
You might need to relaunch your Desktop Manager, before these override changes will be effective.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Desktop Environment alerts (beeps) mutes Spotify ===<br />
<br />
Comment out "module-role-cork" in pulse audio configuration file.<br />
<br />
Open {{ic|/etc/pulse/default.pa}} with your text editor and comment out:<br />
<br />
load-module module-role-cork <br />
<br />
Or simply unload it with:<br />
<br />
pactl unload-module module-role-cork<br />
<br />
=== Using search causes the whole interface to blink and then crash ===<br />
<br />
Spotify is using an old version of Chromium Embedded Framework and hits a bug causing it to crash repeatedly when trying to use the search. This can be worked around by using the following command line option:<br />
<br />
--force-device-scale-factor=1.0000001<br />
<br />
=== Blinking images and improper rendering while using Spotify Linux with DWM ===<br />
Start spotify as a floating window.<br />
<br />
You can add this rule to the rules array in your {{ic|config.h}}:<br />
{ "Spotify", NULL, NULL, 2, True, -1 },<br />
<br />
This will tell dwm to start spotify as a floating window associated with the tag "2" no matter what window mode you are in. Recompile and install dwm to apply your new settings.<br />
<br />
=== Broken search, browsing or radio ===<br />
<br />
: Spotify [http://community.spotify.com/t5/Help-Desktop-Linux-Mac-and/Bug-Desktop-Linux-0-9-0-133-gd18ed589-Having-mixed-locale-breaks/td-p/418270 bug report] concerning non-english locales<br />
If various tabs like browsing only show a blank screen, the search field doesn't seem to do anything or the radio page is broken (stuck when starting and unsresponsive to input) you might be using a custom locale.<br />
<br />
Try setting the environment variable {{ic|LC_NUMERIC}} to {{ic|en_US.utf8}} before starting Spotify.<br />
<br />
=== Deadlock GUI Thread ===<br />
<br />
Can occur under tiling window managers, such as Awesome, when double-clicking new song or playlist. Edit the file {{ic|~/.config/spotify/Users/[1-9]*-user/prefs}} to add or change the following:<br />
<br />
ui.track_notifications_enabled=false<br />
<br />
Restart Spotify. Note that several causes appear to exist for this problem, and this particular fix only applies to select versions of Spotify client, i3 and Awesome, and it may be that additional root causes exist for the Debian and Ubuntu users reporting this issue. Observed with Spotify 0.9.17.1.g9b85d436 and Awesome 3.4.15 and i3-gaps 4.13-2 and Spotify 1.0.64.407.g9bd02c2d.<br />
<br />
{{Note|As of Spotify 1.0.17.75-2, {{ic|1=ui.track_notifications_enabled=false}} seems to be ignored. On the other hand, some users report not experiencing the deadlock anymore as of Awesome 3.5.6. Deadlocks could be caused by scripts called by Awesome, which rely on buggy spotify dbus properties. See [https://github.com/acrisci/playerctl/issues/20].}}<br />
<br />
'''Note:''' This issue has multiple causes, so keep track of what you change while researching this. Update this section with additional scenarios and fixes.<br />
<br />
=== Album art and images are missing, show up as squares ===<br />
<br />
Quit spotify, then open spotify preferences {{ic|~/.config/spotify/prefs}}<br />
<br />
Change @https to @http:<br />
<br />
network.proxy.addr="your-proxy.com:80<strong>@http</strong>"<br />
network.proxy.mode=2<br />
<br />
See original form post [http://community.spotify.com/t5/Help-Desktop-Linux-Mac-and/Mac-Windows-0-9-0-128-Apps-can-t-connect-anywhere-behind-proxy/m-p/448704#M52332 here].<br />
<br />
{{Note|As of 1.0.17 it looks like replacing https with http as suggested above can result in no connectivity at all. If this happens an alternative solution is to set 'no proxy' in the GUI use {{Pkg|proxychains-ng}} to force all TCP connection coming from the app through a proxy. Even with HTTP proxies that reject connections on port 80 (and only work for port 443) this works reliably.}}<br />
<br />
=== Spotify does not detect other devices on local network ===<br />
<br />
If a firewall is in place, open ports 57621 for UDP and TCP. If you use a variant of the [[iptables]] [[Simple stateful firewall]], the following should do it:<br />
<br />
iptables -A TCP -p tcp --dport 57621 -j ACCEPT -m comment --comment spotify<br />
iptables -A UDP -p udp --dport 57621 -j ACCEPT -m comment --comment spotify<br />
<br />
It is also possible to restrict the source and destination to the local network.<br />
<br />
If you are using Spotify Connect to play music on a wireless speaker or AVR, your firewall needs to be configured for Spotify's mDNS lookup of those. Sadly, it uses a random unprivileged port [https://community.spotify.com/t5/Desktop-Linux-Windows-Web-Player/Spotify-Connect-and-iptables-netfilter/td-p/1235049] which makes these firewall rules rather nasty. Fortunately, you can restrict the rules to source port 1900 or 5353.<br />
<br />
iptables -A UDP -p udp --sport 1900 --dport 1025:65535 -j ACCEPT -m comment --comment spotify<br />
iptables -A UDP -p udp --sport 5353 --dport 1025:65535 -j ACCEPT -m comment --comment spotify<br />
<br />
=== Search Bar text is invisible when using a dark theme ===<br />
<br />
The text in the search bar appears to be hardcoded to be white, making it invisible when using a dark Qt theme. To fix this, you'll need to make an override.<br />
<br />
First create a css file somewhere your account has permission to read/write from (such as your home folder). Call it whatever you like (eg. '''spotify-override.css''').<br />
<br />
Open the newly created css file and add the following:<br />
<br />
QLineEdit { color: #000 }<br />
<br />
Save the file and exit. Next, you need to add the following to the end of your Spotify launcher (substitute the path with the actual path of your css file):<br />
<br />
-stylesheet=/home/user/spotify-overide.css<br />
<br />
So your full launch path should look something like this:<br />
<br />
/usr/share/spotify/spotify-client/spotify -stylesheet=/home/user/spotify-override.css<br />
<br />
=== Can't play local files ===<br />
<br />
If you get a segmentation fault or error message when trying to play local files e.g.<br />
<br />
This song is not available. If you have the file on your computer you can import it.<br />
<br />
- it's caused by a missing libavcodec dependency. For PulseAudio users, installing {{aur|ffmpeg-compat-57}} should fix it. If you get PGP verification errors when you install it you might have to import the correct PGP key. <br />
<br />
$ gpg --keyserver pgp.mit.edu --recv-keys FCF986EA15E6E293A5644F10B4322F04D67658D8<br />
<br />
=== Not respecting window manager rules ===<br />
<br />
Window manager that try to apply specific rules like starting it on a determined workspace or maximizing it on startup, has no effect, as Spotify doesn't set the ''WM_CLASS'' property before creating the window, violating the ICCCM specifications. One solution is to use {{AUR|spotifywm-git}}.<br />
<br />
=== GUI hangs while the music plays ===<br />
<br />
Also the previous and next track buttons act with a delay of 10-40 seconds. Spotify by default tries to send notification about next track, if you don't have a notification-daemon installed, Spotify's GUI hangs.<br />
<br />
The solution is to either disable notifications in the settings or to install a notification daemon from [[Desktop notifications]].<br />
<br />
=== GUI Borders are gone and app occupies the whole screen over cinnamon panel ===<br />
<br />
If having issue with window borders disappearing and so app goes to a kind of fullscreen but you can't drag the window or change its size on cinnamon, that may be caused by the preferences located by default at text file {{ic|/home/yourusername/.config/Spotify/Users/yourusername-user/prefs}} configs:<br />
<br />
app.window.position.width=1366<br />
app.window.position.height=768<br />
<br />
What probably happens is, when both resolutions matches your "main" monitor resolution values or higher, this may happen when going from two monitors to only one monitor. As a solution, close Spotify, edit {{ic|prefs}} file to remove both configs above, save it, then run Spotify again.<br />
<br />
=== Can't open settings in Wayland ===<br />
<br />
When using Wayland, clicking on the 'Settings' button does nothing. Using the keyboard instead will work (arrows and enter). See [https://community.spotify.com/t5/Desktop-Linux/Settings-don-t-open-on-Linux/td-p/1478736]<br />
<br />
==See also==<br />
* [https://github.com/acrisci/playerctl playerctl] — A command-line utility and library for controlling media players<br />
* [[SpotCommander]] — A web based remote control for Spotify<br />
* [https://www.spotify.com/int/download/linux/ Spotify for Linux] — Spotify's homepage for the Linux client</div>Zlatinhttps://wiki.archlinux.org/index.php?title=Plymouth&diff=576378Plymouth2019-06-24T23:13:48Z<p>Zlatin: Added info on adding Arch logo to spinner and BGRT themes</p>
<hr />
<div>[[Category:Bootsplash]]<br />
[[cs:Plymouth]]<br />
[[es:Plymouth]]<br />
[[fa:Plymouth]]<br />
[[it:Plymouth]]<br />
[[ja:Plymouth]]<br />
[[pt:Plymouth]]<br />
[[ru:Plymouth]]<br />
[[zh-hans:Plymouth]]<br />
{{Related articles start}}<br />
{{Related|Silent boot}}<br />
{{Related articles end}}<br />
<br />
[http://www.freedesktop.org/wiki/Software/Plymouth Plymouth] is a project from Fedora providing a flicker-free graphical boot process. It relies on [[kernel mode setting]] (KMS) to set the native resolution of the display as early as possible, then provides an eye-candy splash screen leading all the way up to the login manager.<br />
<br />
== Preparation ==<br />
<br />
''Plymouth'' primarily uses [[KMS]] (Kernel Mode Setting) to display graphics. In EFI/UEFI systems, ''plymouth'' can utilize the EFI framebuffer. If you can't use KMS in e.g. because you are using a proprietary driver, or if you don't want to use EFI framebuffer, consider using [[Uvesafb]] as it works with widescreen resolutions.<br />
<br />
If you have neither KMS nor a framebuffer, ''Plymouth'' will fall back to text-mode.<br />
<br />
== Installation ==<br />
<br />
Plymouth is available from the [[AUR]]: the stable package is {{AUR|plymouth}} and the development version is {{AUR|plymouth-git}}.<br />
<br />
If you also use [[GDM]], you should install the {{AUR|gdm-plymouth}}, which compiles gdm with plymouth support.<br />
<br />
=== The plymouth hook ===<br />
<br />
Add {{ic|plymouth}} to the {{ic|HOOKS}} array in [[mkinitcpio.conf]]. It '''must''' be added '''after''' {{ic|base}} and {{ic|udev}} for it to work:<br />
<br />
{{hc|/etc/mkinitcpio.conf|2=HOOKS=(base udev plymouth [...])}}<br />
<br />
{{Warning|<br />
* If you use [[System Encryption with LUKS for dm-crypt|hard drive encryption]] with the {{ic|encrypt}} hook, you '''must''' replace the {{ic|encrypt}} hook with {{ic|plymouth-encrypt}} and add it after the {{ic|plymouth}} hook in order to get to the TTY password prompts.<br />
* Using {{ic|PARTUUID}} or {{ic|PARTLABEL}} in {{ic|1=cryptdevice=}} parameter does '''not''' work with {{ic|plymouth-encrypt}} hook.<br />
* For a [[Installing Arch Linux on ZFS#Native encryption|ZFS encrypted root]], you '''must''' install {{AUR|plymouth-zfs}} and replace {{ic|zfs}} hook with {{ic|plymouth-zfs}}<br />
}}<br />
<br />
After adding the {{ic|plymouth-encrypt}} hook, if input goes to the background in plaintext instead of into the password prompt you need to add your (kernel) graphics driver to your initramfs. For example, if using intel:<br />
<br />
{{hc|/etc/mkinitcpio.conf|2=MODULES=(i915 [...])}}<br />
<br />
This might also be a step needed for some themes to work.<br />
<br />
=== Alternative plymouth hook (systemd) ===<br />
If your [[mkinitcpio.conf]] includes the {{ic|systemd}} hook, then replace {{ic|plymouth}} with {{ic|sd-plymouth}}. Additionally, if using hard drive encryption, use {{ic|sd-encrypt}} instead of {{ic|encrypt}} or {{ic|plymouth-encrypt}}:<br />
<br />
{{hc|/etc/mkinitcpio.conf|2=HOOKS=(base systemd sd-plymouth [...] sd-encrypt [...])}}<br />
<br />
=== The kernel command line ===<br />
<br />
You now need to set the {{ic|1=quiet splash loglevel=3 rd.udev.log_priority=3 vt.global_cursor_default=0}} [[kernel parameters]]. See [[Silent boot]] for other parameters to limit the output to the console.<br />
<br />
Rebuild your initrd image (see [[mkinitcpio]] article for details), for example:<br />
<br />
# mkinitcpio -p linux<br />
<br />
== Configuration ==<br />
<br />
=== Smooth transition ===<br />
<br />
To enable ''smooth transition'' (if supported) you have to:<br />
<br />
# [[Disable]] your [[display manager]] unit, e.g. {{ic|gdm.service}}<br />
# [[Enable]] the respective DM-plymouth unit (GDM, LXDM, SLiM, LightDM, SDDM units provided), e.g. {{ic|gdm-plymouth.service}}<br />
<br />
=== Show Delay ===<br />
<br />
Plymouth has a configuration option to delay the splash screen:<br />
{{hc|/etc/plymouth/plymouthd.conf|2=<br />
[Daemon]<br />
Theme=spinner<br />
ShowDelay=5<br />
}}<br />
<br />
On systems that boot quickly, you may only see a flicker of your splash theme before your DM or login prompt is ready. You can set {{ic|ShowDelay}} to an interval (in seconds) longer than your boot time to prevent this flicker and only show a blank screen.<br />
The default is 5 seconds, but you may wish to change this to a lower value to see your splash earlier during boot.<br />
<br />
=== Changing the Theme ===<br />
<br />
Plymouth comes with a selection of themes:<br />
<br />
# '''Fade-in''': "Simple theme that fades in and out with shimmering stars"<br />
# '''Glow''': "Corporate theme with pie chart boot progress followed by a glowing emerging logo"<br />
# '''Script''': "Script example plugin" (Despite the description seems to be a quite nice Arch logo theme)<br />
# '''Solar''': "Space theme with violent flaring blue star"<br />
# '''Spinner''': "Simple theme with a loading spinner" <br />
# '''Spinfinity''': "Simple theme that shows a rotating infinity sign in the center of the screen"<br />
# ''('''Text''': "Text mode theme with tricolor progress bar")''<br />
# ''('''Details''': "Verbose fallback theme")''<br />
<br />
Development version of Plymouth ({{AUR|plymouth-git}}) also comes with the '''BGRT''' theme, which is a variation of Spinner that keeps the OEM logo if available.<br />
<br />
In addition you can install other themes from [[AUR]], just have a look at the "Required by"-Array on {{AUR|plymouth}}.<br />
<br />
All currently installed themes can be listed by using this command:<br />
<br />
$ plymouth-set-default-theme -l<br />
<br />
or:<br />
<br />
{{hc|$ ls /usr/share/plymouth/themes|<br />
details glow solar spinner tribar<br />
fade-in script spinfinity text<br />
}}<br />
<br />
By default, the '''spinner''' theme is selected. The theme can be changed by editing {{ic|/etc/plymouth/plymouthd.conf}}, for example:<br />
<br />
{{hc|/etc/plymouth/plymouthd.conf|2=<br />
[Daemon]<br />
Theme=spinner<br />
ShowDelay=5<br />
}}<br />
<br />
Themes can be previewed without rebuilding, press {{ic|Ctrl+Alt+F2}} to change to console, log in as root and type:<br />
<br />
# plymouthd<br />
# plymouth --show-splash<br />
<br />
To quit the preview, press {{ic|Ctrl+Alt+F2}} again and type:<br />
<br />
# plymouth --quit<br />
<br />
Every time a theme is changed, the kernel image must be rebuilt:<br />
<br />
# plymouth-set-default-theme -R <theme><br />
<br />
Reboot to apply the changes.<br />
<br />
== Tips and tricks ==<br />
<br />
====Show kernel messages====<br />
During boot you can switch to kernel messages by pressing "Home" (or "Escape") key.<br />
<br />
===Adding Arch Logo to spinner and BGRT themes===<br />
To add Arch Logo to ''spinner'' and ''BGRT'' themes copy Arch logo to spinner theme directory with name {{ic|watermark.png}}:<br />
<br />
# cp /usr/share/plymouth/arch-logo.png /usr/share/plymouth/themes/spinner/watermark.png<br />
<br />
===Replacing the Arch Logo and creating custom themes===<br />
<br />
The following themes use the Arch Linux logo supplied by Plymouth in {{ic|/usr/share/plymouth/arch-logo.png}}: fade-in, script, solar, spinfinity. If you want to use another logo, you can take one of them or one of the plymouth themes in [[AUR]], edit the file {{ic|*.plymouth}} (and maybe {{ic|*.script}}, too) and replace this image with one of your choice. You should create a package from your newly created theme, because changes in {{ic|/usr/share/plymouth}} may not be persistent across package upgrades.<br />
<br />
After installing and selecting your theme, you should rebuild the initrd image to use the new splash.<br />
<br />
== See also ==<br />
<br />
* [http://fedoraproject.org/wiki/Releases/FeatureBetterStartup Original Spec]<br />
* [https://bbs.archlinux.org/viewtopic.php?id=81406 Related forum thread]</div>Zlatin