Browse Source

Cleanup and other shit

main
Yigit Colakoglu 4 years ago
parent
commit
21ceeb5eeb
27 changed files with 3953 additions and 595 deletions
  1. +9
    -0
      arch-setup/arch-setup.sh
  2. +2
    -1
      arch-setup/packages.csv
  3. +54
    -40
      arch-setup/packages.full
  4. +11
    -39
      arch-setup/packages.minimal
  5. +3
    -0
      bash_logout
  6. +2
    -1
      config.env.def
  7. +4
    -1
      config/X11/xinitrc
  8. +1
    -1
      config/dunst/dunstrc
  9. +3
    -3
      config/mimeapps.list
  10. +6
    -1
      install.sh
  11. +1
    -1
      local/bin/.gitignore
  12. +0
    -163
      local/bin/autotrim
  13. +0
    -239
      local/bin/convertToHtmlMultipart
  14. +1
    -1
      local/bin/dmenu_surf
  15. +0
    -10
      local/bin/fastfetch
  16. +33
    -0
      local/bin/firefox-sync
  17. +0
    -26
      local/bin/gen_tracking_url
  18. +0
    -8
      local/bin/lock
  19. +1
    -3
      local/bin/menu-surfraw
  20. +0
    -28
      local/bin/nm_sendmail.sh
  21. +0
    -23
      local/bin/watch_mpv.sh
  22. +0
    -3
      local/bin/weechat_start
  23. +1
    -1
      local/share/.gitignore
  24. +3810
    -0
      local/share/nerdfont_icons
  25. +9
    -0
      notes/firefox.md
  26. +1
    -1
      profile
  27. +1
    -1
      suckless/st/config.h

+ 9
- 0
arch-setup/arch-setup.sh View File

@ -138,6 +138,15 @@ clear
pacstrap /mnt/sys base linux linux-firmware base-devel git nano sudo
genfstab -U /mnt/sys >> /mnt/sys/etc/fstab
echo -n "Would you like to use tmpfs (This can drastically improve performance)?(Y/n): "
read tmpfs_ok
if [ ! "$tmpfs_ok" = "n" ]; then
echo -n "How big should the tmpfs be?(end with G or M): "
read tmpfs_size
echo -e "\n#tmpfs\ntmpfs /tmp tmpfs rw,nodev,nosuid,size=$tmpfs_size""G 0 0\n" >> /mnt/sys/etc/fstab
fi
clear
# Run on chrooted arch install


+ 2
- 1
arch-setup/packages.csv View File

@ -21,7 +21,7 @@ Mandatory,Package_Name,Install_Method,Command
1,blueman
0,borgmatic
0,botan
1,brave-bin
0,brave-bin
1,calcurse
0,calibre
0,canon-pixma-ts5055-complete
@ -69,6 +69,7 @@ Mandatory,Package_Name,Install_Method,Command
0,gradle
1,gtk2-perl
1,gtk2_prefs
1,firefox
1,htop
1,i7z
1,imake


+ 54
- 40
arch-setup/packages.full View File

@ -1,11 +1,14 @@
6cord
a52dec
aalib
abook
accountsservice
ack
acl
activitywatch-bin
adobe-source-code-pro-fonts
adwaita-icon-theme
aic94xx-firmware
alacritty
alsa-card-profiles
alsa-lib
@ -16,9 +19,13 @@ antibody
antlr4-runtime
aom
arandr
arch-install-scripts
archivemount
archlinux-keyring
arch-wiki-docs
arch-wiki-lite
argon2
aria2
asar
aspell
atk
@ -31,10 +38,12 @@ attr
audiofile
audit
autoconf
autoconf2.13
autoconf-archive
automake
avahi
babl
baobab
base
bash
bat
@ -46,6 +55,7 @@ bfg
binutils
binwalk
bison
bitwarden
bitwarden-cli
blackarch-keyring
blas
@ -55,6 +65,8 @@ bluez-libs
bluez-utils
boost-libs
borg
borgmatic
botan
box2d
brave-bin
brotli
@ -69,9 +81,11 @@ cairomm
cairo-perl
calcurse
calibre
canon-pixma-ts5055-complete
cantarell-fonts
capnproto
capstone
capt-src
c-ares
catdoc
cbindgen
@ -81,6 +95,7 @@ cdparanoia
ceph-libs
checkupdates+aur
checkupdates-aur
cheese
chmlib
chromaprint
chrony
@ -93,17 +108,22 @@ clutter
clutter-gst
clutter-gtk
cmake
cndrvcups-lt
code
cogl
colord
compiler-rt
coreutils
cpanminus
cpupower
cracklib
cronie
cryptsetup
ctags
ctemplate
cups
cups-filters
cups-pdf
curl
dash
dav1d
@ -134,6 +154,7 @@ efibootmgr
efitools
efivar
electron
electron11
electron6
elfutils
elinks
@ -157,6 +178,7 @@ figlet
file
filesystem
findutils
firefox
flac
flex
fltk
@ -191,12 +213,14 @@ geoclue
geocode-glib
gettext
ghc-libs
ghidra-darcula
ghostscript
giblib
giflib
gimp
girara
git
gitkraken
git-secret
gksu
glew
@ -212,14 +236,8 @@ glxinfo
gmime3
gmp
gn-m85
gnome-autoar
gnome-bluetooth
gnome-common
gnome-desktop
gnome-disk-utility
gnome-keyring
gnome-online-accounts
gnome-settings-daemon
gnome-themes-extra
gnome-video-effects
gnu-free-fonts
@ -227,19 +245,21 @@ gnupg
gnuplot
gnutls
go
gobject-introspection
gobject-introspection-runtime
google-cloud-sdk
googler
gparted
gperf
gpgme
gpm
gptfdisk
gradle
graphene
graphicsmagick
graphite
graphviz
grep
groff
grub
gsasl
gsettings-desktop-schemas
gsfonts
@ -334,7 +354,6 @@ haskell-http
haskell-http-client
haskell-http-client-tls
haskell-http-types
haskell-hxt
haskell-hxt-charproperties
haskell-hxt-regex-xmlschema
haskell-hxt-unicode
@ -399,7 +418,6 @@ haskell-zip-archive
haskell-zlib
hdf5
hdparm
hexchat
hicolor-icon-theme
hidapi
highlight
@ -410,11 +428,9 @@ hunspell
hwids
hwloc
hyphen
i3lock-color
i7z
iana-etc
icu
ifuse
ijs
imagemagick
imake
@ -429,7 +445,6 @@ iproute2
iptables
iputils
ipython
irssi
iso-codes
isync
itstool
@ -441,7 +456,6 @@ java-environment-common
java-runtime-common
jbig2dec
jdk11-openjdk
jellyfin-mpv-shim
jemalloc
jetbrains-toolbox
jq
@ -463,7 +477,6 @@ jxrlib
karchive
kauth
kbd
kbookmarks
kcodecs
kcompletion
kconfig
@ -476,19 +489,14 @@ keepass
keyutils
kglobalaccel
kguiaddons
khal
khard
ki18n
kiconthemes
kitemviews
kitty-terminfo
kjobwidgets
kmod
knotifications
krb5
kservice
ktextwidgets
kunst-git
kwayland
kwidgetsaddons
kwindowsystem
@ -583,10 +591,7 @@ libfishsound
libfontenc
libfreehand
libgcrypt
libgdata
libgdiplus
libgdm
libgee
libgexiv2
libgksu
libglade
@ -702,7 +707,6 @@ libsidplayfp
libsigc++
libsigsegv
libsm
libsmbios
libsndfile
libsodium
libsoup
@ -749,7 +753,6 @@ libvterm
libwacom
libwebp
libwmf
libwnck3
libwpd
libwpe
libwpg
@ -778,7 +781,6 @@ libxkbfile
libxklavier
libxml2
libxmu
libxnvctrl
libxpm
libxrandr
libxrender
@ -799,7 +801,6 @@ libzmf
licenses
lightdm
lightdm-gtk-greeter
lighttpd
lilv
linux
linux-api-headers
@ -825,6 +826,7 @@ lynx
lz4
lzo
m4
mailcap
make
mallard-ducktype
man-db
@ -857,12 +859,11 @@ mpfr
mpg123
mpris-ctl
mpv
mpv-mpris-git
msgpack-c
msmtp
mtdev
mtools
mujs
mutter
mutt-wizard
mypaint-brushes1
mysql-workbench
@ -877,19 +878,15 @@ neofetch
neomutt
neon
neovim
nerd-fonts-hack
netpbm
nettle
net-tools
networkmanager
newsboat
nextcloud-client
ngrok
ninja
nm-connection-editor
node-gyp
nodejs
notion-app
notmuch
notmuch-runtime
noto-fonts
@ -908,10 +905,12 @@ openal
opencore-amr
opencv
openexr
openh264
openjpeg2
openmpi
openssh
openssl
openssl-1.0
optipng
opus
opusfile
@ -959,6 +958,7 @@ perl-exporter-tiny
perl-extutils-config
perl-extutils-helpers
perl-extutils-installpaths
perl-file-copy-recursive
perl-file-listing
perl-file-next
perl-file-remove
@ -1001,6 +1001,7 @@ perl-package-stash-xs
perl-params-util
perl-par-dist
perl-parse-yapp
perl-pod-parser
perl-sub-exporter
perl-sub-exporter-progressive
perl-sub-identify
@ -1017,7 +1018,6 @@ perl-www-aur
perl-www-robotrules
perl-xml-parser
perl-yaml-tiny
phonon-qt4
phonon-qt5
phonon-qt5-gstreamer
php
@ -1027,12 +1027,10 @@ pinentry
pipes.sh
pipewire
pipewire-media-session
pistol-git
pixman
pkgconf
playerctl
plymouth
pngquant
podofo
polkit
polkit-gnome
@ -1334,7 +1332,6 @@ rasqal
rav1e
rclone
re2
readability-cli
readline
redis
redland
@ -1345,7 +1342,6 @@ rest
rhash
ripgrep
rofi
rofi-bluetooth-git
rsync
rtkit
rtmpdump
@ -1383,7 +1379,6 @@ serd
shaderc
shadow
shared-mime-info
shotwell
simplescreenrecorder
slang
smbclient
@ -1422,6 +1417,7 @@ sxhkd
sxiv
sysbench
sysfsutils
syslinux
system-config-printer
systemd
systemd-libs
@ -1437,16 +1433,27 @@ tcl
tcsh
tdb
telegram-desktop
terminal_dimensions-git
termite
termite-terminfo
tevent
texinfo
texlive-bibtexextra
texlive-bin
texlive-core
texlive-fontsextra
texlive-formatsextra
texlive-games
texlive-humanities
texlive-latexextra
texlive-music
texlive-pictures
texlive-pstricks
texlive-publishers
texlive-science
thermald
thin-provisioning-tools
tidy
tk
tlp
tmate
@ -1462,6 +1469,7 @@ tree-sitter
tslib
ttf-dejavu
ttf-inconsolata
ttf-joypixels
ttf-liberation
ttf-linux-libertine
ttf-material-design-icons
@ -1479,6 +1487,7 @@ ueberzug
unclutter
unibilium
unixodbc
unp
unrar
unzip
upower
@ -1503,12 +1512,14 @@ volume_key
vsqlite++
vte-common
vtop
vue-cli
vulkan-icd-loader
w3m
wallabag-client
wavpack
wayland
wayland-protocols
wd719x-firmware
webkit2gtk
webkitgtk-bin
webrtc-audio-processing
@ -1545,6 +1556,7 @@ xdg-dbus-proxy
xdg-utils
xf86-input-libinput
xf86-video-intel
xf86-video-vesa
xfconf
xfsprogs
xkblayout-state-git
@ -1561,6 +1573,7 @@ xorg-fonts-alias-100dpi
xorg-fonts-alias-75dpi
xorg-fonts-encodings
xorg-font-util
xorg-font-utils
xorg-iceauth
xorg-mkfontscale
xorgproto
@ -1614,6 +1627,7 @@ xxhash
xz
yajl
yarn
yasm
yay
yelp-tools
yelp-xsl
@ -1622,13 +1636,13 @@ ytfzf
zathura
zathura-pdf-mupdf
zbar
zenity
zeromq
zimg
zip
zita-alsa-pcmi
zita-resampler
zlib
zoom
zsh
zstd
zvbi


+ 11
- 39
arch-setup/packages.minimal View File

@ -1,3 +1,4 @@
6cord
a52dec
aalib
abook
@ -16,6 +17,7 @@ antibody
antlr4-runtime
aom
arandr
arch-install-scripts
archlinux-keyring
arch-wiki-docs
argon2
@ -129,6 +131,7 @@ efibootmgr
efitools
efivar
electron
electron11
electron6
elfutils
elinks
@ -152,6 +155,7 @@ figlet
file
filesystem
findutils
firefox
flac
flex
fltk
@ -207,14 +211,8 @@ glxinfo
gmime3
gmp
gn-m85
gnome-autoar
gnome-bluetooth
gnome-common
gnome-desktop
gnome-disk-utility
gnome-keyring
gnome-online-accounts
gnome-settings-daemon
gnome-themes-extra
gnome-video-effects
gnu-free-fonts
@ -222,7 +220,6 @@ gnupg
gnuplot
gnutls
go
gobject-introspection
gobject-introspection-runtime
gparted
gpgme
@ -234,7 +231,6 @@ graphite
graphviz
grep
groff
grub
gsasl
gsettings-desktop-schemas
gsfonts
@ -329,7 +325,6 @@ haskell-http
haskell-http-client
haskell-http-client-tls
haskell-http-types
haskell-hxt
haskell-hxt-charproperties
haskell-hxt-regex-xmlschema
haskell-hxt-unicode
@ -394,7 +389,6 @@ haskell-zip-archive
haskell-zlib
hdf5
hdparm
hexchat
hicolor-icon-theme
hidapi
highlight
@ -405,11 +399,9 @@ hunspell
hwids
hwloc
hyphen
i3lock-color
i7z
iana-etc
icu
ifuse
ijs
imagemagick
imake
@ -424,7 +416,6 @@ iproute2
iptables
iputils
ipython
irssi
iso-codes
isync
itstool
@ -436,7 +427,6 @@ java-environment-common
java-runtime-common
jbig2dec
jdk11-openjdk
jellyfin-mpv-shim
jemalloc
jetbrains-toolbox
jq
@ -458,7 +448,6 @@ jxrlib
karchive
kauth
kbd
kbookmarks
kcodecs
kcompletion
kconfig
@ -471,19 +460,14 @@ keepass
keyutils
kglobalaccel
kguiaddons
khal
khard
ki18n
kiconthemes
kitemviews
kitty-terminfo
kjobwidgets
kmod
knotifications
krb5
kservice
ktextwidgets
kunst-git
kwayland
kwidgetsaddons
kwindowsystem
@ -578,10 +562,7 @@ libfishsound
libfontenc
libfreehand
libgcrypt
libgdata
libgdiplus
libgdm
libgee
libgexiv2
libgksu
libglade
@ -697,7 +678,6 @@ libsidplayfp
libsigc++
libsigsegv
libsm
libsmbios
libsndfile
libsodium
libsoup
@ -744,7 +724,6 @@ libvterm
libwacom
libwebp
libwmf
libwnck3
libwpd
libwpe
libwpg
@ -773,7 +752,6 @@ libxkbfile
libxklavier
libxml2
libxmu
libxnvctrl
libxpm
libxrandr
libxrender
@ -794,7 +772,6 @@ libzmf
licenses
lightdm
lightdm-gtk-greeter
lighttpd
lilv
linux
linux-api-headers
@ -852,12 +829,11 @@ mpfr
mpg123
mpris-ctl
mpv
mpv-mpris-git
msgpack-c
msmtp
mtdev
mtools
mujs
mutter
mutt-wizard
mypaint-brushes1
mysql-workbench
@ -872,19 +848,15 @@ neofetch
neomutt
neon
neovim
nerd-fonts-hack
netpbm
nettle
net-tools
networkmanager
newsboat
nextcloud-client
ngrok
ninja
nm-connection-editor
node-gyp
nodejs
notion-app
notmuch
notmuch-runtime
noto-fonts
@ -903,6 +875,7 @@ openal
opencore-amr
opencv
openexr
openh264
openjpeg2
openmpi
openssh
@ -954,6 +927,7 @@ perl-exporter-tiny
perl-extutils-config
perl-extutils-helpers
perl-extutils-installpaths
perl-file-copy-recursive
perl-file-listing
perl-file-next
perl-file-remove
@ -996,6 +970,7 @@ perl-package-stash-xs
perl-params-util
perl-par-dist
perl-parse-yapp
perl-pod-parser
perl-sub-exporter
perl-sub-exporter-progressive
perl-sub-identify
@ -1012,7 +987,6 @@ perl-www-aur
perl-www-robotrules
perl-xml-parser
perl-yaml-tiny
phonon-qt4
phonon-qt5
phonon-qt5-gstreamer
php
@ -1022,12 +996,10 @@ pinentry
pipes.sh
pipewire
pipewire-media-session
pistol-git
pixman
pkgconf
playerctl
plymouth
pngquant
podofo
polkit
polkit-gnome
@ -1338,7 +1310,6 @@ rest
rhash
ripgrep
rofi
rofi-bluetooth-git
rsync
rtkit
rtmpdump
@ -1376,7 +1347,6 @@ serd
shaderc
shadow
shared-mime-info
shotwell
simplescreenrecorder
slang
smbclient
@ -1415,6 +1385,7 @@ sxhkd
sxiv
sysbench
sysfsutils
syslinux
system-config-printer
systemd
systemd-libs
@ -1472,6 +1443,7 @@ ueberzug
unclutter
unibilium
unixodbc
unp
unrar
unzip
upower
@ -1554,6 +1526,7 @@ xorg-fonts-alias-100dpi
xorg-fonts-alias-75dpi
xorg-fonts-encodings
xorg-font-util
xorg-font-utils
xorg-iceauth
xorg-mkfontscale
xorgproto
@ -1615,7 +1588,6 @@ ytfzf
zathura
zathura-pdf-mupdf
zbar
zenity
zeromq
zimg
zip


+ 3
- 0
bash_logout View File

@ -0,0 +1,3 @@
#!/bin/bash
~/.local/bin/firefox-sync

+ 2
- 1
config.env.def View File

@ -1,6 +1,6 @@
# vim:ft=bash
#!/bin/bash
#!/bin/sh
export ETH_IT=enp3s0f0
export WLAN_IT=wlp0s20u7
@ -11,3 +11,4 @@ export MCONNECT=true
export MCONNECT_DEVICE=/org/mconnect/device/0
export LOCATION=ankara
export ACTIVITYWATCH=false
export FIREFOX_PROFILE=f9atsu8e.default-release

+ 4
- 1
config/X11/xinitrc View File

@ -47,7 +47,10 @@ mpd-mpris &
touch ~/.cache/nextcloud-track
xss-lock -- slock &
picom --no-fading-openclose &
brave &
if [ "$BROWSER" = "firefox" ]; then
~/.local/bin/firefox-sync
fi
$BROWSER &
bitwarden-desktop &
curl 'http://yeetclock/setcolor?R=136&G=192&B=208' &


+ 1
- 1
config/dunst/dunstrc View File

@ -36,7 +36,7 @@
separator_color = auto
startup_notification = false
dmenu = /usr/local/bin/dmenu -p dmenu:
browser = /bin/brave
browser = /bin/firefox
icon_position = left
#icon_path = /home/yigit/.icons/Tela-dark/16/actions:/home/yigit/.icons/Tela-dark/16/apps:/home/yigit/.icons/Tela-dark/16/devices:/home/yigit/.icons/Tela-dark/16/mimetypes:/home/yigit/.icons/Tela-dark/16/panel:/home/yigit/.icons/Tela-dark/16/places:/home/yigit/.icons/Tela-dark/16/status
max_icon_size=32


+ 3
- 3
config/mimeapps.list View File

@ -1,8 +1,8 @@
[Default Applications]
x-scheme-handler/jetbrains=jetbrains-toolbox.desktop
x-scheme-handler/mailspring=mailspring.desktop
x-scheme-handler/http=brave-browser.desktop
x-scheme-handler/https=brave-browser.desktop
x-scheme-handler/http=firefox.desktop
x-scheme-handler/https=firefox.desktop
image/png=sxiv.desktop
image/jpeg=sxiv.desktop
text/plain=vim.desktop
@ -11,7 +11,7 @@ x-scheme-handler/gitkraken=GitKraken.desktop
x-scheme-handler/ssh=ktelnetservice5.desktop
video/mp4=mpv.desktop
video/x-matroska=mpv.desktop
text/html=brave-browser.desktop
text/html=firefox.desktop
application/vnd.openxmlformats-officedocument.wordprocessingml.document=libreoffice-writer.desktop
application/x-shellscript=vim.desktop
inode/directory=lf.desktop


+ 6
- 1
install.sh View File

@ -80,7 +80,10 @@ echo 'ZDOTDIR=$HOME/.config/zsh' > $HOME/.zshenv
chmod +x $HOME/.zshenv
mvie ~/.profile ~/.dotfiles_backup/profile
ln -s ~/.dotfiles/profile ~/.profile
ln -sf ~/.dotfiles/profile ~/.profile
mvie ~/.bash_logout ~/.dotfiles_backup/bash_logout
ln -sf ~/.dotfiles/bash_logout ~/.bash_logout
cp ~/.dotfiles/config.env.def ~/.config.env
@ -106,6 +109,7 @@ if [ ! -f "/var/spool/cron/$username" ]; then
echo "*/8 * * * * /home/$username/.local/bin/mailsync" > /var/spool/cron/$username
echo "*/15 * * * * /home/$username/.local/bin/nextcloud-sync" >> /var/spool/cron/$username
echo "* */1 * * * /home/$username/.local/bin/check-updates" >> /var/spool/cron/$username
echo "*/30 * * * * /home/$username/.local/bin/firefox-sync" >> /var/spool/cron/$username
echo "*/30 * * * * calcurse-caldav" >> /var/spool/cron/$username
echo "*/30 * * * * vdirsyncer sync" >> /var/spool/cron/$username
else
@ -116,6 +120,7 @@ else
echo "*/8 * * * * /home/$username/.local/bin/mailsync" > /var/spool/cron/$username
echo "*/15 * * * * /home/$username/.local/bin/nextcloud-sync" >> /var/spool/cron/$username
echo "* */1 * * * /home/$username/.local/bin/check-updates" >> /var/spool/cron/$username
echo "*/30 * * * * /home/$username/.local/bin/firefox-sync" >> /var/spool/cron/$username
echo "*/30 * * * * calcurse-caldav" >> /var/spool/cron/$username
echo "*/30 * * * * vdirsyncer sync" >> /var/spool/cron/$username
fi


+ 1
- 1
local/bin/.gitignore View File

@ -2,8 +2,8 @@
!.gitignore
!autotrim
!brave
!convertToHtmlMultipart
!firefox-sync
!daily-update
!devmon
!dmenu-arch


+ 0
- 163
local/bin/autotrim View File

@ -1,163 +0,0 @@
#!/usr/bin/perl
#
# "Beautify" quoted message and make it "ready-to-reply" by Michael Velten
use utf8;
# keep quotes nested up to 3rd level
my $ind_max = 4;
my $name = '[[:alpha:]]+([\'`-][[:alpha:]]+|[.])*';
my $fullname = '\b(' . $name . '[,]?\s+)*' . $name . '\b';
# Possible reply greetings (regexes) (note that '> ' will be prefixed)
my @greetings = (
'Dear\s+' . $fullname . '([,.]|\s*!)?',
'[Hh](ello|i|ey)' . '(\s+' . $fullname . ')?' . '([,.]|\s*!)?',
'Sehr geehrter?\s+' . $fullname . '([,.]|\s*!)?',
'Lieber?\s+' . $fullname . '([,.]|\s*!)?',
'Guten Tag' . '(\s+' . $fullname . ')?' . '([,.]|\s*!)?',
'[Hh]allo' . '(\s+' . $fullname . ')?' . '([,.]|\s*!)?',
'[Mm]oin' . '(\s+' . $fullname . ')?' . '([,.]|\s*!)?',
'[Mm]esdames(,| et) [Mm]essieurs([,.]|\s*!)?',
'M(adame)\s+' . $fullname . '([,.]|\s*!)?',
'M(onsieur)\s+' . $fullname . '([,.]|\s*!)?',
'[Cc]her\s+' . $fullname . '([,.]|\s*!)?',
'[Cc]h[eè]re\s+' . $fullname . '([,.]|\s*!)?',
'[Bb]onjour' . '(\s+' . $fullname . ')?' . '([,.]|\s*!)?',
'[Ss]alut' . '(\s+' . $fullname . ')?' . '([,.]|\s*!)?',
'Senhor(ita|a)?' . '(\s+' . $fullname . ')?' . '([,.]|\s*!)?',
'Sra?\.?' . '(\s+' . $fullname . ')?' . '([,.]|\s*!)?',
'Car([ií]ssim)?[ao]s?' . '(\s+' . $fullname . ')?' . '([,.]|\s*!)?',
'Prezad([ií]ssim)?[ao]s?' . '(\s+' . $fullname . ')?' . '([,.]|\s*!)?',
'Estimad([ií]ssim)?[ao]s?' . '(\s+' . $fullname . ')?' . '([,.]|\s*!)?',
'[Bb]om [Dd]ia' . '(\s+' . $fullname . ')?' . '([,.]|\s*!)?',
'[Bb]oa ([Tt]arde|[Nn]oite)' . '(\s+' . $fullname . ')?' . '([,.]|\s*!)?',
'[Oo](i|l[aá])' . '(\s+' . $fullname . ')?' . '([,.]|\s*!)?',
'[Aa]l[ôo]' . '(\s+' . $fullname . ')?' . '([,.]|\s*!)?',
'[Hh]ola' . '(\s+' . $fullname . ')?' . '([,.]|\s*!)?',
'Se[nñ]or(ita|a)?' . '(\s+' . $fullname . ')?' . '([,.]|\s*!)?',
);
# Possible reply "greetouts" (regexes) (note that '> ' will be prefixed)
my @greetouts = (
'([Ww]ith )?(([Kk]ind|[Bb]est|[Ww]arm) )?([Rr]egards|[Ww]ishes)([,.]|\s*!)?',
'[Bb]est([,.]|\s*!)?',
'[Cc]heers([,.]|\s*!)?',
'[Mm]it ([Vv]iel|[Bb]est|[Ll]ieb|[Ff]reundlich)en [Gg]r([ü]|ue)([ß]|ss)en([,.]|\s*!)?',
'(([Vv]iel|[Bb]est|[Ll]ieb|[Ff]reundlich)e )?[Gg]r([ü]|ue)([ß]|ss)e([,.]|\s*!)?',
'(([[Bb]est|[Ll]ieb|[Ff]reundlich)e[rn] )?[Gg]ru([ß]|ss)([,.]|\s*!)?',
'[Mm]it (([[Bb]est|[Ll]ieb|[Ff]reundlich)em )?[Gg]ru([ß]|ss)([,.]|\s*!)?',
'([LV]|MF)G([,.]|\s*!)?',
'(([Tt]r[eè]s|[Bb]ien) )?([Cc]ordi|[Aa]mic)alement([,.]|\s*!)?',
'[Aa]miti[eé]s?([,.]|\s*!)?',
'[Aa]tenciosamente([,.]|\s*!)?',
'[Aa]tt([,.]|\s*!)?',
'[Aa]bra[cç]os?([,.]|\s*!)?',
'[Aa]tentamente([,.]|\s*!)?',
'[Cc]ordialmente([,.]|\s*!)?',
);
my $word = '[[:alpha:]]+([\'`-][[:alpha:]]+)*';
# my $saw_greeting = 0;
# my $saw_greetout = 0;
my $saw_own_sig = 0;
my $saw_blank_line = 0;
my $inds_other_sig = 0;
my $quote_header = 0;
my $extra_pref = '';
my (@mail, @purged_mail);
my $msg = shift;
die "Usage: $0 MAIL" unless $msg;
open(MAIL, "+<:encoding(UTF-8)", $msg) or die "$0: Can't open $msg: $!";
push(@mail, $_) while <MAIL>; # Read whole mail
# Process whole mail
LINE:
foreach my $line (@mail) {
# Treat non-quoted lines as is
if ($line !~ /^>/) {
push(@purged_mail, $line);
next LINE;
}
# Keep all lines after my own signature unmodified
if ($line =~ /^--\s?$/ || $saw_own_sig) {
$saw_own_sig = 1;
push(@purged_mail, $line);
next LINE;
}
# $line =~ tr/\xA0/ /;
# tighten "> > " to ">> "
my ($pref, $suff) = $line =~ /^([>[:space:]]+)(.*)$/;
$pref =~ s/(>\s*(?!$))/>/g;
# reduce multiple pre- and post-blanks to one post-blank
$pref =~ s/^\s*(>+)\s*/$1 /;
$line = $pref . $suff . "\n";
# prepend additional '>' for each Outlook quote header
if ($line =~ /^>+ [-_=]{3,}\s*$word(\s+$word)*\s*[-_=]{3,}$/) {
$quote_header = 1;
next LINE;
}
# first line after Outlook quote header that does not start with ...:
if ($quote_header == 1 && $line !~ /^>+ ([-*]\s*)?$word(\s+$word)*\s*:\s+/) {
$extra_pref = '>' . $extra_pref;
$quote_header = 0;
}
$pref = $extra_pref . $pref;
$line = $pref . $suff . "\n";
# skip line if number of '>'s is greater than $ind_max
my $inds = $pref =~ tr/>//;
next LINE if $inds > $ind_max;
# Remove other signatures
if ($line =~ /^>+ --\s?$/) {
$inds_other_sig = $inds;
}
if ($inds == $inds_other_sig) {
next LINE;
} else {
$inds_other_sig = 0;
}
# Remove quoted greeting
# unless ($saw_greeting) {
foreach my $greeting (@greetings) {
if ($line =~ /^>+ $greeting$/) {
# $saw_greeting = 1;
next LINE;
}
}
# }
# Remove quoted "greetout"
# unless ($saw_greetout) {
foreach my $greetout (@greetouts) {
if ($line =~ /^>+ $greetout$/) {
# $saw_greetout = 1;
next LINE;
}
}
# }
# Remove quoted filler lines
if ($line =~ /^>+ \s*(-*|_*|=*|\+*|#*|\**)$/) {
next LINE;
}
# Save purged line
push(@purged_mail, $line);
}
# Overwrite original mail with purged mail
truncate(MAIL, 0);
seek(MAIL, 0, 0);
print MAIL @purged_mail;
close(MAIL);

+ 0
- 239
local/bin/convertToHtmlMultipart View File

@ -1,239 +0,0 @@
#!/usr/bin/env python3
# Original Source: https://github.com/oblitum/dotfiles/blob/ArchLinux/.local/bin/MIMEmbellish
import re
import sys
import email
import shlex
import mimetypes
import subprocess
from copy import copy
from hashlib import md5
from email import charset
from email import encoders
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from email.mime.nonmultipart import MIMENonMultipart
from os.path import basename, splitext, expanduser
charset.add_charset('utf-8', charset.SHORTEST, '8bit')
def pandoc(from_format, to_format='markdown', plain='markdown', title=None):
markdown = ('markdown'
'-blank_before_blockquote')
if from_format == 'plain':
from_format = plain
if from_format == 'markdown':
from_format = markdown
if to_format == 'markdown':
to_format = markdown
command = 'pandoc -f {} -t {} --standalone --highlight-style=tango'
if to_format in ('html', 'html5'):
if title is not None:
command += ' --variable=pagetitle:{}'.format(shlex.quote(title))
command += ' --webtex --template={}'.format(
expanduser('~/.pandoc/templates/email.html'))
return command.format(from_format, to_format)
def gmailfy(payload):
return payload.replace('<blockquote>',
'<blockquote class="gmail_quote" style="'
'padding: 0 7px 0 7px;'
'border-left: 2px solid #cccccc;'
'font-style: italic;'
'margin: 0 0 7px 3px;'
'">')
def make_alternative(message, part):
alternative = convert(part, 'html',
pandoc(part.get_content_subtype(),
to_format='html',
title=message.get('Subject')))
alternative.set_payload(gmailfy(alternative.get_payload()))
return alternative
def make_replacement(message, part):
return convert(part, 'plain', pandoc(part.get_content_subtype()))
def convert(part, to_subtype, command):
payload = part.get_payload()
if isinstance(payload, str):
payload = payload.encode('utf-8')
else:
payload = part.get_payload(None, True)
if not isinstance(payload, bytes):
payload = payload.encode('utf-8')
process = subprocess.run(
shlex.split(command),
input=payload, stdout=subprocess.PIPE, check=True)
return MIMEText(process.stdout, to_subtype, 'utf-8')
def with_alternative(parent, part, from_signed,
make_alternative=make_alternative,
make_replacement=None):
try:
alternative = make_alternative(parent or part, from_signed or part)
replacement = (make_replacement(parent or part, part)
if from_signed is None and make_replacement is not None
else part)
except:
return parent or part
envelope = MIMEMultipart('alternative')
if parent is None:
for k, v in part.items():
if (k.lower() != 'mime-version'
and not k.lower().startswith('content-')):
envelope.add_header(k, v)
del part[k]
envelope.attach(replacement)
envelope.attach(alternative)
if parent is None:
return envelope
payload = parent.get_payload()
payload[payload.index(part)] = envelope
return parent
def tag_attachments(message):
if message.get_content_type() == 'multipart/mixed':
for part in message.get_payload():
if (part.get_content_maintype() in ['image']
and 'Content-ID' not in part):
filename = part.get_param('filename',
header='Content-Disposition')
if isinstance(filename, tuple):
filename = str(filename[2], filename[0] or 'us-ascii')
if filename:
filename = splitext(basename(filename))[0]
if filename:
part.add_header('Content-ID', '<{}>'.format(filename))
return message
def attachment_from_file_path(attachment_path):
try:
mime, encoding = mimetypes.guess_type(attachment_path, strict=False)
maintype, subtype = mime.split('/')
with open(attachment_path, 'rb') as payload:
attachment = MIMENonMultipart(maintype, subtype)
attachment.set_payload(payload.read())
encoders.encode_base64(attachment)
if encoding:
attachment.add_header('Content-Encoding', encoding)
return attachment
except:
return None
attachment_path_pattern = re.compile(r'\]\s*\(\s*file://(/[^)]*\S)\s*\)|'
r'\]\s*:\s*file://(/.*\S)\s*$',
re.MULTILINE)
def link_attachments(payload):
attached = []
attachments = []
def on_match(match):
if match.group(1):
attachment_path = match.group(1)
cid_fmt = '](cid:{})'
else:
attachment_path = match.group(2)
cid_fmt = ']: cid:{}'
attachment_id = md5(attachment_path.encode()).hexdigest()
if attachment_id in attached:
return cid_fmt.format(attachment_id)
attachment = attachment_from_file_path(attachment_path)
if attachment:
attachment.add_header('Content-ID', '<{}>'.format(attachment_id))
attachments.append(attachment)
attached.append(attachment_id)
return cid_fmt.format(attachment_id)
return match.group()
return attachments, attachment_path_pattern.sub(on_match, payload)
def with_local_attachments(parent, part, from_signed,
link_attachments=link_attachments):
if from_signed is None:
attachments, payload = link_attachments(part.get_payload())
part.set_payload(payload)
else:
attachments, payload = link_attachments(from_signed.get_payload())
from_signed = copy(from_signed)
from_signed.set_payload(payload)
if not attachments:
return parent, part, from_signed
if parent is None:
parent = MIMEMultipart('mixed')
for k, v in part.items():
if (k.lower() != 'mime-version'
and not k.lower().startswith('content-')):
parent.add_header(k, v)
del part[k]
parent.attach(part)
for attachment in attachments:
parent.attach(attachment)
return parent, part, from_signed
def is_target(part, target_subtypes):
return (part.get('Content-Disposition', 'inline') == 'inline'
and part.get_content_maintype() == 'text'
and part.get_content_subtype() in target_subtypes)
def pick_from_signed(part, target_subtypes):
for from_signed in part.get_payload():
if is_target(from_signed, target_subtypes):
return from_signed
def seek_target(message, target_subtypes=['plain', 'markdown']):
if message.is_multipart():
if message.get_content_type() == 'multipart/signed':
part = pick_from_signed(message, target_subtypes)
if part is not None:
return None, message, part
elif message.get_content_type() == 'multipart/mixed':
for part in message.get_payload():
if part.is_multipart():
if part.get_content_type() == 'multipart/signed':
from_signed = pick_from_signed(part, target_subtypes)
if from_signed is not None:
return message, part, from_signed
elif is_target(part, target_subtypes):
return message, part, None
else:
if is_target(message, target_subtypes):
return None, message, None
return None, None, None
def main():
try:
message = email.message_from_file(sys.stdin)
parent, part, from_signed = seek_target(message)
if (parent, part, from_signed) == (None, None, None):
print(message)
return
tag_attachments(message)
print(with_alternative(
*with_local_attachments(parent, part, from_signed)))
except (BrokenPipeError, KeyboardInterrupt):
pass
if __name__ == '__main__':
main()

+ 1
- 1
local/bin/dmenu_surf View File

@ -7,5 +7,5 @@ selection=$(echo "" | dmenu -p "Enter URL")
if [ ! -z "$selection" ]
then
brave $selection
$BROWSER $selection
fi

+ 0
- 10
local/bin/fastfetch View File

@ -1,10 +0,0 @@
#!/bin/sh
if [ ! -f "$HOME/.cache/neofetch" ]; then
mkdir -p "$HOME/.cache"
touch "$HOME/.cache/neofetch"
neofetch --ascii ~/.config/neofetch/ascii.txt > "$HOME/.cache/neofetch"
fi
cat "$HOME/.cache/neofetch"

+ 33
- 0
local/bin/firefox-sync View File

@ -0,0 +1,33 @@
#!/bin/bash
if [ ! "$BROWSER" = "firefox" ]; then
echo "Default browser is not firefox, exiting..."
exit 0
fi
source $HOME/.config.env
static=static-$FIREFOX_PROFILE
link=$FIREFOX_PROFILE
volatile=/dev/shm/firefox-$FIREFOX_PROFILE-$USER
IFS=
set -efu
cd ~/.mozilla/firefox
if [ ! -r $volatile ]; then
mkdir -m0700 $volatile
fi
if [ "$(readlink $link)" != "$volatile" ]; then
mv $link $static
ln -s $volatile $link
fi
if [ -e $link/.unpacked ]; then
rsync -av --delete --exclude .unpacked ./$link/ ./$static/
else
rsync -av ./$static/ ./$link/
touch $link/.unpacked
fi

+ 0
- 26
local/bin/gen_tracking_url View File

@ -1,26 +0,0 @@
#!/bin/python
import sys
from base64 import b64decode
from hashlib import sha256
from urllib.parse import quote
message = b64decode(sys.argv[1]).decode()
userid = "1"
key = "Rwb3pUUG8fQAZUs3Q3qwdHH25Fdq8dyJyzUQqERzrCfxavKExfSExQbr8dZXho57abGvTZGdBmSbyXdVM59jDVi4L5ien9xoVHskMdx4FxNXyq7uBPYaAeA62JXzMZT9"
domain = "https://hermes.yigitcolakoglu.com/read"
subject = "NIL"
recipient = "NIL"
for i in message.split("\n"):
if i.split(" ")[0] == "Subject:":
subject = i[9:]
elif i.split(" ")[0] == "To:":
recipient = i[4:]
identifier = subject + recipient + userid + key
identifier_hash = sha256(identifier.encode("utf-8")).hexdigest()
url = "{}/{}/{}/{}/{}".format(domain,userid,quote(subject),quote(recipient),identifier_hash)
print('![Hermes]({})'.format(url))

+ 0
- 8
local/bin/lock View File

@ -1,8 +0,0 @@
#!/bin/sh
curl 'http://yeetclock/setcolor?R=2000&G=10&B=000&O=0' &
/home/yigit/.local/bin/pacontrol.sh open-mute
/home/yigit/.local/bin/dunst_toggle.sh -s
slock
/home/yigit/.local/bin/dunst_toggle.sh -e
/home/yigit/.local/bin/pacontrol.sh toggle-mute
curl 'http://yeetclock/setcolor?R=136&G=192&B=208' &

+ 1
- 3
local/bin/menu-surfraw View File

@ -7,8 +7,6 @@
# it in your browser of choice.
# Edit here to change what browser you open links in
browser="brave"
usage() {
echo "Usage: $0 [OPTIONS] [ELVIS [SEARCHTERM]]
@ -51,5 +49,5 @@ if [ "$action" = "" ]; then
exit
fi
surfraw -browser=$browser $answerA $action
surfraw -browser=$BROWSER $answerA $action

+ 0
- 28
local/bin/nm_sendmail.sh View File

@ -1,28 +0,0 @@
#!/bin/sh
# Put the message, send to stdin, in a variable
m="$(cat -)"
m64="$(echo -e "$m" | base64)"
echo "$m64" > /tmp/test2
tracking_url=$(/home/yigit/.local/bin/gen_tracking_url "$m64" 2> /tmp/testerr)
echo $tracking_url > /tmp/test3
# Look at the first argument,
# Use it to determine the account to use
# If not set, assume work
# All remaining arguments should be recipient addresses which should be passed to msmtp
account="$1"
shift 1
cleanHeaders(){
# In the headers, delete any lines starting with markdown
cat - | sed '0,/^$/{/^markdown/Id;}'
}
echo "$@"
echo "$message" | cleanHeaders > /tmp/headers
echo "msmtp -a $account $@"
echo "$message" | sed '/^$/q' | grep -q -i 'markdown: true' \
&& msg=$(echo "$message \n$tracking_url" | cleanHeaders | /home/yigit/.local/bin/convertToHtmlMultipart && echo 1 >> /tmp/state) || msg=$(echo "$message" | cleanHeaders)
echo "$msg" > /tmp/test
echo "$msg" | notmuch insert --folder="$account/sent" +sent -inbox
echo "$msg" | msmtp -a $account $@

+ 0
- 23
local/bin/watch_mpv.sh View File

@ -1,23 +0,0 @@
#!/bin/sh
format="-f34" # leave empty for default
player="mpv --quiet --geometry=50%:50% --idx --keep-open"
tmpdir="/tmp"
url="$1"
echo $url
echo $format
mpv $url
exit 0
filepath="$tmpdir/$(youtube-dl --id --get-filename $format $url)"
youtube-dl -c -o $filepath $format $url &
echo $! > $filepath.$$.pid
while [ ! -r $filepath ] && [ ! -r $filepath.part ]; do
echo "Waiting for youtube-dl..."
sleep 3
done
[ -r $filepath.part ] && $player $filepath.part || $player $filepath
kill $(cat $filepath.$$.pid)
rm $filepath.$$.pid

+ 0
- 3
local/bin/weechat_start View File

@ -1,3 +0,0 @@
#!/bin/sh
st -e weechat

+ 1
- 1
local/share/.gitignore View File

@ -5,5 +5,5 @@
!themes
!applications
!vim
!nerdfont_icons
!vim/**

+ 3810
- 0
local/share/nerdfont_icons
File diff suppressed because it is too large
View File


+ 9
- 0
notes/firefox.md View File

@ -0,0 +1,9 @@
## Notes on firefox
Here are some `about:config` variables that you might want to set:
| Variable | Value |
--------------------
| services.sync.prefs.sync.browser.uiCustomization.state | true |
| extensions.pocket.enabled | false |
| browser.cache.disk.parent_directory | /run/user/*UID*/firefox |

+ 1
- 1
profile View File

@ -8,7 +8,7 @@ export SHELL=/bin/zsh
export TERMINAL=/usr/local/bin/st
export TMUX_PLUGIN_MANAGER_PATH=~/.tmux/plugins
export BORG_KEYS_DIR=~/.keys/borg
export BROWSER=brave
export BROWSER=firefox
export EDITOR=nvim
export OPENER=xdg-open
export ANDROID_HOME=/home/yigit/Android


+ 1
- 1
suckless/st/config.h View File

@ -9,7 +9,7 @@ static char *font = "CaskaydiaCove Nerd Font Mono:pixelsize=16:antialias=true:au
static char *font2[] = {
"Symbola:pixelsize=16:antialias=true:autohint=true",
};
char *iso14755_cmd = "dmenu -w \"$WINDOWID\" -p codepoint: </dev/null";
char *iso14755_cmd = "cat /home/yigit/.local/share/nerdfont_icons | dmenu -w \"$WINDOWID\" -p \"Select icon\" -l 10 | cut -d\"(\" -f2 | cut -c 1-4";
static int borderpx = 2;


Loading…
Cancel
Save