diff --git a/matugen/config.toml b/matugen/config.toml index aebffd9..af20502 100755 --- a/matugen/config.toml +++ b/matugen/config.toml @@ -69,3 +69,8 @@ post_hook = 'adwaita-steam-gtk -i || true' [templates.obsidian] input_path = '~/.config/matugen/templates/InioX/obsidian.css' output_path = '~/.config/matugen/templates-out/obsidian.css' + + +[templates.monocle] +input_path = '~/.config/matugen/templates/InioX/colors.css' +output_path = '~/.config/sdgos/monocle/colors.css' \ No newline at end of file diff --git a/sdgos/monocle/colors.css b/sdgos/monocle/colors.css new file mode 100644 index 0000000..b29fb9c --- /dev/null +++ b/sdgos/monocle/colors.css @@ -0,0 +1,105 @@ +/* +* Css Colors +* Generated with Matugen +*/ + + @define-color background #0d141c; + + @define-color error #ffb4ab; + + @define-color error_container #93000a; + + @define-color inverse_on_surface #2a3139; + + @define-color inverse_primary #0062a0; + + @define-color inverse_surface #dde3ee; + + @define-color on_background #dde3ee; + + @define-color on_error #690005; + + @define-color on_error_container #ffdad6; + + @define-color on_primary #003256; + + @define-color on_primary_container #d0e4ff; + + @define-color on_primary_fixed #001d35; + + @define-color on_primary_fixed_variant #00497a; + + @define-color on_secondary #22304c; + + @define-color on_secondary_container #d8e2ff; + + @define-color on_secondary_fixed #0c1b36; + + @define-color on_secondary_fixed_variant #394664; + + @define-color on_surface #dde3ee; + + @define-color on_surface_variant #c0c7d2; + + @define-color on_tertiary #282c5a; + + @define-color on_tertiary_container #e0e0ff; + + @define-color on_tertiary_fixed #121644; + + @define-color on_tertiary_fixed_variant #3e4372; + + @define-color outline #8b919b; + + @define-color outline_variant #414750; + + @define-color primary #9bcaff; + + @define-color primary_container #00497a; + + @define-color primary_fixed #d0e4ff; + + @define-color primary_fixed_dim #9bcaff; + + @define-color scrim #000000; + + @define-color secondary #b8c6ea; + + @define-color secondary_container #394664; + + @define-color secondary_fixed #d8e2ff; + + @define-color secondary_fixed_dim #b8c6ea; + + @define-color shadow #000000; + + @define-color source_color #6c8cb0; + + @define-color surface #0d141c; + + @define-color surface_bright #333a42; + + @define-color surface_container #192028; + + @define-color surface_container_high #242b33; + + @define-color surface_container_highest #2f353e; + + @define-color surface_container_low #151c24; + + @define-color surface_container_lowest #080f16; + + @define-color surface_dim #0d141c; + + @define-color surface_tint #9bcaff; + + @define-color surface_variant #414750; + + @define-color tertiary #bfc2fa; + + @define-color tertiary_container #3e4372; + + @define-color tertiary_fixed #e0e0ff; + + @define-color tertiary_fixed_dim #bfc2fa; + diff --git a/sdgos/monocle/config b/sdgos/monocle/config index 60fff3f..d22de78 100644 --- a/sdgos/monocle/config +++ b/sdgos/monocle/config @@ -2,11 +2,12 @@ "layer": "top", "position": "bottom", "fixed-center": "true", - "margin-top": -8, - "margin-bottom": 0, - "margin-left": 5, - "margin-right": 5, - "spacing": 0, + "output": "HDMI-A-1", + "margin-top": 0, + "margin-bottom": -2, + "margin-left": 0, + "margin-right": 0, + "spacing": 3, // Load Modules "include": [ diff --git a/sdgos/monocle/fetchwindow.sh b/sdgos/monocle/fetchwindow.sh index 2f8a187..19e421b 100755 --- a/sdgos/monocle/fetchwindow.sh +++ b/sdgos/monocle/fetchwindow.sh @@ -3,6 +3,13 @@ INDEX="$1" +while [ -e ~/.config/monocle.lock ]; do + sleep 0.01 +done + WINDOWTITLE=$(cat ~/.config/monocle.state | grep -e "index:$INDEX" | cut -d'\' -f2) + + + echo "$WINDOWTITLE" diff --git a/sdgos/monocle/focuswindow.sh b/sdgos/monocle/focuswindow.sh index 48cf755..92d4c5a 100755 --- a/sdgos/monocle/focuswindow.sh +++ b/sdgos/monocle/focuswindow.sh @@ -2,6 +2,10 @@ INDEX="$1" +while [ -e ~/.config/monocle.lock ]; do + sleep 0.01 + echo "sleeping" +done ACTIVEMON=$(mmsg get all-monitors | jq '.monitors[] | select(.active == true) | .name' -r) echo "activemon is $ACTIVEMON" @@ -10,6 +14,8 @@ echo "activetag is $ACTIVETAG" WINDOWID=$(cat ~/.config/monocle.state | grep -e "index:$INDEX" | cut -d'\' -f3) WINDOWtitle=$(cat ~/.config/monocle.state | grep -e "index:$INDEX" | cut -d'\' -f2) + + echo "moving window $WINDOWID" mmsg dispatch zoom client,$WINDOWID diff --git a/sdgos/monocle/indexer.sh b/sdgos/monocle/indexer.sh index 8326201..dcba162 100755 --- a/sdgos/monocle/indexer.sh +++ b/sdgos/monocle/indexer.sh @@ -4,18 +4,23 @@ MONITOR=HDMI-A-1 # get all clients on that monitor: mmsg get all-clients | jq '.clients[] | select( .monitor == "HDMI-A-1") | .id' -r +MONOCLEMON=$(mmsg get all-monitors | jq -r '.monitors[] | select(.tags[] | select(.is_active == true) | .layout | test("M|K|VK")) | .name') + ACTIVEMON=$(mmsg get all-monitors | jq '.monitors[] | select(.active == true) | .name' -r) #echo "activemon is $ACTIVEMON" ACTIVETAG=$(mmsg get tags $MONITOR | jq '.tags[] | select(.is_active == true) | .index' -r) #echo "activetag is $ACTIVETAG" -ACTIVEWINDOWS=$(mmsg get all-clients | jq -r --arg ACTIVETAG "$ACTIVETAG" --arg ACTIVEMON "$MONITOR" '.clients[] | select(.tags[] == ($ACTIVETAG | tonumber) and .monitor == $ACTIVEMON) | .id') +ACTIVEWINDOWS=$(mmsg get all-clients | jq -r --arg ACTIVETAG "$ACTIVETAG" --arg ACTIVEMON "$MONOCLEMON" '.clients[] | select(.tags[] == ($ACTIVETAG | tonumber) and .monitor == $ACTIVEMON) | .id' | sort) #echo "active windows are:" #echo "----------------------------------------" #echo "$ACTIVEWINDOWS" #echo "----------------------------------------" +echo "lock" > ~/.config/monocle.lock +sleep 0.05 INDEX=0 echo "" > ~/.config/monocle.state + while read LINE; do ID=$LINE TITLE=$(mmsg get all-clients | jq -r --arg ID "$LINE" '.clients[] | select(.id == ($ID | tonumber)) | .title' ) @@ -24,4 +29,7 @@ while read LINE; do done <<< "$ACTIVEWINDOWS" +sleep 0.05 +rm ~/.config/monocle.lock + echo "(running)" \ No newline at end of file diff --git a/sdgos/monocle/modules.json b/sdgos/monocle/modules.json index 869674f..ce2b496 100644 --- a/sdgos/monocle/modules.json +++ b/sdgos/monocle/modules.json @@ -9,7 +9,8 @@ "tooltip-format": "daemon is running, click to refresh", "on-click": "~/.config/sdgos/monocle/indexer.sh", "exec": "~/.config/sdgos/monocle/indexer.sh", - "interval": 5 + "max-length": 20, + "interval": 1 }, @@ -19,7 +20,8 @@ "tooltip-format": "window 1: {text}", "on-click": "~/.config/sdgos/monocle/focuswindow.sh 1", "exec": "~/.config/sdgos/monocle/fetchwindow.sh 1", - "interval": 2.1 + "max-length": 20, + "interval": 1.5 }, "custom/window2": { @@ -28,7 +30,8 @@ "tooltip-format": "window 2: {text}", "on-click": "~/.config/sdgos/monocle/focuswindow.sh 2", "exec": "~/.config/sdgos/monocle/fetchwindow.sh 2", - "interval": 2.1 + "max-length": 20, + "interval": 1.5 }, @@ -38,7 +41,8 @@ "tooltip-format": "window 3: {text}", "on-click": "~/.config/sdgos/monocle/focuswindow.sh 3", "exec": "~/.config/sdgos/monocle/fetchwindow.sh 3", - "interval": 2.1 + "max-length": 20, + "interval": 1.5 }, @@ -48,7 +52,8 @@ "tooltip-format": "window 4: {text}", "on-click": "~/.config/sdgos/monocle/focuswindow.sh 4", "exec": "~/.config/sdgos/monocle/fetchwindow.sh 4", - "interval": 2.1 + "max-length": 20, + "interval": 1.5 }, @@ -58,7 +63,8 @@ "tooltip-format": "window 5: {text}", "on-click": "~/.config/sdgos/monocle/focuswindow.sh 5", "exec": "~/.config/sdgos/monocle/fetchwindow.sh 5", - "interval": 1 + "max-length": 20, + "interval": 1.5 }, @@ -68,7 +74,8 @@ "tooltip-format": "window 6: {text}", "on-click": "~/.config/sdgos/monocle/focuswindow.sh 6", "exec": "~/.config/sdgos/monocle/fetchwindow.sh 6", - "interval": 1 + "max-length": 20, + "interval": 1.5 }, @@ -78,7 +85,8 @@ "tooltip-format": "window 7: {text}", "on-click": "~/.config/sdgos/monocle/focuswindow.sh 7", "exec": "~/.config/sdgos/monocle/fetchwindow.sh 7", - "interval": 1 + "max-length": 20, + "interval": 1.5 }, @@ -88,7 +96,8 @@ "tooltip-format": "window 8: {text}", "on-click": "~/.config/sdgos/monocle/focuswindow.sh 8", "exec": "~/.config/sdgos/monocle/fetchwindow.sh 8", - "interval": 1 + "max-length": 20, + "interval": 1.5 }, @@ -98,7 +107,8 @@ "tooltip-format": "window 9: {text}", "on-click": "~/.config/sdgos/monocle/focuswindow.sh 9", "exec": "~/.config/sdgos/monocle/fetchwindow.sh 9", - "interval": 1 + "max-length": 20, + "interval": 1.5 }, @@ -108,7 +118,8 @@ "tooltip-format": "window 10: {text}", "on-click": "~/.config/sdgos/monocle/focuswindow.sh 10", "exec": "~/.config/sdgos/monocle/fetchwindow.sh 10", - "interval": 1 + "max-length": 20, + "interval": 1.5 }, diff --git a/sdgos/monocle/style.css b/sdgos/monocle/style.css index 0c9eef0..18789a3 100644 --- a/sdgos/monocle/style.css +++ b/sdgos/monocle/style.css @@ -1,3 +1,5 @@ +@import "./colors.css"; + * { font-family: "JetBrainsMono Nerd Font"; font-weight: bold; @@ -6,8 +8,10 @@ font-size: 97%; font-feature-settings: '"zero", "ss01", "ss02", "ss03", "ss04", "ss05", "cv31"'; border: 0px; - padding: 2px; - background-color: black; + padding-top: 4px; + padding-bottom: 2px; + padding-left: 4px; + background-color: @surface; animation: gradient_f 20s ease-in infinite; transition: all 0.3s cubic-bezier(.55,-0.68,.48,1.682); } @@ -32,9 +36,9 @@ #custom-button-zoomin, #custom-button-zoomout, #custom-button-fit { - background-color: #333333; - color: white; - border: 1px; + background-color: @surface_container; + color: @primary; + border: 0px; border-style: solid; border-color: white; border-radius: 10px;