diff --git a/.ccls-cache/@home@yigit@.dotfiles/suckless@surf@config.h b/.ccls-cache/@home@yigit@.dotfiles/suckless@surf@config.h new file mode 100644 index 00000000..49283b3f --- /dev/null +++ b/.ccls-cache/@home@yigit@.dotfiles/suckless@surf@config.h @@ -0,0 +1,251 @@ +/* modifier 0 means no modifier */ +static int surfuseragent = 0; /* Append Surf version to default WebKit user agent */ +static char *fulluseragent = "Mozilla/5.0 (X11; Linux x86_64; rv:87.0) Gecko/20100101 Firefox/87.0"; /* Or override the whole user agent string */ +static char *scriptfiles[] = { + "~/.config/surf/scripts/default.js", +}; +static char *styledir = "~/.config/surf/styles/"; +static char *certdir = "~/.cache/surf/certificates/"; +static char *cachedir = "~/.cache/surf/cache/"; +static char *historyfile = "~/.cache/surf/history.txt"; +static char *cookiefile = "~/.cache/surf/cookies.txt"; +static char *searchengine = "https://google.com/search?q="; +static char **plugindirs = (char*[]){ + "~/.config/surf/plugins/", + LIBPREFIX "/mozilla/plugins/", + NULL +}; + +/* Webkit default features */ +/* Highest priority value will be used. + * Default parameters are priority 0 + * Per-uri parameters are priority 1 + * Command parameters are priority 2 + */ +static Parameter defconfig[ParameterLast] = { + /* parameter Arg value priority */ + [AcceleratedCanvas] = { { .i = 1 }, }, + [AccessMicrophone] = { { .i = 0 }, }, + [AccessWebcam] = { { .i = 0 }, }, + [Certificate] = { { .i = 0 }, }, + [CaretBrowsing] = { { .i = 0 }, }, + [CookiePolicies] = { { .v = "A" }, }, + [DefaultCharset] = { { .v = "UTF-8" }, }, + [DiskCache] = { { .i = 1 }, }, + [DNSPrefetch] = { { .i = 0 }, }, + [Ephemeral] = { { .i = 0 }, }, + [FileURLsCrossAccess] = { { .i = 0 }, }, + [FontSize] = { { .i = 12 }, }, + [FrameFlattening] = { { .i = 0 }, }, + [Geolocation] = { { .i = 0 }, }, + [HideBackground] = { { .i = 0 }, }, + [Inspector] = { { .i = 0 }, }, + [Java] = { { .i = 1 }, }, + [JavaScript] = { { .i = 1 }, }, + [KioskMode] = { { .i = 0 }, }, + [LoadImages] = { { .i = 1 }, }, + [MediaManualPlay] = { { .i = 1 }, }, + [Plugins] = { { .i = 1 }, }, + [PreferredLanguages] = { { .v = (char *[]){ NULL } }, }, + [RunInFullscreen] = { { .i = 0 }, }, + [ScrollBars] = { { .i = 1 }, }, + [ShowIndicators] = { { .i = 1 }, }, + [SiteQuirks] = { { .i = 1 }, }, + [SmoothScrolling] = { { .i = 0 }, }, + [SpellChecking] = { { .i = 0 }, }, + [SpellLanguages] = { { .v = ((char *[]){ "en_US", NULL }) }, }, + [StrictTLS] = { { .i = 1 }, }, + [Style] = { { .i = 1 }, }, + [WebGL] = { { .i = 0 }, }, + [ZoomLevel] = { { .f = 1.0 }, }, + [ClipboardNotPrimary] = { { .i = 1 }, }, +}; + + +#define SETURI(p) { .v = (char *[]){ "/bin/sh", "-c", \ +"prop=\"`surf_history_dmenu.sh`\" &&" \ +"xprop -id $1 -f $0 8s -set $0 \"$prop\"", \ +p, winid, NULL } } + +static UriParameters uriparams[] = { + { "(://|\\.)suckless\\.org(/|$)", { + [JavaScript] = { { .i = 0 }, 1 }, + [Plugins] = { { .i = 0 }, 1 }, + }, }, +}; + +/* default window size: width, height */ +static int winsize[] = { 800, 600 }; + +static WebKitFindOptions findopts = WEBKIT_FIND_OPTIONS_CASE_INSENSITIVE | + WEBKIT_FIND_OPTIONS_WRAP_AROUND; + +#define PROMPT_GO "Go:" +#define PROMPT_FIND "Find:" + +/* SETPROP(readprop, setprop, prompt)*/ +#define SETPROP(r, s, p) { \ + .v = (const char *[]){ "/bin/sh", "-c", \ + "prop=\"$(printf '%b' \"$(xprop -id $1 $2 " \ + "| sed \"s/^$2(STRING) = //;s/^\\\"\\(.*\\)\\\"$/\\1/\" && cat ~/.config/surf/bookmarks)\" " \ + "| dmenu -l 10 -p \"$4\" -w $1)\" && " \ + "xprop -id $1 -f $3 8s -set $3 \"$prop\"", \ + "surf-setprop", winid, r, s, p, NULL \ + } \ +} + +/* DOWNLOAD(URI, referer) */ +#define DOWNLOAD(d, r) { \ + .v = (char *[]){ "/bin/sh", "-c", \ + "cd ~/Downloads;"\ + "st -e /bin/sh -c \"aria2c -U '$1'" \ + " --referer '$2' --load-cookies $3 --save-cookies $3 '$0';" \ + " sleep 3;\"", \ + d, useragent, r, cookiefile, NULL \ + } \ +} + +/* PLUMB(URI) */ +/* This called when some URI which does not begin with "about:", + * "http://" or "https://" should be opened. + */ +#define PLUMB(u) {\ + .v = (const char *[]){ "/bin/sh", "-c", \ + "xdg-open \"$0\"", u, NULL \ + } \ +} + +/* VIDEOPLAY(URI) */ +#define VIDEOPLAY(u) {\ + .v = (const char *[]){ "/bin/sh", "-c", \ + "mpv --really-quiet \"$0\"", u, NULL \ + } \ +} + +/* BM_ADD(readprop) */ +#define BM_ADD(r) {\ + .v = (const char *[]){ "/bin/sh", "-c", \ + "(echo $(xprop -id $0 $1) | cut -d '\"' -f2 " \ + "| sed 's/.*https*:\\/\\/\\(www\\.\\)\\?//' && cat ~/.config/surf/bookmarks) " \ + "| awk '!seen[$0]++' > ~/.config/surf/bookmarks.tmp && " \ + "mv ~/.config/surf/bookmarks.tmp ~/.config/surf/bookmarks", \ + winid, r, NULL \ + } \ +} + +/* styles */ +/* + * The iteration will stop at the first match, beginning at the beginning of + * the list. + */ +static SiteSpecific styles[] = { + /* regexp file in $styledir */ + { ".*", "localwiki.css" }, +}; + +/* certificates */ +/* + * Provide custom certificate for urls + */ +static SiteSpecific certs[] = { + /* regexp file in $certdir */ + { "://suckless\\.org/", "suckless.org.crt" }, +}; + +#define MODKEY GDK_CONTROL_MASK + +static char *linkselect_curwin [] = { "/bin/sh", "-c", + "surf_linkselect.sh $0 'Link' | xargs -r xprop -id $0 -f _SURF_GO 8s -set _SURF_GO", + winid, NULL +}; +static char *linkselect_newwin [] = { "/bin/sh", "-c", + "surf_linkselect.sh $0 'Link (new window)' | xargs -r /home/yigit/.scripts/tabbed_surf", + winid, NULL +}; +static char *editscreen[] = { "/bin/sh", "-c", "edit_screen.sh", NULL }; + +#define WATCH {.v = (char *[]){ "/bin/sh", "-c", \ + "/home/yigit/.scripts/watch_mpv.sh $(xprop -id $0 _SURF_URI | cut -d \\\" -f 2)", \ + winid, NULL } } + +#define WALLABAG {.v = (char *[]){ "/bin/sh", "-c", \ + "wallabag add $(xprop -id $0 _SURF_URI | cut -d '\"' -f 2) ; echo test > /tmp/aaa", \ + winid, NULL }} + +/* hotkeys */ +/* + * If you use anything else but MODKEY and GDK_SHIFT_MASK, don't forget to + * edit the CLEANMASK() macro. + */ +static Key keys[] = { + /* modifier keyval function arg */ + { 0, GDK_KEY_i, insert, { .i = 1 } }, + { 0, GDK_KEY_Escape, insert, { .i = 0 } }, + { 0, GDK_KEY_o, spawn, SETPROP("_SURF_URI", "_SURF_GO", PROMPT_GO) }, + { MODKEY, GDK_KEY_f, spawn, SETPROP("_SURF_FIND", "_SURF_FIND", PROMPT_FIND) }, + { MODKEY, GDK_KEY_b, spawn, BM_ADD("_SURF_URI") }, + + { 0, GDK_KEY_Escape, stop, { 0 } }, + + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_r, reload, { .i = 1 } }, + { MODKEY, GDK_KEY_r, reload, { .i = 0 } }, + + { 0, GDK_KEY_l, navigate, { .i = +1 } }, + { 0, GDK_KEY_h, navigate, { .i = -1 } }, + + /* vertical and horizontal scrolling, in viewport percentage */ + { 0, GDK_KEY_j, scrollv, { .i = +10 } }, + { 0, GDK_KEY_k, scrollv, { .i = -10 } }, + { 0, GDK_KEY_space, scrollv, { .i = +50 } }, + { 0, GDK_KEY_b, scrollv, { .i = -50 } }, + { 0, GDK_KEY_u, scrollh, { .i = -10 } }, + + + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_j, zoom, { .i = -1 } }, + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_k, zoom, { .i = +1 } }, + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_q, zoom, { .i = 0 } }, + { MODKEY, GDK_KEY_minus, zoom, { .i = -1 } }, + { MODKEY, GDK_KEY_plus, zoom, { .i = +1 } }, + + { 0, GDK_KEY_p, clipboard, { .i = 1 } }, + { 0, GDK_KEY_y, clipboard, { .i = 0 } }, + + { 0, GDK_KEY_n, find, { .i = +1 } }, + { GDK_SHIFT_MASK, GDK_KEY_n, find, { .i = -1 } }, + + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_p, print, { 0 } }, + { MODKEY, GDK_KEY_t, showcert, { 0 } }, + + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_a, togglecookiepolicy, { 0 } }, + { 0, GDK_KEY_F11, togglefullscreen, { 0 } }, + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_o, toggleinspector, { 0 } }, + + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_c, toggle, { .i = CaretBrowsing } }, + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_g, toggle, { .i = Geolocation } }, + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_s, toggle, { .i = JavaScript } }, + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_i, toggle, { .i = LoadImages } }, + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_v, toggle, { .i = Plugins } }, + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_b, toggle, { .i = ScrollBars } }, + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_t, toggle, { .i = StrictTLS } }, + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_m, toggle, { .i = Style } }, + { MODKEY, GDK_KEY_d, externalpipe, { .v = linkselect_curwin } }, + { GDK_SHIFT_MASK|MODKEY, GDK_KEY_d, externalpipe, { .v = linkselect_newwin } }, + { MODKEY, GDK_KEY_o, externalpipe, { .v = editscreen } }, + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_w, spawn, WATCH }, + { MODKEY, GDK_KEY_m, spawn, WALLABAG }, + { MODKEY , GDK_KEY_Return, spawn, SETURI("_SURF_GO") }, +}; + +/* button definitions */ +/* target can be OnDoc, OnLink, OnImg, OnMedia, OnEdit, OnBar, OnSel, OnAny */ +static Button buttons[] = { + /* target event mask button function argument stop event */ + { OnLink, 0, 2, clicknewwindow, { .i = 0 }, 1 }, + { OnLink, MODKEY, 2, clicknewwindow, { .i = 0 }, 1 }, + { OnLink, MODKEY, 1, clicknewwindow, { .i = 0 }, 1 }, + { OnAny, 0, 8, clicknavigate, { .i = -1 }, 1 }, + { OnAny, 0, 9, clicknavigate, { .i = +1 }, 1 }, + { OnMedia, MODKEY, 1, clickexternplayer, { 0 }, 1 }, +}; + +#define HOMEPAGE "http://localhost:9999" diff --git a/.ccls-cache/@home@yigit@.dotfiles/suckless@surf@config.h.blob b/.ccls-cache/@home@yigit@.dotfiles/suckless@surf@config.h.blob new file mode 100644 index 00000000..4b7bf11b Binary files /dev/null and b/.ccls-cache/@home@yigit@.dotfiles/suckless@surf@config.h.blob differ diff --git a/.gitsecret/keys/random_seed b/.gitsecret/keys/random_seed new file mode 100644 index 00000000..f985511a Binary files /dev/null and b/.gitsecret/keys/random_seed differ diff --git a/.gitsecret/paths/mapping.cfg b/.gitsecret/paths/mapping.cfg index 616c4549..65b2711d 100644 --- a/.gitsecret/paths/mapping.cfg +++ b/.gitsecret/paths/mapping.cfg @@ -4,5 +4,5 @@ config/calcurse/caldav/config:deb0fa27c7b788836034d168b2f5f401caeb9ec35dd9bd5913 config/zsh/secret:6a6b4e0d168adcfbbf31c969598c6897d6637efebc3ed3b34e1e0a5e0afed9af config/nextcloud/nextcloud:15de37aa910734dd275f2a71fc292f1f84951bc8a57d8b1eee26b2a1dcf66c6d config/spotifyd/spotifyd.conf:2365689856e64f966846c0e33b5fc31f3a3a1a571e4e2ca65bebfd660f8e83cf -config/wakatime/.wakatime.cfg:e306146d45036c38f15aa9a817fc172bdca3c4c9d9ed3c4f6fe1d8d93d783d78 +config/wakatime/.wakatime.cfg:82a89ad69a5440d31054a58e81d21e769c89b2f455172960059478f9639070c4 config/vdirsyncer/config:66055a713d4985c168a40cd1c07debacb76316a45f4b638c1aaf8c61f7515978 diff --git a/arch-setup/chroot.sh b/arch-setup/chroot.sh index cc2832da..4099ac2b 100755 --- a/arch-setup/chroot.sh +++ b/arch-setup/chroot.sh @@ -238,6 +238,7 @@ if [ -f "/install/artix" ]; then sudo rc-update add cronie sudo rc-update add acpi sudo rc-update add dbus + sudo rc-update add syslog-ng else systemctl enable NetworkManager systemctl enable cronie diff --git a/arch-setup/packages.base.artix b/arch-setup/packages.base.artix index 2daa733a..73f0ee11 100644 --- a/arch-setup/packages.base.artix +++ b/arch-setup/packages.base.artix @@ -1,4 +1,3 @@ -networkmanager-openrc efibootmgr refind python @@ -16,6 +15,10 @@ curl dash mksh acpi -acpi-openrc dbus +syslog-ng +avahi-openrc +acpi-openrc dbus-openrc +syslog-ng-openrc +networkmanager-openrc diff --git a/arch-setup/packages.rice b/arch-setup/packages.rice index 999a890d..5b147499 100644 --- a/arch-setup/packages.rice +++ b/arch-setup/packages.rice @@ -32,3 +32,11 @@ ncmpcpp cmake opencv xmenu +pacman-contrib +clipmenu +clipnotify +polkit-gnome +gnome-keyring +feh +sxiv +udevil diff --git a/config/.gitignore b/config/.gitignore index 6b484efc..8f45aae2 100644 --- a/config/.gitignore +++ b/config/.gitignore @@ -52,6 +52,7 @@ !readline/** !spotifyd !surf +!surf/** !tmate !tmate/** !tmux diff --git a/config/X11/xinitrc b/config/X11/xinitrc index 1d494e99..2e0fa8d4 100755 --- a/config/X11/xinitrc +++ b/config/X11/xinitrc @@ -46,11 +46,7 @@ mpd-mpris & touch ~/.cache/nextcloud-track xss-lock -- slock & picom --no-fading-openclose & -if [ "$BROWSER" = "firefox" ]; then - ~/.local/bin/firefox-sync -fi -$BROWSER & -bitwarden-desktop & +~/.local/bin/firefox-sync curl 'http://yeetclock/setcolor?R=136&G=192&B=208' & dunst & @@ -67,6 +63,10 @@ xset dpms 600 600 600 --exec-on-unmount "/sbin/notify-send '禍 drive unmounted' '%l (%f) from %d '" \ --no-unmount --no-gui & + +$BROWSER & +bitwarden-desktop & + touch ~/.cache/dwm-restart while [ -f /home/yigit/.cache/dwm-restart ]; do diff --git a/config/calcurse/caldav/config.secret b/config/calcurse/caldav/config.secret index 5c5a0ae2..0af585b6 100644 Binary files a/config/calcurse/caldav/config.secret and b/config/calcurse/caldav/config.secret differ diff --git a/config/isync/mbsyncrc.secret b/config/isync/mbsyncrc.secret index b99bd796..bab88d4f 100644 Binary files a/config/isync/mbsyncrc.secret and b/config/isync/mbsyncrc.secret differ diff --git a/config/msmtp/config.secret b/config/msmtp/config.secret index 1a36f4b3..b558d6a5 100644 Binary files a/config/msmtp/config.secret and b/config/msmtp/config.secret differ diff --git a/config/nextcloud/nextcloud.secret b/config/nextcloud/nextcloud.secret index 48932377..e3008081 100644 Binary files a/config/nextcloud/nextcloud.secret and b/config/nextcloud/nextcloud.secret differ diff --git a/config/spotifyd/spotifyd.conf.secret b/config/spotifyd/spotifyd.conf.secret index f248997f..66bc7bee 100644 Binary files a/config/spotifyd/spotifyd.conf.secret and b/config/spotifyd/spotifyd.conf.secret differ diff --git a/config/surf/styles/default.css b/config/surf/styles/default.css new file mode 100644 index 00000000..3012a18f --- /dev/null +++ b/config/surf/styles/default.css @@ -0,0 +1,15 @@ + *,div,pre,textarea,body,input,td,tr,p { + background-color: #202020 !important; + background-image: none !important; + color: #bbbbbb !important; + } + h1,h2,h3,h4 { + background-color: #202020 !important; + color: #b8ddea !important; + } + img { + opacity: .5; + } + img:hover { + opacity: 1; + } diff --git a/config/zsh/secret.secret b/config/zsh/secret.secret index f0a69b32..92761d53 100644 Binary files a/config/zsh/secret.secret and b/config/zsh/secret.secret differ diff --git a/install.sh b/install.sh index a2e141bc..327c7a7d 100755 --- a/install.sh +++ b/install.sh @@ -105,10 +105,10 @@ mc cp -r fr1nge-dots/dotfiles/backgrounds/ ~/.local/backgrounds/ if [ ! -f "/var/spool/cron/$username" ]; then sudo touch "/var/spool/cron/$username" sudo chown $username:$username "/var/spool/cron/$username" - sudo chmod 755 "/var/spool/cron/$username" + sudo chmod 0644 "/var/spool/cron/$username" 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 "0 * * * * /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 @@ -119,7 +119,7 @@ else cp /var/spool/cron/$username ~/.dotfiles_backup/crontab 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 "0 * * * * /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 @@ -154,7 +154,11 @@ sudo cp ~/.dotfiles/root/dwm.desktop /usr/share/xsessions sudo cp ~/.dotfiles/root/issue /etc/issue sudo cp ~/.dotfiles/root/motd /etc/motd sudo cp ~/.dotfiles/root/nancyj.flf /usr/share/figlet/fonts -sudo cp ~/.dotfiles/root/quark.service /usr/lib/systemd/system +if [ "$(grep artix < $(uname -a))" = "" ]; then + sudo cp ~/.dotfiles/root/quark /etc/init.d +else + sudo cp ~/.dotfiles/root/quark.service /usr/lib/systemd/system +fi sudo cp ~/.dotfiles/root/kdialog /usr/local/bin/kdialog sudo cp ~/.dotfiles/root/udevil.conf /etc/udevil/udevil.conf sudo chmod +x /usr/local/bin/kdialog @@ -182,6 +186,7 @@ echo "Installing Icons" echo "Setting up start page" prev=$(pwd) cd ~/.dotfiles/browser/startpage +sudo npm install -g parcel-bundler npm install > /dev/null 2> /dev/null npm run build > /dev/null 2> /dev/null cd $prev diff --git a/local/bin/.gitignore b/local/bin/.gitignore index a98733d5..00aacdaa 100644 --- a/local/bin/.gitignore +++ b/local/bin/.gitignore @@ -59,4 +59,4 @@ !ytfzf_dmenu !zaread !texclear -!check-updated +!check-updates diff --git a/local/bin/check-updates b/local/bin/check-updates new file mode 100755 index 00000000..2d13179a --- /dev/null +++ b/local/bin/check-updates @@ -0,0 +1,30 @@ +#!/bin/sh + +case "$(readlink -f /sbin/init)" in + *systemd*) export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus ;; +esac + +ping -q -c 1 example.org > /dev/null || exit + + +pgrepoutput="$(pgrep -a X\(org\|wayland\))" +displays="$(echo "$pgrepoutput" | grep -wo "[0-9]*:[0-9]\+" | sort -u)" +notify() { + [ -n "$pgrepoutput" ] && for x in ${displays:-:0}; do + export DISPLAY=$x + notify-send --app-name="auto-update" "$1" "$2" + done ; +} + +notify " Repository Sync" "Checking for package updates..." + +sudo pacman -Syyuw --noconfirm || notify " An error occured" "Error downloading updates. +Check your internet connection, if pacman is already running, or run update manually to see errors." +pkill -RTMIN+8 "${STATUSBAR:-dwmblocks}" + +if pacman -Qu | grep -v "\[ignored\]" +then + notify " Repository Sync" "Updates available. Click statusbar icon () for update." +else + notify " Repository Sync" "Sync complete. No new packages for update." +fi diff --git a/local/bin/firefox-sync b/local/bin/firefox-sync index deae09a0..4a6d761f 100755 --- a/local/bin/firefox-sync +++ b/local/bin/firefox-sync @@ -1,5 +1,7 @@ #!/bin/bash +source ~/.profile + if [ ! "$BROWSER" = "firefox" ]; then echo "Default browser is not firefox, exiting..." exit 0 diff --git a/local/bin/mailsync b/local/bin/mailsync index 54d3795b..a196f400 100755 --- a/local/bin/mailsync +++ b/local/bin/mailsync @@ -1,6 +1,5 @@ #!/bin/sh - export XDG_CONFIG_HOME="$HOME"/.config export MBSYNCRC="$XDG_CONFIG_HOME"/isync/mbsyncrc @@ -18,7 +17,7 @@ export MBSYNCRC="$XDG_CONFIG_HOME"/isync/mbsyncrc # Run only if user logged in (prevent cron errors) pgrep -u "${USER:=$LOGNAME}" >/dev/null || { echo "$USER not logged in; sync will not run."; exit ;} # Run only if not already running in other instance -pgrep -x mbsync >/dev/null && { echo "mbsync is already running." ; exit ;} +pidof -s mbsync >/dev/null && { echo "mbsync is already running." ; exit ;} # First, we have to get the right variables for the mbsync file, the pass # archive, notmuch and the GPG home. This is done by searching common profile @@ -26,7 +25,7 @@ pgrep -x mbsync >/dev/null && { echo "mbsync is already running." ; exit ;} # will work on the maximum number of machines. eval "$(grep -h -- \ "^\s*\(export \)\?\(MBSYNCRC\|PASSWORD_STORE_DIR\|NOTMUCH_CONFIG\|GNUPGHOME\)=" \ - "$HOME/.profile" "$HOME/.bash_profile" "$HOME/.zprofile" "$HOME/.config/zsh/.zprofile" \ + "$HOME/.profile" "$HOME/.bash_profile" "$HOME/.zprofile" "$HOME/.config/zsh/.zprofile" "$HOME/.zshenv" \ "$HOME/.bashrc" "$HOME/.zshrc" "$HOME/.config/zsh/.zshrc" "$HOME/.pam_environment" 2>/dev/null)" case "$(readlink -f /sbin/init)" in @@ -43,14 +42,16 @@ case "$(uname)" in messageinfo() { osascript -e "display notification with title \"📧 $from\" subtitle \"$subject\"" ;} ;; *) - displays="$(pgrep -a X\(org\|wayland\) | grep -wo "[0-9]*:[0-9]\+" | sort -u)" - notify() { for x in $displays; do + # remember if a display server is running since `ps` doesn't always contain a display + pgrepoutput="$(pgrep -a X\(org\|wayland\))" + displays="$(echo "$pgrepoutput" | grep -wo "[0-9]*:[0-9]\+" | sort -u)" + notify() { [ -n "$pgrepoutput" ] && for x in ${displays:-:0}; do export DISPLAY=$x - notify-send --app-name="mutt-wizard" "📧mutt-wizard" "$(echo $2 | xargs) new mail(s) in \`$1\` account." + notify-send --app-name="mutt-wizard" "mutt-wizard" "ﯬ $2 new mail(s) in \`$1\` account." done ;} - messageinfo() { for x in $displays; do + messageinfo() { [ -n "$pgrepoutput" ] && for x in ${displays:-:0}; do export DISPLAY=$x - notify-send --app-name="mutt-wizard" "📧$from:" "$subject" + notify-send --app-name="mutt-wizard" " $from:" "$subject" done ;} ;; esac @@ -61,10 +62,8 @@ syncandnotify() { if [ -z "$opts" ]; then mbsync "$acc"; else mbsync "$opts" "$acc"; fi new=$(find "$HOME/.local/share/mail/$acc/INBOX/new/" "$HOME/.local/share/mail/$acc/Inbox/new/" "$HOME/.local/share/mail/$acc/inbox/new/" -type f -newer "${XDG_CONFIG_HOME:-$HOME/.config}/mutt/.mailsynclastrun" 2> /dev/null) newcount=$(echo "$new" | sed '/^\s*$/d' | wc -l) - echo -n "$newcount" > ~/.cache/mcount - date +"%R" > ~/.cache/msync if [ "$newcount" -gt "0" ]; then - notify "$acc" "$newcount" & + notify "$acc" "$newcount" & for file in $new; do # Extract subject and sender from mail. from=$(awk '/^From: / && ++n ==1,/^\<.*\>:/' "$file" | perl -CS -MEncode -ne 'print decode("MIME-Header", $_)' | awk '{ $1=""; if (NF>=3)$NF=""; print $0 }' | sed 's/^[[:blank:]]*[\"'\''\<]*//;s/[\"'\''\>]*[[:blank:]]*$//') @@ -92,4 +91,5 @@ done wait notmuch new 2>/dev/null + kill -57 $(pidof dwmblocks) diff --git a/local/bin/status-bar/arch b/local/bin/status-bar/arch index ce3cdafc..64fa006f 100755 --- a/local/bin/status-bar/arch +++ b/local/bin/status-bar/arch @@ -1,17 +1,24 @@ #!/bin/sh -icon= +icon= -if ! updates=$(checkupdates 2> /dev/null | wc -l ); then - updates=0 +if [ ! -f ~/.cache/pacman_updates ]; then + updates=0 +else + updates=$(wc -l < ~/.cache/pacman_updates) + if [ "$updates" = "" ]; then + updates=0 + fi fi + +checkupdates 2> /dev/null > ~/.cache/pacman_updates & + case $BLOCK_BUTTON in 1) PATH="/opt/google-cloud-sdk/bin:/sbin:/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl" setsid -f "$TERMINAL" -c center -n center -e yay -Syu;; 6) "$TERMINAL" -e "$EDITOR" "$0" ;; esac -echo $updates > ~/.cache/pacman_updates #echo "$ifg $icon $tfg$(cat ~/.cache/pacman_updates)" -echo "^c#a48ead^$icon ^d^ $(cat ~/.cache/pacman_updates)" +echo "^c#a48ead^$icon ^d^ $updates" diff --git a/notes/firefox.md b/notes/firefox.md index 03400ae1..f9b6de24 100644 --- a/notes/firefox.md +++ b/notes/firefox.md @@ -3,7 +3,7 @@ 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 | diff --git a/profile b/profile index 79db5ac1..c0848e16 100755 --- a/profile +++ b/profile @@ -73,6 +73,10 @@ export XINITRC="$XDG_CONFIG_HOME"/X11/xinitrc export XAUTHORITY="$XDG_RUNTIME_DIR"/Xauthority export INPUTRC="$XDG_CONFIG_HOME"/readline/inputrc +case "$(readlink -f /sbin/init)" in + *systemd*) export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus ;; +esac + if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then if [ ! "$DBUS_SESSION_BUS_ADDRESS" ] && [ ! $(command -v dbus-launch) ]; then exec dbus-launch --exit-with-session xinit 2> $XDG_RUNTIME_DIR/xinit.err > $XDG_RUNTIME_DIR/xinit || exit diff --git a/root/quark b/root/quark new file mode 100755 index 00000000..afa6fc06 --- /dev/null +++ b/root/quark @@ -0,0 +1,19 @@ +#!/usr/bin/openrc-run + + +depend() { +need net +need localmount +} + +start() { +ebegin "Starting quark" +start-stop-daemon --background --start --exec /usr/local/bin/quark -- -p 9999 -d /home/yigit/.dotfiles/browser/startpage/dist -h 127.0.0.1 +eend $? +} + +stop() { +ebegin "Stopping myApp" +eend $? +} + diff --git a/suckless/surf/config.h b/suckless/surf/config.h index 49283b3f..706f7bf9 100644 --- a/suckless/surf/config.h +++ b/suckless/surf/config.h @@ -140,7 +140,7 @@ static WebKitFindOptions findopts = WEBKIT_FIND_OPTIONS_CASE_INSENSITIVE | */ static SiteSpecific styles[] = { /* regexp file in $styledir */ - { ".*", "localwiki.css" }, + { ".*", "default.css" }, }; /* certificates */