fix configuring sway colors from dispatcher

This commit is contained in:
Almarhoon Ibraheem 2024-06-15 20:15:24 +03:00
parent 5159d1e45a
commit 26abbc2c72
3 changed files with 70 additions and 7 deletions

View file

@ -7,3 +7,60 @@
(sway-output "*" "bg /home/ebeem/dotfiles/.wallpapers/fixed/flat-20.png fill")
(sway-focus-follow-mouse SWAY-FOCUS-FOLLOW-MOUSE-FLAG-NO)
(sway-default-gaps SWAY-GAPS-OPTION-INNER 10)
(sway-title-format "")
(sway-layout SWAY-LAYOUT-TABBED)
(sway-titlebar-border-thickness 0)
(sway-titlebar-padding 0 0)
(sway-default-border-style SWAY-BORDER-STYLE-PIXEL #:n 4)
;; TODO: better move theme colors to another module for all guile scripts to inherit from
(define rosewater "#f4dbd6")
(define flamingo "#f0c6c6")
(define pink "#f5bde6")
(define mauve "#c6a0f6")
(define red "#ed8796")
(define maroon "#ee99a0")
(define peach "#f5a97f")
(define yellow "#eed49f")
(define green "#a6da95")
(define teal "#8bd5ca")
(define sky "#91d7e3")
(define sapphire "#7dc4e4")
(define blue "#8aadf4")
(define lavender "#b7bdf8")
(define text "#cad3f5")
(define subtext1 "#b8c0e0")
(define subtext0 "#a5adcb")
(define overlay2 "#939ab7")
(define overlay1 "#8087a2")
(define overlay0 "#6e738d")
(define surface2 "#5b6078")
(define surface1 "#494d64")
(define surface0 "#363a4f")
(define base "#24273a")
(define mantle "#1e2030")
(define crust "#181926")
(sway-client-background base)
(sway-client-focused-color mauve base text
#:indictor-color rosewater
#:child-border-color mauve)
(sway-client-focused-inactive-color overlay0 base text
#:indictor-color rosewater
#:child-border-color overlay0)
(sway-client-unfocused-color overlay0 base text
#:indictor-color rosewater
#:child-border-color overlay0)
(sway-client-urgent-color peach base peach
#:indictor-color overlay0
#:child-border-color peach)
(sway-client-placeholder-color overlay0 base text
#:indictor-color overlay0
#:child-border-color overlay0)

8
config
View file

@ -1,2 +1,8 @@
include /etc/sway/config.d/*
exec_always "~/.config/sway/init.scm"
# good idea to kill all current guile swayipc instances first
exec_always "pkill -f '.*guile.*sway/init.scm'"
# then run a fresh instance
exec_always "sleep 0.2 && ~/.config/sway/init.scm"

View file

@ -1012,7 +1012,7 @@ If the units are omitted, floating containers are resized in px and tiled contai
- indictor-color: color code to be used for indicator (str)
- child-border-color: color code to be used for child border (str)"
(dispatch-command
(string-append "client.focused " border-color background-color text-color
(string-append "client.focused " border-color " " background-color " " text-color
(if indictor-color (string-append " " indictor-color) "")
(if child-border-color (string-append " " child-border-color) ""))))
@ -1027,7 +1027,7 @@ If the units are omitted, floating containers are resized in px and tiled contai
- indictor-color: color code to be used for indicator (str)
- child-border-color: color code to be used for child border (str)"
(dispatch-command
(string-append "client.focused_inactive " border-color background-color text-color
(string-append "client.focused_inactive " border-color " " background-color " " text-color
(if indictor-color (string-append " " indictor-color) "")
(if child-border-color (string-append " " child-border-color) ""))))
@ -1041,7 +1041,7 @@ If the units are omitted, floating containers are resized in px and tiled contai
- indictor-color: color code to be used for indicator (str)
- child-border-color: color code to be used for child border (str)"
(dispatch-command
(string-append "client.focused_tab_title " border-color background-color text-color)))
(string-append "client.focused_tab_title " border-color " " background-color " " text-color)))
(define* (sway-client-placeholder-color border-color background-color text-color
#:key indictor-color child-border-color)
@ -1053,7 +1053,7 @@ If the units are omitted, floating containers are resized in px and tiled contai
- indictor-color: color code to be used for indicator (str)
- child-border-color: color code to be used for child border (str)"
(dispatch-command
(string-append "client.placeholder " border-color background-color text-color
(string-append "client.placeholder " border-color " " background-color " " text-color
(if indictor-color (string-append " " indictor-color) "")
(if child-border-color (string-append " " child-border-color) ""))))
@ -1068,7 +1068,7 @@ If the units are omitted, floating containers are resized in px and tiled contai
- indictor-color: color code to be used for indicator (str)
- child-border-color: color code to be used for child border (str)"
(dispatch-command
(string-append "client.unfocused " border-color background-color text-color
(string-append "client.unfocused " border-color " " background-color " " text-color
(if indictor-color (string-append " " indictor-color) "")
(if child-border-color (string-append " " child-border-color) ""))))
@ -1083,7 +1083,7 @@ If the units are omitted, floating containers are resized in px and tiled contai
- indictor-color: color code to be used for indicator (str)
- child-border-color: color code to be used for child border (str)"
(dispatch-command
(string-append "client.urgent " border-color background-color text-color
(string-append "client.urgent " border-color " " background-color " " text-color
(if indictor-color (string-append " " indictor-color) "")
(if child-border-color (string-append " " child-border-color) ""))))