This is mostly for myself, but perhaps someone else might get some ideas from it..
Note that you can execute lines from vim by selecting a range and then typing :w !bash
, which will show up like :'<,'>w !bash
. See :help w_c for more details.
First steps
First and foremost, go ahead and remove passwords for sudo:
sudo bash -c "echo '$(whoami) ALL=(ALL) NOPASSWD: ALL' \
| tee /etc/sudoers.d/$USER-nopasswd \
&& chmod -v 440 /etc/sudoers.d/$USER-nopasswd"
And get rid of the ungodly mess that is tracker:
sudo aptitude --assume-yes --without-recommends purge tracker
Also, we should have a suitable swap file for hibernation but not use it for swap (bad for ssd).. So set swapiness to 0 to only use in an emergency:
sudo sysctl -w vm.swappiness=0 # temporary
# set it permanently
grep --silent vm.swappiness /etc/sysctl.conf \
&& sudo sed -ie 's/vm.swappiness.*/vm.swappiness=0/' /etc/sysctl.conf \
|| sudo bash -c "echo 'vm.swappiness=0' >> /etc/sysctl.conf"
Update and install software
Next we'll install all the software that we want to use and set up a couple more things:
# get updates and reboot
sudo apt-get update && sudo apt-get -y dist-upgrade
# install additional packages
sudo apt-get -y install \
acpi-call-dkms aptitude arj cabextract curl ecryptfs-utils exfalso \
fdupes geda geda-examples geda-gattrib geda-gsymcheck geda-utils \
gerbv gimp git gitg gitk gnome-gmail gnome-icon-theme-extras \
gnome-icon-theme-gperfection2 gnome-icon-theme-nuovo \
gnome-icon-theme-suede gnome-icon-theme-symbolic \
gnome-icon-theme-yasis gnome-mplayer gnome-system-monitor gnucash \
gparted gparted gtk-recordmydesktop inkscape iotop libav-tools \
libreoffice lm-sensors lunzip lzip mosh mplayer nmap openssh-client \
openssh-server p7zip p7zip-rar pandoc pbzip2 pcb pigz powertop pv \
quodlibet rar rdfind rsync ruby-bcat screen tlp tp-smapi-dkms unace \
unrar uudeview vim-nox
# set up some stuff
sudo update-alternatives --set editor $(readlink -f $(which vim.nox))
sudo tlp start # start tlp right away to save power
ecryptfs-setup-private # setup the encrypted '~/Private' dir
Some other interesting packages to checkout:
- vim-scripts
- vim-doc
Change terminal settings from command line
For some reason, setting terminal preferences with gsettings
doesn't seem to be easy or possible. However dconf
seems to do it just fine. The first thing to do is to get the terminal profile id so that we can dump/load dconf values from/to it:
dconf dump /org/gnome/terminal/legacy/profiles:/ \
| grep -oe '[-0-9a-f:]\{37\}' | head -n1
This gives us the default profile id that we need to put at the top of our configuration list that we send to '/org/gnome/terminal/legacy/profiles:/' with dconf load
. We can then change individual settings with dconf
like so:
dconf write /org/gnome/terminal/legacy/profiles:/$(dconf dump \
/org/gnome/terminal/legacy/profiles:/ \
| grep -oe '[-0-9a-f:]\{37\}' \
| head -n1)/background-transparency-percent 15
Or use dconf load
to import many at once:
echo "[$(dconf dump /org/gnome/terminal/legacy/profiles:/ \
| head -n1 | grep -oe '[-0-9a-f:]\{37\}')]
background-color='rgb(0,0,0)'
background-transparency-percent=20
font='Monaco 10'
foreground-color='rgb(170,170,170)'
scrollbar-policy='never'
use-system-font=false
use-theme-colors=false
use-theme-transparency=false
use-transparent-background=true
visible-name='Darksparent'
" \
| dconf load /org/gnome/terminal/legacy/profiles:/
In order to get the settings to set in the first place, you can manually adjust them and then run dconf dump
with the path ('/org/gnome/terminal/legacy/profiles:/' for the terminal prefs) to get the values to feed back into dconf load
.
Gnome Shell Settings
Here's all the settings I've found so far that I like:
gsettings set org.gnome.Terminal.Legacy.Settings default-show-menubar false
gsettings set org.gnome.desktop.datetime automatic-timezone true
gsettings set org.gnome.desktop.input-sources xkb-options "['caps:escape', 'compose:ralt']"
gsettings set org.gnome.desktop.interface clock-show-date true
gsettings set org.gnome.desktop.interface monospace-font-name 'Monaco 12'
gsettings set org.gnome.desktop.lockdown disable-lock-screen true # ???
gsettings set org.gnome.desktop.media-handling automount false
gsettings set org.gnome.desktop.media-handling automount-open false
gsettings set org.gnome.desktop.peripherals.touchpad natural-scroll false
gsettings set org.gnome.desktop.peripherals.touchpad tap-to-click true
gsettings set org.gnome.desktop.screensaver lock-enabled false
gsettings set org.gnome.desktop.session idle-delay 0 # disable curtain, nope
gsettings set org.gnome.desktop.thumbnail-cache maximum-age 30 # 30 days
gsettings set org.gnome.desktop.thumbnail-cache maximum-size 64 # 64Mb
gsettings set org.gnome.mutter attach-modal-dialogs false
gsettings set org.gnome.nautilus.preferences always-use-location-entry true
gsettings set org.gnome.nautilus.preferences sort-directories-first true
gsettings set org.gnome.settings-daemon.plugins.media-keys www '<Super>w'
gsettings set org.gtk.Settings.FileChooser clock-format 24h
gsettings set org.gtk.Settings.FileChooser sort-directories-first true
Gnome Shell Theme
This just fixes the spacing in the top bar. Check out this blog post for how to extend and modify themes.
# enable user themes first
gnome-shell-extension-tool -e \
user-theme@gnome-shell-extensions.gcampax.github.com
# clean up and install theme
rm -f ~/.themes/compact_panel \
&& mkdir -p ~/.themes/compact_panel/gnome-shell \
&& echo "
@import url("/usr/share/gnome-shell/theme/gnome-shell.css");
/* http://rlog.rgtti.com/2012/01/29/how-to-modify-a-gnome-shell-theme/ */
.panel-button {
-natural-hpadding: 1px;
-minimum-hpadding: 1px;
}
" | sed -e 's/^ *//' >.themes/compact_panel/gnome-shell/gnome-shell.css \
&& echo "
{
"shell-theme": {
"name": "TheFekete",
"author": "thefekete.blogger.com",
"version": "0.1",
"type": "custom",
"url": "thefekete.blogger.com"
}
}
" | sed -e 's/^ *//' >.themes/compact_panel/gnome-shell/theme.json \
&& gsettings set org.gnome.shell.extensions.user-theme name compact_panel \
&& echo "You may need to perform a <alt><f2>r to reset the shell" \
&& echo "Or run: gnome-shell --replace & disown"
Gnome Shell Extensions
Install and enable extensions with gnome-ext-install
script:
echo "CoverflowAltTab@palatis.blogspot.com
Hide_Activities@shay.shayel.org
TopIcons@phocean.net
battery_status@milliburn.github.com
disconnect-wifi@kgshank.net
drive-menu@gnome-shell-extensions.gcampax.github.com
drop-down-terminal@gs-extensions.zzrough.org
dynamic-panel-transparency@rockon999.github.io
focus-my-window@varianto25.com
freon@UshakovVasilii_Github.yahoo.com
mediaplayer@patapon.info
openweather-extension@jenslody.de
places-menu@gnome-shell-extensions.gcampax.github.com
refresh-wifi@kgshank.net
todo.txt@bart.libert.gmail.com" | xargs gnome-ext-install
Then make sure the ones you want are enabled:
echo "
CoverflowAltTab@palatis.blogspot.com
Hide_Activities@shay.shayel.org
TopIcons@phocean.net
battery_status@milliburn.github.com
disconnect-wifi@kgshank.net
drive-menu@gnome-shell-extensions.gcampax.github.com
drop-down-terminal@gs-extensions.zzrough.org
dynamic-panel-transparency@rockon999.github.io
focus-my-window@varianto25.com
freon@UshakovVasilii_Github.yahoo.com
launch-new-instance@gnome-shell-extensions.gcampax.github.com
mediaplayer@patapon.info
openweather-extension@jenslody.de
places-menu@gnome-shell-extensions.gcampax.github.com
refresh-wifi@kgshank.net
system-monitor@paradoxxx.zero.gmail.com
todo.txt@bart.libert.gmail.com
user-theme@gnome-shell-extensions.gcampax.github.com
" | xargs -r -n1 -I{} gnome-shell-extension-tool --enable-extension={}
system-monitor
The system-monitor extension needs to be manually installed before we can use it:
# first delete any previous version
rm -rf ~/.local/share/gnome-shell/extensions/system-monitor@paradoxxx.zero.gmail.com
sudo apt-get -y install gir1.2-gtop-2.0 gir1.2-networkmanager-1.0 \
&& git clone git://github.com/paradoxxxzero/gnome-shell-system-monitor-applet.git \
&& mkdir -p ~/.local/share/gnome-shell/extensions \
&& cp -a gnome-shell-system-monitor-applet/system-monitor@paradoxxx.zero.gmail.com ~/.local/share/gnome-shell/extensions \
&& rm -r gnome-shell-system-monitor-applet \
&& gnome-shell-extension-tool --enable-extension=system-monitor@paradoxxx.zero.gmail.com || true \
&& echo "
[system-monitor]
battery-show-text=false
fan-sensor-file='/sys/class/hwmon/hwmon1/device/fan1_input'
center-display=false
icon-display=false
compact-display=true
move-clock=false
net-show-text=false
fan-show-text=false
freq-display=false
net-graph-width=40
memory-graph-width=40
thermal-sensor-file='/sys/class/hwmon/hwmon2/temp1_input'
thermal-display=false
thermal-style='digit'
freq-style='digit'
memory-show-text=false
battery-display=false
fan-style='digit'
thermal-show-text=false
cpu-graph-width=40
fan-display=false
cpu-show-text=false
" | sed -e 's/^ *//' | dconf load /org/gnome/shell/extensions/ \
&& echo "You may need to perform a <alt><f2>r to reset the shell" \
&& echo "Or run: gnome-shell --replace & disown"
Extension Settings
echo "
[system-monitor]
battery-show-text=false
fan-sensor-file='/sys/class/hwmon/hwmon1/device/fan1_input'
center-display=false
icon-display=false
compact-display=true
move-clock=false
net-show-text=false
fan-show-text=false
freq-display=false
net-graph-width=40
memory-graph-width=40
thermal-sensor-file='/sys/class/hwmon/hwmon2/temp1_input'
thermal-display=false
thermal-style='digit'
freq-style='digit'
memory-show-text=false
battery-display=false
fan-style='digit'
thermal-show-text=false
cpu-graph-width=40
fan-display=false
cpu-show-text=false
[battery_status]
display-mode='time'
when-full='icon'
[hide-app-icon]
hide-app-label=true
hide-app-icon=true
hide-arrow=true
[freon]
show-decimal-value=false
group-temperature=false
drive-utility='udisks2'
gpu-utility='none'
hot-sensors=['Maximum', 'fan1']
position-in-panel='right'
[openweather]
weather-provider='openweathermap'
days-forecast=3
unit='celsius'
geolocation-provider='openstreetmaps'
use-default-owm-key=true
show-text-in-panel=true
wind-speed-unit='kph'
refresh-interval-forecast=1800
position-in-panel='center'
translate-condition=true
refresh-interval-current=600
city='48.3548077,10.9836535>Friedberg, Landkreis Aichach-Friedberg, Schwaben, Bayern, Deutschland >-1 && 34.1423455,-118.248367>Glendale, Los Angeles County, California, United States of America >-1'
use-symbolic-icons=true
wind-direction=true
pressure-unit='hPa'
show-comment-in-forecast=true
decimal-places=1
[topicons]
icon-opacity=210
icon-size=22
icon-padding=3
tray-pos='left'
icon-saturation=0.5
tray-order=0
[TodoTxt]
donetxt-location='/home/$USER/Dropbox/todo/done.txt'
open-key=['']
show-delete-button=false
truncate-long-tasks=false
priorities-markup={'A': (true, 'rgb(237,212,0)', true, false), 'B': (true, 'rgb(115,210,22)', false, false), 'C': (true, 'rgb(0,153,204)', false, false)}
group-ungrouped=false
display-format-string='todo({unarchived})'
show-status-icon=true
group-by=2
style-priorities=true
show-priority-buttons=false
todotxt-location='/home/$USER/Dropbox/todo/todo.txt'
add-creation-date=true
settings-level=250
show-open-in-text-editor=true
" \
| sed -e 's/^ *//' | dconf load /org/gnome/shell/extensions/
Third-party Apps
Chrome Browser
You can go to the Chrome Download Page and click download, then install the .deb package, or do it all from the command line:
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub \
| sudo apt-key add - \
&& sudo sh -c 'echo \
"deb http://dl.google.com/linux/chrome/deb/ stable main" \
>> /etc/apt/sources.list.d/google-chrome.list' \
&& sudo apt-get update \
&& sudo apt-get install google-chrome-stable
Then go to the NoCountryRedirect app page and install it for use in Deutschland.
VirtualBox
Install VirtualBox from oracle:
wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add - \
&& wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add - \
&& sudo sh -c 'echo \
"deb http://download.virtualbox.org/virtualbox/debian xenial contrib" \
>> /etc/apt/sources.list.d/google-chrome.list' \
&& sudo apt-get update \
&& sudo apt-get -y install virtualbox-5.0 dkms \
&& sudo adduser $USER vboxusers
Dropbox
Download and instal Dropbox:
curl -LO https://www.dropbox.com/download?dl=packages/ubuntu/dropbox_2015.10.28_amd64.deb \
&& sudo dpkg -i dropbox_2015.10.28_amd64.deb \
&& rm dropbox_2015.10.28_amd64.deb \
&& dropbox start -i
Skype
sudo dpkg --add-architecture i386 \
&& sudo add-apt-repository "deb http://archive.canonical.com/ $(lsb_release -sc) partner" \
&& sudo apt-get update \
&& sudo apt-get -y install skype
Docker
sudo apt-get update && sudo apt-get install -y \
apt-transport-https ca-certificates \
&& sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 \
--recv-keys 58118E89F3A912897C070ADBF76221572C52609D \
&& sudo bash -c '
echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" \
>/etc/apt/sources.list.d/docker.list' \
&& sudo apt-get update \
&& sudo apt-get purge lxc-docker \
&& sudo apt-cache policy docker-engine \
&& sudo apt-get update \
&& sudo apt-get install -y linux-image-extra-$(uname -r) \
&& sudo apt-get install -y docker-engine docker-compose \
&& sudo service docker start \
&& sudo docker run hello-world
&& sudo groupadd -f docker \
&& sudo sudo usermod -aG docker $USER \
&& echo "You now need to log in/out to run docker without sudo"
Still to do
- arc-theme for gtk
- Fork blur extension, only blur behind terminal?
- Finger print reader
- Interactive Power button
- github dotfiles (?)
- Keepass or other password manager (later)
- Hibernate
- Disable lock curtain
No comments :
Post a Comment