You are not logged in.
I want to copy text just by using the mouse right click, but I can't find a configuration for alacritty to do that and works. Options with using ctrl or shit are fine, but if I can use only the right click when selecting text in the terminal and send that to the clipboard, you are going to make my day.
Last edited by Succulent of your garden (2025-03-30 10:42:27)
Offline
You mean like https://man.archlinux.org/man/extra/ala … 5.en#MOUSE
[mouse]
bindings = [
{ mouse = "Right", action = "Copy" },
]
Online
Yes, but that it doesn't works in my computer. When I select the text with the right mouse click, it doesn't copy the text to the clipboard. I don't know what could be wrong. I'm not sure if it's copy to another clipboard buffer than main.
Last edited by Succulent of your garden (2025-02-17 14:36:46)
Offline
Sanity check: what's the approach/scenario here?
alacritty like pretty much everything will copy everything you select into the primary buffer (not applicable on wayland where the cliipboard is still hit-and-mess) so if you're using the mouse anyway, there's little point in defining other actions to copy what's already in the primary buffer again (and likely into the primary buffer anyway)
Online
I'm using Xorg. Here is my toml file:
[window]
title = "Alacritty"
decorations = "none"
blur = true
opacity = 0.9
padding.x = 10
padding.y = 10
[window.dimensions]
columns = 160
lines = 80
[cursor.style]
shape= "Beam"
blinking = "Never"
[colors]
#transparent_background_colors = true
draw_bold_text_with_bright_colors = true
[env]
TERM = "xterm-256color"
[font]
glyph_offset = { x = 0, y = 0 }
normal.family = "IosevkaNerdFontMono"
normal.style = "Regular"
size = 12.0
[font.bold]
family = "IosevkaNerdFontMono"
style = "Bold"
[font.italic]
family = "IosevkaNerdFontMono"
style = "Italic"
[keyboard]
bindings = [
{ key = "T", mods = "Control", chars = "\u0002c" }, # create new window(aka tab)
{ key = "T", mods = "Control|Shift", chars = "\u0002!" }, # break pane into new window
{ key = "W", mods = "Control", chars = "\u0002x" }, # close window/pane
{ key = "N", mods = "Control|Shift", chars = "\u0002N" }, # open Floax
#{ key = "W", mods = "Control|Shift", chars = "\u0002w" }, # list windows
{ key = "W", mods = "Control", action = "Quit"}, #Quit Session
{ key = "S", mods = "Control", chars = "\u0002%" }, # split window/pane vertically
{ key = "S", mods = "Control|Shift", chars = "\u0002\"" }, # split window/pane horizontally
{ key = "R", mods = "Control|Shift", chars = "\u0002r" }, # source config file
{ key = ";", mods = "Control|Shift", chars = "\u0002;" }, # navigate over to last pane
{ key = ",", mods = "Control", chars = "\u0002," }, # rename the window
{ key = "]", mods = "Control", chars = "\u0002]" }, # open sesh
{ key = "f", mods = "Control", chars = "zi\n" }, # open zi
]
[mouse]
bindings = [
{ mouse = "Right", action = "Copy" },
]
[general]
live_config_reload = true
working_directory = "None"
But I'm not sure why it's not working.
Offline
How do you determine that it's not working?
Are you using the same access pattern that works w/ ctrl+shift+c ?
Do you use a multiplexer like tmux?
Online
no I'm not using a multiplexer like tmux but I'm trying to simulate the access pattern that ctrl + shift + c does but using the right mouse click. So when I select a bunch of text with the right click, that should be inserted automatically in the clipboard instead of using ctrl + shit + c, and be able to send the output to other programs. that's what I want, I'm not so sure how can I do this in alacritty but I only using the default one. I don't think that using a theme to rice my alacritty should interfere with this requirement, because I send a short version of my toml file without the theme part.
What do you think could be my mistake ?
btw thanks for the help
Offline
I'm not so sure how can I do this in alacritty but I only using the default one
The suggested approach absolutely works here.
a theme to rice my alacritty should interfere with this requirement, because I send a short version of my toml file
Yes "should" … - post the entire config.
Ctrl+Shift+C works as does the primary buffer (select and middle click to paste)?
Online
The middle mouse click works as you said. Here is the entire config:
[window]
title = "Alacritty"
decorations = "none"
blur = true
opacity = 0.9
padding.x = 10
padding.y = 10
[window.dimensions]
columns = 160
lines = 80
[cursor.style]
shape= "Beam"
blinking = "Never"
[colors]
#transparent_background_colors = true
draw_bold_text_with_bright_colors = true
[env]
TERM = "xterm-256color"
[font]
glyph_offset = { x = 0, y = 0 }
normal.family = "IosevkaNerdFontMono"
normal.style = "Regular"
size = 12.0
[font.bold]
family = "IosevkaNerdFontMono"
style = "Bold"
[font.italic]
family = "IosevkaNerdFontMono"
style = "Italic"
[keyboard]
bindings = [
{ key = "T", mods = "Control", chars = "\u0002c" }, # create new window(aka tab)
{ key = "T", mods = "Control|Shift", chars = "\u0002!" }, # break pane into new window
{ key = "W", mods = "Control", chars = "\u0002x" }, # close window/pane
{ key = "N", mods = "Control|Shift", chars = "\u0002N" }, # open Floax
#{ key = "W", mods = "Control|Shift", chars = "\u0002w" }, # list windows
{ key = "W", mods = "Control", action = "Quit"}, #Quit Session
{ key = "S", mods = "Control", chars = "\u0002%" }, # split window/pane vertically
{ key = "S", mods = "Control|Shift", chars = "\u0002\"" }, # split window/pane horizontally
{ key = "R", mods = "Control|Shift", chars = "\u0002r" }, # source config file
{ key = ";", mods = "Control|Shift", chars = "\u0002;" }, # navigate over to last pane
{ key = ",", mods = "Control", chars = "\u0002," }, # rename the window
{ key = "]", mods = "Control", chars = "\u0002]" }, # open sesh
{ key = "f", mods = "Control", chars = "zi\n" }, # open zi
]
[mouse]
bindings = [
{ mouse = "Right", action = "Copy" },
]
[general]
live_config_reload = true
working_directory = "None"
# Themes --
import = [
# -- Themes --
"~/.config/alacritty/catppuccin-macchiato.toml",
]
The catppucin:
[colors.primary]
background = "#24273a"
foreground = "#cad3f5"
dim_foreground = "#8087a2"
bright_foreground = "#cad3f5"
[colors.cursor]
text = "#24273a"
cursor = "#f4dbd6"
[colors.vi_mode_cursor]
text = "#24273a"
cursor = "#b7bdf8"
[colors.search.matches]
foreground = "#24273a"
background = "#a5adcb"
[colors.search.focused_match]
foreground = "#24273a"
background = "#a6da95"
[colors.footer_bar]
foreground = "#24273a"
background = "#a5adcb"
[colors.hints.start]
foreground = "#24273a"
background = "#eed49f"
[colors.hints.end]
foreground = "#24273a"
background = "#a5adcb"
[colors.selection]
text = "#24273a"
background = "#f4dbd6"
[colors.normal]
black = "#494d64"
red = "#ed8796"
green = "#a6da95"
yellow = "#eed49f"
blue = "#8aadf4"
magenta = "#f5bde6"
cyan = "#8bd5ca"
white = "#b8c0e0"
[colors.bright]
black = "#5b6078"
red = "#ed8796"
green = "#a6da95"
yellow = "#eed49f"
blue = "#8aadf4"
magenta = "#f5bde6"
cyan = "#8bd5ca"
white = "#a5adcb"
[colors.dim]
black = "#494d64"
red = "#ed8796"
green = "#a6da95"
yellow = "#eed49f"
blue = "#8aadf4"
magenta = "#f5bde6"
cyan = "#8bd5ca"
white = "#b8c0e0"
[[colors.indexed_colors]]
index = 16
color = "#f5a97f"
[[colors.indexed_colors]]
index = 17
color = "#f4dbd6"
I notice I have a separte keybdinigs.toml also:
[keyboard]
bindings = [
# switch tabs
{ key = "1", mods = "Control", chars = "\u00021" },
{ key = "2", mods = "Control", chars = "\u00022" },
{ key = "3", mods = "Control", chars = "\u00023" },
{ key = "4", mods = "Control", chars = "\u00024" },
{ key = "5", mods = "Control", chars = "\u00025" },
{ key = "6", mods = "Control", chars = "\u00026" },
{ key = "7", mods = "Control", chars = "\u00027" },
{ key = "8", mods = "Control", chars = "\u00028" },
{ key = "9", mods = "Control", chars = "\u00029" },
{ key = "T", mods = "Control", chars = "\u0002c" }, # create new window(aka tab)
{ key = "T", mods = "Control|Shift", chars = "\u0002!" }, # break pane into new window
{ key = "Z", mods = "Control", chars = "\u0002z" }, # detach tmux session
{ key = "W", mods = "Control", chars = "\u0002x" }, # close window/pane
{ key = "N", mods = "Control|Shift", chars = "\u0002N" }, # open Floax
{ key = "W", mods = "Control|Shift", chars = "\u0002w" }, # list windows
{ key = "Q", mods = "Control|Shift", chars = "\u0002Q" }, # Quit Session
{ key = "S", mods = "Control", chars = "\u0002%" }, # split window/pane vertically
{ key = "S", mods = "Control|Shift", chars = "\u0002\"" }, # split window/pane horizontally
{ key = "R", mods = "Control|Shift", chars = "\u0002r" }, # source config file
{ key = "D", mods = "Control|Shift", chars = "\u0002d" }, # detach tmux session
{ key = ";", mods = "Control|Shift", chars = "\u0002;" }, # navigate over to last pane
{ key = ",", mods = "Control", chars = "\u0002," }, # rename the window
{ key = "]", mods = "Control", chars = "\u0002]" }, # open sesh
{ key = "f", mods = "Control", chars = "zi\n" }, # open zi
]
But I'm not sure if the last file is recognize by alacrity, since is not mentioned in the alacritty.toml
nevertheless thanks for the help
Offline
The middle mouse click works as you said.
What about "Ctrl+Shift+C"?
Online
Ctrl+Shift+C works, but I want that in the right click of the mouse as you know before
Offline
I just wanted to make sure that teh overall clipboard implementation isn't broken.
Can you bind the mouse key to eg. "IncreaseFontSize"?
Online
you mean like this ? :
[mouse]
bindings = [
{ mouse = "Right", action = "IncreaseFontSize" },
]
That doesn't work if that's the case, when I just click the font size doesn't change in the terminal. I use dwm as you know, but for example in my firejail applications I can send data to the clipboard buffer to another unsandboxed application, like my terminal emulator, and also I can do the same but backwards.
Last edited by Succulent of your garden (2025-02-23 16:52:07)
Offline
Means either the config isn't applied or the mouse click doesn't make it to alacritty.
More luck with either
[mouse]
hide_when_typing = true
bindings = [
{ mouse = "Right", mods = "Control", action = "IncreaseFontSize" },
]
or
[mouse]
hide_when_typing = true
bindings = [
{ mouse = "Left", mods = "Control", action = "IncreaseFontSize" },
]
and also make sure that "hide_when_typing = true" applies, ie. that the cursor disappears the when you start typing.
Have you tried the behavior w/ a different WM, eg. openbox?
Online
both configuration suggested works in alacritty but if for example I change to this:
[mouse]
hide_when_typing = true
bindings = [
{ mouse = "Left", mods = "Control", action = "Copy" },
]
That doesn't works :C
EDIT: Also the mouse hiding works, in every mouse toml config, including this one in my post.
Last edited by Succulent of your garden (2025-02-24 18:45:05)
Offline
How do you select the text to be copied?
W/ the mouse or the keyboard?
Do you use a clipboard manager?
Online
I select the text by using left Ctrl + selecting the text using the left click of the mouse.
So I use both, but I don't want to use control, but if alacritty doesn't allow me to copy with only the mouse, then could be in consideration.
I don't use a clipboard manager ? that could be the issue ? The main clipboard buffer works in other applications, even in sandbox mode.
Offline
Why are you holding ctrl?
if alacritty doesn't allow me to copy with only the mouse
Alacritty as pretty much every X11 client ever written supports the primary selection buffer.
Select some text then middle-click somewhere else. Boom.
Online
When I use the middle-click the same text selected get pasted after the same text in the terminal emulator.
I'm using ctrl because of the mods in the code in the previous post:
[mouse]
hide_when_typing = true
bindings = [
{ mouse = "Left", mods = "Control", action = "Copy" },
]
Last edited by Succulent of your garden (2025-02-27 19:17:51)
Offline
I'm using ctrl because of the mods in the code in the previous post:
Ok, but that would require you to select some text, then hold ctrl, then click the left button.
When I use the middle-click the same text selected get pasted after the same text in the terminal emulator.
What?
You select some text, that's not in the primary buffer, then you click the middle button (in alacritty or wherever else), the primary buffer now gets pasted there.
Online
Thanks for the info. It seems that the middle-click is able to receive well the output from the primary buffer, and now understand why paste the same text selected. By some reason the copy functionality is been attached to the contrary mouse click, in this case is the right bottom. Using ctrl + right click does copy to the clipboard well. But the mouse config said is the Left bottom. I don't know why that is happening, well at least is an improvement.
Offline
Are your mouse buttons logically reversed?
xev -event mouse
will tell you what you're pressing.
1: left
2: middle
3: right
Online
It does show me that the left bottom is 1, and the other ones are okey. I'm going to change the config to right click and see if it change to the left click.
Offline
You would not believe this Seth: I using this I manage to set the copy in the left click without using ctrl, also with ctrl works.
[mouse]
hide_when_typing = true
bindings = [
{ mouse = "Right", mods = "Control", action = "Copy" },
]
I dont' know how but it works LoL. What do you think ? At least the main requirement is satisfied.
Last edited by Succulent of your garden (2025-02-28 12:43:00)
Offline
{ mouse = "Right", mods = "Control", action = "Copy" }
leading to
copy in the left click without using ctrl, also with ctrl
is either an egregious bug (that I cannot reproduce) or a misperception and I highly suspect some clipboard manager to be at play.
loginctl session-status
Online