From 4af84a42b7bc9472c39293ce3fe6b6e05d6756bd Mon Sep 17 00:00:00 2001 From: Joachim Nielandt Date: Tue, 28 Jun 2022 20:49:43 +0200 Subject: [PATCH] Trying sway again. --- dot_Xresources.tmpl | 4 +++ dot_config/alacritty/alacritty.yml | 2 +- dot_config/polybar/config.tmpl | 40 +++++++++++++++++++----------- dot_config/sway/config | 24 ++++++++++++------ dot_config/waybar/config | 11 +++++++- dot_config/waybar/style.css | 10 +++++++- dot_config/waybar/style.scss | 16 +++++++++++- scripts/executable_gpu.temp.sh | 10 ++++++++ 8 files changed, 90 insertions(+), 27 deletions(-) create mode 100644 scripts/executable_gpu.temp.sh diff --git a/dot_Xresources.tmpl b/dot_Xresources.tmpl index 9bca9c3..c1698b8 100644 --- a/dot_Xresources.tmpl +++ b/dot_Xresources.tmpl @@ -13,6 +13,10 @@ URxvt.background: [90]#1d2021 !URxvt.transparent: true !URxvt.shading: 10 +! Font settings I found on forum +URxvt.utf8: true +URxvt.locale: true + ! Included this so you know how to make your foreground not match the color of your background ! light0_hard gruvbox URxvt.foreground: #f9f5d7 diff --git a/dot_config/alacritty/alacritty.yml b/dot_config/alacritty/alacritty.yml index 4004008..0b4d1e2 100644 --- a/dot_config/alacritty/alacritty.yml +++ b/dot_config/alacritty/alacritty.yml @@ -61,7 +61,7 @@ window: # Values for `decorations` (macOS only): # - transparent: Title bar, transparent background and title bar buttons # - buttonless: Title bar, transparent background and no title bar buttons - decorations: "Full" + decorations: "none" # Background opacity # diff --git a/dot_config/polybar/config.tmpl b/dot_config/polybar/config.tmpl index d7d64cf..44c1e60 100644 --- a/dot_config/polybar/config.tmpl +++ b/dot_config/polybar/config.tmpl @@ -79,12 +79,13 @@ border-top-size = 0 padding-left = 5 padding-right = 5 ; set the bar fonts +; when using mono fonts, icons might appear way too small ;font-0 = fixed:pixelsize=10;1 ;font-0 = "Wuncon Siji:pixelsize=15;1" ;font-1 = unifont:fontformat=truetype:size=8:antialias=false;0 ;font-2 = "Inconsolata\ For\ Powerline:pixelsize=10;1" ;font-0 = FuraCode Nerd Font:pixelsize=11;1 -font-0 = Hasklug Nerd Font Mono:pixelsize=11;1 +font-0 = Hasklug Nerd Font:pixelsize=9;1 ;font-1 = Siji:style=Regular:pixelsize=11 font-1 = Siji:pixelsize=14;0 ; override pointers @@ -104,7 +105,7 @@ bottom = false ;border-right-size = 16 ;unused modules - mpd xbacklight backlight-acpi alsa modules-left = i3 -modules-center = temperature battery xkeyboard memory cpu filesystem updates-pacman updates-aurhelper reboot-check xbacklight top-process +modules-center = temperature gpu-temp battery xkeyboard memory cpu filesystem updates-pacman updates-aurhelper reboot-check xbacklight top-process modules-right = net wifi0 vpn ; TRAY MANAGEMENT @@ -147,6 +148,16 @@ tail = true label = %output% label-foreground = ${colors.light0_hard} +[module/gpu-temp] +type = custom/script +exec = ~/scripts/gpu.temp.sh +tail = true +label = "%output%°C" +label-foreground = ${colors.light0_hard} +format-prefix = " " +format-prefix-foreground = ${colors.bright_green} +interval = 5 + [module/info-hackspeed] type = custom/script format-prefix = " " @@ -182,7 +193,7 @@ label = %title:0:30:...% [module/xkeyboard] type = internal/xkeyboard blacklist-0 = num lock -format-prefix = " " +format-prefix = " " format-prefix-foreground = ${colors.bright_green} ;format-prefix-underline = ${colors.underline-keyboard} ; layout, number, name @@ -297,10 +308,10 @@ label-mode-background = ${colors.dark2} ;label-mode-underline = ${colors.light2} ; can use: %icon% %name% %index -label-focused = %name% -label-unfocused = ·%name% -label-visible = ·%name% -label-urgent = ·%name% +label-focused = "%name%" +label-unfocused = "·%name%" +label-visible = "·%name%" +label-urgent = "·%name%" label-focused-foreground = ${colors.bright_green} label-unfocused-foreground = ${colors.light0_hard} @@ -578,13 +589,12 @@ full-at = 97 time-format = %H:%M -label-charging =  %time% %percentage%% +label-charging = " %time% %percentage%%" format-charging = ;format-charging-underline = #ffb52a ;format-charging-underline = ${colors.underline-battery} - -label-discharging =  %time% %percentage%% +label-discharging = " %time% %percentage%%" format-discharging = ;format-discharging-underline = ${self.format-charging-underline} @@ -592,11 +602,11 @@ format-full-prefix = " " format-full-prefix-foreground = ${colors.bright_green} ;format-full-underline = ${self.format-charging-underline} -ramp-capacity-0 =  -ramp-capacity-1 =  -ramp-capacity-2 =  -ramp-capacity-3 =  -ramp-capacity-4 =  +ramp-capacity-0 = " " +ramp-capacity-1 = " " +ramp-capacity-2 = " " +ramp-capacity-3 = " " +ramp-capacity-4 = " " ramp-capacity-foreground = ${colors.bright_green} animation-charging-0 =  diff --git a/dot_config/sway/config b/dot_config/sway/config index e419b6a..b2c92d2 100644 --- a/dot_config/sway/config +++ b/dot_config/sway/config @@ -63,7 +63,8 @@ focus_wrapping no # font pango:DejaVu Sans Mono 8 # font xft:Fantasque Sans Mono 9 -font xft:FuraCode Nerd Font 8 +# font xft:FuraCode Nerd Font 8 +font xft:Hasklug Nerd Font # Use Mouse+$mod to drag floating windows to their wanted position floating_modifier $mod @@ -484,14 +485,18 @@ set $transparent #ffffff00 # This is how you would get a colors from xrdb # set_from_resource $color0 i3wm.color0 #000000 -# window color class [border| backgr.| text| indicator| child_border] -client.focused $gray_245 $dark0_hard $light0_hard $bright_orange $bright_green -client.focused_inactive $dark0_hard $dark0_hard $light0_hard $dark0_hard $dark0_hard -client.unfocused $dark0_hard $dark0_hard $light0_hard $dark0_hard #FFFFFF00 -client.urgent $dark0_hard $dark0 $light0_hard $dark0_hard $bright_orange -client.placeholder $dark0_hard $dark0_hard $light0_hard $dark0_hard $dark0_hard +# window color class border backgr. text indicator child_border +client.focused $bright_green $dark0_hard $light0_hard $bright_orange $bright_green +client.focused_inactive $faded_green $dark0_hard $light0_hard $dark0_hard $dark0_hard +client.unfocused $transparent $dark0_hard $light0_hard $dark0_hard $transparent +client.urgent $bright_green $dark0 $light0_hard $dark0_hard $bright_orange +client.placeholder $bright_green $dark0_hard $light0_hard $dark0_hard $dark0_hard client.background $dark0_hard +titlebar_border_thickness 1 +titlebar_padding 1 1 + + # Took this from the default config # bar { # position top @@ -508,7 +513,7 @@ client.background $dark0_hard # } # Default wallpaper (more resolutions are available in /usr/share/backgrounds/sway/) -output * bg ~/pictures/l_ash03_big.jpg fill +output * bg ~/pictures/wallpaper/l_ash03_big.jpg fill # Testing this out # dwt - disable while typing @@ -516,7 +521,10 @@ output * bg ~/pictures/l_ash03_big.jpg fill input "1267:12590:ELAN0755:00_04F3:312E_Touchpad" { dwt enabled tap enabled + # adaptive would be acceleration + accel_profile flat natural_scroll enabled + pointer_accel 0.5 middle_emulation enabled } diff --git a/dot_config/waybar/config b/dot_config/waybar/config index 905b8cf..84db984 100644 --- a/dot_config/waybar/config +++ b/dot_config/waybar/config @@ -24,7 +24,7 @@ // Choose the order of the modules "modules-left": ["sway/workspaces", "sway/mode", "custom/media"], "modules-center": ["clock"], - "modules-right": ["mpd", "idle_inhibitor", "pulseaudio", "network", "cpu", "memory", "temperature", "backlight", "keyboard-state", "sway/language", "battery", "battery#bat2"], + "modules-right": ["mpd", "idle_inhibitor", "pulseaudio", "network", "cpu", "memory", "temperature", "custom/gpu-temp", "backlight", "keyboard-state", "sway/language", "battery", "battery#bat2"], // Modules configuration // "sway/workspaces": { // "disable-scroll": true, @@ -183,6 +183,15 @@ "escape": true, "exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder // "exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name + }, + "custom/gpu-temp": { + "format": "{icon} {}°C", + "max-length": 10, + "format-icons": { + "default": "" + }, + "escape": true, + "exec": "sh $HOME/scripts/gpu.temp.sh 2> /dev/null" } } ] diff --git a/dot_config/waybar/style.css b/dot_config/waybar/style.css index 2d15cf0..00fd641 100644 --- a/dot_config/waybar/style.css +++ b/dot_config/waybar/style.css @@ -1,7 +1,10 @@ +/* compile with */ +/* sass -w style.scss style.css */ + * { /* `otf-font-awesome` is required to be installed for icons */ /* font-family: FontAwesome, Roboto, Helvetica, Arial, sans-serif; */ - font-family: FiraCode Nerd Font Mono; + font-family: Hasklug Nerd Font; font-size: 12px; } @@ -232,4 +235,9 @@ label:focus { background: rgba(0, 0, 0, 0.2); } +#gpu-temp { + color: #b16286; + border-bottom: 3px solid #b16286; +} + /*# sourceMappingURL=style.css.map */ diff --git a/dot_config/waybar/style.scss b/dot_config/waybar/style.scss index d683ba3..cb15bf9 100644 --- a/dot_config/waybar/style.scss +++ b/dot_config/waybar/style.scss @@ -1,15 +1,20 @@ +/* compile with */ +/* sass -w style.scss style.css */ @import 'gruvbox.scss'; * { /* `otf-font-awesome` is required to be installed for icons */ /* font-family: FontAwesome, Roboto, Helvetica, Arial, sans-serif; */ - font-family: FiraCode Nerd Font Mono; + /* font-family: FiraCode Nerd Font Mono; */ + font-family: Hasklug Nerd Font; font-size: 12px; } window { &#waybar { + //background-color: $bg0; background-color: $bg0; + opacity: 0.9; color: $fg0; transition-property: background-color; transition-duration: .5s; @@ -214,6 +219,7 @@ label:focus { #tray { background-color: $bg0; + opacity: 0.9; & > .passive { -gtk-icon-effect: dim; @@ -281,3 +287,11 @@ label:focus { background: rgba(0, 0, 0, 0.2); } } + +#gpu-temp { + color: $light-green; + + &.critical { + color: $light-red; + } +} diff --git a/scripts/executable_gpu.temp.sh b/scripts/executable_gpu.temp.sh new file mode 100644 index 0000000..9902ef1 --- /dev/null +++ b/scripts/executable_gpu.temp.sh @@ -0,0 +1,10 @@ +if ! command -v nvidia-settings &> /dev/null +then + # command not found + echo "" + exit +else + # simply output the gpucoretemp as reported by the binary + nvidia-settings -q gpucoretemp -t +fi +