add README

This commit is contained in:
MedzikUser 2022-02-13 16:58:38 +01:00
parent 038055eeb0
commit 41d5b39076
No known key found for this signature in database
GPG Key ID: A5FAC1E185C112DB
5 changed files with 127 additions and 1 deletions

View File

@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
<!-- next-header -->
## [Unreleased]
- Added README
## [0.1.0] - 2022-02-13
### CLI

75
README.md Normal file
View File

@ -0,0 +1,75 @@
# Discord RPC Client
## Examples
### Big image, small image, details and one button
![discord rpc 1](https://cdn.magicuser.cf/6MmBURG.png)
```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`
```
### Big image, details, state and two buttons
![discord rpc 2](https://cdn.magicuser.cf/tRbcy40.png)
```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
```
## How to install?
### Linux
Download discordrpc-linux from the [releases page](https://github.com/MedzikUser/discordrpc/releases/latest) and run
chmod +x discordrpc-linux
./discordrpc-linux
### Arch Linux
Using yay ([AUR](https://aur.archlinux.org/packages/discordrpc))
yay -S discordrpc
Alternatively you can add [this repo](https://github.com/archlinux-pkg/packages) and run
sudo pacman -S discordrpc
### OSX
Download discordrpc-darwin from the [releases page](https://github.com/MedzikUser/discordrpc/releases/latest) and run
chmod +x discordrpc-darwin
./discordrpc-darwin
### Windows
Download discordrpc-windows from the [releases page](https://github.com/MedzikUser/discordrpc/releases/latest) and run
chmod +x discordrpc-windows
./discordrpc-windows
### Compile with Cargo
Make sure you have the latest version of Rust. Then you can run
cargo install imgurs
## How do I get a client id?
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)
![new app](https://cdn.magicuser.cf/RMUjPep.png)
3. Go to General Information
![general](https://cdn.magicuser.cf/yuQufwT.png)
3. Copy ID
![copy id](https://cdn.magicuser.cf/JDHZ6jy.png)
5. Then go to the Rich Presence tab (optional)
![rich presence](https://cdn.magicuser.cf/hIB5VEW.png)
6. Add images to be able to display them in RPC (optional)
![add image](https://cdn.magicuser.cf/vtEs7v6.png)

13
aur/.SRCINFO Normal file
View File

@ -0,0 +1,13 @@
pkgbase = discordrpc
pkgdesc = CLI for Imgur API
pkgver = 0.1.0
pkgrel = 1
url = https://github.com/MedzikUser/discordrpc
arch = x86_64
license = BSD3
makedepends = cargo
depends = libnotify
source = discordrpc-0.1.0.tar.gz::https://github.com/MedzikUser/discordrpc/archive/refs/tags/v0.1.0.tar.gz
sha256sums = SKIP
pkgname = discordrpc

36
aur/PKGBUILD Normal file
View File

@ -0,0 +1,36 @@
# Maintainer: MedzikUser <nivua1fn@duck.com>
_repo='MedzikUser/discordrpc'
_ver=v0.1.0
_pkgname='discordrpc'
pkgname="${_pkgname}"
pkgver=0.1.0
pkgrel=1
pkgdesc='Fast Discord RPC Client written in Rust'
arch=('x86_64')
url="https://github.com/${_repo}"
license=('BSD3')
makedepends=('cargo')
source=("${_pkgname}-${pkgver}.tar.gz::${url}/archive/refs/tags/${_ver}.tar.gz")
sha256sums=('SKIP')
build() {
cd "${_pkgname}-${pkgver}"
cargo build --release
}
package() {
cd "${_pkgname}-${pkgver}"
install -Dm 755 target/release/${_pkgname} "${pkgdir}/usr/bin/${pkgname}"
#mkdir -p "$pkgdir"/usr/share/{bash-completion/completions,zsh/site-functions,fish/vendor_completions.d}
#target/release/${_pkgname} completions bash > "$pkgdir"/usr/share/bash-completion/completions/${pkgname}
#target/release/${_pkgname} completions zsh > "$pkgdir"/usr/share/zsh/site-functions/_${pkgname}
#target/release/${_pkgname} completions fish > "$pkgdir"/usr/share/fish/vendor_completions.d/${pkgname}.fish
install -Dm 644 LICENSE.md "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}

View File

@ -8,6 +8,7 @@ use discord_rich_presence::{
};
use std::{
process::exit,
thread::sleep,
time::{Duration, SystemTime, UNIX_EPOCH},
vec,
};
@ -122,6 +123,6 @@ fn main() {
);
loop {
std::thread::sleep(Duration::new(9999999, 9999999));
sleep(Duration::new(9999999, 9999999));
}
}