From 41d5b390767bedfeb8f21186d8208b275631e61f Mon Sep 17 00:00:00 2001 From: MedzikUser Date: Sun, 13 Feb 2022 16:58:38 +0100 Subject: [PATCH] add README --- CHANGELOG.md | 1 + README.md | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++ aur/.SRCINFO | 13 +++++++++ aur/PKGBUILD | 36 +++++++++++++++++++++++++ src/main.rs | 3 ++- 5 files changed, 127 insertions(+), 1 deletion(-) create mode 100644 README.md create mode 100644 aur/.SRCINFO create mode 100644 aur/PKGBUILD diff --git a/CHANGELOG.md b/CHANGELOG.md index f3a4b49..e20ca77 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +- Added README ## [0.1.0] - 2022-02-13 ### CLI diff --git a/README.md b/README.md new file mode 100644 index 0000000..dda3c35 --- /dev/null +++ b/README.md @@ -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) diff --git a/aur/.SRCINFO b/aur/.SRCINFO new file mode 100644 index 0000000..d5f9dda --- /dev/null +++ b/aur/.SRCINFO @@ -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 diff --git a/aur/PKGBUILD b/aur/PKGBUILD new file mode 100644 index 0000000..fb1f180 --- /dev/null +++ b/aur/PKGBUILD @@ -0,0 +1,36 @@ +# Maintainer: MedzikUser +_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" +} diff --git a/src/main.rs b/src/main.rs index 3a9ad9f..cdcf055 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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)); } }