Saturday, April 27, 2024
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 8773  / 2 Years ago, sat, october 22, 2022, 1:10:47

I would like to change the colour displayed of some folders when I do ls.



Right now I have a directory with movies and I would like to be able to see the ones that I haven't seen in a different colour of the ones that I have already seen.



Anyone can help me?



Thanks!


More From » command-line

 Answers
4

There isn't really a way to make it automatically change the color of a folder or file that you view, but you could do something with changing the permissions on the file, to make it change colors after viewing the movie. First, we will make sure that we have color enabled in our terminal. If you already see different colors for stuff in terminal, you can skip this step.



Edit ~/.bashrc, and make sure to uncomment the following line, if it is commented (simply remove the leading #'s)



#force_color_prompt=yes


You will have to close and re-open a terminal for this to take affect. Now that we have color in the terminal, a simple way to "mark movies as watched" would be to play with the permissions.



If your movies are all files, you could do something like setting the executable bit, which would make them green, by default. This shouldn't really be much of a security issue.



chmod +x MyMovie.mkv


If your movies are stored in separate folders, and you want to mark the containing folder as watched, you could do something like adding the sticky bit, which means that only the owner/creator of the folder (and files within the folder) can delete/rename them. In a typical household scenario, this shouldn't pose any real security risks (in fact, it would be more secure). This will make the "watched" movie show up as white, with a blue background.



chmod +t MyMovieFolder

[#34731] Sunday, October 23, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
uestred

Total Points: 464
Total Questions: 104
Total Answers: 112

Location: Israel
Member since Wed, Apr 14, 2021
3 Years ago
;