Skip to content

Commit

Permalink
✨ add discord presence plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
rayanramoul committed Feb 8, 2024
2 parents 29fc012 + 4824b48 commit 6aa222e
Show file tree
Hide file tree
Showing 27 changed files with 166 additions and 85 deletions.
51 changes: 41 additions & 10 deletions docs/MacOS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
<img src="https://github.com/rayanramoul/RayTerm/blob/master/assets/macos_preview.png?raw=true"/>
</div>

# Table of Content
- [Tiling Window Management](#how-to-have-tiling-window-management-and-keybindings)
- [Setup Top Bar](#setup-a-top-bar)
- [My Dotfiles](#get-my-dotfiles)
- [Essential Apps](#essential-apps)
- [Other Interesting Apps](#other-interesting-apps)

# Summary :
- Fetch Script : neoFetch
- Editor : Neovim
Expand All @@ -17,23 +24,41 @@
- Zsh Theme : Powerlevel10k
- Other Terminal Utilities : Bat, Exa, Fzf, Ripgrep, Starship, Tldr, Zoxide, Lsd, LazyGit

# How To
- Install [Yabai](https://github.com/koekeishiya/yabai) Tiling Window Manager, follow this [Tutorial](https://github.com/koekeishiya/yabai/wiki/Installing-yabai-(from-HEAD)) for example.
- If you are using a Mac with Apple Silicon you will have to run this : sudo nvram boot-args=-arm64e_preview_abi
# How To Have Tiling Window Management and Keybindings
- Install [Yabai](https://github.com/koekeishiya/yabai) Tiling Window Manager, follow this [Tutorial](https://github.com/koekeishiya/yabai/wiki/Installing-yabai-(from-HEAD)) for example.
- (Optional) Another Tiling WM alternative is Amethyst but Yabai is better : https://brandonkboswell.com/blog/Mouseless-MacOS-Window-Management-Yabai-vs-Amethyst/
- (For Apple Silicon users) If you are using a Mac with Apple Silicon you will have to run this : sudo nvram boot-args=-arm64e_preview_abi
- Install [SKHD](https://github.com/koekeishiya/skhd) to set Yabai and system keybinds.

# Setup a Top Bar
You have 2 options :
## First Option - Simple Bar (Simple)
Works better out of the box without too much config or hassle.
- Install [Uebersicht](http://tracesof.net/uebersicht/) this launcher will be helpful to setup the top bar.
- Install [Simple-Bar](https://github.com/Jean-Tinland/simple-bar), then you can configure it by clicking on it then CMD + ,
- Another potential bar is [Sketchy Bar](https://github.com/FelixKratz/SketchyBar/tree/master).

## Second Option - SketchyBar (Similar to i3wm or GlazeWM bars)
I prefer it, configuration is a yaml file saved in ~/.config and also it better follows the behaviours of other twm i use
- Install following [this](https://github.com/FelixKratz/SketchyBar)


# (Optional) Have highlights on borders of apps to know which one is selected
- Install [Janky-Border](https://github.com/FelixKratz/JankyBorders) this will help to highlight focused windows.
- Goo to System Prefs > Mission Control,
- Uncheck - Automatically rearrange
- Check - Displays have separate spaces
- Install [RayCast](https://www.raycast.com/) app launcher.

# Get my dotfiles
The dotfiles specific to Mac are mostly yabai [config](https://github.com/rayanramoul/RayTerm/blob/master/dotfiles/.config/yabai/yabairc) and skhd [config](https://github.com/rayanramoul/RayTerm/blob/master/dotfiles/.config/skhd/skhdrc) and sketchy bar [config](https://github.com/rayanramoul/RayTerm/blob/master/dotfiles/.config/sketchybar/sketchybarrc) ones, i reproduce with them what i have on i3wm and glazewm.
## First Option - With install.sh script
- Setup dotfiles, in your terminal launch :
```bash
sh -c "$(wget https://raw.githubusercontent.com/rayanramoul/RayTerm/master/install.sh -O -)"
```
The script will clone this repository and install ansible then prompt you to choose which part of the install you want to run. <br>

## Second Option - Use Stow
If you only want to check the dotfiles you can get them at this link : [Dotfiles](dotfiles) and for example run [Stow](https://www.gnu.org/software/stow/) to symlink your config with the repositories ones :
```bash
git clone https://github.com/rayanramoul/RayTerm/
Expand All @@ -46,17 +71,23 @@ yabai --restart-service
skhd --restart-service
```

# Essential Apps
- Keeps Computer not sleepy : https://apps.apple.com/fr/app/amphetamine/id937984704?mt=12
- Mac native search is really limited, get a better spotlight (search for apps, folders and more) : https://manual.raycast.com/
- (Optional) another spotlight alternative is [Alfred](https://www.alfredapp.com/), comparison between the 2 : https://joshcollinsworth.com/blog/alfred-raycast
- Better Screenshot tool : https://shottr.cc/
- Best terminal for Mac (I personally use Alacritty for cross-platform support) : https://www.warp.dev/


# Other Interesting Apps
- Resize windows like in Windows : https://rectangleapp.com/
- Keeps not sleepy : https://apps.apple.com/fr/app/amphetamine/id937984704?mt=12
- Resize windows like in Windows (install it if you didn't setup Tiling Window Management) : https://rectangleapp.com/
- Test of camera : https://apps.apple.com/us/app/hand-mirror/id1502839586?mt=12
- Better spotlight : https://manual.raycast.com/
- Bind hotkeys : https://apps.apple.com/fr/app/hotkey-app/id975890633?mt=12
- Optimize images sizes : https://imageoptim.com/mac
- Save apps for later to prepare calls/sharing screen : https://getlater.app/
- Download latest versions of apps : https://max.codes/latest/
- Read articles : https://quietreader.app/
- Better Screenshot tool : https://shottr.cc/
- Best terminal for Mac : https://www.warp.dev/
- Setup Terminal : https://youtu.be/ynL1fYncZ1E and https://github.com/zsh-users/zsh-completions and https://fig.io/
- Get commands recommendations in Terminal (install it if you you are using something else than Warp terminal) : https://youtu.be/ynL1fYncZ1E and https://github.com/zsh-users/zsh-completions and https://fig.io/

# Keybinds
My keybindgs are the same accross all the OSs i use, you can find a recap of them [here](https://github.com/rayanramoul/RayTerm/blob/master/docs/Keybindings.md)
Empty file.
1 change: 1 addition & 0 deletions dotfiles/.config/nvim/after/plugin/gitsigns.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require('gitsigns').setup()
24 changes: 24 additions & 0 deletions dotfiles/.config/nvim/after/plugin/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,30 @@ local cmp_mappings = lsp.defaults.cmp_mappings({
['<C-y>'] = cmp.mapping.confirm({ select = true }),
["<C-Space>"] = cmp.mapping.complete(),
})

-- `/` cmdline setup.
cmp.setup.cmdline('/', {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = 'buffer' }
}
})

-- `:` cmdline setup.
cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = 'path' }
}, {
{
name = 'cmdline',
option = {
ignore_cmds = { 'Man', '!' }
}
}
})
})

cmp.setup({
mapping = cmp_mappings,
sources = {
Expand Down
18 changes: 18 additions & 0 deletions dotfiles/.config/nvim/after/plugin/noice.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
require("noice").setup({
lsp = {
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
override = {
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
["vim.lsp.util.stylize_markdown"] = true,
["cmp.entry.get_documentation"] = true, -- requires hrsh7th/nvim-cmp
},
},
-- you can enable a preset for easier configuration
presets = {
bottom_search = true, -- use a classic bottom cmdline for search
command_palette = true, -- position the cmdline and popupmenu together
long_message_to_split = true, -- long messages will be sent to a split
inc_rename = false, -- enables an input dialog for inc-rename.nvim
lsp_doc_border = false, -- add a border to hover docs and signature help
},
})
53 changes: 22 additions & 31 deletions dotfiles/.config/nvim/after/plugin/presence.lua
Original file line number Diff line number Diff line change
@@ -1,33 +1,24 @@
-- The setup config table shows all available config options with their default values:
require("presence").setup({

-- -- General options
-- auto_update = true, -- Update activity based on autocmd events (if `false`, map or manually execute `:lua package.loaded.presence:update()`)
--
-- neovim_image_text = "The One True Text Editor", -- Text displayed when hovered over the Neovim image
--
-- main_image = "neovim", -- Main image display (either "neovim" or "file")
-- client_id = "793271441293967371", -- Use your own Discord application client id (not recommended)
-- log_level = nil, -- Log messages at or above this level (one of the following: "debug", "info", "warn", "error")
--
-- debounce_timeout = 10, -- Number of seconds to debounce events (or calls to `:lua package.loaded.presence:update(<filename>, true)`)
--
-- enable_line_number = false, -- Displays the current line number instead of the current project
-- blacklist = {}, -- A list of strings or Lua patterns that disable Rich Presence if the current file name, path, or workspace matches
-- buttons = true, -- Configure Rich Presence button(s), either a boolean to enable/disable, a static table (`{{ label = "<label>", url = "<url>" }, ...}`, or a function(buffer: string, repo_url: string|nil): table)
--
-- file_assets = {}, -- Custom file asset definitions keyed by file names and extensions (see default config at `lua/presence/file_assets.lua` for reference)
--
-- show_time = true, -- Show the timer
--
-- -- Rich Presence text options
-- editing_text = "Editing %s", -- Format string rendered when an editable file is loaded in the buffer (either string or function(filename: string): string)
-- file_explorer_text = "Browsing %s", -- Format string rendered when browsing a file explorer (either string or function(file_explorer_name: string): string)
-- git_commit_text = "Committing changes", -- Format string rendered when committing changes in git (either string or function(filename: string): string)
-- plugin_manager_text = "Managing plugins", -- Format string rendered when managing plugins (either string or function(plugin_manager_name: string): string)
--
-- reading_text = "Reading %s", -- Format string rendered when a read-only or unmodifiable file is loaded in the buffer (either string or function(filename: string): string)
-- workspace_text = "Working on %s", -- Format string rendered when in a git repository (either string or function(project_name: string|nil, filename: string): string)
-- line_number_text = "Line %s out of %s", -- Format string rendered when `enable_line_number` is set to true (either string or function(line_number: number, line_count: number): string)
--

-- General options
auto_update = true, -- Update activity based on autocmd events (if `false`, map or manually execute `:lua package.loaded.presence:update()`)
-- neovim_image_text = "The One True Text Editor", -- Text displayed when hovered over the Neovim image
-- main_image = "neovim", -- Main image display (either "neovim" or "file")
-- client_id = "793271441293967371", -- Use your own Discord application client id (not recommended)
-- log_level = nil, -- Log messages at or above this level (one of the following: "debug", "info", "warn", "error")
-- debounce_timeout = 10, -- Number of seconds to debounce events (or calls to `:lua package.loaded.presence:update(<filename>, true)`)
-- enable_line_number = false, -- Displays the current line number instead of the current project
-- blacklist = {}, -- A list of strings or Lua patterns that disable Rich Presence if the current file name, path, or workspace matches
-- buttons = true, -- Configure Rich Presence button(s), either a boolean to enable/disable, a static table (`{{ label = "<label>", url = "<url>" }, ...}`, or a function(buffer: string, repo_url: string|nil): table)
-- file_assets = {}, -- Custom file asset definitions keyed by file names and extensions (see default config at `lua/presence/file_assets.lua` for reference)
show_time = true, -- Show the timer
--
-- -- Rich Presence text options
editing_text = "Editing File", -- Format string rendered when an editable file is loaded in the buffer (either string or function(filename: string): string)
file_explorer_text = "Browsing File", -- Format string rendered when browsing a file explorer (either string or function(file_explorer_name: string): string)
-- git_commit_text = "Committing changes", -- Format string rendered when committing changes in git (either string or function(filename: string): string)
-- plugin_manager_text = "Managing plugins", -- Format string rendered when managing plugins (either string or function(plugin_manager_name: string): string)
reading_text = "Reading File", -- %s", -- Format string rendered when a read-only or unmodifiable file is loaded in the buffer (either string or function(filename: string): string)
workspace_text = "Working on File", -- Format string rendered when in a git repository (either string or function(project_name: string|nil, filename: string): string)
-- line_number_text = "Line %s out of %s", -- Format string rendered when `enable_line_number` is set to true (either string or function(line_number: number, line_count: number): string)
})
1 change: 1 addition & 0 deletions dotfiles/.config/nvim/after/plugin/whichkey.lua
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,6 @@ wk.register({
["<leader>gF"] = { "<cmd>lua vim.lsp.buf.formatting()<CR>", "Format" },
["<leader>gS"] = { "<cmd>lua vim.lsp.buf.document_symbol()<CR>", "Document Symbols" },
["<leader>gD"] = { "<cmd>lua vim.lsp.buf.declaration()<CR>", "Declaration" },
["<leader>gp"] = { ":Gitsigns preview_hunk<CR>", "Git Preview Changes"},
})
wk.setup(opts)
9 changes: 0 additions & 9 deletions dotfiles/.config/nvim/after/vista.lua

This file was deleted.

Loading

0 comments on commit 6aa222e

Please sign in to comment.