42
deprecated/compare.py
Normal file
42
deprecated/compare.py
Normal file
@@ -0,0 +1,42 @@
|
||||
#!/usr/bin/env python3
|
||||
#
|
||||
# Ferit Yiğit BALABAN <fyb@duck.com>, 2022
|
||||
#
|
||||
|
||||
|
||||
def main():
|
||||
follower_path = '/home/ferit/scripts/follower'
|
||||
followed_path = '/home/ferit/scripts/followed'
|
||||
follower2_path = '/home/ferit/scripts/follower2'
|
||||
with open(follower_path, 'r') as f:
|
||||
follower_list = f.readlines()
|
||||
f.close()
|
||||
with open(followed_path, 'r') as f:
|
||||
followed_list = f.readlines()
|
||||
f.close()
|
||||
with open(follower2_path, 'r') as f:
|
||||
follower2_list = f.readlines()
|
||||
f.close()
|
||||
|
||||
follower_list = [x.removesuffix('\n') for x in follower_list]
|
||||
followed_list = [x.removesuffix('\n') for x in followed_list]
|
||||
follower2_list = [x.removesuffix('\n') for x in follower2_list]
|
||||
|
||||
print('Old method:')
|
||||
for followed in followed_list:
|
||||
if followed not in follower1_list:
|
||||
print(followed, 'doesn\'t follow you back.')
|
||||
|
||||
print('New method:')
|
||||
for followed in followed_list:
|
||||
if followed not in follower2_list:
|
||||
print(followed, 'doesn\t follow you back.')
|
||||
|
||||
print('Who unfollowed me:')
|
||||
for old_follower in follower_list:
|
||||
if old_follower not in follower2_list:
|
||||
print(old_follower, 'unfollowed you.')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
54
deprecated/drun_cleaner.py
Normal file
54
deprecated/drun_cleaner.py
Normal file
@@ -0,0 +1,54 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# This script adds 'NoDisplay=true' to blacklisted application
|
||||
# desktop entries commonly found in /usr/share/applications
|
||||
# and $HOME/.local/share/applications.
|
||||
#
|
||||
# Ferit Yigit BALABAN <fyb@duck.com>, 2022
|
||||
|
||||
# Usage:
|
||||
# This script will check append every filename in blacklist
|
||||
# to every directory name in search_folders. Resulting paths
|
||||
# will then be checked if they exist. Files that exist will
|
||||
# get appended with 'NoDisplay=true'.
|
||||
#
|
||||
# Note: You can use environment variables in search_directories,
|
||||
# but you mustn't use them in blacklist.
|
||||
import os
|
||||
|
||||
|
||||
def modify_file(path):
|
||||
with open(path, 'a') as stream:
|
||||
if 'NoDisplay=true' not in stream:
|
||||
stream.write('NoDisplay=true')
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
|
||||
def main():
|
||||
blacklist = [
|
||||
'avahi-discover.desktop',
|
||||
'electron16.desktop',
|
||||
'bssh.desktop',
|
||||
'bvnc.desktop',
|
||||
'qv4l2.desktop',
|
||||
'qvidcap.desktop'
|
||||
]
|
||||
|
||||
search_directories = ['/usr/share/applications', '$HOME/.local/share/applications']
|
||||
search_directories = [os.path.expandvars(path) for path in search_directories]
|
||||
for directory in search_directories:
|
||||
for file in blacklist:
|
||||
if os.path.exists(directory + '/' + file):
|
||||
full_path = directory + '/' + file
|
||||
_ = modify_file(full_path)
|
||||
if _:
|
||||
print(f'Appended "NoDisplay=true" 0 {full_path}')
|
||||
else:
|
||||
print(f'File {full_path} already had "NoDisplay=true"')
|
||||
print('Reached end of combinations. Good bye!')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
10
deprecated/fast_commit
Executable file
10
deprecated/fast_commit
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
cd $HOME/notes
|
||||
git add .
|
||||
git add .gitignore
|
||||
git add *
|
||||
git status
|
||||
dt=$(date +"%d/%m/%y-%H.%M.%S")
|
||||
git commit -m "Auto $dt"
|
||||
git push
|
||||
exit 0
|
||||
17
deprecated/nowplaying.sh
Executable file
17
deprecated/nowplaying.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
stat=$( playerctl status )
|
||||
msg=$( playerctl -f '{{trunc(xesam:artist, 15)}} - {{trunc(xesam:title, 30)}}' metadata )
|
||||
if [ "$stat" = "Playing" ]; then
|
||||
if [ "$msg" = " - " ]; then
|
||||
echo "No metadata"
|
||||
else
|
||||
echo "$msg"
|
||||
fi
|
||||
else
|
||||
if [ "$stat" = "Paused" ]; then
|
||||
echo "Paused"
|
||||
else
|
||||
echo ""
|
||||
fi
|
||||
fi
|
||||
exit 0
|
||||
14
deprecated/wait_unlock.sh
Executable file
14
deprecated/wait_unlock.sh
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Ferit Yiğit BALABAN <f@fybx.dev>, 2022
|
||||
#
|
||||
sleep 5
|
||||
while : ; do
|
||||
if pgrep -x "i3lock" > /dev/null
|
||||
then
|
||||
sleep 5
|
||||
else
|
||||
python $HOME/scripts/modeset.py --unlock
|
||||
break
|
||||
fi
|
||||
done
|
||||
37
deprecated/ytdlp_helper.py
Normal file
37
deprecated/ytdlp_helper.py
Normal file
@@ -0,0 +1,37 @@
|
||||
#!/usr/bin/env python3
|
||||
# Helps me to download whole playlists or just one video, in any format I wish.
|
||||
from subprocess import run
|
||||
|
||||
|
||||
def yt_dlp(url: str, what: int, form: int, ):
|
||||
try:
|
||||
if what == 1 and form == 1:
|
||||
run(['yt-dlp', '-x', '--audio-format', "'mp3'", '--audio-quality', '0', f"'{url}'"])
|
||||
elif what == 1 and form == 2:
|
||||
run(['yt-dlp', '-S', "'ext'", f"'{url}'"])
|
||||
elif what == 2 and form == 1:
|
||||
run(['yt-dlp'])
|
||||
except FileNotFoundError:
|
||||
print("Are you sure that yt-dlp is installed?")
|
||||
|
||||
|
||||
def main():
|
||||
print("Welcome to yt-dlp helper!\n")
|
||||
url = input("Would you be kind and share the URL of content you wish to download: ")
|
||||
|
||||
print("Which format do you want the downloaded content be in?")
|
||||
print("1. mp3")
|
||||
print("2. mp4")
|
||||
form = int(input("Please make your selection: "))
|
||||
|
||||
print("1. I want to download a video.")
|
||||
print("2. I want to download a playlist.")
|
||||
if input("Please make your selection: ") == 1:
|
||||
print("Alright! Your download shall begin now: ")
|
||||
yt_dlp(url, 1, form)
|
||||
else:
|
||||
yt_dlp(url, 2, form)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
5
deprecated/ytdlp_wrapper.sh
Executable file
5
deprecated/ytdlp_wrapper.sh
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
mkdir -p "./$1"
|
||||
cd "./$1" || echo "Failed to change directory to $1" && exit 1
|
||||
yt-dlp -x --audio-format best --audio-quality 0 "$2"
|
||||
Reference in New Issue
Block a user