chore: update
This commit is contained in:
parent
51111180d9
commit
002c36c3d0
|
@ -1,2 +1,6 @@
|
||||||
# Cargo
|
# Cargo
|
||||||
/target
|
/target
|
||||||
|
|
||||||
|
# IDEs
|
||||||
|
.vscode
|
||||||
|
.idea
|
||||||
|
|
|
@ -159,16 +159,6 @@ dependencies = [
|
||||||
"winapi 0.3.9",
|
"winapi 0.3.9",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "ctrlc"
|
|
||||||
version = "3.2.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "b37feaa84e6861e00a1f5e5aa8da3ee56d605c9992d33e082786754828e20865"
|
|
||||||
dependencies = [
|
|
||||||
"nix",
|
|
||||||
"winapi 0.3.9",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "discord-rich-presence"
|
name = "discord-rich-presence"
|
||||||
version = "0.2.0"
|
version = "0.2.0"
|
||||||
|
@ -191,7 +181,6 @@ dependencies = [
|
||||||
"clap_complete",
|
"clap_complete",
|
||||||
"clap_mangen",
|
"clap_mangen",
|
||||||
"colored",
|
"colored",
|
||||||
"ctrlc",
|
|
||||||
"discord-rich-presence",
|
"discord-rich-presence",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -293,17 +282,6 @@ dependencies = [
|
||||||
"autocfg",
|
"autocfg",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "nix"
|
|
||||||
version = "0.24.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "8f17df307904acd05aa8e32e97bb20f2a0df1728bbc2d771ae8f9a90463441e9"
|
|
||||||
dependencies = [
|
|
||||||
"bitflags",
|
|
||||||
"cfg-if",
|
|
||||||
"libc",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "object"
|
name = "object"
|
||||||
version = "0.27.1"
|
version = "0.27.1"
|
||||||
|
|
|
@ -18,12 +18,8 @@ codegen-units = 1
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
better-panic = "0.3.0"
|
better-panic = "0.3.0"
|
||||||
|
clap = { version = "3.1.18", features = ["derive"] }
|
||||||
clap_complete = "3.1.4"
|
clap_complete = "3.1.4"
|
||||||
|
clap_mangen = "0.1.6"
|
||||||
colored = "2.0.0"
|
colored = "2.0.0"
|
||||||
discord-rich-presence = "0.2.0"
|
discord-rich-presence = "0.2.0"
|
||||||
ctrlc = "3.2.2"
|
|
||||||
clap_mangen = "0.1.6"
|
|
||||||
|
|
||||||
[dependencies.clap]
|
|
||||||
version = "3.1.18"
|
|
||||||
features = ["derive", "cargo", "std"]
|
|
||||||
|
|
18
README.md
18
README.md
|
@ -4,18 +4,18 @@
|
||||||
|
|
||||||
### Big image, small image, details and one button
|
### Big image, small image, details and one button
|
||||||
|
|
||||||
![discord rpc 1](https://cdn.magicuser.cf/6MmBURG.png)
|
![](https://i.imgur.com/6MmBURG.png)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
discordrpc -c 942151169185316874 -d 'untypeable nickname' --button-1-text 'Discord RPC written in Rust' --button-1-url 'https://github.com/MedzikUser/discord-rpc' -N medzik -I medzik -n archlinux -i archlinux`
|
discordrpc --client-id 942151169185316874 --details 'untypeable nickname' --button-1-text 'Discord RPC written in Rust' --button-1-url 'https://github.com/MedzikUser/discord-rpc' --large-image medzik --large-image-text medzik --small-image archlinux --small-image-text archlinux
|
||||||
```
|
```
|
||||||
|
|
||||||
### Big image, details, state and two buttons
|
### Big image, details, state and two buttons
|
||||||
|
|
||||||
![discord rpc 2](https://cdn.magicuser.cf/tRbcy40.png)
|
![](https://i.imgur.com/tRbcy40.png)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
discordrpc -c 942151169185316874 -d 'untypeable nickname' -s 'MedzikUser' --button-1-text 'Discord RPC written in Rust' --button-1-url 'https://github.com/MedzikUser/discord-rpc' --button-2-text 'GitHub' --button-2-url 'https://github.com/MedzikUser' -N medzik -I medzik
|
discordrpc --client-id 942151169185316874 --details 'untypeable nickname' --state 'MedzikUser' --button-1-text 'Discord RPC written in Rust' --button-1-url 'https://github.com/MedzikUser/discord-rpc' --button-2-text 'GitHub' --button-2-url 'https://github.com/MedzikUser' --large-image medzik --large-image-text medzik
|
||||||
```
|
```
|
||||||
|
|
||||||
## How to install?
|
## How to install?
|
||||||
|
@ -56,20 +56,20 @@ Make sure you have the latest version of Rust. Then you can run
|
||||||
1. Go to [Discord Developer Portal](https://discord.com/developers/applications)
|
1. Go to [Discord Developer Portal](https://discord.com/developers/applications)
|
||||||
2. Make New Application, name them freely (the name will be displayed in RPC)
|
2. Make New Application, name them freely (the name will be displayed in RPC)
|
||||||
|
|
||||||
![new app](https://cdn.magicuser.cf/RMUjPep.png)
|
![new app](https://i.imgur.com/RMUjPep.png)
|
||||||
|
|
||||||
3. Go to General Information
|
3. Go to General Information
|
||||||
|
|
||||||
![general](https://cdn.magicuser.cf/yuQufwT.png)
|
![general](https://i.imgur.com/yuQufwT.png)
|
||||||
|
|
||||||
3. Copy ID
|
3. Copy ID
|
||||||
|
|
||||||
![copy id](https://cdn.magicuser.cf/JDHZ6jy.png)
|
![copy id](https://i.imgur.com/JDHZ6jy.png)
|
||||||
|
|
||||||
5. Then go to the Rich Presence tab (optional)
|
5. Then go to the Rich Presence tab (optional)
|
||||||
|
|
||||||
![rich presence](https://cdn.magicuser.cf/hIB5VEW.png)
|
![rich presence](https://i.imgur.com/hIB5VEW.png)
|
||||||
|
|
||||||
6. Add images to be able to display them in RPC (optional)
|
6. Add images to be able to display them in RPC (optional)
|
||||||
|
|
||||||
![add image](https://cdn.magicuser.cf/vtEs7v6.png)
|
![add image](https://i.imgur.com/vtEs7v6.png)
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
pub mod parse;
|
|
||||||
|
|
||||||
pub use parse::Cli;
|
|
14
src/main.rs
14
src/main.rs
|
@ -11,15 +11,9 @@ use crate::cli::Cli;
|
||||||
fn main() {
|
fn main() {
|
||||||
better_panic::install();
|
better_panic::install();
|
||||||
|
|
||||||
ctrlc::set_handler(move || {
|
|
||||||
println!("{}", "Bye!".red());
|
|
||||||
exit(0)
|
|
||||||
})
|
|
||||||
.expect("Error setting Ctrl-C handler");
|
|
||||||
|
|
||||||
let args = Cli::parse();
|
let args = Cli::parse();
|
||||||
|
|
||||||
// * print completions
|
// print completions
|
||||||
if let Some(shell) = args.print_completions {
|
if let Some(shell) = args.print_completions {
|
||||||
let mut clap_app = Cli::command();
|
let mut clap_app = Cli::command();
|
||||||
let app_name = clap_app.get_name().to_string();
|
let app_name = clap_app.get_name().to_string();
|
||||||
|
@ -28,7 +22,7 @@ fn main() {
|
||||||
exit(0)
|
exit(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
// * print manpage
|
// print manpage
|
||||||
if args.manpage {
|
if args.manpage {
|
||||||
let clap_app = Cli::command();
|
let clap_app = Cli::command();
|
||||||
let man = clap_mangen::Man::new(clap_app);
|
let man = clap_mangen::Man::new(clap_app);
|
||||||
|
@ -37,7 +31,7 @@ fn main() {
|
||||||
exit(0)
|
exit(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
// * start discord rpc
|
// start discord rpc
|
||||||
execute::run(args.clone());
|
execute::run(args.clone());
|
||||||
|
|
||||||
println!(
|
println!(
|
||||||
|
@ -54,7 +48,7 @@ fn main() {
|
||||||
exit(0)
|
exit(0)
|
||||||
} else {
|
} else {
|
||||||
loop {
|
loop {
|
||||||
// * empty `loop {}` wastes CPU cycles
|
// empty `loop {}` wastes CPU cycles
|
||||||
sleep(Duration::from_secs(9999999));
|
sleep(Duration::from_secs(9999999));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue