-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 858d924
Showing
32 changed files
with
843 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
patreon: axorax |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package-lock.json | ||
*.lock | ||
|
||
node_modules/ | ||
target/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2024 Axorax | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<p align="center"><img src="./src-tauri/icons/128x128.png"></p> | ||
|
||
<p align="center"><strong><code>livewinsize</code></strong></p> | ||
|
||
<p align="center">View window size on Desktop</p> | ||
|
||
# About | ||
|
||
When you are developing Desktop applications, you may need to put the height and width of the window for when the app starts or set it to another value for any reason. You need to guess the size or put any value then test it and repeat that process. livewinsize is a simple app that shows the window size that it is currently opened in. You can use this to resize the window and get an idea on what the value for the width and height should be on your app! You can also convert the size into inches, centimeters, etc. with livewinsize and also input a custom size after which livewinsize will resize itself to that size. | ||
|
||
# Preview | ||
|
||
![Preview](./preview.png) | ||
|
||
--- | ||
|
||
<p align="center"><a href="https://www.patreon.com/axorax">Support me on Patreon</a> — <a href="https://github.com/axorax/socials">Check out my socials</a></p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
|
||
echo "Copying..." | ||
|
||
src_folder="src" | ||
dest_folder="src-copy" | ||
|
||
if [ ! -d "$dest_folder" ]; then | ||
mkdir "$dest_folder" | ||
fi | ||
|
||
cp -r "$src_folder"/* "$dest_folder" | ||
|
||
echo "Minification starting..." | ||
|
||
find "$src_folder" -type f -name "*.html" -exec echo "Minifying {}" \; -exec npx html-minifier-terser --collapse-whitespace --remove-comments --output {} {} \; | ||
find "$src_folder" -type f -name "*.css" -exec echo "Minifying {}" \; -exec npx uglifycss --output {} {} \; | ||
find "$src_folder" -type f -name "*.js" -exec echo "Minifying {}" \; -exec npx terser --compress --mangle --output {} -- {} \; | ||
|
||
echo "Building..." | ||
|
||
npm run tauri build & | ||
|
||
wait $! | ||
|
||
echo "Cleaning up..." | ||
|
||
rm -rf "$src_folder" | ||
mv "$dest_folder" "$src_folder" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"name": "livewinsize", | ||
"private": true, | ||
"version": "1.0.0", | ||
"type": "module", | ||
"scripts": { | ||
"tauri": "tauri" | ||
}, | ||
"devDependencies": { | ||
"@tauri-apps/cli": "^1" | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
if [ ! -d "node_modules" ]; then | ||
npm install | ||
fi | ||
|
||
npm run tauri dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
[package] | ||
name = "livewinsize" | ||
version = "1.0.0" | ||
description = "View window size on Desktop" | ||
authors = ["Axorax"] | ||
edition = "2021" | ||
|
||
[build-dependencies] | ||
tauri-build = { version = "1", features = [] } | ||
|
||
[dependencies] | ||
tauri = { version = "1", features = [ "shell-open", "window-set-size"] } | ||
serde = { version = "1", features = ["derive"] } | ||
serde_json = "1" | ||
|
||
[features] | ||
custom-protocol = ["tauri/custom-protocol"] | ||
|
||
[profile.release] | ||
strip = true | ||
lto = true | ||
opt-level = "z" | ||
panic = "abort" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
fn main() { | ||
tauri_build::build() | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] | ||
|
||
fn main() { | ||
tauri::Builder::default() | ||
.run(tauri::generate_context!()) | ||
.expect("An error occured! Sorry..."); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{ | ||
"build": { | ||
"devPath": "../src", | ||
"distDir": "../src", | ||
"withGlobalTauri": true | ||
}, | ||
"package": { | ||
"productName": "livewinsize", | ||
"version": "1.0.0" | ||
}, | ||
"tauri": { | ||
"allowlist": { | ||
"all": false, | ||
"window": { | ||
"all": false, | ||
"setSize": true | ||
}, | ||
"shell": { | ||
"all": false, | ||
"open": true | ||
} | ||
}, | ||
"windows": [ | ||
{ | ||
"title": "livewinsize", | ||
"width": 800, | ||
"height": 500 | ||
} | ||
], | ||
"security": { | ||
"csp": null | ||
}, | ||
"bundle": { | ||
"active": true, | ||
"targets": "all", | ||
"identifier": "com.axorax.livewinsize", | ||
"icon": [ | ||
"icons/icon.icns", | ||
"icons/icon.ico", | ||
"icons/icon.png", | ||
"icons/128x128.png", | ||
"icons/32x32.png", | ||
"icons/128x128@2x.png", | ||
"icons/StoreLogo.png", | ||
"icons/Square30x30Logo.png", | ||
"icons/Square44x44Logo.png", | ||
"icons/Square71x71Logo.png", | ||
"icons/Square89x89Logo.png", | ||
"icons/Square107x107Logo.png", | ||
"icons/Square142x142Logo.png", | ||
"icons/Square150x150Logo.png", | ||
"icons/Square284x284Logo.png", | ||
"icons/Square310x310Logo.png" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<link rel="stylesheet" href="./style.css" /> | ||
<script src="main.js" defer></script> | ||
</head> | ||
<body> | ||
<main> | ||
<div> | ||
<p>Your screen size is</p> | ||
<h1> | ||
<div | ||
class="width" | ||
contenteditable="true" | ||
onblur="focusLost()" | ||
onkeypress="onlyNumbers(event)" | ||
onkeydown="resizeFromEvent(event, 'w', this)" | ||
></div> | ||
<div>x</div> | ||
<div | ||
class="height" | ||
contenteditable="true" | ||
onblur="focusLost()" | ||
onkeypress="onlyNumbers(event)" | ||
onkeydown="resizeFromEvent(event, 'h', this)" | ||
></div> | ||
</h1> | ||
<h2>pixels</h2> | ||
<h3>width x height</h3> | ||
<div class="note">Press Enter to resize the window!</div> | ||
</div> | ||
</main> | ||
|
||
<footer> | ||
<div class="button-group"> | ||
<div class="group size"> | ||
<div> | ||
<div> | ||
<p>Width</p> | ||
<input | ||
class="width" | ||
type="text" | ||
placeholder="Width" | ||
onkeypress="onlyNumbers(event)" | ||
/> | ||
</div> | ||
<div> | ||
<p>Height</p> | ||
<input | ||
class="height" | ||
type="text" | ||
placeholder="Height" | ||
onkeypress="onlyNumbers(event)" | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<button onclick="resizeFromInput()" class="size button"> | ||
set size | ||
</button> | ||
|
||
<div class="group ppi"> | ||
<div>DPI/PPI</div> | ||
<div> | ||
<input | ||
oninput="setPPIFromInput(this)" | ||
type="text" | ||
value="96" | ||
onkeypress="onlyNumbers(event)" | ||
/> | ||
</div> | ||
</div> | ||
|
||
<div class="group unit"> | ||
<div>unit</div> | ||
<button>pixels ▾</button> | ||
</div> | ||
|
||
<button class="donate button">Donate</button> | ||
</div> | ||
|
||
<div class="dropcover unit"> | ||
<input type="text" class="search" placeholder="🔎︎ search units" /> | ||
<div></div> | ||
</div> | ||
</footer> | ||
</body> | ||
</html> |
Oops, something went wrong.