Skip to content

Instantly share code, notes, and snippets.

@unipi-user
Last active February 2, 2019 16:52
Show Gist options
  • Save unipi-user/e33fb19c0d3f60284547 to your computer and use it in GitHub Desktop.
Save unipi-user/e33fb19c0d3f60284547 to your computer and use it in GitHub Desktop.
Arch-Final
#!/bin/bash
#Installation
# Set the hostname
echo martin-pc > /etc/hostname
# Set timezone (or use tzselect)
ln -s /usr/share/zoneinfo/Europe/Berlin /etc/localtime
# Set locales and generate them
echo LANG=de_DE.UTF-8 > /etc/locale.conf
echo LANGUAGE=de_DE >> /etc/locale.conf
echo KEYMAP=de-latin1 > /etc/vconsole.conf
echo "en_US.UTF-8 UTF-8" > /etc/locale.gen
echo "en_US ISO-8859-1" >> /etc/locale.gen
echo "de_DE.UTF-8 UTF-8" >> /etc/locale.gen
echo "de_DE ISO-8859-1" >> /etc/locale.gen
locale-gen
# Configure the network
pacman -Sy wpa_supplicant dialog
cp /etc/netctl/examples/wireless-wpa /etc/netctl/
nano /etc/netctl/wireless-wpa
netctl enable wireless-wpa
# Create a new initial RAM disk
mkinitcpio -p linux
# Set the root password
echo "Set root password:"
passwd
# Install and configure the Bootloader
bootctl install
echo "title Arch Linux" > /boot/loader/entries/arch.conf
echo "linux /vmlinuz-linux" >> /boot/loader/entries/arch.conf
echo "initrd /initramfs-linux.img" >> /boot/loader/entries/arch.conf
echo "options root=/dev/sda2 rw" >> /boot/loader/entries/arch.conf
echo "default arch" > /boot/loader/loader.conf
# Exit the chroot environment and reboot (optionaly add: umount -R /mnt)
echo "1. exit | 2. umount -R /mnt | 3. reboot | 4. execute Arch-Post-Installation.sh"
#!/bin/bash
#Post-Installation
# Create user and set password
useradd -m -g users -G wheel,storage,power,audio,video,vboxusers -s /bin/bash martin
echo "Set password for user-martin:"
passwd martin
# Install important services
pacman -Sy acpid ntp dbus avahi cups cronie
systemctl enable acpid
systemctl enable ntpd
systemctl enable avahi-daemon
systemctl enable org.cups.cupsd.service
systemctl enable cronie
# Install command line and ncurses programs
pacman -S sudo
pacman -S htop
pacman -S vim
pacman -S alsa-utils
pacman -S scrot
pacman -S xrandr
# Install xorg
pacman -S mesa
pacman -S xorg
pacman -S xorg-xinit
# Install window manager
pacman -S i3
pacman -S dmenu
# Install graphical programs
pacman -S rxvt-unicode rxvt-unicode-terminfo xclip
pacman -S firefox # + Adblocker
pacman -S libreoffice
pacman -S vlc
pacman -S geany
pacman -S gimp
pacman -S thunar gvfs udisks file-roller zip unzip unrar
pacman -S gpicview
sudo pacman -S virtualbox virtualbox-host-modules virtualbox-guest-iso
# Install some extras
pacman -S iw wpa_supplicant dialog
pacman -S ttf-dejavu
pacman -S flashplugin
pacman -S xf86-input-synaptics
# Enable Sdcard-reader
modprobe ohci_hcd
# Create Screenshot folder
mkdir -p /home/martin/Images/Screenshots
# Configure sudo
sed -i 's/# %wheel ALL=(ALL) ALL/%wheel ALL=(ALL) ALL/' /etc/sudoers
# Allow to run Wifi-menu without password
echo "martin ALL = NOPASSWD: /usr/bin/wifi-menu" >> /etc/sudoers
# Configure Keyboardlayout
localectl set-x11-keymap de pc105 de_nodeadkeys
echo "#! /bin/bash" > /home/martin/.xinitrc
echo "setxkbmap de" >> /home/martin/.xinitrc
# Configure the network
#cp /etc/netctl/examples/wireless-wpa /etc/netctl/
#nano /etc/netctl/wireless-wpa
#netctl enable wireless-wpa
# Configure alsamixer
sudo touch /etc/asound.conf
echo "defaults.pcm.card 1" > /etc/asound.conf
echo "defaults.pcm.device 0" >> /etc/asound.conf
echo "defaults.ctl.card 1" >> /etc/asound.conf
# Configure urxvt terminal
cp /Xdefaults.sh /home/martin/.Xdefaults
# Feh set background
mkdir -p /home/martin/Images/Wallpapers
cp /1337.jpg /home/martin/Images/Wallpapers/1337.jpg
feh --bg-fill /home/martin/Images/Wallpapers/1337.jpg
echo "sh ~/.fehbg &" >> /home/martin/.xinitrc
# Configure i3
cp /i3status.sh /home/martin/.i3status.conf
cp /i3config.sh /home/martin/.config/i3/config
# Configure xinit
echo "exec i3" >> /home/martin/.xinitrc
# Finish
echo "Installation finished!!!"
#!/bin/bash
#Pre-Installation
# Set the keyboard layout
loadkeys de-latin1
# Connect to the Internet
wifi-menu
# Update the system clock
timedatectl set-ntp true
# Partition the disks
# mkpart ESP fat32 1MiB 513MiB
# set 1 boot on
# mkpart primary ext4 513MiB 100%
parted
# Format the partitions
mkfs.fat -F32 /dev/sda1
mkfs.ext4 /dev/sda2
# Mount the partitions
mount /dev/sda2 /mnt
mkdir -p /mnt/boot
mount /dev/sda1 /mnt/boot
# Select the mirrors
cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak
grep -E -A 1 ".*Germany.*$" /etc/pacman.d/mirrorlist.bak | sed '/--/d' > /etc/pacman.d/mirrorlist
# Install the base packages
pacstrap -i /mnt base base-devel
# Configure the system
genfstab -U /mnt > /mnt/etc/fstab
# Copy the scripts to the new system
cp Arch-Installation.sh /mnt/Arch-Installation.sh
cp Arch-Post-Installation.sh /mnt/Arch-Post-Installation.sh
cp i3config.sh /mnt/i3config.sh
cp i3status.sh /mnt/i3status.sh
cp Xdefaults.sh /mnt/Xdefaults.sh
# Change root into the new system and start second Script
arch-chroot /mnt /bin/bash ./Arch-Installation.sh
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
set $mod Mod4
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
font pango:monospace 8
# This font is widely installed, provides lots of unicode glyphs, right-to-left
# text rendering and scalability on retina/hidpi displays (thanks to pango).
#font pango:DejaVu Sans Mono 8
# Before i3 v4.8, we used to recommend this one as the default:
# font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
# The font above is very space-efficient, that is, it looks good, sharp and
# clear in small sizes. However, its unicode glyph coverage is limited, the old
# X core fonts rendering does not support right-to-left and this being a bitmap
# font, it doesn’t scale on retina/hidpi displays.
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# start a terminal
bindsym $mod+Return exec i3-sensible-terminal
# kill focused window
bindsym $mod+Shift+q kill
# start dmenu (a program launcher)
bindsym $mod+d exec dmenu_run
# There also is the (new) i3-dmenu-desktop which only displays applications
# shipping a .desktop file. It is a wrapper around dmenu, so you need that
# installed.
# bindsym $mod+d exec --no-startup-id i3-dmenu-desktop
# change focus
bindsym $mod+j focus left
bindsym $mod+k focus down
bindsym $mod+l focus up
bindsym $mod+semicolon focus right
# alternatively, you can use the cursor keys:
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# move focused window
bindsym $mod+Shift+j move left
bindsym $mod+Shift+k move down
bindsym $mod+Shift+l move up
bindsym $mod+Shift+semicolon move right
# alternatively, you can use the cursor keys:
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
# split in horizontal orientation
bindsym $mod+h split h
# split in vertical orientation
bindsym $mod+v split v
# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle
# change container layout (stacked, tabbed, toggle split)
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
# toggle tiling / floating
bindsym $mod+Shift+space floating toggle
# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle
# focus the parent container
bindsym $mod+a focus parent
# focus the child container
#bindsym $mod+d focus child
# switch to workspace
bindsym $mod+1 workspace 1
bindsym $mod+2 workspace 2
bindsym $mod+3 workspace 3
bindsym $mod+4 workspace 4
bindsym $mod+5 workspace 5
bindsym $mod+6 workspace 6
bindsym $mod+7 workspace 7
bindsym $mod+8 workspace 8
bindsym $mod+9 workspace 9
bindsym $mod+0 workspace 10
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace 1
bindsym $mod+Shift+2 move container to workspace 2
bindsym $mod+Shift+3 move container to workspace 3
bindsym $mod+Shift+4 move container to workspace 4
bindsym $mod+Shift+5 move container to workspace 5
bindsym $mod+Shift+6 move container to workspace 6
bindsym $mod+Shift+7 move container to workspace 7
bindsym $mod+Shift+8 move container to workspace 8
bindsym $mod+Shift+9 move container to workspace 9
bindsym $mod+Shift+0 move container to workspace 10
# reload the configuration file
bindsym $mod+Shift+c reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+r restart
# exit i3 (logs you out of your X session)
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'"
# resize window (you can also use the mouse for that)
mode "resize" {
# These bindings trigger as soon as you enter the resize mode
# Pressing left will shrink the window’s width.
# Pressing right will grow the window’s width.
# Pressing up will shrink the window’s height.
# Pressing down will grow the window’s height.
bindsym j resize shrink width 10 px or 10 ppt
bindsym k resize grow height 10 px or 10 ppt
bindsym l resize shrink height 10 px or 10 ppt
bindsym semicolon resize grow width 10 px or 10 ppt
# same bindings, but for the arrow keys
bindsym Left resize shrink width 10 px or 10 ppt
bindsym Down resize grow height 10 px or 10 ppt
bindsym Up resize shrink height 10 px or 10 ppt
bindsym Right resize grow width 10 px or 10 ppt
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
bar {
status_command i3status
tray_output primary
}
# Inc Dec Mute Music
bindsym XF86AudioRaiseVolume exec amixer -q set Master 5%+ unmute
bindsym XF86AudioLowerVolume exec amixer -q set Master 5%- unmute
bindsym XF86AudioMute exec amixer -q set Master mute
# XF86MonBrightnessDown
bindsym $mod+F5 exec xbacklight -dec 10
# XF86MonBrightnessUp
bindsym $mod+F6 exec xbacklight -inc 10
# Wlan set up
bindsym $mod+F2 exec terminator -e "sudo wifi-menu"
# Make Screenshot
bindsym --release Print exec scrot -s ~/Images/Screenshots/%Y-%m-%d-%T-screenshot.png
# i3status configuration file.
# see "man i3status" for documentation.
# It is important that this file is edited as UTF-8.
# The following line should contain a sharp s:
# ß
# If the above line is not correctly displayed, fix your editor first!
general {
colors = true
interval = 5
}
#order += "ipv6"
#order += "disk /"
#order += "run_watch DHCP"
#order += "run_watch VPN"
order += "wireless _first_"
#order += "ethernet _first_"
order += "battery 0"
#order += "load"
order += "tztime local"
wireless _first_ {
format_up = "%quality"
format_down = "Down"
}
battery 0 {
format = "%status %percentage %remaining"
}
tztime local {
format = "%d-%m-%Y %H:%M"
}
! urxvt
URxvt*geometry: 115x40
!URxvt*font: xft:Liberation Mono:pixelsize=14:antialias=false:hinting=true
URxvt*font: xft:Inconsolata:pixelsize=17:antialias=true:hinting=true
URxvt*boldFont: xft:Inconsolata:bold:pixelsize=17:antialias=false:hinting=true
!URxvt*boldFont: xft:Liberation Mono:bold:pixelsize=14:antialias=false:hinting=true
URxvt*depth: 24
URxvt*borderless: 1
URxvt*scrollBar: false
URxvt*saveLines: 2000
URxvt.transparent: true
URxvt*.shading: 10
! Meta modifier for keybindings
!URxvt.modifier: super
!! perl extensions
URxvt.perl-ext: default,url-select,clipboard
! url-select (part of urxvt-perls package)
URxvt.keysym.M-u: perl:url-select:select_next
URxvt.url-select.autocopy: true
URxvt.url-select.button: 2
URxvt.url-select.launcher: chromium
URxvt.url-select.underline: true
! Nastavuje kopirovani
URxvt.keysym.Shift-Control-V: perl:clipboard:paste
URxvt.keysym.Shift-Control-C: perl:clipboard:copy
! disable the stupid ctrl+shift 'feature'
URxvt.iso14755: false
URxvt.iso14755_52: false
!urxvt color scheme:
URxvt*background: #2B2B2B
URxvt*foreground: #DEDEDE
URxvt*colorUL: #86a2b0
! black
URxvt*color0 : #2E3436
URxvt*color8 : #555753
! red
URxvt*color1 : #CC0000
URxvt*color9 : #EF2929
! green
URxvt*color2 : #4E9A06
URxvt*color10 : #8AE234
! yellow
URxvt*color3 : #C4A000
URxvt*color11 : #FCE94F
! blue
URxvt*color4 : #3465A4
URxvt*color12 : #729FCF
! magenta
URxvt*color5 : #75507B
URxvt*color13 : #AD7FA8
! cyan
URxvt*color6 : #06989A
URxvt*color14 : #34E2E2
! white
URxvt*color7 : #D3D7CF
URxvt*color15 : #EEEEEC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment