From f064922a74100af86def550d4ef6a50ab4e80203 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Wed, 18 Aug 2021 17:23:55 +0200 Subject: Added startpage search engine --- config/qutebrowser/config.py | 1 + 1 file changed, 1 insertion(+) diff --git a/config/qutebrowser/config.py b/config/qutebrowser/config.py index de73eb6..3d20f10 100644 --- a/config/qutebrowser/config.py +++ b/config/qutebrowser/config.py @@ -15,6 +15,7 @@ c.url.searchengines = { "DEFAULT": "https://searx.cacharle.xyz?q={}", "d": "https://duckduckgo.com/?q={}", "g": "https://google.com/?q={}", + "sp": "https://www.startpage.com/sp/search?q={}", "y": "https://www.youtube.com/results?search_query={}", "w": "https://en.wikipedia.org/wiki/Special:Search?search={}&go=Go&ns0=1", "wfr": "https://fr.wikipedia.org/wiki/Special:Search?search={}&go=Go&ns0=1", -- cgit From 7d9345c9564370bdb32cbb06d24b238986572ea6 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Thu, 19 Aug 2021 12:42:52 +0200 Subject: Added battery-low-notify script and crontab to run it every 10min --- crontab/laptop.crontab | 3 +++ install | 11 +++++++++-- local/bin/battery-low-check | 5 ----- local/bin/battery-low-notify | 14 ++++++++++++++ 4 files changed, 26 insertions(+), 7 deletions(-) create mode 100644 crontab/laptop.crontab delete mode 100755 local/bin/battery-low-check create mode 100755 local/bin/battery-low-notify diff --git a/crontab/laptop.crontab b/crontab/laptop.crontab new file mode 100644 index 0000000..18f36f1 --- /dev/null +++ b/crontab/laptop.crontab @@ -0,0 +1,3 @@ +*/10 * * * * . $HOME/.zprofile ; DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$(id -u $USER)/bus" DISPLAY=:0 battery-low-notify + +# vim:ft=crontab diff --git a/install b/install index 2c6ee73..892e845 100755 --- a/install +++ b/install @@ -6,7 +6,7 @@ if [ "$USER" = 'root' ] then - crontab 'crontab/root.crontab' + crontab crontab/root.crontab exit fi @@ -96,7 +96,14 @@ parallel_wait ############################################################################### echo '---------------------------- INSTALL CRONTAB -----------------------------' -crontab 'crontab/user.crontab' + +if [ "$(hostname)" = 'charleslaptopcarbon' ] +then + cat crontab/user.crontab crontab/laptop.crontab | crontab - +else + crontab crontab/user.crontab +fi + echo 'INFO: Run this script as root if you want to install the root contab' ############################################################################### diff --git a/local/bin/battery-low-check b/local/bin/battery-low-check deleted file mode 100755 index dbbdc6b..0000000 --- a/local/bin/battery-low-check +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -capacity=$(cat /sys/class/power_supply/BAT0/capacity) - -[ "$capacity" -lt 10 ] && notify-send -u critical "Battery low $capacity%" diff --git a/local/bin/battery-low-notify b/local/bin/battery-low-notify new file mode 100755 index 0000000..605ea91 --- /dev/null +++ b/local/bin/battery-low-notify @@ -0,0 +1,14 @@ +#!/bin/sh + +battery_dir='/sys/class/power_supply/BAT0' + +[ ! -d "$battery_dir" ] && exit 1 + +if [ "$(cat "$battery_dir/status")" != 'Charging' ] +then + capacity="$(cat "$battery_dir/capacity")" + [ "$capacity" -lt 15 ] && + notify-send -u critical "Battery low: $capacity%" +fi + +exit 0 -- cgit From 8deac2775f27a4a22d3f7bd5ecf42a9b56370b14 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Sat, 21 Aug 2021 11:58:37 +0200 Subject: Added battery charging status battery notification --- config/xmonad/xmonad.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config/xmonad/xmonad.hs b/config/xmonad/xmonad.hs index f71ce1d..d285569 100644 --- a/config/xmonad/xmonad.hs +++ b/config/xmonad/xmonad.hs @@ -65,7 +65,9 @@ keys' = [ ("", spawn "pulseaudio-ctl down") , ("M-i", spawn $ myTerminal ++ " -e zsh -c 'source ~/.config/zsh/.zshrc && rc'") , ("M-m", spawn $ myTerminal ++ " -e mocp -C /home/cacharle/.config/moc/config") , ("M-S-d", spawn "notify-send -i x-office-calendar \"$(date +\"%H:%M %A %d/%m/%Y %B\")\"") - , ("M-S-b", spawn "notify-send --hint=int:transient:1 --hint=int:value:\"$(cat /sys/class/power_supply/BAT0/capacity)\" \"Battery\"") + , ("M-S-b", spawn $ "notify-send --hint=int:transient:1 " ++ + "--hint=int:value:\"$(cat /sys/class/power_supply/BAT0/capacity)\" " ++ + "\"Battery: $(cat /sys/class/power_supply/BAT0/status)\"") , ("M-q", spawn "notify-send 'Restarting xmonad'" >> spawn restartCmd) , ("M-S-q", confirm "Are you sure you want to shutdown?" $ io (exitWith ExitSuccess)) ] -- cgit From 688d5df1bbf44914d20eb69fd55774c8d9b3f7a5 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Mon, 23 Aug 2021 11:18:47 +0200 Subject: Moving mimeapps.list to the correct directory --- config/mimeapps.list | 25 +++++++++++++++++++++++++ local/share/mimeapps.list | 25 ------------------------- 2 files changed, 25 insertions(+), 25 deletions(-) create mode 100644 config/mimeapps.list delete mode 100644 local/share/mimeapps.list diff --git a/config/mimeapps.list b/config/mimeapps.list new file mode 100644 index 0000000..49a184b --- /dev/null +++ b/config/mimeapps.list @@ -0,0 +1,25 @@ +[Default Applications] + +# from: https://git.lukesmith.xyz/dotfiles/file/.config/mimeapps.list + +# xdg-open will use these settings to determine how to open filetypes. +# These .desktop entries can also be seen and changed in ~/.local/share/applications/ + +# text/x-shellscript=text.desktop; +# x-scheme-handler/magnet=torrent.desktop; +# application/x-bittorrent=torrent.desktop; +x-scheme-handler/mailto=mail.desktop; +# text/plain=text.desktop; +application/postscript=zathura.desktop; +application/pdf=zathura.desktop; + +image/png=sxiv.desktop; +image/jpeg=sxiv.desktop; +image/gif=sxiv.desktop; +image/svg+xml=sxiv.desktop; + +application/rss+xml=newsboat.desktop + +video/x-matroska=mpv.desktop +# x-scheme-handler/lbry=lbry.desktop +# inode/directory=file.desktop diff --git a/local/share/mimeapps.list b/local/share/mimeapps.list deleted file mode 100644 index 49a184b..0000000 --- a/local/share/mimeapps.list +++ /dev/null @@ -1,25 +0,0 @@ -[Default Applications] - -# from: https://git.lukesmith.xyz/dotfiles/file/.config/mimeapps.list - -# xdg-open will use these settings to determine how to open filetypes. -# These .desktop entries can also be seen and changed in ~/.local/share/applications/ - -# text/x-shellscript=text.desktop; -# x-scheme-handler/magnet=torrent.desktop; -# application/x-bittorrent=torrent.desktop; -x-scheme-handler/mailto=mail.desktop; -# text/plain=text.desktop; -application/postscript=zathura.desktop; -application/pdf=zathura.desktop; - -image/png=sxiv.desktop; -image/jpeg=sxiv.desktop; -image/gif=sxiv.desktop; -image/svg+xml=sxiv.desktop; - -application/rss+xml=newsboat.desktop - -video/x-matroska=mpv.desktop -# x-scheme-handler/lbry=lbry.desktop -# inode/directory=file.desktop -- cgit From 4a2a439f9f54acc553b40be12be68e3e2a8a055f Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Mon, 23 Aug 2021 11:27:18 +0200 Subject: Added epub entry to mimeapps.list --- config/mimeapps.list | 1 + 1 file changed, 1 insertion(+) diff --git a/config/mimeapps.list b/config/mimeapps.list index 49a184b..db42645 100644 --- a/config/mimeapps.list +++ b/config/mimeapps.list @@ -12,6 +12,7 @@ x-scheme-handler/mailto=mail.desktop; # text/plain=text.desktop; application/postscript=zathura.desktop; application/pdf=zathura.desktop; +application/epub+zip=zathura.desktop; image/png=sxiv.desktop; image/jpeg=sxiv.desktop; -- cgit From 04bb6725e3605567fca9b98b7aee8077dcc030b4 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Mon, 23 Aug 2021 22:47:58 +0200 Subject: Added command-not-found package list to zsh --- config/zsh/.zshrc | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/config/zsh/.zshrc b/config/zsh/.zshrc index 7cc7bab..0b28a0f 100644 --- a/config/zsh/.zshrc +++ b/config/zsh/.zshrc @@ -68,13 +68,6 @@ chpwd() { # shellcheck disable=SC2034,SC2039,SC3030 fignore=(o hi) # ignore extensions in autocomplete -# pluggins -# shellcheck source=/dev/null -. "$XDG_DATA_HOME/zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" # prompt syntax highlight - -export YSU_MESSAGE_POSITION="after" # you-should-use message after command output -. "$XDG_DATA_HOME/zsh/zsh-you-should-use/you-should-use.plugin.zsh" # alias reminder - # set tab to 4 spaces tabs 4 @@ -82,3 +75,14 @@ GPG_TTY=$(tty) # fixing gpg fatal error about tty export GPG_TTY export BAT_THEME='gruvbox-dark' # gruvbox theme for bat (fancy cat) + +# pluggins +# shellcheck source=/dev/null +. "$XDG_DATA_HOME/zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" # prompt syntax highlight + +export YSU_MESSAGE_POSITION="after" # you-should-use message after command output +. "$XDG_DATA_HOME/zsh/zsh-you-should-use/you-should-use.plugin.zsh" # alias reminder + +# install pkgfile package on Arch Linux +# run `pkgfile --update` +. /usr/share/doc/pkgfile/command-not-found.zsh -- cgit From e49f51533e191ba5dbde33f88f74001c2a0fa2fe Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Thu, 26 Aug 2021 01:36:20 +0200 Subject: Added crontab to remove unrequired packages --- crontab/root.crontab | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crontab/root.crontab b/crontab/root.crontab index 48cb3ab..dbe87f6 100644 --- a/crontab/root.crontab +++ b/crontab/root.crontab @@ -1,5 +1,6 @@ # Meant to be installed as root -0 12 */2 * * pacman --noconfirm -Syu >> /var/log/pacman_update.log +0 12 */2 * * pacman --noconfirm -Syu +20 12 */2 * * pacman -Qdt | xargs pacman --noconfirm -Rns # vim:ft=crontab -- cgit From fec8285a351a0586107fcba0d11d078d8d5cd368 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Thu, 26 Aug 2021 01:37:16 +0200 Subject: Added mimeapps.list entry to open mailto URIs --- config/mimeapps.list | 2 +- local/share/applications/mutt.desktop | 4 ---- local/share/applications/st-mutt.desktop | 4 ++++ 3 files changed, 5 insertions(+), 5 deletions(-) delete mode 100644 local/share/applications/mutt.desktop create mode 100644 local/share/applications/st-mutt.desktop diff --git a/config/mimeapps.list b/config/mimeapps.list index db42645..db8d517 100644 --- a/config/mimeapps.list +++ b/config/mimeapps.list @@ -8,7 +8,7 @@ # text/x-shellscript=text.desktop; # x-scheme-handler/magnet=torrent.desktop; # application/x-bittorrent=torrent.desktop; -x-scheme-handler/mailto=mail.desktop; +x-scheme-handler/mailto=st-mutt.desktop; # text/plain=text.desktop; application/postscript=zathura.desktop; application/pdf=zathura.desktop; diff --git a/local/share/applications/mutt.desktop b/local/share/applications/mutt.desktop deleted file mode 100644 index 24d0a48..0000000 --- a/local/share/applications/mutt.desktop +++ /dev/null @@ -1,4 +0,0 @@ -[Desktop Entry] -Type=Application -Name=Mail client -Exec=/usr/bin/mutt %u diff --git a/local/share/applications/st-mutt.desktop b/local/share/applications/st-mutt.desktop new file mode 100644 index 0000000..d15aff8 --- /dev/null +++ b/local/share/applications/st-mutt.desktop @@ -0,0 +1,4 @@ +[Desktop Entry] +Type=Application +Name=Mutt in an st terminal +Exec=/usr/local/bin/st -e /usr/bin/mutt %u -- cgit