Simple swaybar example












2














I'd like to have a simple, calm status bar for Sway which I use with Arch Linux.



The configurations I found so far, use a separate program like i3status but I'd like to keep it simple and use status_command mentioned in man sway-bar directly.



Preferably, this status bar would work equally well with i3 which should be possible since Sway aims to have its configuration be compatible with i3.










share|improve this question





























    2














    I'd like to have a simple, calm status bar for Sway which I use with Arch Linux.



    The configurations I found so far, use a separate program like i3status but I'd like to keep it simple and use status_command mentioned in man sway-bar directly.



    Preferably, this status bar would work equally well with i3 which should be possible since Sway aims to have its configuration be compatible with i3.










    share|improve this question



























      2












      2








      2







      I'd like to have a simple, calm status bar for Sway which I use with Arch Linux.



      The configurations I found so far, use a separate program like i3status but I'd like to keep it simple and use status_command mentioned in man sway-bar directly.



      Preferably, this status bar would work equally well with i3 which should be possible since Sway aims to have its configuration be compatible with i3.










      share|improve this question















      I'd like to have a simple, calm status bar for Sway which I use with Arch Linux.



      The configurations I found so far, use a separate program like i3status but I'd like to keep it simple and use status_command mentioned in man sway-bar directly.



      Preferably, this status bar would work equally well with i3 which should be possible since Sway aims to have its configuration be compatible with i3.







      sway






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 2 hours ago

























      asked Oct 7 '18 at 14:09









      Matthias Braun

      1,92721322




      1,92721322






















          2 Answers
          2






          active

          oldest

          votes


















          2














          I have this script at ~/.config/sway/status.sh:



          # The Sway configuration file in ~/.config/sway/config calls this script.
          # You should see changes to the status bar after saving this script.
          # If not, do "killall swaybar" and $mod+Shift+c to reload the configuration.

          # Produces "21 days", for example
          uptime_formatted=$(uptime | cut -d ',' -f1 | cut -d ' ' -f4,5)

          # The abbreviated weekday (e.g., "Sat"), followed by the ISO-formatted date
          # like 2018-10-06 and the time (e.g., 14:01)
          date_formatted=$(date "+%a %F %H:%M")

          # Get the Linux version but remove the "-1-ARCH" part
          linux_version=$(uname -r | cut -d '-' -f1)

          # Returns the battery status: "Full", "Discharging", or "Charging".
          battery_status=$(cat /sys/class/power_supply/BAT0/status)

          # Emojis and characters for the status bar
          # 💎 💻 💡 🔌 ⚡ 📁 |
          echo $uptime_formatted ↑ $linux_version 🐧 $battery_status 🔋 $date_formatted


          The part in ~/.config/sway/config that defines the status bar is this:



          bar {
          position top
          # Keep in mind that the current directory of this config file is $HOME
          status_command while ~/.config/sway/status.sh; do sleep 1; done

          colors {
          # Text color of status bar
          statusline #ffffff
          # Background of status bar
          background #323232
          }
          font pango:DejaVu Sans Mono 10
          }


          That's how the bar looks using this configuration:



          swaybar



          The above settings works also in i3 with an identical result.






          share|improve this answer































            0














            Here's my current status bar:



            status bar screenshot sound on



            When audio is muted:



            status bar screenshot sound off



            Content of status.sh which ~/.config/sway/config calls:



            # The Sway configuration file in ~/.config/sway/config calls this script.
            # You should see changes to the status bar after saving this script.
            # If not, do "killall swaybar" and $mod+Shift+c to reload the configuration.

            # The abbreviated weekday (e.g., "Sat"), followed by the ISO-formatted date
            # like 2018-10-06 and the time (e.g., 14:01). Check `man date` on how to format
            # time and date.
            date_formatted=$(date "+%a %F %H:%M")

            # "upower --enumerate | grep 'BAT'" gets the battery name (e.g.,
            # "/org/freedesktop/UPower/devices/battery_BAT0") from all power devices.
            # "upower --show-info" prints battery information from which we get
            # the state (such as "charging" or "fully-charged") and the battery's
            # charge percentage. With awk, we cut away the column containing
            # identifiers. i3 and sway convert the newline between battery state and
            # the charge percentage automatically to a space, producing a result like
            # "charging 59%" or "fully-charged 100%".
            battery_info=$(upower --show-info $(upower --enumerate |
            grep 'BAT') |
            egrep "state|percentage" |
            awk '{print $2}')

            # "amixer -M" gets the mapped volume for evaluating the percentage which
            # is more natural to the human ear according to "man amixer".
            # Column number 4 contains the current volume percentage in brackets, e.g.,
            # "[36%]". Column number 6 is "[off]" or "[on]" depending on whether sound
            # is muted or not.
            # "tr -d " removes brackets around the volume.
            # Adapted from https://bbs.archlinux.org/viewtopic.php?id=89648
            audio_volume=$(amixer -M get Master |
            awk '/Mono.+/ {print $6=="[off]" ?
            $4" 🔇":
            $4" 🔉"}' |
            tr -d )

            # Additional emojis and characters for the status bar:
            # Electricity: ⚡ ↯ ⭍ 🔌
            # Audio: 🔈 🔊 🎧 🎶 🎵 🎤
            # Separators: | ❘ ❙ ❚
            # Misc: 🐧 💎 💻 💡 ⭐ 📁 ↑ ↓ ✉ ✅ ❎
            echo $audio_volume $battery_info 🔋 $date_formatted


            Here's the status bar part of ~/.config/sway/config:



            bar {
            position top

            # Keep in mind that the current directory of this config file is $HOME
            status_command while ~/.config/sway/status.sh; do sleep 1; done

            # https://i3wm.org/docs/userguide.html#_colors
            colors {
            # Text color of status bar
            statusline #f8b500

            # Background color of status bar
            background #5e227f
            }
            }


            status.sh works also with i3 when called from /.config/i3/config using the same bar block shown above.






            share|improve this answer























              Your Answer








              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "106"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: false,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f473788%2fsimple-swaybar-example%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              2














              I have this script at ~/.config/sway/status.sh:



              # The Sway configuration file in ~/.config/sway/config calls this script.
              # You should see changes to the status bar after saving this script.
              # If not, do "killall swaybar" and $mod+Shift+c to reload the configuration.

              # Produces "21 days", for example
              uptime_formatted=$(uptime | cut -d ',' -f1 | cut -d ' ' -f4,5)

              # The abbreviated weekday (e.g., "Sat"), followed by the ISO-formatted date
              # like 2018-10-06 and the time (e.g., 14:01)
              date_formatted=$(date "+%a %F %H:%M")

              # Get the Linux version but remove the "-1-ARCH" part
              linux_version=$(uname -r | cut -d '-' -f1)

              # Returns the battery status: "Full", "Discharging", or "Charging".
              battery_status=$(cat /sys/class/power_supply/BAT0/status)

              # Emojis and characters for the status bar
              # 💎 💻 💡 🔌 ⚡ 📁 |
              echo $uptime_formatted ↑ $linux_version 🐧 $battery_status 🔋 $date_formatted


              The part in ~/.config/sway/config that defines the status bar is this:



              bar {
              position top
              # Keep in mind that the current directory of this config file is $HOME
              status_command while ~/.config/sway/status.sh; do sleep 1; done

              colors {
              # Text color of status bar
              statusline #ffffff
              # Background of status bar
              background #323232
              }
              font pango:DejaVu Sans Mono 10
              }


              That's how the bar looks using this configuration:



              swaybar



              The above settings works also in i3 with an identical result.






              share|improve this answer




























                2














                I have this script at ~/.config/sway/status.sh:



                # The Sway configuration file in ~/.config/sway/config calls this script.
                # You should see changes to the status bar after saving this script.
                # If not, do "killall swaybar" and $mod+Shift+c to reload the configuration.

                # Produces "21 days", for example
                uptime_formatted=$(uptime | cut -d ',' -f1 | cut -d ' ' -f4,5)

                # The abbreviated weekday (e.g., "Sat"), followed by the ISO-formatted date
                # like 2018-10-06 and the time (e.g., 14:01)
                date_formatted=$(date "+%a %F %H:%M")

                # Get the Linux version but remove the "-1-ARCH" part
                linux_version=$(uname -r | cut -d '-' -f1)

                # Returns the battery status: "Full", "Discharging", or "Charging".
                battery_status=$(cat /sys/class/power_supply/BAT0/status)

                # Emojis and characters for the status bar
                # 💎 💻 💡 🔌 ⚡ 📁 |
                echo $uptime_formatted ↑ $linux_version 🐧 $battery_status 🔋 $date_formatted


                The part in ~/.config/sway/config that defines the status bar is this:



                bar {
                position top
                # Keep in mind that the current directory of this config file is $HOME
                status_command while ~/.config/sway/status.sh; do sleep 1; done

                colors {
                # Text color of status bar
                statusline #ffffff
                # Background of status bar
                background #323232
                }
                font pango:DejaVu Sans Mono 10
                }


                That's how the bar looks using this configuration:



                swaybar



                The above settings works also in i3 with an identical result.






                share|improve this answer


























                  2












                  2








                  2






                  I have this script at ~/.config/sway/status.sh:



                  # The Sway configuration file in ~/.config/sway/config calls this script.
                  # You should see changes to the status bar after saving this script.
                  # If not, do "killall swaybar" and $mod+Shift+c to reload the configuration.

                  # Produces "21 days", for example
                  uptime_formatted=$(uptime | cut -d ',' -f1 | cut -d ' ' -f4,5)

                  # The abbreviated weekday (e.g., "Sat"), followed by the ISO-formatted date
                  # like 2018-10-06 and the time (e.g., 14:01)
                  date_formatted=$(date "+%a %F %H:%M")

                  # Get the Linux version but remove the "-1-ARCH" part
                  linux_version=$(uname -r | cut -d '-' -f1)

                  # Returns the battery status: "Full", "Discharging", or "Charging".
                  battery_status=$(cat /sys/class/power_supply/BAT0/status)

                  # Emojis and characters for the status bar
                  # 💎 💻 💡 🔌 ⚡ 📁 |
                  echo $uptime_formatted ↑ $linux_version 🐧 $battery_status 🔋 $date_formatted


                  The part in ~/.config/sway/config that defines the status bar is this:



                  bar {
                  position top
                  # Keep in mind that the current directory of this config file is $HOME
                  status_command while ~/.config/sway/status.sh; do sleep 1; done

                  colors {
                  # Text color of status bar
                  statusline #ffffff
                  # Background of status bar
                  background #323232
                  }
                  font pango:DejaVu Sans Mono 10
                  }


                  That's how the bar looks using this configuration:



                  swaybar



                  The above settings works also in i3 with an identical result.






                  share|improve this answer














                  I have this script at ~/.config/sway/status.sh:



                  # The Sway configuration file in ~/.config/sway/config calls this script.
                  # You should see changes to the status bar after saving this script.
                  # If not, do "killall swaybar" and $mod+Shift+c to reload the configuration.

                  # Produces "21 days", for example
                  uptime_formatted=$(uptime | cut -d ',' -f1 | cut -d ' ' -f4,5)

                  # The abbreviated weekday (e.g., "Sat"), followed by the ISO-formatted date
                  # like 2018-10-06 and the time (e.g., 14:01)
                  date_formatted=$(date "+%a %F %H:%M")

                  # Get the Linux version but remove the "-1-ARCH" part
                  linux_version=$(uname -r | cut -d '-' -f1)

                  # Returns the battery status: "Full", "Discharging", or "Charging".
                  battery_status=$(cat /sys/class/power_supply/BAT0/status)

                  # Emojis and characters for the status bar
                  # 💎 💻 💡 🔌 ⚡ 📁 |
                  echo $uptime_formatted ↑ $linux_version 🐧 $battery_status 🔋 $date_formatted


                  The part in ~/.config/sway/config that defines the status bar is this:



                  bar {
                  position top
                  # Keep in mind that the current directory of this config file is $HOME
                  status_command while ~/.config/sway/status.sh; do sleep 1; done

                  colors {
                  # Text color of status bar
                  statusline #ffffff
                  # Background of status bar
                  background #323232
                  }
                  font pango:DejaVu Sans Mono 10
                  }


                  That's how the bar looks using this configuration:



                  swaybar



                  The above settings works also in i3 with an identical result.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited 3 hours ago

























                  answered Oct 7 '18 at 14:09









                  Matthias Braun

                  1,92721322




                  1,92721322

























                      0














                      Here's my current status bar:



                      status bar screenshot sound on



                      When audio is muted:



                      status bar screenshot sound off



                      Content of status.sh which ~/.config/sway/config calls:



                      # The Sway configuration file in ~/.config/sway/config calls this script.
                      # You should see changes to the status bar after saving this script.
                      # If not, do "killall swaybar" and $mod+Shift+c to reload the configuration.

                      # The abbreviated weekday (e.g., "Sat"), followed by the ISO-formatted date
                      # like 2018-10-06 and the time (e.g., 14:01). Check `man date` on how to format
                      # time and date.
                      date_formatted=$(date "+%a %F %H:%M")

                      # "upower --enumerate | grep 'BAT'" gets the battery name (e.g.,
                      # "/org/freedesktop/UPower/devices/battery_BAT0") from all power devices.
                      # "upower --show-info" prints battery information from which we get
                      # the state (such as "charging" or "fully-charged") and the battery's
                      # charge percentage. With awk, we cut away the column containing
                      # identifiers. i3 and sway convert the newline between battery state and
                      # the charge percentage automatically to a space, producing a result like
                      # "charging 59%" or "fully-charged 100%".
                      battery_info=$(upower --show-info $(upower --enumerate |
                      grep 'BAT') |
                      egrep "state|percentage" |
                      awk '{print $2}')

                      # "amixer -M" gets the mapped volume for evaluating the percentage which
                      # is more natural to the human ear according to "man amixer".
                      # Column number 4 contains the current volume percentage in brackets, e.g.,
                      # "[36%]". Column number 6 is "[off]" or "[on]" depending on whether sound
                      # is muted or not.
                      # "tr -d " removes brackets around the volume.
                      # Adapted from https://bbs.archlinux.org/viewtopic.php?id=89648
                      audio_volume=$(amixer -M get Master |
                      awk '/Mono.+/ {print $6=="[off]" ?
                      $4" 🔇":
                      $4" 🔉"}' |
                      tr -d )

                      # Additional emojis and characters for the status bar:
                      # Electricity: ⚡ ↯ ⭍ 🔌
                      # Audio: 🔈 🔊 🎧 🎶 🎵 🎤
                      # Separators: | ❘ ❙ ❚
                      # Misc: 🐧 💎 💻 💡 ⭐ 📁 ↑ ↓ ✉ ✅ ❎
                      echo $audio_volume $battery_info 🔋 $date_formatted


                      Here's the status bar part of ~/.config/sway/config:



                      bar {
                      position top

                      # Keep in mind that the current directory of this config file is $HOME
                      status_command while ~/.config/sway/status.sh; do sleep 1; done

                      # https://i3wm.org/docs/userguide.html#_colors
                      colors {
                      # Text color of status bar
                      statusline #f8b500

                      # Background color of status bar
                      background #5e227f
                      }
                      }


                      status.sh works also with i3 when called from /.config/i3/config using the same bar block shown above.






                      share|improve this answer




























                        0














                        Here's my current status bar:



                        status bar screenshot sound on



                        When audio is muted:



                        status bar screenshot sound off



                        Content of status.sh which ~/.config/sway/config calls:



                        # The Sway configuration file in ~/.config/sway/config calls this script.
                        # You should see changes to the status bar after saving this script.
                        # If not, do "killall swaybar" and $mod+Shift+c to reload the configuration.

                        # The abbreviated weekday (e.g., "Sat"), followed by the ISO-formatted date
                        # like 2018-10-06 and the time (e.g., 14:01). Check `man date` on how to format
                        # time and date.
                        date_formatted=$(date "+%a %F %H:%M")

                        # "upower --enumerate | grep 'BAT'" gets the battery name (e.g.,
                        # "/org/freedesktop/UPower/devices/battery_BAT0") from all power devices.
                        # "upower --show-info" prints battery information from which we get
                        # the state (such as "charging" or "fully-charged") and the battery's
                        # charge percentage. With awk, we cut away the column containing
                        # identifiers. i3 and sway convert the newline between battery state and
                        # the charge percentage automatically to a space, producing a result like
                        # "charging 59%" or "fully-charged 100%".
                        battery_info=$(upower --show-info $(upower --enumerate |
                        grep 'BAT') |
                        egrep "state|percentage" |
                        awk '{print $2}')

                        # "amixer -M" gets the mapped volume for evaluating the percentage which
                        # is more natural to the human ear according to "man amixer".
                        # Column number 4 contains the current volume percentage in brackets, e.g.,
                        # "[36%]". Column number 6 is "[off]" or "[on]" depending on whether sound
                        # is muted or not.
                        # "tr -d " removes brackets around the volume.
                        # Adapted from https://bbs.archlinux.org/viewtopic.php?id=89648
                        audio_volume=$(amixer -M get Master |
                        awk '/Mono.+/ {print $6=="[off]" ?
                        $4" 🔇":
                        $4" 🔉"}' |
                        tr -d )

                        # Additional emojis and characters for the status bar:
                        # Electricity: ⚡ ↯ ⭍ 🔌
                        # Audio: 🔈 🔊 🎧 🎶 🎵 🎤
                        # Separators: | ❘ ❙ ❚
                        # Misc: 🐧 💎 💻 💡 ⭐ 📁 ↑ ↓ ✉ ✅ ❎
                        echo $audio_volume $battery_info 🔋 $date_formatted


                        Here's the status bar part of ~/.config/sway/config:



                        bar {
                        position top

                        # Keep in mind that the current directory of this config file is $HOME
                        status_command while ~/.config/sway/status.sh; do sleep 1; done

                        # https://i3wm.org/docs/userguide.html#_colors
                        colors {
                        # Text color of status bar
                        statusline #f8b500

                        # Background color of status bar
                        background #5e227f
                        }
                        }


                        status.sh works also with i3 when called from /.config/i3/config using the same bar block shown above.






                        share|improve this answer


























                          0












                          0








                          0






                          Here's my current status bar:



                          status bar screenshot sound on



                          When audio is muted:



                          status bar screenshot sound off



                          Content of status.sh which ~/.config/sway/config calls:



                          # The Sway configuration file in ~/.config/sway/config calls this script.
                          # You should see changes to the status bar after saving this script.
                          # If not, do "killall swaybar" and $mod+Shift+c to reload the configuration.

                          # The abbreviated weekday (e.g., "Sat"), followed by the ISO-formatted date
                          # like 2018-10-06 and the time (e.g., 14:01). Check `man date` on how to format
                          # time and date.
                          date_formatted=$(date "+%a %F %H:%M")

                          # "upower --enumerate | grep 'BAT'" gets the battery name (e.g.,
                          # "/org/freedesktop/UPower/devices/battery_BAT0") from all power devices.
                          # "upower --show-info" prints battery information from which we get
                          # the state (such as "charging" or "fully-charged") and the battery's
                          # charge percentage. With awk, we cut away the column containing
                          # identifiers. i3 and sway convert the newline between battery state and
                          # the charge percentage automatically to a space, producing a result like
                          # "charging 59%" or "fully-charged 100%".
                          battery_info=$(upower --show-info $(upower --enumerate |
                          grep 'BAT') |
                          egrep "state|percentage" |
                          awk '{print $2}')

                          # "amixer -M" gets the mapped volume for evaluating the percentage which
                          # is more natural to the human ear according to "man amixer".
                          # Column number 4 contains the current volume percentage in brackets, e.g.,
                          # "[36%]". Column number 6 is "[off]" or "[on]" depending on whether sound
                          # is muted or not.
                          # "tr -d " removes brackets around the volume.
                          # Adapted from https://bbs.archlinux.org/viewtopic.php?id=89648
                          audio_volume=$(amixer -M get Master |
                          awk '/Mono.+/ {print $6=="[off]" ?
                          $4" 🔇":
                          $4" 🔉"}' |
                          tr -d )

                          # Additional emojis and characters for the status bar:
                          # Electricity: ⚡ ↯ ⭍ 🔌
                          # Audio: 🔈 🔊 🎧 🎶 🎵 🎤
                          # Separators: | ❘ ❙ ❚
                          # Misc: 🐧 💎 💻 💡 ⭐ 📁 ↑ ↓ ✉ ✅ ❎
                          echo $audio_volume $battery_info 🔋 $date_formatted


                          Here's the status bar part of ~/.config/sway/config:



                          bar {
                          position top

                          # Keep in mind that the current directory of this config file is $HOME
                          status_command while ~/.config/sway/status.sh; do sleep 1; done

                          # https://i3wm.org/docs/userguide.html#_colors
                          colors {
                          # Text color of status bar
                          statusline #f8b500

                          # Background color of status bar
                          background #5e227f
                          }
                          }


                          status.sh works also with i3 when called from /.config/i3/config using the same bar block shown above.






                          share|improve this answer














                          Here's my current status bar:



                          status bar screenshot sound on



                          When audio is muted:



                          status bar screenshot sound off



                          Content of status.sh which ~/.config/sway/config calls:



                          # The Sway configuration file in ~/.config/sway/config calls this script.
                          # You should see changes to the status bar after saving this script.
                          # If not, do "killall swaybar" and $mod+Shift+c to reload the configuration.

                          # The abbreviated weekday (e.g., "Sat"), followed by the ISO-formatted date
                          # like 2018-10-06 and the time (e.g., 14:01). Check `man date` on how to format
                          # time and date.
                          date_formatted=$(date "+%a %F %H:%M")

                          # "upower --enumerate | grep 'BAT'" gets the battery name (e.g.,
                          # "/org/freedesktop/UPower/devices/battery_BAT0") from all power devices.
                          # "upower --show-info" prints battery information from which we get
                          # the state (such as "charging" or "fully-charged") and the battery's
                          # charge percentage. With awk, we cut away the column containing
                          # identifiers. i3 and sway convert the newline between battery state and
                          # the charge percentage automatically to a space, producing a result like
                          # "charging 59%" or "fully-charged 100%".
                          battery_info=$(upower --show-info $(upower --enumerate |
                          grep 'BAT') |
                          egrep "state|percentage" |
                          awk '{print $2}')

                          # "amixer -M" gets the mapped volume for evaluating the percentage which
                          # is more natural to the human ear according to "man amixer".
                          # Column number 4 contains the current volume percentage in brackets, e.g.,
                          # "[36%]". Column number 6 is "[off]" or "[on]" depending on whether sound
                          # is muted or not.
                          # "tr -d " removes brackets around the volume.
                          # Adapted from https://bbs.archlinux.org/viewtopic.php?id=89648
                          audio_volume=$(amixer -M get Master |
                          awk '/Mono.+/ {print $6=="[off]" ?
                          $4" 🔇":
                          $4" 🔉"}' |
                          tr -d )

                          # Additional emojis and characters for the status bar:
                          # Electricity: ⚡ ↯ ⭍ 🔌
                          # Audio: 🔈 🔊 🎧 🎶 🎵 🎤
                          # Separators: | ❘ ❙ ❚
                          # Misc: 🐧 💎 💻 💡 ⭐ 📁 ↑ ↓ ✉ ✅ ❎
                          echo $audio_volume $battery_info 🔋 $date_formatted


                          Here's the status bar part of ~/.config/sway/config:



                          bar {
                          position top

                          # Keep in mind that the current directory of this config file is $HOME
                          status_command while ~/.config/sway/status.sh; do sleep 1; done

                          # https://i3wm.org/docs/userguide.html#_colors
                          colors {
                          # Text color of status bar
                          statusline #f8b500

                          # Background color of status bar
                          background #5e227f
                          }
                          }


                          status.sh works also with i3 when called from /.config/i3/config using the same bar block shown above.







                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited 2 hours ago

























                          answered 3 hours ago









                          Matthias Braun

                          1,92721322




                          1,92721322






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Unix & Linux Stack Exchange!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.





                              Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                              Please pay close attention to the following guidance:


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f473788%2fsimple-swaybar-example%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              宮崎県

                              濃尾地震

                              シテ島