diff options
Diffstat (limited to 'dotfiles/system/.config')
| -rw-r--r-- | dotfiles/system/.config/sway/config | 54 | ||||
| -rwxr-xr-x | dotfiles/system/.config/sway/config.d/swaybar.sh | 44 | 
2 files changed, 81 insertions, 17 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" | 
