feat(desktop): eminence, polybar CPU fix

This commit is contained in:
Pavel Korytov 2021-07-10 19:42:57 +03:00
parent b046e1dd06
commit 2c3505505f
5 changed files with 42 additions and 19 deletions

View file

@ -16,7 +16,6 @@
"light" "light"
"arandr" "arandr"
"xprop" "xprop"
"xrandr"
"megacmd-1.4" "megacmd-1.4"
"activitywatch-bin" "activitywatch-bin"
"xdg-desktop-portal" "xdg-desktop-portal"
@ -38,6 +37,8 @@
"bind:utils" "bind:utils"
"polybar" "polybar"
"i3-gaps" "i3-gaps"
"xgamma"
"xrandr"
"xsettingsd" "xsettingsd"
"papirus-icon-theme" "papirus-icon-theme"
"matcha-theme")) "matcha-theme"))

View file

@ -118,7 +118,7 @@ content = "|"
content-foreground = ${colors.magenta} content-foreground = ${colors.magenta}
content-padding = 0 content-padding = 0
content-margin = 0 content-margin = 0
interval = 0 interval = 100000
; SEP:1 ends here ; SEP:1 ends here
; [[file:../../Desktop.org::*TSEP][TSEP:2]] ; [[file:../../Desktop.org::*TSEP][TSEP:2]]
@ -126,7 +126,7 @@ interval = 0
type = custom/script type = custom/script
exec = /home/pavel/bin/polybar/tray-sep.sh exec = /home/pavel/bin/polybar/tray-sep.sh
format-foreground = ${colors.magenta} format-foreground = ${colors.magenta}
interval = 0 interval = 100000
; TSEP:2 ends here ; TSEP:2 ends here
; [[file:../../Desktop.org::*i3][i3:1]] ; [[file:../../Desktop.org::*i3][i3:1]]

View file

@ -179,6 +179,7 @@ Also, Xresources are used to set =Xft= settings. Unfortunately, the DPI setting
#+begin_src emacs-lisp #+begin_src emacs-lisp
(let ((hostname (system-name))) (let ((hostname (system-name)))
(cond ((string-equal hostname "azure") 120) (cond ((string-equal hostname "azure") 120)
((string-equal hostname "eminence") 120)
(t 96))) (t 96)))
#+end_src #+end_src
@ -200,19 +201,26 @@ A few programs I use to customize the apperance are listed below.
Net/ThemeName "Matcha-dark-azul" Net/ThemeName "Matcha-dark-azul"
Net/IconThemeName "Papirus-Dark" Net/IconThemeName "Papirus-Dark"
Gtk/DecorationLayout "menu:minimize,maximize,close" Gtk/DecorationLayout "menu:minimize,maximize,close"
Gtk/FontName "Sans 12" Gtk/FontName "Sans 10"
Gtk/MonospaceFontName "JetBrainsMono Nerd Mono 12" Gtk/MonospaceFontName "JetBrainsMono Nerd Mono 12"
Gtk/CursorThemeName "Adwaita" Gtk/CursorThemeName "Adwaita"
Xft/Antialias 1 Xft/Antialias 1
Xft/Hinting 0 Xft/Hinting 0
Xft/HintStyle "hintnone" Xft/HintStyle "hintnone"
#+end_src #+end_src
** Screen layout ** Screen settings
Set screen layout depending on hostname | Guix dependency | Description |
|-----------------+--------------------------------------------|
| xrandr | X11 CLI to RandR |
| xgamma | A tool to alter monitor's gamma correction |
Set screen layout & other params depending on hostname
#+begin_src sh :tangle ~/bin/scripts/screen-layout #+begin_src sh :tangle ~/bin/scripts/screen-layout
hostname=$(hostname) hostname=$(hostname)
if [ "$hostname" = "indigo" ]; then if [ "$hostname" = "indigo" ]; then
xrandr --output DisplayPort-0 --off --output HDMI-A-0 --mode 1920x1080 --pos 0x0 --rotate normal --output DVI-D-0 --mode 1366x768 --pos 1920x312 --rotate normal xrandr --output DisplayPort-0 --off --output HDMI-A-0 --mode 1920x1080 --pos 0x0 --rotate normal --output DVI-D-0 --mode 1366x768 --pos 1920x312 --rotate normal
elif [ "$hostname" = "eminence" ]; then
xgamma -gamma 1.25
fi fi
#+end_src #+end_src
* i3wm * i3wm
@ -774,6 +782,9 @@ hostname=$(hostname)
if [ "$hostname" = "azure" ]; then if [ "$hostname" = "azure" ]; then
TRAY_MONITOR="eDP-1" TRAY_MONITOR="eDP-1"
export WLAN_INTERFACE="wlp3s0" export WLAN_INTERFACE="wlp3s0"
elif [ "$hostname" = "eminence" ]; then
TRAY_MONITOR="eDP"
export WLAN_INTERFACE="wlo1"
else else
TRAY_MONITOR="HDMI-A-0" TRAY_MONITOR="HDMI-A-0"
export WLAN_INTERFACE="wlp35s0f3u2" export WLAN_INTERFACE="wlp35s0f3u2"
@ -781,24 +792,28 @@ fi
# Setting varying on the monitor # Setting varying on the monitor
declare -A FONT_SIZES=( declare -A FONT_SIZES=(
["eDP"]="13"
["eDP-1"]="13" ["eDP-1"]="13"
["DVI-D-0"]="11" ["DVI-D-0"]="11"
["HDMI-A-0"]="13" ["HDMI-A-0"]="13"
) )
declare -A EMOJI_SCALE=( declare -A EMOJI_SCALE=(
["eDP"]="9"
["eDP-1"]="9" ["eDP-1"]="9"
["DVI-D-0"]="10" ["DVI-D-0"]="10"
["HDMI-A-0"]="10" ["HDMI-A-0"]="10"
) )
declare -A BAR_HEIGHT=( declare -A BAR_HEIGHT=(
["eDP"]="29"
["eDP-1"]="29" ["eDP-1"]="29"
["DVI-D-0"]="23" ["DVI-D-0"]="23"
["HDMI-A-0"]="29" ["HDMI-A-0"]="29"
) )
declare -A BLOCKS=( declare -A BLOCKS=(
["eDP"]="pulseaudio mpd SEP cpu ram-memory swap-memory SEP network ipstack-vpn SEP xkeyboard SEP battery SEP sun aw-afk date TSEP"
["eDP-1"]="pulseaudio mpd SEP cpu ram-memory swap-memory SEP network ipstack-vpn SEP xkeyboard SEP battery SEP sun aw-afk date TSEP"
["DVI-D-0"]="pulseaudio SEP cpu ram-memory swap-memory SEP network ipstack-vpn SEP xkeyboard SEP weather SEP sun aw-afk date TSEP" ["DVI-D-0"]="pulseaudio SEP cpu ram-memory swap-memory SEP network ipstack-vpn SEP xkeyboard SEP weather SEP sun aw-afk date TSEP"
["HDMI-A-0"]="pulseaudio mpd SEP cpu ram-memory swap-memory SEP network ipstack-vpn SEP xkeyboard SEP weather SEP sun aw-afk date TSEP" ["HDMI-A-0"]="pulseaudio mpd SEP cpu ram-memory swap-memory SEP network ipstack-vpn SEP xkeyboard SEP weather SEP sun aw-afk date TSEP"
["eDP-1"]="pulseaudio mpd SEP cpu ram-memory swap-memory SEP network ipstack-vpn SEP xkeyboard SEP battery SEP sun aw-afk date TSEP"
) )
# Geolocation for some modules # Geolocation for some modules
@ -1060,7 +1075,7 @@ content = "|"
content-foreground = ${colors.magenta} content-foreground = ${colors.magenta}
content-padding = 0 content-padding = 0
content-margin = 0 content-margin = 0
interval = 0 interval = 100000
#+end_src #+end_src
*** TSEP *** TSEP
A separator, which appears only if monitor is set to have a tray in the launch script A separator, which appears only if monitor is set to have a tray in the launch script
@ -1075,7 +1090,7 @@ fi
type = custom/script type = custom/script
exec = /home/pavel/bin/polybar/tray-sep.sh exec = /home/pavel/bin/polybar/tray-sep.sh
format-foreground = ${colors.magenta} format-foreground = ${colors.magenta}
interval = 0 interval = 100000
#+end_src #+end_src
*** i3 *** i3
@ -2084,7 +2099,6 @@ This section generates manifests for various desktop software that I'm using.
|----------+-----------------| |----------+-----------------|
| dev | conda | | dev | conda |
| dev | docker-compose | | dev | docker-compose |
| dev | python |
| dev | postgresql | | dev | postgresql |
** Manifests ** Manifests
#+NAME: packages #+NAME: packages
@ -2156,17 +2170,17 @@ Packages to install:
#+begin_src emacs-lisp :var table=flatpak-deps :wrap example #+begin_src emacs-lisp :var table=flatpak-deps :wrap example
(mapconcat (mapconcat
(lambda (c) (concat "flatpak install --user " (nth 1 c) " " (nth 0 c))) (lambda (c) (concat "flatpak install -y --user " (nth 1 c) " " (nth 0 c)))
table table
"\n") "\n")
#+end_src #+end_src
#+RESULTS: #+RESULTS:
#+begin_example #+begin_example
flatpak install --user flathub com.github.wwmm.pulseeffects flatpak install -y --user flathub com.github.wwmm.pulseeffects
flatpak install --user flathub com.discordapp.Discord flatpak install -y --user flathub com.discordapp.Discord
flatpak install --user flathub us.zoom.Zoom flatpak install -y --user flathub us.zoom.Zoom
flatpak install --user flathub com.slack.Slack flatpak install -y --user flathub com.slack.Slack
#+end_example #+end_example
** Nix ** Nix
| Type | Description | | Type | Description |
@ -2344,7 +2358,6 @@ Other desktop programs I use are listed below.
| Guix dependency | Description | | Guix dependency | Description |
|------------------------+-------------------------------------------| |------------------------+-------------------------------------------|
| xrandr | X11 CLI to RandR |
| xprop | Tool to display properties of X windows | | xprop | Tool to display properties of X windows |
| arandr | GUI to xrandr | | arandr | GUI to xrandr |
| light | Control screen brightness | | light | Control screen brightness |

View file

@ -5,6 +5,9 @@ hostname=$(hostname)
if [ "$hostname" = "azure" ]; then if [ "$hostname" = "azure" ]; then
TRAY_MONITOR="eDP-1" TRAY_MONITOR="eDP-1"
export WLAN_INTERFACE="wlp3s0" export WLAN_INTERFACE="wlp3s0"
elif [ "$hostname" = "eminence" ]; then
TRAY_MONITOR="eDP"
export WLAN_INTERFACE="wlo1"
else else
TRAY_MONITOR="HDMI-A-0" TRAY_MONITOR="HDMI-A-0"
export WLAN_INTERFACE="wlp35s0f3u2" export WLAN_INTERFACE="wlp35s0f3u2"
@ -12,24 +15,28 @@ fi
# Setting varying on the monitor # Setting varying on the monitor
declare -A FONT_SIZES=( declare -A FONT_SIZES=(
["eDP"]="13"
["eDP-1"]="13" ["eDP-1"]="13"
["DVI-D-0"]="11" ["DVI-D-0"]="11"
["HDMI-A-0"]="13" ["HDMI-A-0"]="13"
) )
declare -A EMOJI_SCALE=( declare -A EMOJI_SCALE=(
["eDP"]="9"
["eDP-1"]="9" ["eDP-1"]="9"
["DVI-D-0"]="10" ["DVI-D-0"]="10"
["HDMI-A-0"]="10" ["HDMI-A-0"]="10"
) )
declare -A BAR_HEIGHT=( declare -A BAR_HEIGHT=(
["eDP"]="29"
["eDP-1"]="29" ["eDP-1"]="29"
["DVI-D-0"]="23" ["DVI-D-0"]="23"
["HDMI-A-0"]="29" ["HDMI-A-0"]="29"
) )
declare -A BLOCKS=( declare -A BLOCKS=(
["eDP"]="pulseaudio mpd SEP cpu ram-memory swap-memory SEP network ipstack-vpn SEP xkeyboard SEP battery SEP sun aw-afk date TSEP"
["eDP-1"]="pulseaudio mpd SEP cpu ram-memory swap-memory SEP network ipstack-vpn SEP xkeyboard SEP battery SEP sun aw-afk date TSEP"
["DVI-D-0"]="pulseaudio SEP cpu ram-memory swap-memory SEP network ipstack-vpn SEP xkeyboard SEP weather SEP sun aw-afk date TSEP" ["DVI-D-0"]="pulseaudio SEP cpu ram-memory swap-memory SEP network ipstack-vpn SEP xkeyboard SEP weather SEP sun aw-afk date TSEP"
["HDMI-A-0"]="pulseaudio mpd SEP cpu ram-memory swap-memory SEP network ipstack-vpn SEP xkeyboard SEP weather SEP sun aw-afk date TSEP" ["HDMI-A-0"]="pulseaudio mpd SEP cpu ram-memory swap-memory SEP network ipstack-vpn SEP xkeyboard SEP weather SEP sun aw-afk date TSEP"
["eDP-1"]="pulseaudio mpd SEP cpu ram-memory swap-memory SEP network ipstack-vpn SEP xkeyboard SEP battery SEP sun aw-afk date TSEP"
) )
# Geolocation for some modules # Geolocation for some modules

View file

@ -1,7 +1,9 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# [[file:../../Desktop.org::*Screen layout][Screen layout:1]] # [[file:../../Desktop.org::*Screen settings][Screen settings:1]]
hostname=$(hostname) hostname=$(hostname)
if [ "$hostname" = "indigo" ]; then if [ "$hostname" = "indigo" ]; then
xrandr --output DisplayPort-0 --off --output HDMI-A-0 --mode 1920x1080 --pos 0x0 --rotate normal --output DVI-D-0 --mode 1366x768 --pos 1920x312 --rotate normal xrandr --output DisplayPort-0 --off --output HDMI-A-0 --mode 1920x1080 --pos 0x0 --rotate normal --output DVI-D-0 --mode 1366x768 --pos 1920x312 --rotate normal
elif [ "$hostname" = "eminence" ]; then
xgamma -gamma 1.25
fi fi
# Screen layout:1 ends here # Screen settings:1 ends here