added battery level on xmobar

master
Kerem Yollu 3 years ago
parent ef0b8caa25
commit ba3bc6133f

@ -0,0 +1,3 @@
#!/bin/bash
echo $(acpi | grep -o -E '[0-9][0-9]?%|100%')

@ -1,12 +1,12 @@
Config { font = "xft:Ubuntu:weight=bold:pixelsize=20:antialias=true:hinting=true" Config { font = "xft:Ubuntu:weight=bold:pixelsize=26:antialias=true:hinting=true"
, additionalFonts = [ "xft:Mononoki:pixelsize=18:antialias=true:hinting=true" , additionalFonts = [ "xft:Mononoki:pixelsize=18:antialias=true:hinting=true"
, "xft:Font Awesome 6 Free Solid:pixelsize=22" , "xft:Font Awesome 6 Free Solid:pixelsize=30"
, "xft:Font Awesome 6 Brands:pixelsize=22" , "xft:Font Awesome 6 Brands:pixelsize=30"
] ]
, bgColor = "#282c34" , bgColor = "#282c34"
, fgColor = "#ff6c6b" , fgColor = "#ff6c6b"
, alpha = 255 , alpha = 255
, position = TopSize L 100 24 , position = TopSize L 100 35
, textOffset = -1 , textOffset = -1
, iconOffset = -1 , iconOffset = -1
, lowerOnStart = True , lowerOnStart = True
@ -24,8 +24,10 @@ Config { font = "xft:Ubuntu:weight=bold:pixelsize=20:antialias=true:h
, Run Com "echo" ["<fn=2>\xf796</fn>"] "rj" 36000 , Run Com "echo" ["<fn=2>\xf796</fn>"] "rj" 36000
-- Get the Current IP address -- Get the Current IP address
, Run Com "/home/key/.config/xmobar/ip.sh" [] "myip" 150 , Run Com "/home/key/.config/xmobar/ip.sh" [] "myip" 150
, Run Com "/home/key/.config/xmobar/battery.sh" [] "battery" 150
-- Dy Newtoek consumption -- Dy Newtoek consumption
, Run DynNetwork [ "--template" , "<dev>: <tx>kB/s|<rx>kB/s" , Run DynNetwork [ "--template" , "<dev>: <tx>kB/s|<rx>kB/s"
, "--Low" , "5000" -- units: kB/s , "--Low" , "5000" -- units: kB/s
, "--High" , "50000" -- units: kB/s , "--High" , "50000" -- units: kB/s
@ -50,15 +52,13 @@ Config { font = "xft:Ubuntu:weight=bold:pixelsize=20:antialias=true:h
-- Echos a "battery" icon in front of the pacman updates. -- Echos a "battery" icon in front of the pacman updates.
, Run Com "echo" ["<fn=2>\xf242</fn>"] "baticon" 3600 , Run Com "echo" ["<fn=2>\xf242</fn>"] "baticon" 3600
-- Battery -- Battery
, Run BatteryP ["BAT0"] ["-t", "<acstatus><watts> (<left>%)"] 360
-- Time and date
, Run Date "<fn=2>\xf017</fn> %b %d %Y - (%H:%M) " "date" 50 , Run Date "<fn=2>\xf017</fn> %b %d %Y - (%H:%M) " "date" 50
-- Prints out the left side items such as workspaces, layout, etc. -- Prints out the left side items such as workspaces, layout, etc.
, Run UnsafeStdinReader , Run UnsafeStdinReader
] ]
, sepChar = "%" , sepChar = "%"
, alignSep = "}{" , alignSep = "}{"
, template = "<box type=Bottom width=2 mb=2 color=#51afef><fc=#51afef>%penguin% %kernel%</fc></box> <box type=Bottom width=2 mb=2 color=#DA8012><fc=#DA8012> %rj% %dynnetwork% IP:%myip%</fc></box>}{<box type=Bottom width=2 mb=2 color=#ecbe7b><fc=#ecbe7b><action=`alacritty -e htop`>%cpu%</action></fc></box> <box type=Bottom width=2 mb=2 color=#1259DA><fc=#1259DA>%date%</fc></box>" , template = "<box type=Bottom width=2 mb=2 color=#51afef><fc=#51afef>%penguin% %kernel%</fc></box> <box type=Bottom width=2 mb=2 color=#DA8012><fc=#DA8012> %rj% %dynnetwork% IP:%myip%</fc></box>}<box type=Bottom width=2 mb=2 color=#1259DA><fc=#1259DA>%date%</fc></box>{<box type=Bottom width=2 mb=2 color=#DC143C><fc=#DC143C>%battery% %baticon%</fc></box> <box type=Bottom width=2 mb=2 color=#ecbe7b><fc=#ecbe7b><action=`alacritty -e htop`>%cpu%</action></fc></box> "
} }

@ -0,0 +1,9 @@
#!/bin/bash
NVIMDIR="/home/$USER/.config/"
CURDATE=$(date +%m%d%Y%H%M%S)
cd $NVIMDIR
rm -rf nvim
rm -rf ~/.local/share/nvim
rm -rf ~/.local/state/nvim

@ -0,0 +1,14 @@
#!/bin/bash
main_dir=$PWD
bat_now=$(cat /sys/class/power_supply/BAT0/energy_now)
bat_full=$(cat /sys/class/power_supply/BAT0/energy_full)
echo $bat_now
echo $bat_full
#percent=$((bat_full/(bat_now*100)))
percent=$((10/(5*100)))
echo $percent
Loading…
Cancel
Save