Simple swaybar example
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I'd like to have a simple, calm status bar for Sway which I use with Arch Linux.
The configurations I found use a separate program like i3status but I'd like to keep it simple and use status_command
mentioned in man sway-bar
directly.
sway
add a comment |Â
up vote
0
down vote
favorite
I'd like to have a simple, calm status bar for Sway which I use with Arch Linux.
The configurations I found use a separate program like i3status but I'd like to keep it simple and use status_command
mentioned in man sway-bar
directly.
sway
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'd like to have a simple, calm status bar for Sway which I use with Arch Linux.
The configurations I found use a separate program like i3status but I'd like to keep it simple and use status_command
mentioned in man sway-bar
directly.
sway
I'd like to have a simple, calm status bar for Sway which I use with Arch Linux.
The configurations I found use a separate program like i3status but I'd like to keep it simple and use status_command
mentioned in man sway-bar
directly.
sway
sway
asked yesterday
Matthias Braun
1,70711120
1,70711120
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
0
down vote
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
height 20
The result of that configuration:
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
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
height 20
The result of that configuration:
add a comment |Â
up vote
0
down vote
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
height 20
The result of that configuration:
add a comment |Â
up vote
0
down vote
up vote
0
down vote
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
height 20
The result of that configuration:
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
height 20
The result of that configuration:
edited yesterday
answered yesterday
Matthias Braun
1,70711120
1,70711120
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password