Skip to content

Instantly share code, notes, and snippets.

@pydevd
Last active December 19, 2018 13:31
Show Gist options
  • Save pydevd/d4175549d631a630b37e96be96a4e7fb to your computer and use it in GitHub Desktop.
Save pydevd/d4175549d631a630b37e96be96a4e7fb to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# 1. Configure two monitors mode, set xfce panel to be displayed on the primary monitor
# 2. Instal required packages and remove unused
sudo apt update
sudo apt upgrade
sudo apt install terminator htop python3-setuptools python3-pip python3-dev python3-venv python2.7-dev vim git docker.io mysql-client
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb && rm google-chrome-stable_current_amd64.deb
sudo apt remove --purge firefox thunderbird mousepad
sudo apt install -f
# 3. Configure directories
echo 'DESKTOP=desktop
DOWNLOAD=downloads
DOCUMENTS=etc
PICTURES=pics
' | sudo tee /etc/xdg/user-dirs.defaults > /dev/null
echo 'XDG_DESKTOP_DIR="$HOME/desktop"
XDG_DOWNLOAD_DIR="$HOME/downloads"
XDG_DOCUMENTS_DIR="$HOME/etc"
XDG_PICTURES_DIR="$HOME/pics"
' > /home/pydevd/.config/user-dirs.dirs
rm -r $HOME/Desktop $HOME/Documents $HOME/Downloads $HOME/Music $HOME/Pictures $HOME/Public $HOME/Templates $HOME/Videos
mkdir -p $HOME/desktop $HOME/downloads $HOME/etc $HOME/pics
# 4. Set 'terminator' and 'google chrome' as prefered applications
mkdir -p /home/pydevd/.config/xfce4
echo "WebBrowser=google-chrome
TerminalEmulator=terminator
" > /home/pydevd/.config/xfce4/helpers.rc
# 5. Install terminator config
mkdir -p /home/pydevd/.config/terminator
echo '[global_config]
always_split_with_profile = True
scroll_tabbar = True
title_font = DejaVu Sans Mono 9
title_hide_sizetext = True
title_use_system_font = False
window_state = maximise
[keybindings]
copy = <Primary>c
paste = <Primary>v
[layouts]
[[default]]
[[[child1]]]
parent = window0
type = Terminal
[[[window0]]]
parent = ""
type = Window
[plugins]
[profiles]
[[default]]
background_color = "#282828"
background_darkness = 0.8
background_type = transparent
cursor_color = "#fce94f"
cursor_shape = underline
font = DejaVu Sans Mono 9
foreground_color = "#faffad"
icon_bell = False
palette = "#2e3436:#ef2929:#73d216:#c4a000:#3465a4:#75507b:#06989a:#d3d7cf:#555753:#ef2929:#8ae234:#fce94f:#729fcf:#ad7fa8:#34e2e2:#eeeeec"
scroll_on_output = True
scrollback_infinite = True
show_titlebar = False
use_system_font = False
' > /home/pydevd/.config/terminator/config
# 6. Configure panel
echo '<?xml version="1.0" encoding="UTF-8"?><channel name="xfce4-panel" version="1.0"> <property name="panels" type="uint" value="1"> <property name="panel-0" type="empty"> <property name="position" type="string" value="p=6;x=0;y=0"/> <property name="length" type="uint" value="100"/> <property name="position-locked" type="bool" value="true"/> <property name="plugin-ids" type="array"> <value type="int" value="1"/> <value type="int" value="2"/> <value type="int" value="3"/> <value type="int" value="13"/> <value type="int" value="4"/> <value type="int" value="5"/> <value type="int" value="6"/> <value type="int" value="7"/> <value type="int" value="8"/> <value type="int" value="9"/> <value type="int" value="14"/> <value type="int" value="10"/> <value type="int" value="11"/> <value type="int" value="16"/> <value type="int" value="15"/> </property> <property name="background-style" type="uint" value="0"/> <property name="background-alpha" type="uint" value="64"/> <property name="size" type="uint" value="27"/> <property name="length-adjust" type="bool" value="true"/> <property name="span-monitors" type="bool" value="false"/> <property name="enter-opacity" type="uint" value="100"/> <property name="leave-opacity" type="uint" value="100"/> <property name="mode" type="uint" value="0"/> <property name="autohide-behavior" type="uint" value="0"/> <property name="nrows" type="uint" value="1"/> </property> </property> <property name="plugins" type="empty"> <property name="plugin-1" type="string" value="whiskermenu"/> <property name="plugin-2" type="string" value="tasklist"> <property name="flat-buttons" type="bool" value="true"/> <property name="show-handle" type="bool" value="true"/> <property name="show-labels" type="bool" value="true"/> <property name="grouping" type="uint" value="1"/> </property> <property name="plugin-3" type="string" value="separator"> <property name="style" type="uint" value="0"/> <property name="expand" type="bool" value="true"/> </property> <property name="plugin-4" type="string" value="systray"> <property name="show-frame" type="bool" value="false"/> <property name="size-max" type="uint" value="22"/> <property name="names-visible" type="array"> <value type="string" value="network"/> <value type="string" value="networkmanager applet"/> <value type="string" value="blueman-applet"/> </property> <property name="names-hidden" type="array"> </property> </property> <property name="plugin-5" type="string" value="notification-plugin"/> <property name="plugin-6" type="string" value="indicator"> <property name="blacklist" type="array"> <value type="string" value="libappmenu.so"/> </property> <property name="known-indicators" type="array"> <value type="string" value="com.canonical.indicator.messages"/> </property> </property> <property name="plugin-7" type="string" value="statusnotifier"> <property name="icon-size" type="uint" value="22"/> <property name="menu-is-primary" type="bool" value="true"/> <property name="mode-whitelist" type="bool" value="false"/> <property name="single-row" type="bool" value="false"/> <property name="square-icons" type="bool" value="false"/> <property name="symbolic-icons" type="bool" value="true"/> <property name="known-items" type="array"> <value type="string" value="blueman"/> <value type="string" value="nm-applet"/> </property> </property> <property name="plugin-8" type="string" value="power-manager-plugin"/> <property name="plugin-9" type="string" value="pulseaudio"> <property name="enable-keyboard-shortcuts" type="bool" value="true"/> <property name="enable-mpris" type="bool" value="true"/> <property name="mixer-command" type="string" value="pavucontrol"/> <property name="mpris-players" type="string" value="parole"/> <property name="show-notifications" type="bool" value="true"/> </property> <property name="plugin-10" type="string" value="separator"> <property name="style" type="uint" value="0"/> <property name="expand" type="bool" value="false"/> </property> <property name="plugin-11" type="string" value="clock"> <property name="digital-format" type="string" value="%d %B %Y %H:%M:%S"/> <property name="mode" type="uint" value="2"/> </property> <property name="plugin-13" type="string" value="weather"/> <property name="plugin-14" type="string" value="thunar-tpa"/> <property name="plugin-15" type="string" value="actions"> <property name="appearance" type="uint" value="1"/> <property name="items" type="array"> <value type="string" value="+lock-screen"/> <value type="string" value="-switch-user"/> <value type="string" value="+separator"/> <value type="string" value="-suspend"/> <value type="string" value="-hibernate"/> <value type="string" value="-separator"/> <value type="string" value="+shutdown"/> <value type="string" value="+restart"/> <value type="string" value="+separator"/> <value type="string" value="+logout"/> <value type="string" value="-logout-dialog"/> </property> </property> <property name="plugin-16" type="string" value="separator"/> </property> <property name="configver" type="int" value="2"/></channel>' > /home/pydevd/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml
# 7. Configure git
git config --global core.editor "vim"
git config --global user.email "<email>"
git config --global user.name "pydevd"
# 8. Create _gc script file at /usr/local/bin/_gc from https://gist.github.com/pydevd/732f58fd6bbe1f4fc101988e5109c2c4
sudo wget https://gist.github.com/pydevd/732f58fd6bbe1f4fc101988e5109c2c4/raw -O /usr/local/bin/_gc
sudo chmod +x /usr/local/bin/_gc
# 9. Install snap packages
sudo snap install vlc --classic
sudo snap install skype --classic
sudo snap install vscode --classic
sudo snap install pycharm-professional --classic
sudo snap install telegram-desktop --classic
# 10. Configure keyboard layouts (EN, RU, UA). win+space
echo '<?xml version="1.0" encoding="UTF-8"?><channel name="keyboard-layout" version="1.0"><property name="Default" type="empty"><property name="XkbDisable" type="bool" value="false"/><property name="XkbLayout" type="string" value="us,ru,ua"/><property name="XkbVariant" type="string" value=",,"/><property name="XkbOptions" type="empty"><property name="Group" type="string" value="grp:win_space_toggle"/></property></property></channel>' > .config/xfce4/xfconf/xfce-perchannel-xml/keyboard-layout.xml
# 11. Add current user to docker group to avoid sudo usage for docker commands
sudo adduser pydevd docker
# 12. Configure autostart via GUI: add skype, slack, telegram and terminator.
echo '[Desktop Entry]
Encoding=UTF-8
Version=0.9.4
Type=Application
Name=Terminator
Comment=Terminal Emulator
Exec=terminator
OnlyShowIn=XFCE;
StartupNotify=false
Terminal=false
Hidden=false
' > /home/pydevd/.config/autostart/Terminator.desktop
echo '[Desktop Entry]
Encoding=UTF-8
Version=0.9.4
Type=Application
Name=Skype
Comment=Skype Desktop Client
Exec=skype
OnlyShowIn=XFCE;
StartupNotify=false
Terminal=false
Hidden=false
' > /home/pydevd/.config/autostart/Skype.desktop
echo '[Desktop Entry]
Encoding=UTF-8
Version=0.9.4
Type=Application
Name=Telegram
Comment=Telegram Desktop Client
Exec=telegram-desktop
OnlyShowIn=XFCE;
StartupNotify=false
Terminal=false
Hidden=false
' > /home/pydevd/.config/autostart/Telegram.desktop
# 13. Install and configure Xonsh
sudo pip3 install xonsh xonsh-apt-tabcomplete xonsh-docker-tabcomplete xonsh-vox-tabcomplete prompt_toolkit
echo $(which xonsh) | sudo tee -a /etc/shells > /dev/null
chsh -s $(which xonsh) pydevd
# download .xonshrc from https://gist.github.com/pydevd/d8e2591d5b667ac68ae99380d978f43d
wget https://gist.github.com/pydevd/d8e2591d5b667ac68ae99380d978f43d/raw -O .xonshrc
# 14. Customize XFCE look and feel, windows borders, icons, fonts, login screen
# 15. Configure PyCharm: license, material theme, line sorter
# 16. Add ssh key to agent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment