diff options
| author | Marc Vertes <mvertes@free.fr> | 2020-06-01 21:47:22 +0200 |
|---|---|---|
| committer | Marc Vertes <mvertes@free.fr> | 2020-06-01 21:47:22 +0200 |
| commit | d5aa393bc951a7609aab3c3c22c473a9637ea983 (patch) | |
| tree | e4c0d721ff8e1ed77cbda5a2a78700b6196a0241 | |
| parent | b87761ba92a15794d3cf8a65cf7feddfc088cd6f (diff) | |
update
| -rw-r--r-- | .bashrc | 4 | ||||
| -rw-r--r-- | .config/gtk-3.0/settings.ini | 2 | ||||
| -rw-r--r-- | .config/i3/config | 5 | ||||
| -rw-r--r-- | .i3status.conf | 16 | ||||
| -rw-r--r-- | .local/share/applications/wpa_gui.desktop | 10 | ||||
| -rw-r--r-- | .profile | 2 | ||||
| -rwxr-xr-x | bin/yoda | 34 |
7 files changed, 52 insertions, 21 deletions
@@ -40,6 +40,8 @@ export TERMINAL=xt alias cl='cf xft:Mono:size=12' alias ls='ls --color=auto -v' alias ll='ls -AlFhv' +alias vi='vim' +alias view='vim -R' #alias op='xdg-open' alias git='hub' #alias go='go1.14.1' @@ -60,7 +62,7 @@ alias ww='vi ~/Wiki/HomePage' alias dotfiles='git --git-dir=$HOME/dotfiles --work-tree=$HOME' alias uc='systemctl --user' -alias wpa='sudo wpa_gui -i wlo1' +alias wpa='sudo wpa_gui -i wlan0' alias ifre='echo "ip link set wlo1 down; ip link set wlo1 up"|sudo sh' diff --git a/.config/gtk-3.0/settings.ini b/.config/gtk-3.0/settings.ini new file mode 100644 index 0000000..a3da8ab --- /dev/null +++ b/.config/gtk-3.0/settings.ini @@ -0,0 +1,2 @@ +[Settings] +gtk-font-name = Liberation Sans 9 diff --git a/.config/i3/config b/.config/i3/config index 44acee4..757e202 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -26,7 +26,7 @@ font fixed # xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the # screen before suspend. Use loginctl lock-session to lock your screen. -#exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork +exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock -c 000000 --nofork # NetworkManager is the most popular way to manage wireless networks on Linux, # and nm-applet is a desktop environment-independent system tray GUI for it. @@ -39,8 +39,11 @@ exec --no-startup-id pasystray # Use pactl to adjust volume in PulseAudio. set $refresh_i3status killall -SIGUSR1 i3status bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status +bindsym $mod+KP_Add exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status +bindsym $mod+KP_Subtract exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status +bindsym $mod+KP_Enter exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status # enable floating mode diff --git a/.i3status.conf b/.i3status.conf index f01681f..9936f8a 100644 --- a/.i3status.conf +++ b/.i3status.conf @@ -13,10 +13,10 @@ general { #order += "ipv6" order += "wireless _first_" -#order += "ethernet _first_" +order += "ethernet _first_" order += "battery all" order += "disk /" -order += "disk /home" +#order += "disk /boot" order += "cpu_usage" #order += "load" order += "memory" @@ -29,10 +29,10 @@ wireless _first_ { format_down = "W: down" } -#ethernet _first_ { -# format_up = "E: %ip (%speed)" -# format_down = "E: down" -#} +ethernet _first_ { + format_up = "E: %ip (%speed)" + format_down = "E: down" +} battery all { last_full_capacity = true @@ -57,8 +57,8 @@ disk "/" { format = "/ %avail" } -disk "/home" { - format = "/home %avail" +disk "/boot" { + format = "/boot %avail" } cpu_usage { diff --git a/.local/share/applications/wpa_gui.desktop b/.local/share/applications/wpa_gui.desktop new file mode 100644 index 0000000..29542af --- /dev/null +++ b/.local/share/applications/wpa_gui.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Version=1.0 +Name=wpa_gui +Comment=Graphical user interface for wpa_supplicant +Exec=sudo wpa_gui -i wlan0 +Icon=wpa_gui +GenericName=wpa_supplicant user interface +Terminal=false +Type=Application +Categories=Qt;Network; @@ -6,5 +6,5 @@ PATH=~/bin:$PATH:~/go/bin # Last action: auto start X11 when logged on first console case $HOSTNAME in -(swift) [ "$(tty)" != /dev/tty1 ] || exec startx ;; +(swift|yoda) [ "$(tty)" != /dev/tty1 ] || exec startx ;; esac @@ -35,6 +35,16 @@ skip() { return 1 } +# return 1 if any of the required commands is missing +prereq() { + ok='ok' + for cmd in cryptsetup dd fdisk mkfs.fat mkfs.ext4 mount pacstrap genfstab arch-chroot + do + command -v "$cmd" >/dev/null || { ok=''; echo "$cmd not found"; } + done + test "$ok" +} + # Step 0: Prepare by wiping all data and randomize (very long). step0() { cryptsetup open --type plain -d /dev/urandom "$dev" to_be_wiped @@ -64,13 +74,13 @@ EOT # Step 2: Encrypt root partition. step2() { rootpart="/dev/mapper/$par" - cryptsetup -y -v luksFormat ${dev}2 - cryptsetup open ${dev}2 $par + cryptsetup -y -v luksFormat ${dev}${ppref}2 + cryptsetup open ${dev}${ppref}2 $par } # Step 3: Format partitions. step3() { - mkfs.fat -F32 "${dev}1" + mkfs.fat -F32 "${dev}${ppref}1" yes | mkfs.ext4 "$rootpart" } @@ -78,7 +88,7 @@ step3() { step4() { mount "$rootpart" /mnt mkdir /mnt/boot - mount ${dev}1 /mnt/boot + mount ${dev}${ppref}1 /mnt/boot trap cleanup EXIT } @@ -161,8 +171,8 @@ EOT DNSSEC=no EOT - packages="linux linux-firmware intel-ucode amd-ucode sudo vi wireless_tools -wpa_supplicant openssh arch-install-scripts" + packages="linux linux-firmware intel-ucode amd-ucode sof-firmware \ + dosfstools sudo vi wireless_tools wpa_supplicant openssh arch-install-scripts" arch-chroot /mnt << EOT locale-gen @@ -181,6 +191,7 @@ EOT echo "$user ALL=(ALL) ALL" > "/mnt/etc/sudoers.d/01_$user" fi + mkdir -p /mnt/etc/wpa_supplicant cat /etc/wpa_supplicant/wpa_supplicant*.conf > /mnt/etc/wpa_supplicant/wpa_supplicant-wlan0.conf cat > /mnt/boot/loader/loader.conf << \EOT @@ -190,10 +201,10 @@ console-mode max EOT if skip 2; then - uid=$(blkid -p -s UUID -o value "${dev}2") + uid=$(blkid -p -s UUID -o value "${dev}${ppref}2") rdopt="root=/dev/disk/by-uuid/$uid" else - uid=$(blkid -p -s UUID -o value "${dev}2") + uid=$(blkid -p -s UUID -o value "${dev}${ppref}2") rdopt="rd.luks.name=$uid=root root=/dev/mapper/root" fi cat > /mnt/boot/loader/entries/arch.conf << EOT @@ -202,7 +213,7 @@ linux /vmlinuz-linux initrd /intel-ucode.img initrd /amd-ucode.img initrd /initramfs-linux.img -option $rdopt net.ifnames=0 rw +options $rdopt net.ifnames=0 rw EOT } @@ -229,9 +240,12 @@ shift $((OPTIND - 1)) [ "$(id -u)" = 0 ] || die "not root" [ "$1" ] && dev=$1 || die 'no device' par=${dev##*/}root -rootpart="${dev}2" +case $dev in (*nvme*) ppref='p';; esac +rootpart="${dev}${ppref}2" myself=$(type -p $0) +prereq || exit 1 + echo -n "Device $dev will be completely erased. Continue ? Y/N " read -r resp && [ "$resp" = 'Y' ] || exit |
