summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2025-05-14 18:10:17 -0500
committerCraig Jennings <c@cjennings.net>2025-05-14 18:10:17 -0500
commite2c7d8a2636762999163a73df51cd968a235336d (patch)
treeada236565729fc18a0c17457929dbe5fc2817148
parent2be0eda167369a64107d1d322af909ca38906dff (diff)
moving back to swaybar and basic info
-rw-r--r--dotfiles/system/.config/sway/config54
-rwxr-xr-xdotfiles/system/.config/sway/config.d/swaybar.sh44
-rwxr-xr-xroot_scripts/wayland_config.sh7
3 files changed, 85 insertions, 20 deletions
diff --git a/dotfiles/system/.config/sway/config b/dotfiles/system/.config/sway/config
index ee610a7..0a2f790 100644
--- a/dotfiles/system/.config/sway/config
+++ b/dotfiles/system/.config/sway/config
@@ -25,6 +25,9 @@ focus_follows_mouse no
### Output configuration
output * bg /home/cjennings/pictures/wallpaper/it.saves.more.than.text.png fill
+# make cursor Vimix White
+seat * xcursor_theme Vimix-White 32
+
# scaling for framework laptop
output eDP-1 scale 1.8
@@ -218,25 +221,25 @@ bindsym $mod+r mode "resize"
#
# Utilities:
#
- # Special keys to adjust volume via PulseAudio
- bindsym --locked XF86AudioMute exec pactl set-sink-mute \@DEFAULT_SINK@ toggle
- bindsym --locked XF86AudioLowerVolume exec pactl set-sink-volume \@DEFAULT_SINK@ -5%
- bindsym --locked XF86AudioRaiseVolume exec pactl set-sink-volume \@DEFAULT_SINK@ +5%
- bindsym --locked XF86AudioMicMute exec pactl set-source-mute \@DEFAULT_SOURCE@ toggle
- # Special keys to adjust brightness via brightnessctl
- bindsym --locked XF86MonBrightnessDown exec brightnessctl set 5%-
- bindsym --locked XF86MonBrightnessUp exec brightnessctl set 5%+
- # Special key to take a screenshot with grim
- bindsym Print exec grim
-#
-# Waybar
-#
+ # Brightness Controls
+ bindsym XF86MonBrightnessUp exec backlight incr 5
+ bindsym XF86MonBrightnessDown exec backlight decr 5
+
+ # Audio Controls
+ bindsym XF86AudioMute exec mixer vol.mute=^
+ bindsym XF86AudioLowerVolume exec mixer vol=-0.1
+ bindsym XF86AudioRaiseVolume exec mixer vol=+0.1
-bar {
- swaybar_command waybar
- position top
-}
+ # # Special key to take a screenshot with grim
+ # bindsym Print exec grim
+
+
+# Disable display when lid is closed (and vice versa)
+set $disp_laptop "eDP-1"
+
+bindswitch --reload --locked lid:on output $disp_laptop disable
+bindswitch --reload --locked lid:off output $disp_laptop enable
#
# Window Title Bar
@@ -248,4 +251,21 @@ bar {
smart_borders smart
titlebar_border_thickness 0
+#
+# Swaybar Contents
+#
+
+bar {
+ swaybar_command swaybar
+ status_command while true; do ~/.config/sway/config.d/swaybar.sh; sleep 30; done
+
+ font pango:FontAwesome 10, FiraCode 10
+ position top
+ tray_output primary
+ colors {
+ statusline #ffffff
+ background #222222
+ }
+}
+
include /usr/local/etc/sway/config.d/*
diff --git a/dotfiles/system/.config/sway/config.d/swaybar.sh b/dotfiles/system/.config/sway/config.d/swaybar.sh
new file mode 100755
index 0000000..fe0771d
--- /dev/null
+++ b/dotfiles/system/.config/sway/config.d/swaybar.sh
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+# Get the formatted date and time
+datetime=$(date "+%a %b %-d, %Y %-l:%M %p %Z")
+
+# Get battery percentage
+battery=$(sysctl -n hw.acpi.battery.life 2>/dev/null)
+
+# Handle battery icon
+if [ -z "$battery" ]; then
+ battery="?"
+ battery_icon="" # Unknown
+else
+ if [ "$battery" -ge 90 ]; then
+ battery_icon=""
+ elif [ "$battery" -ge 60 ]; then
+ battery_icon=""
+ elif [ "$battery" -ge 30 ]; then
+ battery_icon=""
+ elif [ "$battery" -ge 10 ]; then
+ battery_icon=""
+ else
+ battery_icon=""
+ fi
+fi
+
+# Get connected Wi-Fi SSID (for FreeBSD)
+# Use ifconfig to get the SSID of wlan0 (adjust if different interface name)
+wifi_ssid=$(ifconfig wlan0 2>/dev/null | awk '/ssid/ {print $2}' | head -n 1)
+
+# Only show Wi-Fi if connected
+if [ -n "$wifi_ssid" ]; then
+ wifi_output=" $wifi_ssid"
+else
+ wifi_output=""
+fi
+
+# Build final output
+output=""
+[ -n "$wifi_output" ] && output="$wifi_output | "
+output="$output$battery_icon $battery% | $datetime"
+
+# Output the result
+echo "$output"
diff --git a/root_scripts/wayland_config.sh b/root_scripts/wayland_config.sh
index 4b144b5..6f29d24 100755
--- a/root_scripts/wayland_config.sh
+++ b/root_scripts/wayland_config.sh
@@ -1,13 +1,13 @@
#!/bin/sh
# Craig Jennings <c@cjennings.net>
-pkg install -y wayland # core wayland window system code and protocol
+pkg install -y foot # wayland terminal emulator
+pkg install -y fuzzel # application launcher for wayland compositors
pkg install -y seatd # seat management daemon and universal library required by wayland
pkg install -y sway # i3-comptatible wayland compositor
pkg install -y swayidle # idle management daemon for wayland
pkg install -y swaylock-effects # screen locker for wayland with fancy effects
-pkg install -y foot # wayland terminal emulator
-pkg install -y fuzzel # application launcher for wayland compositors
+pkg install -y wayland # core wayland window system code and protocol
pkg install -y wtype # programmatically simulate keyboard input on wayland
# add XDG RUNTIME to .profile
@@ -16,3 +16,4 @@ echo "export XDG_RUNTIME_DIR=/tmp" >> /root/.profile
# seatd mediates access to shared devices (wayland requirement)
sysrc seatd_enable="YES"
service seatd start
+