Skip to content

Commit

Permalink
remove unused packages
Browse files Browse the repository at this point in the history
sorry edelvarden
  • Loading branch information
0-don committed Dec 10, 2023
1 parent bc5fbc5 commit 906f971
Show file tree
Hide file tree
Showing 20 changed files with 73 additions and 64 deletions.
20 changes: 9 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@ jobs:
with:
node-version: 20

- uses: mukunku/[email protected]
id: checkTag
with:
tag: '${{ env.PACKAGE_VERSION }}'
# - uses: mukunku/[email protected]
# id: checkTag
# with:
# tag: '${{ env.PACKAGE_VERSION }}'

- name: stop jobs if tag exist
if: steps.checkTag.outputs.exists == 'true'
run: exit 1
# - name: stop jobs if tag exist
# if: steps.checkTag.outputs.exists == 'true'
# run: exit 1

- name: install rust stable
uses: dtolnay/rust-toolchain@stable
Expand All @@ -101,9 +101,7 @@ jobs:
sudo apt-get install -y libgtk-3-dev
sudo apt-get install -y libwebkit2gtk-4.0-dev
sudo apt-get install -y libappindicator3-dev
sudo apt-get install -y librsvg2-dev
sudo apt-get install -y patchelf
sudo apt-get install -y libxcb-shape0-dev
sudo apt-get install -y libxcb-xfixes0-dev
sudo apt-get install -y libxdo-dev
Expand Down Expand Up @@ -144,7 +142,7 @@ jobs:
pkgver=${{ env.PACKAGE_VERSION }}
md5sums=('$(md5sum ${{ env.BIN_PATH }}/${{ env.DEB_PKG_RENAMED }} | awk '{print $1}')')
pkgrel=1
depends=('libappindicator-gtk3' 'webkit2gtk' 'gtk3')
depends=('xdotool' 'webkit2gtk' 'gtk3')
pkgdesc='${{ env.DESCRIPTION }}'
arch=('${{ env.ARCH }}')
url="https://github.com/${{ github.repository }}"
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ package-lock.json
pnpm-lock.yaml
target
yarn-error.log

.vscode
4 changes: 0 additions & 4 deletions .husky/pre-commit

This file was deleted.

27 changes: 25 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@

successor of [the electron clippy](https://github.com/Don-Cryptus/clippy-ts)

### features
### Features

- display/hide **ctrl+y** or **ctrl+d** (change in settings)
- type out clipboard **ctrl+b** (where pasting isn't allowed)
- images & text support
Expand All @@ -34,6 +35,28 @@ successor of [the electron clippy](https://github.com/Don-Cryptus/clippy-ts)
- change keyboard bindings
- dark mode / white mode

### Prerequisites

Before you begin, ensure you have met the following requirements:

- [Rust](https://www.rust-lang.org/tools/install)
- [Node.js](https://nodejs.org/en/download/)

### Installation and Running the Application

1. **Install Dependencies:**
First, install the necessary Node.js dependencies:

```bash
npm install
```

2. **Run the Application in Watch Mode:**
To start the Tauri application in watch mode, use:
```bash
npm run d
```

#### note
Tested on Linux(x11), Windows

Tested on Linux(x11), Windows
7 changes: 3 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en" class="dark">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Tauri + Solid + Typescript App</title>
<title>Main</title>
</head>

<body class="overflow-hidden">
<div id="root"></div>
<script src="/src/index.tsx" type="module"></script>
<script src="src/index.tsx" type="module"></script>
</body>
</html>
19 changes: 4 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "clippy",
"version": "1.2.1",
"version": "1.2.2",
"description": "Clipboard Manager built with Rust & Typescript",
"license": "MIT",
"type": "module",
Expand All @@ -9,33 +9,22 @@
"start": "vite",
"dev": "vite",
"build": "vite build",
"serve": "vite preview",
"tauri": "tauri",
"d": "tauri dev",
"gen": "sea-orm-cli migrate refresh -v -d src-tauri/migration && sea-orm-cli generate entity -l -o src-tauri/entity/src --expanded-format --with-serde both",
"icon": "tauri icon",
"pre-commit": "lint-staged"
},
"lint-staged": {
"*.{js,jsx,ts,tsx,css,scss}": [
"prettier --write --list-different"
]
"icon": "tauri icon"
},
"dependencies": {
"@tauri-apps/api": "^1.5.1",
"dayjs": "^1.11.10",
"solid-icons": "^1.1.0",
"solid-js": "^1.8.7",
"tauri-plugin-autostart-api": "https://github.com/tauri-apps/tauri-plugin-autostart"
"solid-js": "^1.8.7"
},
"devDependencies": {
"@tauri-apps/cli": "^1.5.7",
"@types/node": "^20.10.4",
"autoprefixer": "^10.4.16",
"husky": "^8.0.3",
"lint-staged": "^15.2.0",
"postcss": "^8.4.32",
"prettier": "^3.1.0",
"prettier": "^3.1.1",
"prettier-plugin-organize-imports": "^3.2.4",
"prettier-plugin-tailwindcss": "^0.5.9",
"tailwindcss": "^3.3.6",
Expand Down
2 changes: 1 addition & 1 deletion pages/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Tauri + Solid + Typescript App</title>
<title>About</title>
</head>
<body>
<div id="root"></div>
Expand Down
4 changes: 2 additions & 2 deletions pages/settings.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en" class="dark">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Tauri + Solid + Typescript App</title>
<title>Settings</title>
</head>
<body>
<div id="root"></div>
Expand Down
18 changes: 10 additions & 8 deletions src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "clippy"
version = "1.2.1"
version = "1.2.2"
description = "Clipboard Manager built with Rust & Typescript"
authors = ["Don-Cryptus"]
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/entity/src/clipboard.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.4
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.6

use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/entity/src/hotkey.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.4
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.6

use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/entity/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.4
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.6

pub mod prelude;

Expand Down
2 changes: 1 addition & 1 deletion src-tauri/entity/src/prelude.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.4
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.6

pub use super::clipboard::Entity as Clipboard;
pub use super::hotkey::Entity as Hotkey;
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/entity/src/settings.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.4
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.6

use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
Expand Down
1 change: 0 additions & 1 deletion src-tauri/src/service/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ pub fn toggle_main_window() {
get_main_window()
.emit("set_global_hotkey_event", false)
.unwrap();
// *HOTKEY_RUNNING.get().unwrap().lock().unwrap() = false;
} else {
printlog!("displaying window");
get_main_window()
Expand Down
11 changes: 10 additions & 1 deletion src-tauri/src/utils/hotkey_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ pub async fn upsert_hotkeys_in_store() -> Result<(), Box<dyn std::error::Error>>
key: hotkey.key,
hotkey: key,
};
println!("{:?}", hotkey_str.clone());

insert_hotkey_into_store(key_struct);
}

Expand Down Expand Up @@ -208,6 +208,15 @@ pub fn parse_shortcut(ctrl: bool, alt: bool, shift: bool, key: &str) -> String {
}

fn format_key_for_parsing(key: &str) -> String {
if key.len() >= 2 && (key.starts_with('F') || key.starts_with('f')) {
if let Ok(number) = key[1..].parse::<u32>() {
if number >= 1 && number <= 24 {
// Adjust the range if necessary
return key.to_uppercase(); // This is a function key like F1, F2, ..., F24
}
}
}

match key.chars().next().unwrap_or_default() {
'0'..='9' => format!("Digit{}", key), // For digits
'A'..='Z' | 'a'..='z' => format!("Key{}", key.to_uppercase()), // For letters
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"package": {
"productName": "clippy",
"version": "1.2.1"
"version": "1.2.2"
},
"tauri": {
"allowlist": {
Expand Down
2 changes: 1 addition & 1 deletion src/components/pages/app/Clipboards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ dayjs.extend(relativeTime);
interface ClipboardsProps {}

export const Clipboards: Component<ClipboardsProps> = ({}) => {
let dbClickTimer: NodeJS.Timeout;
let dbClickTimer: any;

const [scrollToTop, setScrollToTop] = createSignal(false);

Expand Down
6 changes: 0 additions & 6 deletions src/store/SettingsStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { HiSolidCog8Tooth } from "solid-icons/hi";
import { RiDeviceKeyboardFill } from "solid-icons/ri";
import { VsHistory } from "solid-icons/vs";
import { createRoot, createSignal } from "solid-js";
import { disable, enable } from "tauri-plugin-autostart-api";
import { Settings } from "../@types";

type SettingsTabName = "General" | "Backup" | "History" | "Hotkeys";
Expand Down Expand Up @@ -47,11 +46,6 @@ function createSettingsStore() {
const initSettings = async () => {
const settings = await invoke<Settings>("get_settings");
setSettings(settings);

try {
const env = (import.meta as any).env;
env.PROD && settings.startup ? await enable() : await disable();
} catch (_) {}
};

const syncClipboard = () => invoke("sync_clipboard_history") as Promise<void>;
Expand Down

0 comments on commit 906f971

Please sign in to comment.