Skip to content

Instantly share code, notes, and snippets.

@cg505
Last active February 12, 2019 01:54
Show Gist options
  • Select an option

  • Save cg505/bc8ef41ae505a4ab0fb6cdf2b6d03fd6 to your computer and use it in GitHub Desktop.

Select an option

Save cg505/bc8ef41ae505a4ab0fb6cdf2b6d03fd6 to your computer and use it in GitHub Desktop.
.desktoprc
~/remote/setup-desktop 2>> ~/remote/.desktoprc.log >> ~/remote/.desktoprc.log
#!/bin/bash
echo "setup-desktop on $(hostname)"
date
REMOTE=~/r
echo setting remote to $REMOTE
mkdir -p "$REMOTE"
sshfs tsunami: "$REMOTE"
# GPG keys lmao
rm -rf ~/.gnupg
mkdir ~/.gnupg
sshfs failure:.gnupg ~/.gnupg
# pulseaudio flat-volumes is fucking stupid
mkdir -p ~/.config/pulse/
echo "flat-volumes = no" > ~/.config/pulse/daemon.conf
# now restart pulse so it takes effect (this will fail if pulse hasn't started yet, that's ok)
pulseaudio -k
# set up one-letter links
ln -Ts $REMOTE/c ~/c
ln -Ts $REMOTE/s ~/s
ln -Ts $REMOTE/o ~/o
# emacs
rm -rf ~/.emacs.d
rm -f ~/.emacs
ln -Ts $REMOTE/.emacs.d ~/.emacs.d
mkdir -p ~/.config/dot/emacs/
cat << EOF > ~/.config/dot/emacs/init.el
(setf kotct/font-default-height 10.0)
(kotct/font-reset-height)
;;(with-eval-after-load 'org-agenda
;; (setf org-agenda-files '("~/Dropbox/Orgzly/")))
EOF
systemctl --user start emacs
# tilix
ln -Ts $REMOTE/.config/dconf ~/.config/dconf
ln -Ts $REMOTE/.config/tilix ~/.config/tilix
# cli tools
ln -s $REMOTE/.ls_colors ~/.ls_colors
cp $REMOTE/.toprc ~/.toprc
ln -s $REMOTE/.gitconfig ~/.gitconfig
# xscreensaver
ln -s $REMOTE/.xscreensaver ~/.xscreensaver
# fish
# delete existing .config/fish, which might be from logging in to a tty
rm -rf ~/.config/fish
ln -Ts $REMOTE/.config/fish ~/.config/fish
fish -c "set -U fish_prompt_pwd_dir_length 0"
# ssh
# can't symlink, fucks up future sshfs i think
mkdir -p ~/.ssh
cp $REMOTE/.ssh/* ~/.ssh/
# xfce/wm/theme
# pray
rm -rf ~/.config/xfce4
ln -Ts $REMOTE/.config/xfce4 ~/.config/xfce4
mkdir -p ~/.themes
ln -Ts $REMOTE/themes/Adapta-Nokto ~/.themes/Adapta-Nokto
mkdir -p ~/.icons
ln -Ts $REMOTE/icons/Paper ~/.icons/Paper
# spotify
ln -Ts $REMOTE/.config/spotify ~/.config/spotify
# redshift
mkdir -p ~/.config/systemd/user
cat << EOF > ~/.config/systemd/user/redshift.service
[Unit]
Description=cooperc redshift service
[Service]
Type=simple
ExecStart=/usr/bin/redshift -l 37.85:-122.36
EOF
systemctl --user start redshift
if [ "$(hostname)" = "eruption" -o "$(hostname)" = "hurricane" ]
then
# set usb audio out on eruption/hurricane
pactl set-default-sink alsa_output.usb-C-Media_Electronics_Inc._USB_Audio_Device-00.analog-stereo
fi
if [ "$(hostname)" = "eruption" ]
then
# set weird backgrounds in the middle
cp ~/.config/xfce4/xfconf/xfce-perchannel-xml/{desktop-eruption.xml,xfce4-desktop.xml}
else
# set normal backgrounds
cp ~/.config/xfce4/xfconf/xfce-perchannel-xml/{desktop-default.xml,xfce4-desktop.xml}
fi
date
echo "setup-desktop finished"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment