summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Vertes <mvertes@free.fr>2020-06-01 22:20:51 +0200
committerMarc Vertes <mvertes@free.fr>2020-06-01 22:20:51 +0200
commit39bcc0e9bf2b655849024ba28676145e794f538d (patch)
treef9a7accea460583610ace4d452f7e73e10d05cfb
parentb87761ba92a15794d3cf8a65cf7feddfc088cd6f (diff)
update
-rw-r--r--.bashrc4
-rw-r--r--.config/gtk-3.0/settings.ini2
-rw-r--r--.config/i3/config5
-rw-r--r--.i3status.conf12
-rw-r--r--.local/share/applications/wpa_gui.desktop10
-rwxr-xr-xbin/yoda34
6 files changed, 52 insertions, 15 deletions
diff --git a/.bashrc b/.bashrc
index 4b95197..771c00e 100644
--- a/.bashrc
+++ b/.bashrc
@@ -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..df25313 100644
--- a/.i3status.conf
+++ b/.i3status.conf
@@ -11,18 +11,24 @@ general {
interval = 5
}
+order += "read_file hostname"
#order += "ipv6"
order += "wireless _first_"
#order += "ethernet _first_"
order += "battery all"
order += "disk /"
-order += "disk /home"
+#order += "disk /boot"
order += "cpu_usage"
#order += "load"
order += "memory"
order += "cpu_temperature 0"
order += "tztime local"
+read_file hostname {
+ format = "%content"
+ path = "/etc/hostname"
+}
+
wireless _first_ {
# format_up = "W: %essid %quality %ip"
format_up = "W: %essid %quality"
@@ -57,8 +63,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;
diff --git a/bin/yoda b/bin/yoda
index a847d8f..4aa1667 100755
--- a/bin/yoda
+++ b/bin/yoda
@@ -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