diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 52e14d48..3fe34cdf 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -45,6 +45,34 @@ else() set(ADAPTER ADP1) endif() +# }}} +# Get network interfaces {{{ + +if(ENABLE_NETWORK) + string(REGEX REPLACE /%battery%.* "" PATH_BAT ${SETTING_PATH_BATTERY_CAPACITY}) + string(REGEX REPLACE /%adapter%.* "" PATH_ADP ${SETTING_PATH_ADAPTER_STATUS}) + + file(GLOB IFLIST RELATIVE /sys/class/net /sys/class/net/*) + + foreach(INTERFACE ${IFLIST}) + if(NOT ${INTERFACE} STREQUAL "lo") + file(GLOB IS_WIRELESS /sys/class/net/${INTERFACE}/wireless) + if(IS_WIRELESS) + set(INTERFACE_WLAN ${INTERFACE}) + else() + set(INTERFACE_ETH ${INTERFACE}) + endif() + endif() + endforeach() + + if(NOT INTERFACE_ETH) + set(INTERFACE_ETH net0) + endif() + if(NOT INTERFACE_WLAN) + set(INTERFACE_WLAN net1) + endif() +endif() + # }}} # Configure and install {{{ diff --git a/examples/config.cmake b/examples/config.cmake index f24a7402..2619389a 100644 --- a/examples/config.cmake +++ b/examples/config.cmake @@ -10,18 +10,17 @@ [global/wm] margin-top = 5 margin-bottom = 5 -margin-left = 5 -margin-right = 5 [bar/example] -;monitor = HDMI-1 +;monitor = ${env:MONITOR:HDMI-1} dock = false width = 100% height = 27 offset-x = 0 offset-y = 0 +;background = ${xrdb:color9} background = #ee222222 foreground = #dfdfdf linecolor = #555 @@ -45,7 +44,7 @@ modules-center = @MODULES_CENTER@ modules-right = @MODULES_RIGHT@ tray-position = right -tray-padding = 4 +tray-padding = 2 ;tray-transparent = true ;tray-background = #0063ff @@ -66,9 +65,6 @@ mount-0 = / mount-1 = /home mount-2 = /invalid/mountpoint -;fixed-values = true -;spacing = 4 - label-mounted = %mountpoint%: %percentage_free% label-unmounted = %mountpoint%: not mounted @@ -163,52 +159,20 @@ bar-empty-foreground = #55 [module/cpu] type = internal/cpu interval = 2 - -format =