home · contact · privacy
Improve raspi setup.
authorChristian Heller <c.heller@plomlompom.de>
Sat, 2 Nov 2024 17:45:38 +0000 (18:45 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Sat, 2 Nov 2024 17:45:38 +0000 (18:45 +0100)
many_releases/aptmark/raspi
many_releases/etc/raspi/greetd/config.toml
many_releases/home/desktop/.config/sway/config
many_releases/home/raspi/.nonpath_bins/on_session_start.sh [new file with mode: 0755]
many_releases/home/raspi/.nonpath_bins/status.sh [new file with mode: 0755]
many_releases/home/raspi/.on_session_start.sh [deleted file]

index 6db4efe3abdaa79d710965f3a54323fef2520ae5..537a645a5f81218f5b16eb153dfc717b98941588 100644 (file)
@@ -5,6 +5,8 @@ raspi-firmware
 # to boot into a graphical environment
 greetd
 sway
+# for waybar script
+calc
 # for sound
 pulseaudio
 # for setting console keyboard via /etc/default/keyboard 
@@ -16,6 +18,8 @@ mpv
 firefox-esr
 # for convenience
 foot
+less
 sudo
 vim
 ack
+man-db
index d07e7c951875ac83e63431088ab704e470d65789..d7b50f83efef1eea90988ff7987422fd23a7694d 100644 (file)
@@ -1,5 +1,5 @@
 [terminal]
 vt = 7 
 [default_session]
-command = "/home/plom/.on_session_start.sh"
+command = "~/.nonpath_bins/on_session_start.sh"
 user = "plom"
index ccd2b504f00849c832b189b39bf485128b13968a..e995681f1fa28d0465fded57eb170f6932e07bfe 100644 (file)
@@ -1,4 +1,37 @@
-include /etc/sway/config
-output * background #551199 solid_color
-bindsym $mod+Shift+p exec swaynag -t warning -m 'Really exit sway/end Wayland session?' -B 'Yes, exit sway' 'swaymsg exit'
+# because these are included by /etc/sway/config for probably good reason …
+include /etc/sway/config-vars.d/*
+include /etc/sway/config.d/*
+
+# simple green background
+output * background #559911 solid_color
+
+# keyboard layout
 input * xkb_layout "de"
+
+# waybar
+bar {
+  position top
+  status_command ~/.nonpath_bins/status.sh
+}
+
+# keybindings
+set $mod Mod4
+
+bindsym $mod+Return exec foot
+bindsym $mod+Shift+q kill
+bindsym $mod+Shift+p exit
+
+bindsym $mod+f fullscreen
+bindsym $mod+space focus mode_toggle
+bindsym $mod+Shift+space floating toggle
+
+bindsym $mod+Left focus left
+bindsym $mod+Down focus down
+bindsym $mod+Up focus up
+bindsym $mod+Right focus right
+
+bindsym $mod+Shift+Left move left
+bindsym $mod+Shift+Down move down
+bindsym $mod+Shift+Up move up
+bindsym $mod+Shift+Right move right
+
diff --git a/many_releases/home/raspi/.nonpath_bins/on_session_start.sh b/many_releases/home/raspi/.nonpath_bins/on_session_start.sh
new file mode 100755 (executable)
index 0000000..380e79f
--- /dev/null
@@ -0,0 +1,13 @@
+#!/usr/bin/sh
+# Iinitalize anything we want in our sessions opened by greetd.
+
+# Workaround to pulseaudio daemon somehow not respecting setting these with
+# ~/.config/pulse/default.pa – note that the first pactl call also seems
+# necessary, probably for forcing some init routines without which the pacmd
+# calls that follow won't work; TODO: find cleaner solutions 
+pactl list sinks > /dev/null
+pacmd set-default-sink alsa_output.platform-fef05700.hdmi.hdmi-stereo
+pacmd set-sink-volume alsa_output.platform-fef05700.hdmi.hdmi-stereo 65536 
+
+# Wayland environment.
+/usr/bin/sway
diff --git a/many_releases/home/raspi/.nonpath_bins/status.sh b/many_releases/home/raspi/.nonpath_bins/status.sh
new file mode 100755 (executable)
index 0000000..418a52b
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh
+# see sway-bar(5) and swaybar-protocol(7)
+printf '{ "version": 1 }\n[\n' 
+while true; do
+  printf '  [\n'
+  printf '    {"full_text": "%s"},\n' "$(ip -4 addr show scope global | grep -oP '(?<=inet\s)\d+(\.\d+){3}')"
+  printf '    {"full_text": "%d° C"},\n' $(calc "$(cat /sys/class/thermal/thermal_zone0/temp) // 1000")
+  printf '    {"full_text": "%.1f GHz"},\n' $(calc "$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq) / 1000000")
+  printf '    {"full_text": "%s"},\n' "$(date +'%Y-%m-%d %X')"
+  printf '  ],\n'
+  sleep 1
+done
diff --git a/many_releases/home/raspi/.on_session_start.sh b/many_releases/home/raspi/.on_session_start.sh
deleted file mode 100755 (executable)
index bcbba4d..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/usr/bin/sh
-# Iinitalize anything we want in our sessions opened by greetd.
-
-# Workaround to pulseaudio daemon somehow not respecting setting these with
-# ~/.config/pulse/default.pa – note that the first pactl call also seems
-# necessary, probably for forcing some init routines without which the pacmd
-# calls that follow won't work; TODO: find cleaner solutions 
-pactl list sinks > /dev/null
-pacmd set-default-sink alsa_output.platform-fef05700.hdmi.hdmi-stereo
-pacmd set-sink-volume alsa_output.platform-fef05700.hdmi.hdmi-stereo 32768 
-
-# Wayland environment.
-/usr/bin/sway