1767 Commits

Author SHA1 Message Date
Emre AKYÜZ
d68ba937be
Add robust error handling 2023-11-19 17:13:36 +03:00
Emre AKYÜZ
e259c2af0a
Make dmenu case insensitive 2023-11-19 00:54:48 +03:00
Emre AKYÜZ
9d921b33af
Add dropdown menu 2023-11-18 23:43:26 +03:00
Emre AKYÜZ
4c80fed876
fgrep outputs a deprecation message 2023-11-18 22:39:31 +03:00
Emre AKYÜZ
18018b18ff
fgrep is 0.00001% faster and safer. 2023-11-10 09:55:38 +03:00
Emre AKYÜZ
533c21c3af
Use RAM instead of I/O | Minimize further 2023-11-09 11:25:02 +03:00
Emre AKYÜZ
fe8f0bce94
improve && simplify 2023-10-18 03:04:57 +03:00
Emre AKYUZ
6476766a21
Extremely Simple and Efficient Script I Think You Like
The inspiration: (Luke Smith's Video: "Unix Chad JUST WON'T STOP Piping!" youtu.be/w_37upFE-qw

Execution Time: 0.15s to 0.30s on my system (opening a video then closing it to see the output of "time" command)

Very Short Summary: 
1- This script feeds the "dmenu" with a list of all videos in a hard drive.
2- File paths and extensions are removed for better readability for the dmenu list.
3- Opens the chosen video file in "mpv" using the complete paths and extensions.
4- An approach of having the least amount of lines & characters while keeping the simplicity and performance has been used.

updatedb command needs to be executed at first showing the database file "~/.config/.mymlocate.db" Or the script should be changed with a new path.
For example: $updatedb -o ~/.config/.mymlocate.db -U /mnt/externaldrive

Thoroughly detailed explanation for everyone:

temp_file=$(mktemp): This command creates a temporary file using the mktemp command and stores its path in the temp_file variable. This temporary file will be used later to store the search results.

locate -d ~/.config/.mymlocate.db -b -r '.*\.\(mp4\|mkv\...)$': This command searches for files with the ".mp4" or other extension in the database located at "~/.config/.mymlocate.db". The -d flag specifies the database path, the -b flag searches for files with matching base names (ignores the path), and the -r flag allows the use of regular expressions for matching.

awk -F/ '{name=$NF; gsub(/\.(mp4|mkv)$/, "", name); print name "\t" $0}': This command processes the search results obtained from the locate command. It uses / as a field separator and works on each line of the output:
name=$NF: Stores the last field (file name with extension) in the name variable.
gsub(/\.(mp4|mkv)$/, "", name): Removes the ".mp4" or ".mkv" file extension from the name variable.
print name "\t" $0: Prints the modified file name (without extension) followed by a tab character and the original line (complete file path with the extension).

> "$temp_file": Redirects the output of the previous awk command to the temporary file created earlier.

chosen_file_name_and_path=$(cut -f1 "$temp_file" | dmenu -i -l 10 -p "Select a video file:"): This command reads the file names without extensions from the temporary file, presents them to the user using dmenu, and stores the user's selection in the chosen_file_name_and_path variable. The cut -f1 command extracts the file names, and the dmenu -i -l 10 -p "Select a video file:" command displays the list in a menu with a prompt.

mpv "$(awk -F'\t' -v chosen="$chosen_file_name_and_path" '$1 == chosen {print $2; exit}' "$temp_file")": This command plays the selected file using mpv. It uses awk to search the temporary file for the line where the first field (file name without extension) matches the user's selection and then extracts the second field (the complete file path with the extension) to pass it as an argument to the mpv command.

&& rm "$temp_file": After the mpv command has finished executing, this command removes the temporary file.
2023-04-22 11:46:47 +03:00
Luke Smith
77fd62b9f3
Merge branch 'master' of github.com:LukeSmithxyz/voidrice 2023-04-20 09:21:17 -04:00
Luke Smith
65378ab944
sb-price improvements 2023-04-20 08:48:34 -04:00
Luke Smith
b719590427
use built-ins, close #1297 2023-04-20 08:47:39 -04:00
anggatd
c08949ebd2
Change LibreOffice binaries to libreoffice (#1294)
In the current update, the libreoffice package doesn't have any binary for libreoffice writer, calc, impress, draw, etc. So it's better to open all of the document using the 'libreoffice' binary as it can work in the old version of libreoffice as well as the new one.
2023-04-20 12:32:31 +00:00
snailed
d4ff2ebaf3
fix shellcheck (#1301)
Shellcheck wines when printf doesn't get an argument
2023-04-12 12:11:29 +00:00
Mathieu Rollet
5c92a1770f
Set GOMODCACHE to comply with XDG (#1299)
If GOMODCACHE is not set, it defaults to $GOPATH/pkg/mod
cf. https://go.dev/ref/mod#environment-variables
2023-04-12 12:10:42 +00:00
RealAestan
a94ee62680
dmenuunicode: don't use variables in the printf format string (#1284)
It works but the good practice is to use `printf "..%s.." "$foo"`
see https://www.shellcheck.net/wiki/SC2059
2023-04-03 14:07:54 +00:00
Luke Smith
5a6c56d565
efficiency and fail tweaks 2023-03-31 09:44:59 -04:00
Luke Smith
749f74f84e
Merge branch 'LalleSX-patch-1' 2023-03-24 17:49:43 -04:00
Luke Smith
07b0fbcce2
fix name 2023-03-24 17:49:38 -04:00
Lalle
a558356ecf
Added Larbs commits RSS 2023-03-24 21:10:26 +01:00
Luke Smith
4537bce2c2
check scripts to avoid rerunning remapd 2023-03-23 22:06:10 -04:00
Luke Smith
0e2cd987dc
Merge branch 'master' of github.com:LukeSmithxyz/voidrice 2023-03-20 09:50:29 -04:00
Luke Smith
fd964d54b6
customizable wttr/rate urls, sb-price improvements 2023-03-20 09:50:18 -04:00
Axel
b394c5f772
Added video.desktop file. (#1288)
Updated mimeapps.list to include mp4 files.
Closes #1271
2023-03-20 12:11:07 +00:00
Luke Smith
37930fdf57
use stig over tremc by default 2023-03-01 13:38:22 -05:00
HelionSmoker
2062e8110c
SQLite ~/ cleanup (#1283) 2023-02-23 12:33:45 +00:00
appeasementPolitik
2e5226545b
maimpick: hide cursor when selecting area (#1282)
Normally when making a screenshot of an area there's still a bit of the cursor that can be seen, this hides it.
2023-02-22 22:21:55 +00:00
Luke Smith
6c92dfa4eb
Merge branch 'iStagnant-master' 2023-02-21 10:27:29 -05:00
Luke Smith
d292d927f1
use android name in fsname 2023-02-21 10:27:08 -05:00
iStagnant
89f8506d85 Made mounter not show already mounted android devices in the mounting prompt 2023-02-20 23:16:20 +02:00
Jameson
27c00576c2
update tutorialvids (#1276)
remove duplicate status bar and align
2023-02-20 12:01:52 +00:00
Luke Smith
762eadd9d1
fix #1275 2023-02-17 12:12:10 -05:00
Luke Smith
ad6ecdb3fc
Merge branch 'master' of github.com:LukeSmithxyz/voidrice 2023-02-17 11:01:19 -05:00
Luke Smith
b04d4c9ac8
mounter improvements, old scripts removed
now checks fstab for info, also one less android prompt
2023-02-17 11:01:07 -05:00
sudo-Tiz
8dce96b986
add dwmblock tutorial video to tutorialvids script (#1274) 2023-02-17 15:32:44 +00:00
Luke Smith
a2e767e4f4
other aliases 2023-02-17 10:18:01 -05:00
Luke Smith
185ac25e52
mount drives with user's ownership 2023-02-17 10:17:35 -05:00
Stagnant
335c1bc8af
Fixed android device not mounting to root owned directories (#1273) 2023-02-17 14:31:44 +00:00
Luke Smith
12167f3dda
fix #1268, use sudo -A, var rename 2023-02-13 08:12:40 -05:00
Luke Smith
537464795b
Merge branch 'HelionSmoker-master' 2023-02-12 09:00:31 -05:00
Luke Smith
de4b34cd32
read file only once 2023-02-12 09:00:23 -05:00
HelionSmoker
d8f386d512
Switch to kebab-case for file name 2023-02-12 13:33:34 +02:00
HelionSmoker
fe198c960f
Rewrite sb-forecast 2023-02-12 12:24:10 +02:00
Luke Smith
e0331ad0e7
Merge branch 'master' of github.com:LukeSmithxyz/voidrice 2023-02-09 11:53:03 -05:00
Luke Smith
c5f4c6c9f4
Merge branch 'ssnailed-patch-1' 2023-02-09 11:52:55 -05:00
Luke Smith
88477d8497
use bash procsub 2023-02-09 11:52:47 -05:00
Luke Smith
9bf90a1b72
Merge branch 'patch-1' of https://github.com/ssnailed/voidrice into ssnailed-patch-1 2023-02-09 11:51:29 -05:00
Luca Bilke
457539c043 remove complexity 2023-02-09 17:11:16 +01:00
Luke Smith
505d86c848
Merge branch 'patch-1' of https://github.com/ssnailed/voidrice into ssnailed-patch-1 2023-02-09 09:50:36 -05:00
Luca Bilke
ec1914e0b9 fix broken trap 2023-02-09 15:39:31 +01:00
HelionSmoker
ca000f5fe4
Python ~/ cleanup (#1264) 2023-02-09 14:37:31 +00:00