Skip to content

Commit

Permalink
feat: customize notification sounds (#127)
Browse files Browse the repository at this point in the history
* refactor: split frontend code

* feat: add custom sound buttons

* feat: choose file

* feat: add Tauri select dialog

* chore: use same port for dialog

* chore: save custom audio path

* fix: don't block when playing sound

* chore: update dependencies

* chore: update elm deps

* fix: styling

* fix: update pomodoro state with config

* feat: add custom sounds

* fix: don't reset state at every update

* feat: save all audio files

* refactor: sound choice view
  • Loading branch information
vjousse authored Nov 6, 2024
1 parent 98fe901 commit 85f6545
Show file tree
Hide file tree
Showing 25 changed files with 1,883 additions and 1,130 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
- [x] Fully compatible with **HiDPI/4K screens**
- [x] Linux: **Wayland** and **X11** support
- [x] Small: size < 4Mb (no electron, no node)
- [x] Custom sounds
- [ ] Mini mode
- [ ] Terminal User Interface
- [ ] Mobile version
Expand Down
45 changes: 22 additions & 23 deletions elm.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
{
"type": "application",
"source-directories": [
"src-elm"
],
"elm-version": "0.19.1",
"dependencies": {
"direct": {
"NoRedInk/elm-json-decode-pipeline": "1.0.1",
"elm/browser": "1.0.2",
"elm/core": "1.0.3",
"elm/html": "1.0.0",
"elm/json": "1.1.3",
"elm/svg": "1.0.1",
"rtfeldman/elm-hex": "1.0.0"
},
"indirect": {
"elm/time": "1.0.0",
"elm/url": "1.0.0",
"elm/virtual-dom": "1.0.3"
}
"type": "application",
"source-directories": ["src-elm"],
"elm-version": "0.19.1",
"dependencies": {
"direct": {
"NoRedInk/elm-json-decode-pipeline": "1.0.1",
"elm/browser": "1.0.2",
"elm/core": "1.0.3",
"elm/html": "1.0.0",
"elm/json": "1.1.3",
"elm/svg": "1.0.1",
"rtfeldman/elm-hex": "1.0.0"
},
"test-dependencies": {
"direct": {},
"indirect": {}
"indirect": {
"elm/bytes": "1.0.8",
"elm/time": "1.0.0",
"elm/url": "1.0.0",
"elm/virtual-dom": "1.0.3"
}
},
"test-dependencies": {
"direct": {},
"indirect": {}
}
}
169 changes: 169 additions & 0 deletions flatpak/cargo-sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,19 @@
"dest": "cargo/vendor/arrayvec-0.7.6",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/ashpd/ashpd-0.9.2.crate",
"sha256": "4d43c03d9e36dd40cab48435be0b09646da362c278223ca535493877b2c1dee9",
"dest": "cargo/vendor/ashpd-0.9.2"
},
{
"type": "inline",
"contents": "{\"package\": \"4d43c03d9e36dd40cab48435be0b09646da362c278223ca535493877b2c1dee9\", \"files\": {}}",
"dest": "cargo/vendor/ashpd-0.9.2",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
Expand Down Expand Up @@ -1611,6 +1624,19 @@
"dest": "cargo/vendor/dispatch-0.2.0",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/dlib/dlib-0.5.2.crate",
"sha256": "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412",
"dest": "cargo/vendor/dlib-0.5.2"
},
{
"type": "inline",
"contents": "{\"package\": \"330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412\", \"files\": {}}",
"dest": "cargo/vendor/dlib-0.5.2",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
Expand All @@ -1637,6 +1663,19 @@
"dest": "cargo/vendor/dlopen2_derive-0.4.0",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/downcast-rs/downcast-rs-1.2.1.crate",
"sha256": "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2",
"dest": "cargo/vendor/downcast-rs-1.2.1"
},
{
"type": "inline",
"contents": "{\"package\": \"75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2\", \"files\": {}}",
"dest": "cargo/vendor/downcast-rs-1.2.1",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
Expand Down Expand Up @@ -4757,6 +4796,19 @@
"dest": "cargo/vendor/quick-xml-0.32.0",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/quick-xml/quick-xml-0.36.2.crate",
"sha256": "f7649a7b4df05aed9ea7ec6f628c67c9953a43869b8bc50929569b2999d443fe",
"dest": "cargo/vendor/quick-xml-0.36.2"
},
{
"type": "inline",
"contents": "{\"package\": \"f7649a7b4df05aed9ea7ec6f628c67c9953a43869b8bc50929569b2999d443fe\", \"files\": {}}",
"dest": "cargo/vendor/quick-xml-0.36.2",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
Expand Down Expand Up @@ -5043,6 +5095,19 @@
"dest": "cargo/vendor/reqwest-0.12.8",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/rfd/rfd-0.15.0.crate",
"sha256": "8af382a047821a08aa6bfc09ab0d80ff48d45d8726f7cd8e44891f7cb4a4278e",
"dest": "cargo/vendor/rfd-0.15.0"
},
{
"type": "inline",
"contents": "{\"package\": \"8af382a047821a08aa6bfc09ab0d80ff48d45d8726f7cd8e44891f7cb4a4278e\", \"files\": {}}",
"dest": "cargo/vendor/rfd-0.15.0",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
Expand Down Expand Up @@ -5251,6 +5316,19 @@
"dest": "cargo/vendor/schemars_derive-0.8.21",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/scoped-tls/scoped-tls-1.0.1.crate",
"sha256": "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294",
"dest": "cargo/vendor/scoped-tls-1.0.1"
},
{
"type": "inline",
"contents": "{\"package\": \"e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294\", \"files\": {}}",
"dest": "cargo/vendor/scoped-tls-1.0.1",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
Expand Down Expand Up @@ -6018,6 +6096,32 @@
"dest": "cargo/vendor/tauri-plugin-2.0.1",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/tauri-plugin-dialog/tauri-plugin-dialog-2.0.1.crate",
"sha256": "ddb2fe88b602461c118722c574e2775ab26a4e68886680583874b2f6520608b7",
"dest": "cargo/vendor/tauri-plugin-dialog-2.0.1"
},
{
"type": "inline",
"contents": "{\"package\": \"ddb2fe88b602461c118722c574e2775ab26a4e68886680583874b2f6520608b7\", \"files\": {}}",
"dest": "cargo/vendor/tauri-plugin-dialog-2.0.1",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/tauri-plugin-fs/tauri-plugin-fs-2.0.1.crate",
"sha256": "ab300488ebec3487ca5f56289692e7e45feb07eea8d5e1dba497f7dc9dd9c407",
"dest": "cargo/vendor/tauri-plugin-fs-2.0.1"
},
{
"type": "inline",
"contents": "{\"package\": \"ab300488ebec3487ca5f56289692e7e45feb07eea8d5e1dba497f7dc9dd9c407\", \"files\": {}}",
"dest": "cargo/vendor/tauri-plugin-fs-2.0.1",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
Expand Down Expand Up @@ -6954,6 +7058,71 @@
"dest": "cargo/vendor/wasm-streams-0.4.1",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/wayland-backend/wayland-backend-0.3.7.crate",
"sha256": "056535ced7a150d45159d3a8dc30f91a2e2d588ca0b23f70e56033622b8016f6",
"dest": "cargo/vendor/wayland-backend-0.3.7"
},
{
"type": "inline",
"contents": "{\"package\": \"056535ced7a150d45159d3a8dc30f91a2e2d588ca0b23f70e56033622b8016f6\", \"files\": {}}",
"dest": "cargo/vendor/wayland-backend-0.3.7",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/wayland-client/wayland-client-0.31.7.crate",
"sha256": "b66249d3fc69f76fd74c82cc319300faa554e9d865dab1f7cd66cc20db10b280",
"dest": "cargo/vendor/wayland-client-0.31.7"
},
{
"type": "inline",
"contents": "{\"package\": \"b66249d3fc69f76fd74c82cc319300faa554e9d865dab1f7cd66cc20db10b280\", \"files\": {}}",
"dest": "cargo/vendor/wayland-client-0.31.7",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/wayland-protocols/wayland-protocols-0.32.5.crate",
"sha256": "7cd0ade57c4e6e9a8952741325c30bf82f4246885dca8bf561898b86d0c1f58e",
"dest": "cargo/vendor/wayland-protocols-0.32.5"
},
{
"type": "inline",
"contents": "{\"package\": \"7cd0ade57c4e6e9a8952741325c30bf82f4246885dca8bf561898b86d0c1f58e\", \"files\": {}}",
"dest": "cargo/vendor/wayland-protocols-0.32.5",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/wayland-scanner/wayland-scanner-0.31.5.crate",
"sha256": "597f2001b2e5fc1121e3d5b9791d3e78f05ba6bfa4641053846248e3a13661c3",
"dest": "cargo/vendor/wayland-scanner-0.31.5"
},
{
"type": "inline",
"contents": "{\"package\": \"597f2001b2e5fc1121e3d5b9791d3e78f05ba6bfa4641053846248e3a13661c3\", \"files\": {}}",
"dest": "cargo/vendor/wayland-scanner-0.31.5",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/wayland-sys/wayland-sys-0.31.5.crate",
"sha256": "efa8ac0d8e8ed3e3b5c9fc92c7881406a268e11555abe36493efabe649a29e09",
"dest": "cargo/vendor/wayland-sys-0.31.5"
},
{
"type": "inline",
"contents": "{\"package\": \"efa8ac0d8e8ed3e3b5c9fc92c7881406a268e11555abe36493efabe649a29e09\", \"files\": {}}",
"dest": "cargo/vendor/wayland-sys-0.31.5",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
Expand Down
20 changes: 14 additions & 6 deletions flatpak/elm-sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,26 @@
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://github.com/elm/time/archive/1.0.0.tar.gz",
"dest": "elm-stuff/home/.elm/0.19.1/packages/elm/time/1.0.0/",
"url": "https://github.com/rtfeldman/elm-hex/archive/1.0.0.tar.gz",
"dest": "elm-stuff/home/.elm/0.19.1/packages/rtfeldman/elm-hex/1.0.0/",
"strip-components": 1,
"sha512": "4eaee428ad86847fb8d4206c438233e2c5023ec96621a1f7c23a5a47c23a3dd88d544b994fd48432370def28ced9a6871826c73c7ddd463e57d6a8cb0fb6a744"
"sha512": "96277859ace21ac6a7bd13266348c2a91abdd272bf5be63016796d3926e27b9d094b08889fc1c3eee08a036611694810fc10990a2f0742cbb781c5a34b641af6"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://github.com/rtfeldman/elm-hex/archive/1.0.0.tar.gz",
"dest": "elm-stuff/home/.elm/0.19.1/packages/rtfeldman/elm-hex/1.0.0/",
"url": "https://github.com/elm/bytes/archive/1.0.8.tar.gz",
"dest": "elm-stuff/home/.elm/0.19.1/packages/elm/bytes/1.0.8/",
"strip-components": 1,
"sha512": "96277859ace21ac6a7bd13266348c2a91abdd272bf5be63016796d3926e27b9d094b08889fc1c3eee08a036611694810fc10990a2f0742cbb781c5a34b641af6"
"sha512": "c652c4a91c315a37d0aeeb40d6c03dc68ea8cf65f1dd6dcb7b0e53b64703f3488a89787af0f3d19415226e67a97b4181fbf8ca8f3be48115b6648f63aae48beb"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://github.com/elm/time/archive/1.0.0.tar.gz",
"dest": "elm-stuff/home/.elm/0.19.1/packages/elm/time/1.0.0/",
"strip-components": 1,
"sha512": "4eaee428ad86847fb8d4206c438233e2c5023ec96621a1f7c23a5a47c23a3dd88d544b994fd48432370def28ced9a6871826c73c7ddd463e57d6a8cb0fb6a744"
},
{
"type": "archive",
Expand Down
33 changes: 23 additions & 10 deletions flatpak/node-sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -510,10 +510,10 @@
},
{
"type": "file",
"url": "https://registry.npmjs.org/@tauri-apps/api/-/api-2.0.0-rc.4.tgz",
"sha512": "50d888861286d3c8f8a28b2cda810455ec5f7e65a48246250b633719c5f754fb4db2a16054d2fc31cc3fe18eeb3bd33d4be7df00c9cb385e72a73caec9bf2dca",
"dest-filename": "88861286d3c8f8a28b2cda810455ec5f7e65a48246250b633719c5f754fb4db2a16054d2fc31cc3fe18eeb3bd33d4be7df00c9cb385e72a73caec9bf2dca",
"dest": "flatpak-node/npm-cache/_cacache/content-v2/sha512/50/d8"
"url": "https://registry.npmjs.org/@tauri-apps/api/-/api-2.0.3.tgz",
"sha512": "f38d2a93a9fcadb5c15cc039fda0204d8b20e4902e6ca3b49d7c39c1fec8cc69d4b982866c1e28141219b573885b2f84d243530c8dea86ae62aaca0c25fc29f2",
"dest-filename": "2a93a9fcadb5c15cc039fda0204d8b20e4902e6ca3b49d7c39c1fec8cc69d4b982866c1e28141219b573885b2f84d243530c8dea86ae62aaca0c25fc29f2",
"dest": "flatpak-node/npm-cache/_cacache/content-v2/sha512/f3/8d"
},
{
"type": "file",
Expand Down Expand Up @@ -592,6 +592,13 @@
"dest-filename": "fbbaa32edc2d97d6f9cffff754e530da13afcf2051f971b97616366254912b2ac8e19486d9305ceb5894d24814c02b8d99c6210087e75fc367ab4c14e3ad",
"dest": "flatpak-node/npm-cache/_cacache/content-v2/sha512/3e/a9"
},
{
"type": "file",
"url": "https://registry.npmjs.org/@tauri-apps/plugin-dialog/-/plugin-dialog-2.0.1.tgz",
"sha512": "7e752b36be847ef4ea765b3fb9fbac53b87a51b345ccb2af1e4ff34ee3a206ad35477753383ab072d665cda91d6df4a9ffba4dc132af80a4c0825fcd00ffd9d1",
"dest-filename": "2b36be847ef4ea765b3fb9fbac53b87a51b345ccb2af1e4ff34ee3a206ad35477753383ab072d665cda91d6df4a9ffba4dc132af80a4c0825fcd00ffd9d1",
"dest": "flatpak-node/npm-cache/_cacache/content-v2/sha512/7e/75"
},
{
"type": "file",
"url": "https://registry.npmjs.org/@tauri-apps/plugin-log/-/plugin-log-2.0.0-rc.1.tgz",
Expand Down Expand Up @@ -2136,6 +2143,12 @@
"dest-filename": "ed8b1c3259b5490cf1d267d292f77895573e71628ad34e51e699096d46e1",
"dest": "flatpak-node/npm-cache/_cacache/index-v5/92/af"
},
{
"type": "inline",
"contents": "2eac53f5b128023ecbee6a70e6e809e3d2e6f4c4\t{\"key\": \"make-fetch-happen:request-cache:https://registry.npmjs.org/@tauri-apps/plugin-dialog/-/plugin-dialog-2.0.1.tgz\", \"integrity\": \"sha512-fnUrNr6EfvTqdls/ufusU7h6UbNFzLKvHk/zTuOiBq01R3dTODqwctZlzakdbfSp/7pNwTKvgKTAgl/NAP/Z0Q==\", \"time\": 0, \"size\": 4338, \"metadata\": {\"url\": \"https://registry.npmjs.org/@tauri-apps/plugin-dialog/-/plugin-dialog-2.0.1.tgz\", \"reqHeaders\": {}, \"resHeaders\": {}}}",
"dest-filename": "a19ee0fde34bd5231550fb3fdc20663389a03bdfb2705e3948511dcb7015",
"dest": "flatpak-node/npm-cache/_cacache/index-v5/02/c6"
},
{
"type": "inline",
"contents": "2f51a4b48c10574999988ceb3ea8ffec3ccb1a61\t{\"key\": \"make-fetch-happen:request-cache:https://registry.npmjs.org/@tauri-apps/cli-darwin-x64/-/cli-darwin-x64-2.0.0-rc.13.tgz\", \"integrity\": \"sha512-xj9O2G2aC4XdQtNefJRlk3M+mLchHphefMpkmhxAeeHIFspt24Cr15WO4FnUF/BcSkpIt1Pxdy3XTISECzx3eA==\", \"time\": 0, \"size\": 7979311, \"metadata\": {\"url\": \"https://registry.npmjs.org/@tauri-apps/cli-darwin-x64/-/cli-darwin-x64-2.0.0-rc.13.tgz\", \"reqHeaders\": {}, \"resHeaders\": {}}}",
Expand Down Expand Up @@ -3398,15 +3411,15 @@
},
{
"type": "inline",
"contents": "eb55e357db5ffa3616b9f331bb2b01cd24a60d41\t{\"key\": \"make-fetch-happen:request-cache:https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz\", \"integrity\": \"sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==\", \"time\": 0, \"size\": 1676, \"metadata\": {\"url\": \"https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz\", \"reqHeaders\": {}, \"resHeaders\": {}}}",
"dest-filename": "532a4c7bf52c908d567ded2bb11b0f3282f0733d0d079a5291c2f72e0077",
"dest": "flatpak-node/npm-cache/_cacache/index-v5/1a/fd"
"contents": "e8d795fd5eddab66336534a201424d6476e812db\t{\"key\": \"make-fetch-happen:request-cache:https://registry.npmjs.org/@tauri-apps/api/-/api-2.0.3.tgz\", \"integrity\": \"sha512-840qk6n8rbXBXMA5/aAgTYsg5JAubKO0nXw5wf7IzGnUuYKGbB4oFBIZtXOIWy+E0kNTDI3qhq5iqsoMJfwp8g==\", \"time\": 0, \"size\": 111216, \"metadata\": {\"url\": \"https://registry.npmjs.org/@tauri-apps/api/-/api-2.0.3.tgz\", \"reqHeaders\": {}, \"resHeaders\": {}}}",
"dest-filename": "5c8c05c3308c9f612fd5ec7ba05b0da3c6e4761f64a4976a29d0acdc950e",
"dest": "flatpak-node/npm-cache/_cacache/index-v5/7e/4c"
},
{
"type": "inline",
"contents": "ebcd5343c1a15d71d7cde1283b8300255c3e20b8\t{\"key\": \"make-fetch-happen:request-cache:https://registry.npmjs.org/@tauri-apps/api/-/api-2.0.0-rc.4.tgz\", \"integrity\": \"sha512-UNiIhhKG08j4ooss2oEEVexffmWkgkYlC2M3GcX3VPtNsqFgVNL8Mcw/4Y7rO9M9S+ffAMnLOF5ypzyuyb8tyg==\", \"time\": 0, \"size\": 109147, \"metadata\": {\"url\": \"https://registry.npmjs.org/@tauri-apps/api/-/api-2.0.0-rc.4.tgz\", \"reqHeaders\": {}, \"resHeaders\": {}}}",
"dest-filename": "44707081547b87fda5405ede2dd1e8162829b679dd92866a625d469c6f50",
"dest": "flatpak-node/npm-cache/_cacache/index-v5/a5/b2"
"contents": "eb55e357db5ffa3616b9f331bb2b01cd24a60d41\t{\"key\": \"make-fetch-happen:request-cache:https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz\", \"integrity\": \"sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==\", \"time\": 0, \"size\": 1676, \"metadata\": {\"url\": \"https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz\", \"reqHeaders\": {}, \"resHeaders\": {}}}",
"dest-filename": "532a4c7bf52c908d567ded2bb11b0f3282f0733d0d079a5291c2f72e0077",
"dest": "flatpak-node/npm-cache/_cacache/index-v5/1a/fd"
},
{
"type": "inline",
Expand Down
Loading

0 comments on commit 85f6545

Please sign in to comment.