From 8626591b5b2a27cdbf1af038bcec617fcf31cb48 Mon Sep 17 00:00:00 2001 From: Xamora Date: Tue, 14 Mar 2023 14:25:39 +0100 Subject: [PATCH] Modification barre des taches avec l'ajout d'un status.sh --- bashrc | 6 ++++++ config.fish | 5 +++++ install.sh | 2 ++ status.sh | 14 ++++++++++++++ sway-config | 3 ++- 5 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 config.fish create mode 100644 status.sh diff --git a/bashrc b/bashrc index 568650a..6b48a1a 100644 --- a/bashrc +++ b/bashrc @@ -1 +1,7 @@ fish + +#Alias + alias v="nvim" + alias spu="sudo pacman -syu" + alias sps="sudo pacman -S" + alias ps="pacman -s" diff --git a/config.fish b/config.fish new file mode 100644 index 0000000..f19aa52 --- /dev/null +++ b/config.fish @@ -0,0 +1,5 @@ +#Alias + alias v="nvim" + alias spu="sudo pacman -syu" + alias sps="sudo pacman -S" + alias ps="pacman -s" diff --git a/install.sh b/install.sh index 65fd303..cd5e4c7 100644 --- a/install.sh +++ b/install.sh @@ -1,5 +1,7 @@ #!/bin/sh mkdir -p ~/.config/sway cp -v sway-config ~/.config/sway/config +cp -v status.sh ~/.config/sway/status.sh +cp -v config.fish ~/.config/fish cp -v bashrc ~/.bashrc cp -v ssh-config ~/.ssh/config diff --git a/status.sh b/status.sh new file mode 100644 index 0000000..ad2ffa1 --- /dev/null +++ b/status.sh @@ -0,0 +1,14 @@ +# 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) +date_formatted=$(date "+%a %d-%m-%+4Y %H:%M") + +# Returns the battery status: "Full", "Discharging", or "Charging". +battery_status=$(cat /sys/class/power_supply/BAT1/status) +battery_level=$(cat /sys/class/power_supply/BAT1/capacity) + +echo "$battery_level%" $battery_status '|' $date_formatted + diff --git a/sway-config b/sway-config index 6ed3875..985c14a 100644 --- a/sway-config +++ b/sway-config @@ -206,10 +206,11 @@ bindsym $mod+r mode "resize" # Read `man 5 sway-bar` for more information about this section. bar { position top + mode hide # 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 %I:%M:%S %p'; do sleep 1; done + status_command while bash ~/.config/sway/status.sh; do sleep 1; done colors { statusline #ffffff