diff --git a/home/dot_config/environment.d/wayland.conf b/home/dot_config/environment.d/wayland.conf index 5fca9b7..32b8457 100644 --- a/home/dot_config/environment.d/wayland.conf +++ b/home/dot_config/environment.d/wayland.conf @@ -13,3 +13,4 @@ QT_QPA_PLATFORM=wayland;xcb CLUTTER_BACKEND=wayland SDL_VIDEODRIVER=wayland EDITOR=nvim +ELECTRON_OZONE_PLATFORM_HINT=auto diff --git a/home/dot_config/eww/eww.scss b/home/dot_config/eww/eww.scss index 0d6b502..70f2a7a 100644 --- a/home/dot_config/eww/eww.scss +++ b/home/dot_config/eww/eww.scss @@ -55,13 +55,18 @@ button { border-radius: 6px; } -.volume-widget, .brightness-widget { - padding: 0 5px; +.battery-widget, .volume-widget, .brightness-widget, .caffeine { + padding: 0 2px; } -.volume-widget button:hover, .brightness-widget button:hover { - background-color: $surface; +.tray-button { + padding: 0 8px; border-radius: 6px; + transition: background-color 0.2s; +} + +.tray-button:hover { + background-color: $surface; } .popup-box { @@ -117,3 +122,37 @@ button { calendar { padding: 5px; } + +.popup-title { + font-size: 16px; + font-weight: bold; + color: $blue; + margin-bottom: 5px; +} + +.popup-subtitle { + font-size: 12px; + color: $fg; + opacity: 0.8; + margin-top: 5px; +} + +.profile-active { + background-color: $blue; + color: $crust; + padding: 8px 12px; + border-radius: 6px; + font-weight: bold; +} + +.profile-inactive { + background-color: $surface; + color: $fg; + padding: 8px 12px; + border-radius: 6px; +} + +.profile-inactive:hover { + background-color: lighten($surface, 5%); + border: 1px solid $blue; +} diff --git a/home/dot_config/eww/eww.yuck b/home/dot_config/eww/eww.yuck index 666602f..05d5aca 100644 --- a/home/dot_config/eww/eww.yuck +++ b/home/dot_config/eww/eww.yuck @@ -4,6 +4,10 @@ (defpoll vol_icon :interval "1s" :initial "🔉" "bash ~/.config/eww/scripts/volume.sh icon") (defpoll br :interval "1s" :initial "50" "bash ~/.config/eww/scripts/brightness.sh get") (defpoll br_icon :interval "1s" :initial "â˜€ī¸" "bash ~/.config/eww/scripts/brightness.sh icon") +(defpoll battery :interval "10s" :initial "100" "cat /sys/class/power_supply/BAT*/capacity 2>/dev/null || echo 100") +(defpoll battery_status :interval "10s" :initial "Unknown" "cat /sys/class/power_supply/BAT*/status 2>/dev/null || echo Unknown") +(defpoll power_profile :interval "5s" :initial "balanced" "bash ~/.config/eww/scripts/power-profile.sh get") +(defpoll power_profile_icon :interval "5s" :initial "âš–ī¸" "bash ~/.config/eww/scripts/power-profile.sh icon") (deflisten workspaces :initial "[]" "bash ~/.config/eww/scripts/get-workspaces.sh") @@ -23,21 +27,35 @@ (box :class "volume-widget" (button :onclick "bash ~/.config/eww/scripts/toggle-window.sh volume_popup" :onrightclick "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" + :class "tray-button" "${vol_icon} ${vol}%"))) (defwidget brightness_widget [] (box :class "brightness-widget" (button :onclick "bash ~/.config/eww/scripts/toggle-window.sh brightness_popup" + :class "tray-button" "${br_icon} ${br}%"))) (defwidget caffeine_widget [] (box :class "caffeine" (button :onclick "bash ~/.config/eww/scripts/toggle-inhibit.sh" - :class {inhibit_status == "on" ? "caffeine-on" : "caffeine-off"} + :class "tray-button ${inhibit_status == 'on' ? 'caffeine-on' : 'caffeine-off'}" {inhibit_status == "on" ? "☕" : "🌙"}))) +(defwidget battery_widget [] + (box :class "battery-widget" + (button :onclick "bash ~/.config/eww/scripts/toggle-window.sh power_profile_popup" + :tooltip "Battery: ${battery}% (${battery_status})\nPower Profile: ${power_profile}" + :class "tray-button" + "${battery_status == 'Charging' ? '🔌' : + battery >= 80 ? '🔋' : + battery >= 50 ? '🔋' : + battery >= 20 ? 'đŸĒĢ' : + 'đŸĒĢ'} ${battery}% ${power_profile_icon}"))) + (defwidget tray_widget [] (box :halign "end" :class "tray-container" :space-evenly false :spacing 10 + (battery_widget) (brightness_widget) (volume_widget) (caffeine_widget) @@ -85,3 +103,22 @@ (label :text br_icon) (scale :class "br-bar" :min 0 :max 101 :value {br == "" ? 0 : br} :width 150 :onchange "brightnessctl s {}%") (label :text "${br}%"))) + +(defwindow power_profile_popup + :monitor "eDP-1" + :geometry (geometry :x "15px" :y "15px" :width "300px" :height "180px" :anchor "top right") + :stacking "fg" + :focusable false + (box :class "popup-box" :orientation "v" :space-evenly false :spacing 10 + (label :class "popup-title" :text "Power Profile") + (box :orientation "v" :spacing 8 + (button :class {power_profile == "power-saver" ? "profile-active" : "profile-inactive"} + :onclick "bash ~/.config/eww/scripts/power-profile.sh set power-saver && bash ~/.config/eww/scripts/toggle-window.sh power_profile_popup" + "đŸĸ Power Saver") + (button :class {power_profile == "balanced" ? "profile-active" : "profile-inactive"} + :onclick "bash ~/.config/eww/scripts/power-profile.sh set balanced && bash ~/.config/eww/scripts/toggle-window.sh power_profile_popup" + "âš–ī¸ Balanced") + (button :class {power_profile == "performance" ? "profile-active" : "profile-inactive"} + :onclick "bash ~/.config/eww/scripts/power-profile.sh set performance && bash ~/.config/eww/scripts/toggle-window.sh power_profile_popup" + "🚀 Performance")) + (label :class "popup-subtitle" :text "Current: ${power_profile}"))) diff --git a/home/dot_config/sway/conf.d/keybinding.conf b/home/dot_config/sway/conf.d/keybinding.conf index 44f7c05..d13175b 100644 --- a/home/dot_config/sway/conf.d/keybinding.conf +++ b/home/dot_config/sway/conf.d/keybinding.conf @@ -5,7 +5,6 @@ # bindsym $alt+Shift+c exec ~/bin/screenshot bindsym $alt+Shift+m exec ~/bin/screenshot-monitor - bindsym $alt+Shift+v exec ~/bin/auto-screenshot-monitor # Start a terminal bindsym $mod+Return exec $term @@ -20,6 +19,8 @@ bindsym $alt+space exec $menu bindsym $mod+Shift+w exec $window_switcher bindsym $mod+w exec $window_workspace_switcher + bindsym $mod+Shift+v exec ~/.config/wofi/wofi-control-panel.sh + bindsym $mod+Shift+t exec ~/.config/wofi/wofi-totp-menu.sh # Drag floating windows by holding down $mod and left mouse button. # Resize them with right mouse button + $mod. @@ -167,4 +168,4 @@ bindsym $mod+r mode "resize" #bindsym --release $mod+Shift+w exec "echo 0 > /tmp/sovpipe" # show bindsym help -bindsym $mod+Ctrl+h exec cat ~/.config/sway/config |grep bindsym |grep -v "#"| sed 's/^[[:space:]]*//'| wofi --dmenu +bindsym $mod+Ctrl+h exec cat ~/.config/sway/conf.d/keybinding.conf |grep bindsym |grep -v "#"| sed 's/^[[:space:]]*//'| wofi --dmenu diff --git a/home/dot_config/sway/conf.d/monitor.conf b/home/dot_config/sway/conf.d/monitor.conf index d19a431..6eb9477 100644 --- a/home/dot_config/sway/conf.d/monitor.conf +++ b/home/dot_config/sway/conf.d/monitor.conf @@ -4,10 +4,10 @@ output eDP-1 scale 1.3 workspace 1 output eDP-1 workspace 2 output eDP-1 workspace 3 output eDP-1 -workspace 4 output HDMI-A-1 DP-9 eDP-1 -workspace 5 output HDMI-A-1 DP-9 eDP-1 -workspace 6 output HDMI-A-1 DP-9 eDP-1 -workspace 7 output HDMI-A-1 DP-9 eDP-1 -workspace 8 output HDMI-A-1 DP-9 eDP-1 +workspace 4 output HDMI-A-1 DP-1 DP-9 eDP-1 +workspace 5 output HDMI-A-1 DP-1 DP-9 eDP-1 +workspace 6 output HDMI-A-1 DP-1 DP-9 eDP-1 +workspace 7 output HDMI-A-1 DP-1 DP-9 eDP-1 +workspace 8 output HDMI-A-1 DP-1 DP-9 eDP-1 workspace 9 output eDP-1 workspace 10 output eDP-1 diff --git a/home/dot_config/sway/config b/home/dot_config/sway/config index 45f48cf..688c967 100644 --- a/home/dot_config/sway/config +++ b/home/dot_config/sway/config @@ -54,7 +54,7 @@ exec dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DE exec_always kanshi exec dex -a -e sway -s /etc/xdg/autostart/:~/.config/autostart/ exec mako -exec udiskie --smart-tray +exec udiskie -t exec_always ~/.config/eww/open-main.sh diff --git a/home/dot_config/wofi/executable_wofi-window-switch.sh b/home/dot_config/wofi/executable_wofi-window-switch.sh index 4a539a8..a2a140b 100644 --- a/home/dot_config/wofi/executable_wofi-window-switch.sh +++ b/home/dot_config/wofi/executable_wofi-window-switch.sh @@ -4,12 +4,12 @@ entries=$(swaymsg -t get_tree | jq -r -c ' recurse(.nodes[]?) | recurse(.floating_nodes[]?) | select(.type=="con"), select(.type=="floating_con") | - (.id | tostring) + " " + .app_id + ": " + .name') + (.id | tostring) + " " + (.window_properties.class // .app_id) + ": " + .name') echo "$entries" selected=$(echo -e "$entries" | wofi --width 450 --height 350 --dmenu --cache-file /dev/null | awk '{print $1}') if [ -n "$selected" ]; then - swaymsg "[con_id=$selected]" focus + swaymsg "[con_id=$selected]" focus fi