There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

linux

This magazine is from a federated server and may be incomplete. Browse more on the original instance.

dlarge6510 , (edited ) in How to make it such that, when running `command`, it automatically does `SOME_ENV_VAR=value command`? (something cleaner than aliases?)

Put your aliases in .bash_aliases

Make sure your .bashrc sources .bash_aliases like this:

if [ -f ~/.bash_aliases ]; then . ~/.bash_aliases fi

2xsaiko , in Why is copy and paste so difficult for Linux to solve?
@2xsaiko@discuss.tchncs.de avatar

I’ve only ever had this problem for the first few janky years of Wayland. Not anymore.

dlarge6510 , in Why do we need tiling window managers when we have tmux?

I’ve tried hard to get libreoffice and dvddisaster to render in a terminal but for some reason it never works… 😏

SteveTech ,

You could probably get it to work in a framebuffer… 😏

Probably not though, although some apps like mpv, (maybe vlc) and mplayer can, plus QT and a GTK fork have support too.

dlarge6510 ,

Mplayer can render to the terminal using aalib

SteveTech ,

I guess if you have to use a classical terminal or terminal emulator, but I was more talking about drawing apps directly to the Linux console without X or another sort of windowing system.

For example this is Midori, a web browser: https://higfxback.github.io/midori-linux-framebuffer.png

dlarge6510 ,

Well yes I thought you were using emulators. When I was a kid I would frequently break X11 so I spent much of my time on the console framebuffer. All I needed it to to is let me watch TV and videos till I was bothered to fix the config file for X

linuxFan , in Why is copy and paste so difficult for Linux to solve?
@linuxFan@vlemmy.net avatar

Linux has 2 clipboards. You’re mixing the two. askubuntu.com/…/two-clipboards-possible

kolorafa , in Why is copy and paste so difficult for Linux to solve?

@BaconIsAVeg

Linux running X11 has 2 clipboards:

  • oldschool ( from terminal-only era ) => copy by selecting text (mostly in terminals) and paste using middle mouse click
  • more modern new style ( based on graphical interfaces ) => copy by ctrl+c (or ctrl+shift+c in terminals and such) and paste ctrl+v (ctrl+shift+v in terminals …)

Normally both those clipboards work independent as they are handled by 2 different processes, so you can for example copy one text using ctrl+c and copy another text by only selecting second text, then you can paste both, one with middle click, second with ctrl+v

More and more distro have a clipboard managers that have a feature to “sync” both clipboards, but it’s a lot of time disabled because it’s more confusing people and sometimes annoying. Why it’s confusing and disabled by default? Imagine that you selected some text, then did a ctrl+c, you move to some word document, select text, remove it, and want to Paste it. Guess what, the selecting you did to remove text did copy the selection to clipboard overriding what you did have there from ctrl+c.

Most if not all terminal emulators (konsole, gnome-terminal, xterm) support both clipboard styles, old-school select to copy, and new one but because the “ctrl+c” shortcut reserved to stop/interrupt applications they all decide to use ctrl+shift+c to do a copy. And yes, not only terminal emulators use ctrl+shift+c, I did have few encounters on some random apps, but most of the time, if ctrl+c is used for something else, ctrl+shift+c was available.

BaconIsAVeg OP ,

Yes this makes sense. I’ve been using terminals for years with the ‘copy on highlight’ feature enabled, and I’m pretty sure when I was on OSX it was a single buffer.

I can see how having mouse selected text end up in the buffer on a non-Terminal app would probably not be the desired behavior.

I found ‘autocutsel’ which will keep PRIMARY and CLIPBOARD in sync, however Gnome Terminal doesn’t seem to support ‘copy on highlight’ while Terminator does.

DamnOrangeCat ,

A very comprehensive and complete reply. I did know about the different clip buffers but reading this was still so good because no one was actually explaining it. Thanks

what ,

I have been using desktop Linux for years and never realized… thanks!

Fleppensteijn , in Why is copy and paste so difficult for Linux to solve?
@Fleppensteijn@feddit.nl avatar

From what I understood is that the functionality that pastes selected text with middle-click is coded deep in the Linux kernel, so it doesn’t even use a clipboard and it would be hard to get rid of this functionality. As others mentioned, using normal copy-paste commands (ctrl+shift+c) shouldn’t be a problem because it uses a clipboard.

sovietsnake , in Why is copy and paste so difficult for Linux to solve?
@sovietsnake@lemmygrad.ml avatar

As far as I know that happens because in Linux ctrl+v and middle click pastes are stored in different places and are considered different things, in fact there’s a third way to paste which I don’t remember. But basically the middle click paste is used whenever you select a string, there’s no need to copy it, and the ctrl+v paste works when you do ctrl+c.

juliette , in Share Your Favorite Linux Distros and Why You Love Them

Linux From Scratch

juliette ,

Puts you in control of everything

bslinux ,

I did that once, probably 20 years ago now. Never again.

dlarge6510 , (edited ) in Why is copy and paste so difficult for Linux to solve?

Middle click in chrome…

If you want to use ctrl-v you need to the newer method of ctrl-shift-c first. It uses shift for the same reason windows does in a command prompt, ctrl-c is a reserved combination.

Not a Linux issue. Two different paradigms one older than the other, chose which is best to use.

On my laptop’s I use ctrl-shift-c and ctrl-shift-v due to not having a middle click. With a mouse I middle click instinctively.

ik5pvx ,

You can set the touchpad to emulate third button by clicking left and right together. this setting is buried in the mouse configuration options and usually disabled by default.

dlarge6510 ,

Yes I have used that in the past but it’s way to finniky in operation as it sometimes registers a left or right click instead.

ik5pvx , in Why is copy and paste so difficult for Linux to solve?

There are two copy/paste buffers. The one you get with just the mouse is not the same as the one you get with ctrl-c ctrl-v. And frankly, once you know this, it’s f*ing awesome. If you really want a single buffer, there are apps that do that.

BaalInvoker , in Why is copy and paste so difficult for Linux to solve?

Have you tried ctrl+shift+c to copy from terminal?

Terminal shortcuts to copy and paste are different, because ctrl+<letter> may be a command

julianh ,

Yeah this is probably the best way to do it. I think(?) the middle-click copy/paste has a separate buffer so you should use it separately from ctrl+c and ctrl+v.

redcalcium ,

Yes, never have this problem thanks to the trusty ctrl+shift+c and ctrl+shift+v.

primeraziel ,

I have this problem the other way around, I always try to copy with ctrl shift c, out of muscle memory, but in chrome it opens up the devtools instead

saucyloggins ,

You and me both. The worst is I have to use Teams for work and Ctrl+Shift+C is the shortcut to call the person you’re chatting with.

Nuuskis , in Why is copy and paste so difficult for Linux to solve?

What I’d like to see is a clipboard history which pastes the content into cursor with just mouse click/enter.

animist ,

Clipboard indicator might be what you’re looking for, unless I misunderstood your comment

Andy , (edited ) in How to make it such that, when running `command`, it automatically does `SOME_ENV_VAR=value command`? (something cleaner than aliases?)
@Andy@programming.dev avatar

If you were using Zsh, one way you could do this is by autoloading function files from a folder in your fpath.

Let’s say you’re using ~/.local/share/zsh/site-functions for your custom functions. To ensure that folder is an early part of your fpath, put something like this within your .zshrc:

<pre style="background-color:#ffffff;">
<span style="color:#323232;">typeset -U fpath=(~/.local/share/zsh/site-functions $fpath)
</span>

Then let’s say you want to override the uptime command. Add a file ~/.local/share/zsh/site-functions/uptime with content like:

<pre style="background-color:#ffffff;">
<span style="color:#323232;">NO_COLOR=1 =uptime
</span>

Explanation for the second =:=’ expansion If a word begins with an unquoted =’ and the EQUALS option is set, the remainder of the word is taken as the name of a command. If a command ex‐ ists by that name, the word is replaced by the full pathname of the command.

The last thing you need to do is mark it for autoloading, in your .zshrc:

<pre style="background-color:#ffffff;">
<span style="color:#323232;">autoload -Uz uptime
</span>

Instead of listing those functions manually as arguments, you could instead use a glob pattern to collect all those names, excluding any which begin with _ (completion functions):

<pre style="background-color:#ffffff;">
<span style="color:#323232;">autoload -Uz ~/.local/share/zsh/site-functions/[^_]*(:t)
</span>
s_s , in Why do we need tiling window managers when we have tmux?

while having a full desktop environment for all other applications.

What if I don’t want that?

MoriGM , in which linux podcasts do you listen to?
@MoriGM@feddit.de avatar

For English, I can recommend:
Linux Action News
Linux Unplugged
The Linux Experiment
He has even an lemmy community feddit.de/…/[email protected]

German: TuxRadio

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines