Created
March 13, 2020 18:17
-
-
Save notanimposter/952ec7aefad1825ee9a30cbbbc4a6453 to your computer and use it in GitHub Desktop.
make a second plank for your second monitor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
plank -n dock2 & | |
kill $! | |
printf "Monitor: " | |
read monitor | |
echo "Using $monitor as monitor" | |
gsettings reset-recursively net.launchpad.plank.dock.settings:/net/launchpad/plank/docks/dock2/ | |
for key in $(gsettings list-keys net.launchpad.plank.dock.settings:/net/launchpad/plank/docks/dock1/); do | |
val=$(gsettings get net.launchpad.plank.dock.settings:/net/launchpad/plank/docks/dock1/ $key) | |
gsettings set net.launchpad.plank.dock.settings:/net/launchpad/plank/docks/dock2/ $key "$val" | |
done | |
gsettings set net.launchpad.plank.dock.settings:/net/launchpad/plank/docks/dock2/ monitor $monitor | |
mkdir -p $HOME/.config/plank/dock2/ | |
rm -rf $HOME/.config/plank/dock2/launchers | |
ln -s $HOME/.config/plank/dock1/launchers $HOME/.config/plank/dock2/launchers | |
killall plank |
Thanks for this, was exactly what I needed. Also thanks @angela-d, your modifications worked spot on.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for sharing, this is super useful!
If anyone reading this wants the script to auto-detect the non-primary monitor, replace:
with:
(if you have more than 2 monitors, you might need to do a loop, instead)
The only thing this script didn't do, was set dock2 as enabled. You can pull the current array (as long as you have at least dock1) and simply append to it, without disturbing other docks, by adding this after
gsettings set net.launchpad.plank.dock.settings:/net/launchpad/plank/docks/dock2/ monitor $monitor
: