diff --git a/.install/hyprland-dotfiles.sh b/.install/hyprland-dotfiles.sh index 4ff1cc8..3c4e761 100644 --- a/.install/hyprland-dotfiles.sh +++ b/.install/hyprland-dotfiles.sh @@ -37,5 +37,8 @@ fi if [ -d ~/dotfiles-versions/$version/swappy ]; then _installSymLink swappy ~/.config/swappy ~/dotfiles/swappy/ ~/.config fi +if [ -d ~/dotfiles-versions/$version/swappy ]; then + _installSymLink eww ~/.config/eww ~/dotfiles/eww/ ~/.config +fi echo ":: Symbolic links created." echo diff --git a/.install/restore.sh b/.install/restore.sh index 5149141..178e000 100755 --- a/.install/restore.sh +++ b/.install/restore.sh @@ -8,7 +8,7 @@ monitorrestored=0 _showRestoreOptions() { echo "The following configurations can be transferred into the new installation." - echo "(SPACE = select/unselect a profile. RETURN = confirm. ESC/No selection = Skip Restore)" + echo "(SPACE = select/unselect a profile. RETURN = confirm. CTRL-C/No selection = Skip Restore)" echo "" restorelist="" if [ -f ~/dotfiles/.bashrc ]; then diff --git a/.install/settings.sh b/.install/settings.sh index 3daf5ea..491a0cb 100644 --- a/.install/settings.sh +++ b/.install/settings.sh @@ -1,8 +1,10 @@ if [ "$restored" == "1" ]; then - echo -e "${GREEN}" - figlet "Restore Settings" - echo -e "${NONE}" - python .install/restore.py + if [ -f ~/dotfiles/.settings/settings.json ] ;then + echo -e "${GREEN}" + figlet "Restore Settings" + echo -e "${NONE}" + python .install/restore.py + fi else if [ -f ~/dotfiles/.settings/settings.json ] ;then rm ~/dotfiles/.settings/settings.json diff --git a/.settings/eww-monitor.sh b/.settings/eww-monitor.sh index eea852b..4d18c3e 100755 --- a/.settings/eww-monitor.sh +++ b/.settings/eww-monitor.sh @@ -1,4 +1 @@ -#!/bin/bash -# screen=0 -screen=$(hyprctl activewindow -j | jq '.monitor') -echo $screen \ No newline at end of file +auto \ No newline at end of file diff --git a/.version/name b/.version/name index 941430c..aea0839 100644 --- a/.version/name +++ b/.version/name @@ -1 +1 @@ -2.9RC2 \ No newline at end of file +2.9RC3 \ No newline at end of file diff --git a/README.md b/README.md index 3d8e34d..ab496db 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# ML4W Dotfiles 2.9 RC2 +# ML4W Dotfiles 2.9 An advanced configuration of Hyprland and Qtile for Arch Linux based distributions. This package includes an installation script to install and setup the required components. diff --git a/eww/eww.yuck b/eww/eww.yuck new file mode 100644 index 0000000..e69de29 diff --git a/eww/ml4w-sidebar/launch.sh b/eww/ml4w-sidebar/launch.sh index f7b8ca0..d144e52 100755 --- a/eww/ml4w-sidebar/launch.sh +++ b/eww/ml4w-sidebar/launch.sh @@ -8,7 +8,13 @@ if [[ ! `pidof eww` ]]; then sleep 0.5 fi -sc=$($HOME/dotfiles/.settings/eww-monitor.sh) +if [ -f $HOME/dotfiles/.settings/eww-monitor.sh ] && [ $(cat $HOME/dotfiles/.settings/eww-monitor.sh) != "auto" ] ;then + echo ":: Using monitor id from $HOME/dotfiles/.settings/eww-monitor.sh" + sc=$(cat $HOME/dotfiles/.settings/eww-monitor.sh) +else + echo ":: Autodetect current focused monitor." + sc=$(python $HOME/dotfiles/hypr/scripts/active-monitor.py) +fi if [[ ! -f "$FILE" ]]; then touch "$FILE" echo ":: Opening on Monitor $sc" diff --git a/hypr/scripts/active-monitor.py b/hypr/scripts/active-monitor.py new file mode 100644 index 0000000..9aad2ae --- /dev/null +++ b/hypr/scripts/active-monitor.py @@ -0,0 +1,18 @@ +import sys +import subprocess +import os +import json +import pathlib +import shutil + +# Get script path +pathname = os.path.dirname(sys.argv[0]) +homeFolder = os.path.expanduser('~') # Path to home folder +dotfiles = homeFolder + "/dotfiles/" + +result = subprocess.run(["bash", dotfiles + "hypr/scripts/monitors.sh"], capture_output=True, text=True) +monitors_json = result.stdout.strip() +monitors_arr = json.loads(monitors_json) +for row in monitors_arr: + if row["focused"]: + print(row["id"]) diff --git a/hypr/scripts/eww.sh b/hypr/scripts/eww.sh index 4524508..ef4c3af 100755 --- a/hypr/scripts/eww.sh +++ b/hypr/scripts/eww.sh @@ -1,4 +1,6 @@ #!/bin/bash EWW=`which eww` -killall eww -${EWW} daemon \ No newline at end of file +if [[ ! `pidof eww` ]]; then + ${EWW} daemon + sleep 0.5 +fi diff --git a/hypr/scripts/monitors.sh b/hypr/scripts/monitors.sh new file mode 100755 index 0000000..14ea2ea --- /dev/null +++ b/hypr/scripts/monitors.sh @@ -0,0 +1,2 @@ +#!/bin/bash +hyprctl -j monitors \ No newline at end of file diff --git a/waybar/modules.json b/waybar/modules.json index 0a2523d..0695d26 100644 --- a/waybar/modules.json +++ b/waybar/modules.json @@ -58,8 +58,8 @@ // ML4W Welcome App "custom/ml4w-welcome": { - "on-click": "sleep 0.5 && ~/dotfiles/eww/ml4w-sidebar/launch.sh", - "on-click-right": "sleep 0.5 && ~/dotfiles/apps/ML4W_Welcome-x86_64.AppImage", + "on-click": "sleep 0.3 && ~/dotfiles/eww/ml4w-sidebar/launch.sh", + "on-click-right": "sleep 0.3 && ~/dotfiles/apps/ML4W_Welcome-x86_64.AppImage", "format": " ", "tooltip": false },