Skip to content

Commit 93216ec

Browse files
committed
Improve README and publish script. Remove redundent flake stuff.
1 parent 32991a9 commit 93216ec

4 files changed

Lines changed: 12 additions & 88 deletions

File tree

‎.github/workflows/publish.yml‎

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -168,26 +168,12 @@ jobs:
168168
echo "version=$VERSION" >> $GITHUB_OUTPUT
169169
echo "Version detected: $VERSION"
170170
171-
- name: Wait for crates.io availability
172-
run: |
173-
echo "Waiting for package to be available on crates.io..."
174-
echo "Initial wait of ${{ vars.CRATES_IO_INITIAL_WAIT || '180' }} seconds..."
175-
sleep ${{ vars.CRATES_IO_INITIAL_WAIT || '180' }}
176-
for i in {1..30}; do
177-
if curl -s "https://crates.io/api/v1/crates/hyprsession/${{ steps.version.outputs.version }}" | grep -q "\"num\":\"${{ steps.version.outputs.version }}\""; then
178-
echo "Package found on crates.io"
179-
break
180-
fi
181-
echo "Attempt $i: Package not yet available, waiting ${{ vars.CRATES_IO_RETRY_WAIT || '60' }} seconds..."
182-
sleep ${{ vars.CRATES_IO_RETRY_WAIT || '60' }}
183-
done
184-
185-
- name: Get SHA256 checksum from crates.io
171+
- name: Get SHA256 checksum from repository
186172
id: checksum
187173
run: |
188-
# Download the crate to get the real checksum
189-
wget -q "https://crates.io/api/v1/crates/hyprsession/${{ steps.version.outputs.version }}/download" -O hyprsession-${{ steps.version.outputs.version }}.crate
190-
SHA256=$(sha256sum hyprsession-${{ steps.version.outputs.version }}.crate | cut -d' ' -f1)
174+
# Create a temporary tarball from the repository
175+
git archive --format=tar.gz --prefix=hyprsession-${{ steps.version.outputs.version }}/ HEAD > hyprsession-${{ steps.version.outputs.version }}.tar.gz
176+
SHA256=$(sha256sum hyprsession-${{ steps.version.outputs.version }}.tar.gz | cut -d' ' -f1)
191177
echo "checksum=$SHA256" >> $GITHUB_OUTPUT
192178
echo "SHA256: $SHA256"
193179
@@ -206,15 +192,9 @@ jobs:
206192
license=('GPL-3.0-or-later')
207193
depends=()
208194
makedepends=('rust' 'cargo')
209-
source=("$pkgname-$pkgver.tar.gz::https://crates.io/api/v1/crates/$pkgname/$pkgver/download")
195+
source=("$pkgname-$pkgver.tar.gz::https://github.com/joshurtree/hyprsession/archive/refs/tags/v$pkgver.tar.gz")
210196
sha256sums=('${{ steps.checksum.outputs.checksum }}')
211197
212-
prepare() {
213-
cd "$pkgname-$pkgver"
214-
# Update the lockfile
215-
cargo update
216-
}
217-
218198
build() {
219199
cd "$pkgname-$pkgver"
220200
export RUSTUP_TOOLCHAIN=stable

‎Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "hyprsession"
3-
version = "0.2.0"
3+
version = "0.2.0-1"
44
edition = "2021"
55
authors = [ "Josh Andrews" ]
66
license = "GPL-3.0"

‎README.md‎

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,7 @@ exec-once = hyprsession
3535
The same line can be added to your `home.nix` hyprland configuration if your are using Nix Home Manager.
3636
If you want to save a session that is already running then run
3737
```
38-
hyprsession save-only &
39-
```
40-
or
41-
```
42-
hyprsession save-and-exit
38+
hyprsession save <session-name>
4339
```
4440

4541
## Options
@@ -80,17 +76,17 @@ Sets the mode the program runs in
8076
* LoadAndExit - Load the saved session then immediatly exit
8177
* SaveAndExit - Save the current session then exit
8278

83-
## Command detection and fake commands
79+
## Command detection and bridge commands
8480
Detecting what command is needed to create any given window in wayland does not have a single uniform solution.
8581
The information within the `/proc` directory is used to try and find this. If this doesn't yield a command available
8682
via $PATH then the `initial_class` of the window is checked followed by `initial_title`.
8783

8884
With applications that come in the form of Flatpaks, Snaps or Electron apps this method does not produce a proper result.
89-
To solve this requires the use of fake commands. An example would be if you use the Firefox flatpak then runing
85+
To solve this requires the use of brige commands. By running `hyprctl clients` you can find the `initial_class` of the window. You can then create a bridging command to run the correct command on startup. For example if you use the Firefox flatpak then runing
9086
```
9187
hyprsession command firefox "flatpak run org.mozilla.firefox"
9288
```
93-
This creates a script in the `~/.local/bin` directory that runs the correct command.
89+
creates a script in the `~/.local/bin` directory that runs the correct command.
9490

9591
## Change log
9692
### 0.1.1
@@ -113,7 +109,7 @@ This creates a script in the `~/.local/bin` directory that runs the correct comm
113109
* Introduce named sessions
114110
* Improve method of finding originating command for clients
115111
* Track client creation to try and better place them
116-
* Introduce 'fake command' functionality to deal with programs complicated launch patterns (flatpak, snap etc.)
112+
* Introduce bridge command functionality to deal with programs complicated launch patterns (flatpak, snap etc.)
117113
* Refactor code to allow potential future use as either standalone or as a client
118114

119115
## Development

‎flake.nix‎

Lines changed: 1 addition & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -20,36 +20,6 @@
2020
cargoLock.lockFile = ./Cargo.lock;
2121
src = pkgs.lib.cleanSource ./.;
2222
};
23-
24-
# C++ version
25-
hyprsession-cpp = pkgs.stdenv.mkDerivation {
26-
pname = "${manifest.name}-cpp";
27-
version = manifest.version;
28-
src = pkgs.lib.cleanSource ./.;
29-
30-
nativeBuildInputs = with pkgs; [
31-
cmake
32-
pkg-config
33-
];
34-
35-
buildInputs = with pkgs; [
36-
nlohmann_json
37-
wayland
38-
hyprland
39-
];
40-
41-
buildPhase = ''
42-
mkdir -p build
43-
cd build
44-
cmake .. -DCMAKE_BUILD_TYPE=Release
45-
make -j$NIX_BUILD_CORES
46-
'';
47-
48-
installPhase = ''
49-
mkdir -p $out/bin
50-
cp hyprsession-cpp $out/bin/
51-
'';
52-
};
5323
};
5424

5525
devShells = rec {
@@ -63,29 +33,7 @@
6333
clippy
6434
rustfmt
6535
];
66-
};
67-
68-
cpp-dev = pkgs.mkShell {
69-
nativeBuildInputs = with pkgs; [
70-
cmake
71-
gcc
72-
gdb
73-
pkg-config
74-
clang-tools
75-
];
76-
77-
buildInputs = with pkgs; [
78-
nlohmann_json
79-
wayland
80-
hyprland
81-
];
82-
83-
shellHook = ''
84-
echo "C++ Development Environment"
85-
echo "Available tools: cmake, g++, gdb, pkg-config"
86-
echo "To build: mkdir -p build_cpp && cd build_cpp && cmake .. && make"
87-
'';
88-
};
36+
};
8937
};
9038
});
9139
}

0 commit comments

Comments
 (0)