summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2025-05-08 11:48:21 -0500
committerCraig Jennings <c@cjennings.net>2025-05-08 11:48:21 -0500
commit1c18243cb7fdbadfa27059128bde61577982df7a (patch)
tree1ab9e958bddbe56a959b262ab5c1a8032a8512e5
parent5525f755156b9ffd8daf9f9d091e581ff99f820a (diff)
adding touchpad with gestures
-rw-r--r--dotfiles/sway/.config/sway/config47
1 files changed, 39 insertions, 8 deletions
diff --git a/dotfiles/sway/.config/sway/config b/dotfiles/sway/.config/sway/config
index d2e6492..9bc9311 100644
--- a/dotfiles/sway/.config/sway/config
+++ b/dotfiles/sway/.config/sway/config
@@ -8,6 +8,9 @@
#
# Logo key. Use Mod1 for Alt.
set $mod Mod4
+
+input * xkb_rules evdev
+
# Home row direction keys, like vim
set $left h
set $down j
@@ -207,21 +210,49 @@ bindsym $mod+r mode "resize"
# Special key to take a screenshot with grim
bindsym Print exec grim
+# touchpad config with gestures
+input type:touchpad {
+ dwt enabled
+ tap enabled
+ middle_emulation enable
+ tap_button_map lrm
+ scroll_method two_finger
+}
+
#
# Status Bar:
#
# Read `man 5 sway-bar` for more information about this section.
bar {
- position top
+ # apm extracts power data, get the percentage
+ result=$(apm |grep \%|cut -d ' ' -f4|head -1)
+
+ # If mute is on, apply a "speaker-no" emoji
+ mute_status=""
+ if [ $(mixer vol.mute|cut -f2 -d=) = "on" ]; then
+ mute_status="🔇 "
+ fi
+
+ # Convert the volume data from the mixer into a whole number
+ # and display it after a cool emoji speaker
+ pct=""
+ if [ -z "$mute_status" ]; then
+ vol_val=`mixer vol.volume|cut -d: -f2`
+ vv_pct=`echo "${vol_val} * 100"|bc -l|cut -d\. -f1`
+ pct=`printf "🔊 %s%%" ${vv_pct}`
+ else
+ pct=""
+ fi
+
+ # Aggregate mute|volume, volume level data into a variable
+ sound_status="${mute_status}${pct}"
+
+ # Get date/time
+ d=$(date +'%Y-%m-%d %I:%M:%S %p')
- # When the status_command prints a new line to stdout, swaybar updates.
- # The default just shows the current date and time.
- status_command while date +'%Y-%m-%d %X'; do sleep 1; done
+ # Date, battery icon|battery level, sound summary
+ echo "$d (🔋${result}) ${sound_status}"
- colors {
- statusline #ffffff
- background #323232
- inactive_workspace #32323200 #32323200 #5c5c5c
}
}