• 6 Posts
  • 8 Comments
Joined 8 months 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.