From 4d2e4fff143870a185c1e73afc41c088a77ff743 Mon Sep 17 00:00:00 2001 From: AngeD Date: Thu, 29 Jun 2023 12:09:36 +0200 Subject: [PATCH] fix: sway config --- .config/sway/config | 5 +- .config/sway/config.d/10-variables.conf | 5 +- .config/sway/config.d/20-io.conf | 5 +- .config/sway/config.d/30-startup.conf | 8 +- .config/sway/config.d/40-hotkeys.conf | 2 + .config/sway/config.d/50-bar.conf | 7 + .config/waybar/config | 80 -------- .config/waybar/style.css | 261 ------------------------ .config/zsh/.zprofile | 8 +- .config/zsh/custom/themes/powerlevel10k | 2 +- .config/zsh/ohmyzsh | 2 +- .zshenv | 2 +- bin/sbar | 8 +- 13 files changed, 38 insertions(+), 357 deletions(-) create mode 100644 .config/sway/config.d/50-bar.conf delete mode 100644 .config/waybar/config delete mode 100644 .config/waybar/style.css diff --git a/.config/sway/config b/.config/sway/config index 045f2eb..90ec2c9 100644 --- a/.config/sway/config +++ b/.config/sway/config @@ -1,4 +1,3 @@ -# Config for sway -# Read `man 5 sway` for a complete reference. - include "config.d/*.conf + +# vim: ft=swayconfig diff --git a/.config/sway/config.d/10-variables.conf b/.config/sway/config.d/10-variables.conf index f6c2e98..9022a02 100644 --- a/.config/sway/config.d/10-variables.conf +++ b/.config/sway/config.d/10-variables.conf @@ -5,7 +5,7 @@ set $down k set $up j set $right l -set $menu dmenu_run | xargs swaymsg exec -- +set $menu dmenu_path | dmenu | xargs swaymsg exec -- set $term alacritty set $browser firefox set $private_browser firefox --private-window @@ -15,6 +15,7 @@ set $lock swaylock -F -f -i $wallpapers/lock.png set $screenshot flameshot full -c set $screenshot_rect flameshot gui +# 1: to fix order set $ws1 1:TTY set $ws2 2:WEB set $ws3 3:DEV @@ -30,3 +31,5 @@ client.focused #4c7899 #285577 #ffffff #2e9ef4 #e00000 default_border pixel set $screen_timeout 600 + +# vim: ft=swayconfig diff --git a/.config/sway/config.d/20-io.conf b/.config/sway/config.d/20-io.conf index e345b11..daf15d1 100644 --- a/.config/sway/config.d/20-io.conf +++ b/.config/sway/config.d/20-io.conf @@ -15,7 +15,8 @@ input type:touchpad { output { eDP-1 position 0 0 - DP-3 position 1920 0 - DP-2 position 3840 0 + DP-2 position 1920 0 * bg $wallpapers/mount_cook.jpg fill } + +# vim: ft=swayconfig diff --git a/.config/sway/config.d/30-startup.conf b/.config/sway/config.d/30-startup.conf index 9e5616c..dd4760a 100644 --- a/.config/sway/config.d/30-startup.conf +++ b/.config/sway/config.d/30-startup.conf @@ -11,10 +11,12 @@ exec swayidle -w \ resume 'swaymsg "output * dpms on"' \ before-sleep "$lock" -bar swaybar_command waybar +#bar swaybar_command waybar -exec /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 # arch -#exec /usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1 # debian +#exec /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 # arch +exec /usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1 # debian #exec /usr/libexec/polkit-gnome-authentication-agent-1 & # fedora exec gammastep + +# vim: ft=swayconfig diff --git a/.config/sway/config.d/40-hotkeys.conf b/.config/sway/config.d/40-hotkeys.conf index 97be183..bd6c839 100644 --- a/.config/sway/config.d/40-hotkeys.conf +++ b/.config/sway/config.d/40-hotkeys.conf @@ -81,3 +81,5 @@ # Toggle the current focus between tiling and floating mode bindsym $mod+space floating toggle + +# vim: ft=swayconfig diff --git a/.config/sway/config.d/50-bar.conf b/.config/sway/config.d/50-bar.conf new file mode 100644 index 0000000..2c4ea20 --- /dev/null +++ b/.config/sway/config.d/50-bar.conf @@ -0,0 +1,7 @@ +bar { + position top + strip_workspace_numbers yes + status_command sbar +} + +# vim: ft=swayconfig diff --git a/.config/waybar/config b/.config/waybar/config deleted file mode 100644 index 3d98f9c..0000000 --- a/.config/waybar/config +++ /dev/null @@ -1,80 +0,0 @@ -{ - "modules-left": ["sway/workspaces"], - "modules-center": ["sway/window"], - "modules-right": ["custom/crypto", "pulseaudio", "cpu", "memory", "temperature", "backlight", "battery", "tray", "clock"], - "backlight": { - "format": "{percent}% {icon}", - "format-icons": ["", ""], - "on-scroll-up": "set-light +10", - "on-scroll-down": "set-light -10", - "smooth-scrolling-threshold": 1, - }, - "battery": { - "states": { - "warning": 30, - "critical": 15, - }, - "format": "{capacity}% {icon}", - "format-charging": "{capacity}% ", - "format-plugged": "{capacity}% ", - "format-alt": "{time} {icon}", - "format-icons": ["", "", "", "", ""], - }, - "clock": { - "format": "{:%a %b %d, %R}", - "tooltip-format": "{calendar}", - }, - "cpu": { - "format": "{usage}% ", - }, - "idle_inhibitor": { - "format": "{icon}", - "format-icons": { - "activated": "", - "deactivated": "", - }, - }, - "memory": { - "format": "{}% ", - }, - "pulseaudio": { - "format": "{volume}% {icon} {format_source}", - "format-bluetooth": "{volume}% {icon} {format_source}", - "format-bluetooth-muted": " {icon} {format_source}", - "format-muted": " {format_source}", - "format-source": "{volume}% ", - "format-source-muted": "", - "format-icons": { - "headphone": "", - "hands-free": "", - "headset": "", - "phone": "", - "portable": "", - "car": "", - "default": ["", "", ""], - }, - "on-click": "pavucontrol", - "on-scroll-up": "set-vol +5", - "on-scroll-down": "set-vol -5", - "smooth-scrolling-threshold": 1, - }, - "temperature": { - "critical-threshold": 80, - "format": "{temperatureC}°C {icon}", - "format-icons": ["", "", ""], - }, - "tray": { - "icon-size": 21, - "spacing": 10, - }, - "sway/workspaces": { - "disable-scroll": true, - "format": "{name}", - }, - "custom/crypto": { - "exec": "crypto", - "interval": 3600, - } -} - -// vim: ft=json diff --git a/.config/waybar/style.css b/.config/waybar/style.css deleted file mode 100644 index 77e8b02..0000000 --- a/.config/waybar/style.css +++ /dev/null @@ -1,261 +0,0 @@ -* { - border: none; - border-radius: 0; - /* `otf-font-awesome` is required to be installed for icons */ - font-family: Roboto, Helvetica, Arial, sans-serif, "Font Awesome 5 Free"; - font-size: 13px; - min-height: 0; -} - -window#waybar { - background-color: rgba(43, 48, 59, 0.5); - border-bottom: 3px solid rgba(100, 114, 125, 0.5); - color: #ffffff; - transition-property: background-color; - transition-duration: .5s; -} - -window#waybar.hidden { - opacity: 0.2; -} - -/* -window#waybar.empty { - background-color: transparent; -} -window#waybar.solo { - background-color: #FFFFFF; -} -*/ - -window#waybar.termite { - background-color: #3F3F3F; -} - -window#waybar.chromium { - background-color: #000000; - border: none; -} - -#workspaces button { - padding: 0 5px; - background-color: transparent; - color: #ffffff; - /* Use box-shadow instead of border so the text isn't offset */ - box-shadow: inset 0 -3px transparent; -} - -/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */ -#workspaces button:hover { - background: rgba(0, 0, 0, 0.2); - box-shadow: inset 0 -3px #ffffff; -} - -#workspaces button.focused { - background-color: #64727D; - box-shadow: inset 0 -3px #ffffff; -} - -#workspaces button.urgent { - background-color: #eb4d4b; -} - -#mode { - background-color: #64727D; - border-bottom: 3px solid #ffffff; -} - -#clock, -#battery, -#cpu, -#memory, -#disk, -#temperature, -#backlight, -#network, -#pulseaudio, -#custom-media, -#tray, -#mode, -#idle_inhibitor, -#custom-crypto -#mpd { - padding: 0 10px; - margin: 0 4px; - color: #ffffff; -} - -#window, -#workspaces { - margin: 0 4px; -} - -/* If workspaces is the leftmost module, omit left margin */ -.modules-left > widget:first-child > #workspaces { - margin-left: 0; -} - -/* If workspaces is the rightmost module, omit right margin */ -.modules-right > widget:last-child > #workspaces { - margin-right: 0; -} - -#clock { - background-color: #64727D; -} - -#battery { - background-color: #ffffff; - color: #000000; -} - -#battery.charging, #battery.plugged { - color: #ffffff; - background-color: #26A65B; -} - -@keyframes blink { - to { - background-color: #ffffff; - color: #000000; - } -} - -#battery.critical:not(.charging) { - background-color: #f53c3c; - color: #ffffff; - animation-name: blink; - animation-duration: 0.5s; - animation-timing-function: linear; - animation-iteration-count: infinite; - animation-direction: alternate; -} - -label:focus { - background-color: #000000; -} - -#cpu { - background-color: #2ecc71; - color: #000000; -} - -#memory { - background-color: #9b59b6; -} - -#disk { - background-color: #964B00; -} - -#backlight { - background-color: #90b1b1; -} - -#network { - background-color: #2980b9; -} - -#network.disconnected { - background-color: #f53c3c; -} - -#pulseaudio { - background-color: #f1c40f; - color: #000000; -} - -#pulseaudio.muted { - background-color: #90b1b1; - color: #2a5c45; -} - -#custom-media { - background-color: #66cc99; - color: #2a5c45; - min-width: 100px; -} - -#custom-media.custom-spotify { - background-color: #66cc99; -} - -#custom-media.custom-vlc { - background-color: #ffa000; -} - -#temperature { - background-color: #f0932b; -} - -#temperature.critical { - background-color: #eb4d4b; -} - -#tray { - background-color: #2980b9; -} - -#tray > .passive { - -gtk-icon-effect: dim; -} - -#tray > .needs-attention { - -gtk-icon-effect: highlight; - background-color: #eb4d4b; -} - -#idle_inhibitor { - background-color: #2d3436; -} - -#idle_inhibitor.activated { - background-color: #ecf0f1; - color: #2d3436; -} - -#mpd { - background-color: #66cc99; - color: #2a5c45; -} - -#mpd.disconnected { - background-color: #f53c3c; -} - -#mpd.stopped { - background-color: #90b1b1; -} - -#mpd.paused { - background-color: #51a37a; -} - -#language { - background: #00b093; - color: #740864; - padding: 0 5px; - margin: 0 5px; - min-width: 16px; -} - -#keyboard-state { - background: #97e1ad; - color: #000000; - padding: 0 0px; - margin: 0 5px; - min-width: 16px; -} - -#keyboard-state > label { - padding: 0 5px; -} - -#keyboard-state > label.locked { - background: rgba(0, 0, 0, 0.2); -} - -#custom-crypto { - background-color: #f1c40f; - color: #000000; -} diff --git a/.config/zsh/.zprofile b/.config/zsh/.zprofile index d67f6d0..27f138a 100644 --- a/.config/zsh/.zprofile +++ b/.config/zsh/.zprofile @@ -1,9 +1,11 @@ if [ "$XDG_VTNR" = 1 ]; then - GUILOG="$HOME/.local/share/xorg/gui.log" + GUILOG="$HOME/.local/share/gui.log" + mkdir -p "$(dirname "$GUILOG")" mv "$GUILOG" "$GUILOG.old" 2> /dev/null - exec startx > "$GUILOG" 2>&1 - #export XDG_CURRENT_DESKTOP=sway && exec sway > "$HOME/.gui.log" 2>&1 + + #export XDG_CURRENT_DESKTOP=Unity && exec startx > "$GUILOG" 2>&1 + export XDG_CURRENT_DESKTOP=sway && exec sway > "$GUILOG" 2>&1 fi # vim: ft=zsh diff --git a/.config/zsh/custom/themes/powerlevel10k b/.config/zsh/custom/themes/powerlevel10k index ab8bac0..20323d6 160000 --- a/.config/zsh/custom/themes/powerlevel10k +++ b/.config/zsh/custom/themes/powerlevel10k @@ -1 +1 @@ -Subproject commit ab8bac01e2a90e1cd749d4936e4decbdba3c2727 +Subproject commit 20323d6f8cd267805a793dafc840d22330653867 diff --git a/.config/zsh/ohmyzsh b/.config/zsh/ohmyzsh index c0e811c..8cbe984 160000 --- a/.config/zsh/ohmyzsh +++ b/.config/zsh/ohmyzsh @@ -1 +1 @@ -Subproject commit c0e811c90df387eca4223c7d4dbb3f2d32a684c7 +Subproject commit 8cbe98469d9862d37d43ca4229dc8e915ec377a9 diff --git a/.zshenv b/.zshenv index 93427a1..e613de2 100644 --- a/.zshenv +++ b/.zshenv @@ -19,5 +19,5 @@ path=("$HOME/bin" "$HOME/.local/bin" $path) export EDITOR='nvim' export MAKEFLAGS='-j' -export XDG_CURRENT_DESKTOP=Unity export QT_STYLE_OVERRIDE=Materia-dark +export MOZ_ENABLE_WAYLAND=1 diff --git a/bin/sbar b/bin/sbar index 4ee50fe..475003f 100755 --- a/bin/sbar +++ b/bin/sbar @@ -70,7 +70,7 @@ reload_bar() { } display() { - xsetroot -name "$crypto | $cpu | $memory | $vol | $wlp | $bat | $time" + ${DISPLAYCMD[@]} "$crypto | $cpu | $memory | $vol | $wlp | $bat | $time" } # SIGNALING @@ -82,6 +82,12 @@ trap 'update_crypto;display' 'RTMIN+2' ## kill -m "$(cat ~/.cache/pidofbar)" # where m = 34 + n +if [ "$XDG_SESSION_TYPE" = wayland ]; then + DISPLAYCMD=(echo) +else + DISPLAYCMD=(xsetroot -name) +fi + sec=0 while true; do [ "$((sec % 300))" = 0 ] && update_crypto