[-] Communist@lemmy.ml 47 points 2 months ago

I desperately want to know what he thinks his worst idea is

18
submitted 3 months ago* (last edited 3 months ago) by Communist@lemmy.ml to c/linux@lemmy.ml

I use the following oneliner to switch sinks:

wpctl set-default $(pw-cli i $(pactl list short sinks | awk '{print $2}' | sd 'easyeffects_sink\n' '' | sd "$(pactl get-default-sink)\n" '' | rg '.' || echo "$(pactl get-default-sink)" | tofi --prompt-text " " --height 40% --width 40% --auto-accept-single true ) | rg -oP 'id: \K\w+') && notify-send --urgency=low --icon=/usr/share/icons/Flat-Remix-Red-Dark/panel/audio-volume-high-symbolic.svg "$(pactl list sinks | rg -A 1 "Name: $(pactl get-default-sink)" | rg Description: | sd ' Description: ' '')" -h string:x-canonical-private-synchronous:sink-state && pw-play --volume=0.2 /usr/share/sounds/freedesktop/stereo/audio-volume-change.oga &!

This is great, however, i'd like it if the sink menu showed the descriptions for selection instead of the actual sink names

I've started a script like the following:

RET=$(pactl list sinks | rg Description: | sd '	Description: ' '') | tofi
case $RET in
	pactl list sinks | rg Description: | sd '	Description: ' '') pactl list short sinks | awk '{print $2}'
esac

but that doesn't seem to work at all, any ideas for how to get this working?

edit: I found a better solution

$sinkswitch = wpctl set-default $(pw-cli i $(pactl list sinks | rg --fixed-strings -B 1 "$(pactl list sinks | rg Description: | sd ' Description: ' '' | sd 'Easy Effects Sink' '' | sd --fixed-strings "$(pactl list sinks | rg -A 1 "Name: $(pactl get-default-sink)" | rg Description: | sd ' Description: ' '')" '' | rg '.' || echo "$(pactl list sinks | rg -A 1 "Name: $(pactl get-default-sink)" | rg Description: | sd ' Description: ' '')" | tofi --prompt-text " " --height 40% --width 40% --auto-accept-single true )" | rg Name: | awk '{print $2}' ) | rg -oP 'id: \K\w+') && notify-send --urgency=low --icon=/usr/share/icons/Flat-Remix-Red-Dark/panel/audio-volume-high-symbolic.svg "$(pactl list sinks | rg -A 1 "Name: $(pactl get-default-sink)" | rg Description: | sd ' Description: ' '')" -h string:x-canonical-private-synchronous:sink-state && pw-play --volume=0.2 /usr/share/sounds/freedesktop/stereo/audio-volume-change.oga &!

20
submitted 3 months ago* (last edited 3 months ago) by Communist@lemmy.ml to c/linux@lemmy.ml

I currently use the following one-liner to switch between sinks

pactl set-default-sink $(pactl list short sinks | awk '{print $2}' | sd 'easyeffects_sink\n' '' | sd "$(pactl get-default-sink)\n" '' | tofi --prompt-text " " --height 40% --width 40% --auto-accept-single true ) && pw-play --volume=0.2 /usr/share/sounds/freedesktop/stereo/audio-volume-change.oga

It seems wpctl doesn't currently support node.names which makes this significantly more complex, has anyone done something similar with wpctl? I've found a massive script but I want something more simple that's a one-liner.

wpctl set-default $(pw-cli i $(pactl list short sinks | awk '{print $2}' | sd 'easyeffects_sink\n' '' | sd "$(pactl get-default-sink)\n" '' | tofi --prompt-text " " --height 40% --width 40% --auto-accept-single true ) | rg -oP 'id: \K\w+')

closest I've managed so far is this, which at least makes it so that wpctl sets the sink, which is an upgrade, I guess, but there's still two pactl's to eliminate...

87
submitted 3 months ago* (last edited 3 months ago) by Communist@lemmy.ml to c/linux@lemmy.ml
bindntr=CTRL,C,exec,hyprctl dispatch closewindow alacrittyclipboard & hyprctl activewindow | rg -q "class: Wfica" && alacritty -qq --config-file ~/.config/alacritty/alacrittyclipboard.toml --class 'alacrittyclipboard' --title 'Office365 Desktop - Nexus (SSL/TLS Secured, 256 bit)' -e sh -c 'sleep .03 && xclip -o | wl-copy'
windowrulev2 = float,class:(alacrittyclipboard)
windowrulev2 = stayfocused,class:(alacrittyclipboard)
windowrulev2 = noborder,class:(alacrittyclipboard)
windowrulev2 = noanim,class:(alacrittyclipboard)
windowrulev2 = noblur,class:(alacrittyclipboard)
windowrulev2 = opacity 0,class:(alacrittyclipboard)
windowrulev2 = maxsize 1 1,class:(alacrittyclipboard)

i've done it, I've finally figured out a workaround for this stupid bug that has existed on my system for the last 10 years. the citrix clipboard now works properly, this is the glueyest dumbest thing i've ever had to do and i've spent literally years trying to figure it out, turns out the wayland protocol forbids windows that don't have focus from accessing the clipboard, so, i had to make a window, it had to be focused for enough time for it to be recognized and it was a whole thing. Here you go for anybody that needs it, should be relatively easy to adapt from hyprland over to whatever. Fuck.

2
submitted 4 months ago* (last edited 4 months ago) by Communist@lemmy.ml to c/fuck_ai@lemmy.world

I have no idea why, I've made a single comment here one time and never asked for this, but I promise to be a benevolent dictator

[-] Communist@lemmy.ml 35 points 4 months ago

I'm excited for arm improvements.

[-] Communist@lemmy.ml 31 points 5 months ago* (last edited 5 months ago)

It's not even an indicator, there's places where the opposite is true, this is like the myth of the vertical slit pupils meaning they're venomous, there's no actual correlation, this just coincidentally works in areas with few snake species, but you'd have to know that ahead of time, and since there's few species wherever this does work, you might as well just learn what the venomous snakes look like so this is practically completely useless.

This usually happens when somebody learns that in their local area this rule applies, and then assumes it applies everywhere.

[-] Communist@lemmy.ml 63 points 5 months ago

this isn't even true

[-] Communist@lemmy.ml 33 points 5 months ago* (last edited 5 months ago)

...the OS isn't proprietary, there's one piece of proprietary software installed. (not counting blobs)

Steam is an app, not an operating system.

[-] Communist@lemmy.ml 38 points 5 months ago

Is there anything wrong with that? Hahaha, it's pretty similar but not quite that

77
submitted 5 months ago* (last edited 5 months ago) by Communist@lemmy.ml to c/linux@lemmy.ml

I have a dumb work related chrome thing, i'd like to make it so that when a certain notification sound plays in chromium, my computer does a few things automatically for me

Does anyone know a good way to make this happen?

I imagine it'd have to be setup like:

when chrome starts playing audio && check if that audio matches soundfile.ogg && myscript.sh, but I don't know any good cli utilities that could get something like that done, and if there are any better ideas!

edit: to avoid X/Y issues i've summarized the problem in full here:

  1. I have a work program, this notifies me if I get a call or email, the work program then presents an accept/decline page, and does not proceed until I either accept, decline, or it times out.
  2. I want it to do two different things depending on if it's a call or email
  3. It provides no notification other than the sound and an "accept" button on the page
  4. I have a chrome window open that does nothing but this, and I never use chrome for anything else
  5. I want to automatically do various things when I receive either this call or email
  6. I want it to be broadly applicable rather than a script designed for the specific website giving me the notification (so not a chrome extension). This prevents me from having to update any code in the event that the backend changes dramatically, and even if the notification sound changes, i'd just record a new sound as the activation noise.
  7. The noise is always the same, and hasn't changed for many years, and there is a distinct noise between calls and emails
  8. They never overlap, they never play multiple times at the same time, and they never make any noises other than those two. The noises are distinct.

These factors cause me to want to run a script once the noise is recognized, only if the noise is playing in a particular app. I'm using pipewire/hyprland on arch.

My current plan for isolating the noise is to do the following:

pactl load-module module-combine-sink sink_name='Work' slaves='easyeffects_sink'

and then set chrome exclusively to play audio on work.

Then set a script to check the sink work for audio that matches what I want. That should be simpler than the other methods i've seen to isolate the noise.

[-] Communist@lemmy.ml 139 points 5 months ago

Absolutely not, that guy is eating marketing

80
submitted 5 months ago* (last edited 5 months ago) by Communist@lemmy.ml to c/linux@lemmy.ml

in my config file exists...

exec-once = zsh -c 'sleep 1' && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar && waybar

Why? Because waybar crashes sometimes when I turn my monitor off/on, I documented this here: https://github.com/Alexays/Waybar/issues/3047

...this opens waybar if it crashes... and if that crashes, it opens another waybar, and you'll notice, if that one crashes, it opens another one... now you may have seen the pattern here but in case you didn't, that one will then lead to another waybar...

Is there a less ridiculous way of making waybar open every time when waybar crashes, giving me better fault tolerance?

8
submitted 6 months ago by Communist@lemmy.ml to c/python@programming.dev

cross-posted from: https://lemmy.ml/post/13397153

I'm just trying to control my smartlights with a script, it seems to be having a lot of problems, I really don't know what I'm doing, i'd appreciate any help I can get

Once I have a script that can individually turn lights on/off i can edit the rest myself, I just can't get the base functionality working.

5
submitted 6 months ago* (last edited 6 months ago) by Communist@lemmy.ml to c/python@lemmy.ml

I'm just trying to control my smartlights with a script, it seems to be having a lot of problems, I really don't know what I'm doing, i'd appreciate any help I can get

Once I have a script that can individually turn lights on/off i can edit the rest myself, I just can't get the base functionality working.

[-] Communist@lemmy.ml 39 points 6 months ago* (last edited 6 months ago)

Manjaro should not even be considered in the modern distro landscape, the story of manjaro is just a series of incompetent mistakes.

[-] Communist@lemmy.ml 34 points 6 months ago

He looks real proud of himself

33
submitted 7 months ago* (last edited 7 months ago) by Communist@lemmy.ml to c/linux@lemmy.ml

I'm trying to improve the clipboard sync situation, i've realized that if I can make it so that a bindsym only applies when an xwayland window is in focus, I can basically do

bindsym --release Control+c exec "xclip -o | wl-copy"

And it'll automatically sync the clipboard... however, I can't find a way to make the bindsym only run on xwayland windows, as, if this runs on a wayland window, it'll just overwrite the wayland clipboard with the last xwayland clipboard.

I've discovered you can match all xwayland windows with "swaymsg [shell='xwayland']" but I can't figure out how to make a bindsym only work if that is in focus

edit: I figured out the following:

bindsym --release Control+c exec swaymsg -t get_tree | jq '.. | select(.type?) | select(.focused==true) | .shell' | grep -Eq 'xwayland' && xclip -o | wl-copy

^^ that SHOULD WORK in theory, but it doesn't, because xclip outputs what it remembers as soon as the command starts, and as a result, the string gets messed up... I cannot figure out for the life of me why running "xclip -o | wl-copy" fixes it but not that. please help.

bindsym --release Control+c exec swaymsg -t get_tree | jq '.. | select(.type?) | select(.focused==true) | .shell' | grep -Eq 'xwayland' && [xclip -o | wl-copy]

^^does not fix it, unfortunately

here's an issue tracker: https://github.com/swaywm/sway/issues/7958

22
submitted 8 months ago* (last edited 8 months ago) by Communist@lemmy.ml to c/linux@lemmy.ml

I noticed on startup my computer is saying "Failed to start D-bus system message bus"

my sway session would not start

I switched to dbus-deamon-units and now sway will start with seatd, but i can't, for example, use notify-send as it says

Error spawning command line “dbus-launch --autolaunch=82fe279a661a4ecdb58cb22596899103 --binary-syntax --close-stderr”: Child process exited with code 1

I suspect I may have setup dbus to run as root with systemctl or something? but I have no idea what's going on and have been at this for hours, any advice would be helpful

Also, it takes two attempts to run commands, zsh is saying

zsh: corrupt history file

edit: I discovered pacman was lying to me about dbus-daemon-units being installed, and dbus-broker is now running fine at a user level and dbus at the system level, but if I setup dbus broker as root everything breaks, I dunno

[-] Communist@lemmy.ml 41 points 11 months ago

I don't understand why anyone cares. I'm pro-repost bot, whether a real human posts the content or not makes no difference to me, I just want the content.

[-] Communist@lemmy.ml 29 points 11 months ago* (last edited 11 months ago)

Google is extremely insufficient for this due to the insane level of propaganda on BOTH sides of the issue. The only way to get this information is to read theory from the actual philosophers, IMHO, and that's asking a lot.

And that's not even getting into the terminology you have to learn just to understand the philosophers.

For example: most people are under the impression that private property is things that normal people own... but that's not even a little bit what marx means when he says abolish private property, you'll note, that would be insane.

[-] Communist@lemmy.ml 62 points 11 months ago* (last edited 11 months ago)

There are no countries with socialist policies.

Can you name a country that has workplace democracy? No? Then there isn't a socialist country out there.

Would I move to the social democracies of the world? I love norway and whatnot politically (as much as a communist can love the state of any country)... but I love having warm air and nature I can enjoy without a coat much more.

-1
submitted 1 year ago by Communist@lemmy.ml to c/fediverse@lemmy.ml

What's stopping us from using the api to post all of reddit here in a massive one-time merger?

Obviously the Lemmy devs would have to do it, but would there be legal issues? I think it would solve most of the problems with Lemmy, really.

view more: next ›

Communist

joined 4 years ago
MODERATOR OF