|
7 | 7 | CARGO_TERM_COLOR: always |
8 | 8 |
|
9 | 9 | jobs: |
10 | | - linux: |
11 | | - runs-on: ubuntu-latest |
12 | | - steps: |
13 | | - - uses: actions/checkout@v4 |
14 | | - - name: Build |
15 | | - run: cargo build --verbose |
16 | | - - name: Install Gnome and friends |
17 | | - run: | |
18 | | - sudo apt update |
19 | | - sudo apt install ubuntu-desktop -y |
20 | | - - name: Prepare Scripts |
21 | | - run: | |
22 | | - mkdir -p $HOME/.config/dark-mode-daemon/scripts/ |
23 | | - cat <<EOF > $HOME/.config/dark-mode-daemon/scripts/executable.sh |
24 | | - #!/usr/bin/env bash |
25 | | - echo "scripts ran" >> $HOME/protocol.txt |
26 | | - EOF |
27 | | - chmod +x $HOME/.config/dark-mode-daemon/scripts/executable.sh |
28 | | - - name: Run Daemon |
29 | | - run: cargo run --verbose -- daemon & |
30 | | - - name: Switch Mode |
31 | | - run: gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark' |
32 | | - - name: Assert Scripts Did Ran |
33 | | - run: | |
34 | | - sleep 5 |
35 | | - # Once when starting the scripts |
36 | | - echo "scripts ran" >> $HOME/expected.txt |
37 | | - # Once for when we toggled the mode |
38 | | - echo "scripts ran" >> $HOME/expected.txt |
39 | | - diff $HOME/expected.txt $HOME/protocol.txt |
40 | | -
|
41 | 10 | macos: |
42 | 11 | runs-on: macos-latest |
43 | 12 | steps: |
|
64 | 33 | # Once for when we toggled the mode |
65 | 34 | echo "scripts ran" >> $HOME/expected.txt |
66 | 35 | diff $HOME/expected.txt $HOME/protocol.txt |
67 | | -
|
68 | | - windows: |
69 | | - runs-on: windows-latest |
70 | | - steps: |
71 | | - - uses: actions/checkout@v4 |
72 | | - - name: Build |
73 | | - run: cargo build --verbose |
74 | | - - name: Prepare Scripts |
75 | | - run: | |
76 | | - New-Item -Path "$env:USERPROFILE/.config/dark-mode-daemon/scripts/" -ItemType Directory |
77 | | - 'Add-Content -Path $env:USERPROFILE/protocol.txt -Value "scripts ran"' | Out-File -FilePath "$env:USERPROFILE/.config/dark-mode-daemon/scripts/executable.ps1" |
78 | | - - name: Run Daemon |
79 | | - run: cargo run --verbose -- daemon & |
80 | | - - name: Switch Mode |
81 | | - run: New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name SystemUsesLightTheme -Value 0 -Type Dword -Force; New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name AppsUseLightTheme -Value 0 -Type Dword -Force |
82 | | - - name: Assert Scripts Did Ran |
83 | | - run: | |
84 | | - Start-Sleep -Seconds 5 |
85 | | - # Once when starting the scripts |
86 | | - Add-Content -Path "$env:USERPROFILE/expected.txt" -Value "scripts ran" |
87 | | - # Once for when we toggled the mode |
88 | | - Add-Content -Path "$env:USERPROFILE/expected.txt" -Value "scripts ran" |
89 | | - Compare-Object expected.txt protocol.txt |
0 commit comments