From aa8caa69ca2e111f3837fd15466793a71e084e40 Mon Sep 17 00:00:00 2001 From: qvalentin Date: Sat, 30 Oct 2021 14:52:24 +0200 Subject: [PATCH] makke xmobar fancy --- .config/xmobar/xmobarrc | 26 +++++++++++++++-------- .config/xmobar/xmobarrc-template | 25 ---------------------- .config/xmobar/xmobarrc-template.hs | 33 +++++++++++++++++++++++++++++ .config/xmobar/xpm/haskell_20.xpm | 25 ++++++++++++++++++++++ .config/xmonad | 2 +- .profile | 6 ++++-- .scripts/changebg | 2 +- .scripts/update_xmobar.sh | 28 ++++++++++++++++++++++++ 8 files changed, 109 insertions(+), 38 deletions(-) delete mode 100644 .config/xmobar/xmobarrc-template create mode 100644 .config/xmobar/xmobarrc-template.hs create mode 100644 .config/xmobar/xpm/haskell_20.xpm create mode 100755 .scripts/update_xmobar.sh diff --git a/.config/xmobar/xmobarrc b/.config/xmobar/xmobarrc index ec27dee..fb80e1c 100644 --- a/.config/xmobar/xmobarrc +++ b/.config/xmobar/xmobarrc @@ -1,12 +1,16 @@ Config { overrideRedirect = False - , font = "xft:Roboto Mono for Powerline:size=11" - , bgColor = "#0C0C0F" - , fgColor = "#ccdee5" + , font = "xft:FiraCode Nerd Font:size=11", + additionalFonts = [ "xft:FiraCode Nerd Font:bold:pixelsize=19:antialias=true:hinting=true" + , "xft:FiraCode Nerd Font:bold:pixelsize=25:antialias=true:hinting=true" + , "xft:FiraCode Nerd Font:bold:pixelsize=20:antialias=true:hinting=true" ] + + , bgColor = "#0d141b" + , fgColor = "#c4c1df" , position = TopW L 100 , iconRoot = ".config/xmobar/xpm/" , commands = [Run Cpu - [ "-L", "3" - , "-H", "50" + [ "--template", "%" + ,"-w", "2" ] 10 , Run Alsa "default" "Master" [ "--template", "" @@ -14,12 +18,16 @@ Config { overrideRedirect = False , "--" , "--on", "" ] - , Run Memory ["--template", "Mem: %"] 10 - , Run Date "%a %Y-%m-%d %H:%M" "date" 10 + , Run Memory ["--template", ""] 10 + , Run Date "%a %Y-%m-%d%H:%M" "date" 10 , Run XMonadLog , Run Com "get_music_info" [] "" 10 ] , sepChar = "%" , alignSep = "}{" - , template = " %XMonadLog% }{ %get_music_info% | %alsa:default:Master% | %cpu% | %memory% | %date% " - } + , template = " %XMonadLog% }{\ + \%get_music_info%\ + \ %alsa:default:Master%\ + \﬙ %cpu%\ + \ %memory%\ + \%date%" diff --git a/.config/xmobar/xmobarrc-template b/.config/xmobar/xmobarrc-template deleted file mode 100644 index 5aa0e2d..0000000 --- a/.config/xmobar/xmobarrc-template +++ /dev/null @@ -1,25 +0,0 @@ -Config { overrideRedirect = False - , font = "xft:Roboto Mono for Powerline:size=11" - , bgColor = "BGCOLOR" - , fgColor = "FGCOLOR" - , position = TopW L 100 - , iconRoot = ".config/xmobar/xpm/" - , commands = [Run Cpu - [ "-L", "3" - , "-H", "50" - ] 10 - , Run Alsa "default" "Master" - [ "--template", "" - , "--suffix" , "True" - , "--" - , "--on", "" - ] - , Run Memory ["--template", "Mem: %"] 10 - , Run Date "%a %Y-%m-%d %H:%M" "date" 10 - , Run XMonadLog - , Run Com "get_music_info" [] "" 10 - ] - , sepChar = "%" - , alignSep = "}{" - , template = " %XMonadLog% }{ %get_music_info% | %alsa:default:Master% | %cpu% | %memory% | %date% " - } diff --git a/.config/xmobar/xmobarrc-template.hs b/.config/xmobar/xmobarrc-template.hs new file mode 100644 index 0000000..eb6c82d --- /dev/null +++ b/.config/xmobar/xmobarrc-template.hs @@ -0,0 +1,33 @@ +Config { overrideRedirect = False + , font = "xft:FiraCode Nerd Font:size=10", + additionalFonts = [ "xft:FiraCode Nerd Font:bold:pixelsize=19:antialias=true:hinting=true" + , "xft:FiraCode Nerd Font:bold:pixelsize=25:antialias=true:hinting=true" + , "xft:FiraCode Nerd Font:bold:pixelsize=20:antialias=true:hinting=true" ] + + , bgColor = "BGCOLOR" + , fgColor = "FGCOLOR" + , position = TopW L 100 + , iconRoot = ".config/xmobar/xpm/" + , commands = [Run Cpu + [ "--template", "%" + ,"-w", "2" + ] 10 + , Run Alsa "default" "Master" + [ "--template", "" + , "--suffix" , "True" + , "--" + , "--on", "" + ] + , Run Memory ["--template", ""] 10 + , Run Date "%a %Y-%m-%d%H:%M" "date" 10 + , Run XMonadLog + , Run Com "get_music_info" [] "" 10 + ] + , sepChar = "%" + , alignSep = "}{" + , template = " %XMonadLog% }{\ + \%get_music_info%\ + \ %alsa:default:Master%\ + \﬙ %cpu%\ + \ %memory%\ + \%date%" diff --git a/.config/xmobar/xpm/haskell_20.xpm b/.config/xmobar/xpm/haskell_20.xpm new file mode 100644 index 0000000..9e11ae2 --- /dev/null +++ b/.config/xmobar/xpm/haskell_20.xpm @@ -0,0 +1,25 @@ +/* XPM */ +static char * haskell_20_xpm[] = { +"20 20 2 1", +" c None", +". c #FFFFFF", +" ", +" ", +" ", +".... .... ", +" .... ... ", +" ... .... ", +" .... .... ", +" .... ... ........", +" ... .... .......", +" .... .... ", +" .... .... ", +" ... ...... .....", +" .... ....... ....", +" .... .... ... ", +" ... .... .... ", +" .... ... .... ", +".... .... ... ", +" ", +" ", +" "}; diff --git a/.config/xmonad b/.config/xmonad index a3ad5c5..4d947ab 160000 --- a/.config/xmonad +++ b/.config/xmonad @@ -1 +1 @@ -Subproject commit a3ad5c55441dab9447a785c69b71ea720f984849 +Subproject commit 4d947ab1a3907e42bf51ded588ac088007b19cfe diff --git a/.profile b/.profile index 3bcb337..5808d31 100644 --- a/.profile +++ b/.profile @@ -1,4 +1,6 @@ # - - export PATH=$PATH:/home/qv/.local/bin:/home/qv/.ghcup/bin:/home/qv/.scripts:/home/qv/.emacs.d/bin:/opt/texlive/2021/bin/x86_64-linux + + + +export _JAVA_AWT_WM_NONREPARENTING=1 diff --git a/.scripts/changebg b/.scripts/changebg index abf5587..13b32f0 100755 --- a/.scripts/changebg +++ b/.scripts/changebg @@ -20,7 +20,7 @@ xmobar_change(){ -e "s/COLOR13/$color13/g" \ -e "s/COLOR14/$color14/g" \ -e "s/COLOR15/$color15/g" \ - ~/.config/xmobar/xmobarrc-template > ~/.config/xmobar/xmobarrc + ~/.config/xmobar/xmobarrc-template.hs > ~/.config/xmobar/xmobarrc } args=("$@") PATH_TO_IMG="${args[0]}" diff --git a/.scripts/update_xmobar.sh b/.scripts/update_xmobar.sh new file mode 100755 index 0000000..01395d7 --- /dev/null +++ b/.scripts/update_xmobar.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +xmobar_change(){ + echo "changing xmobarrc" + source ~/.cache/wal/colors.sh + sed -e "s/BGCOLOR/$background/g" \ + -e "s/FGCOLOR/$foreground/g" \ + -e "s/COLOR1/$color1/g" \ + -e "s/COLOR2/$color2/g" \ + -e "s/COLOR3/$color3/g" \ + -e "s/COLOR4/$color4/g" \ + -e "s/COLOR5/$color5/g" \ + -e "s/COLOR6/$color6/g" \ + -e "s/COLOR7/$color7/g" \ + -e "s/COLOR8/$color8/g" \ + -e "s/COLOR9/$color9/g" \ + -e "s/COLOR10/$color10/g" \ + -e "s/COLOR11/$color11/g" \ + -e "s/COLOR12/$color12/g" \ + -e "s/COLOR13/$color13/g" \ + -e "s/COLOR14/$color14/g" \ + -e "s/COLOR15/$color15/g" \ + ~/.config/xmobar/xmobarrc-template.hs > ~/.config/xmobar/xmobarrc +} + +xmobar_change +killall xmobar +xmobar