• 14 Posts
  • 11 Comments
Joined 1 year ago
cake
Cake day: November 18th, 2024

help-circle








  • find /your/mp3/directory -type f -name "*.mp3" -exec test -f "/your/mp3/directory/$(basename -s .mp3 {}).txt" \; -exec mp3splt -A "/your/mp3/directory/$(basename -s .mp3 {}).txt" {} \;
    

    This one liner should still work, even if your file names have spaces in them because find now looks at each individual match, not the entire output. Using a for loop with the results of find would create a lot of extra pieces of the file names because spaces separate the arguments. However, this single command is harder to read than using a for loop.

    The idea behind this one is that search operators in find evaluate to true or false. The first exec tells find to run the second exec only if the file exists. If the file doesn’t exist, it just ignores it.


  • Watching this video brought back memories of when I first started using Linux. I really connected with him. Linux makes you feel like you have a lot of control – like you can change things easily. Windows, on the other hand, often feels frustrating and doesn’t really help you much.

    What I noticed about the video is that he encourages you to try new things and be willing to make mistakes. He doesn’t seem to get upset when things go wrong, which I think is helpful for viewers. He also admits that Linux isn’t for everyone, which is a realistic acknowledgement. It’s a good video for introducing Linux, but it doesn’t overhype it either.





  • First, make sure to include the full path to the script in your config file, like exec /home/your_username/path/start_cmus.sh or exec ~/path/start_cmus.sh. If you just use ./start_cmus.sh, there will be a complaint as it doesn’t know where to look for the script.

    Another thing to keep in mind is that swaymsg is usually the better choice (man sway) when you want to send commands to sway. You can write your script as swaymsg -t command 'workspace 10; exec wezterm -e cmus' and then put the whole thing in your config file.

    To make debugging easier, I like to add some echo or notify-send commands to my script to see if it’s working as expected. I’ll put those in my config file, run it, and check if the debug commands are being executed correctly like echo "first: $first_output" && commands && echo "second: $second_output". It’s a simple trick that can save you a lot of time. Also, don’t forget to check out journalctl for more info.






  • This isn’t an echo chamber. You and I are on Lemmy, and we, lemmings, love free and open-source software. But I bet you that many people still use proprietary software as their daily drivers. Many of them still use Windows as their main OS, and many are still on iOS. However, that’s not the end of the story. They also use plenty of FOSS software, like Firefox, VLC (you can’t deny the love of people for VLC), OBS, and qBittorrent. And that’s a good thing! It’s not a binary choice that you have to either go this way or this way. That’s not healthy.

    Even if this is an echo chamber, so what? I see it as an effort to set a norm for the community. ‘Hey, I love Linux, you should try it!’ ‘I have the same experience, you should give it a go.’ ‘I’ve used Linux for a long time and I love it, feel free to ask me any questions.’ When there are many people willing to help, others are less scared to try new things. And when we move together, we fear nothing!