diff options
| author | Charles Cabergs <me@cacharle.xyz> | 2021-09-07 08:52:44 +0200 |
|---|---|---|
| committer | Charles Cabergs <me@cacharle.xyz> | 2021-09-07 08:52:44 +0200 |
| commit | c27ec9af26ee58d10c8a4120eb30ea30ed3e48dd (patch) | |
| tree | ea6468cef43a4c7b61c1d6c1f198535e9204d38a | |
| parent | c2ef576bcf9b69059492f7b7b4dfe89eb438fe44 (diff) | |
| parent | fec8285a351a0586107fcba0d11d078d8d5cd368 (diff) | |
| download | dotfiles-c27ec9af26ee58d10c8a4120eb30ea30ed3e48dd.tar.gz dotfiles-c27ec9af26ee58d10c8a4120eb30ea30ed3e48dd.tar.bz2 dotfiles-c27ec9af26ee58d10c8a4120eb30ea30ed3e48dd.zip | |
Merge branch 'master' of cacharle.xyz:/srv/git/dotfiles
| -rw-r--r-- | config/mimeapps.list (renamed from local/share/mimeapps.list) | 3 | ||||
| -rw-r--r-- | config/qutebrowser/config.py | 1 | ||||
| -rw-r--r-- | config/xmonad/xmonad.hs | 4 | ||||
| -rw-r--r-- | config/zsh/.zshrc | 18 | ||||
| -rw-r--r-- | crontab/laptop.crontab | 3 | ||||
| -rw-r--r-- | crontab/root.crontab | 3 | ||||
| -rwxr-xr-x | install | 11 | ||||
| -rwxr-xr-x | local/bin/battery-low-check | 5 | ||||
| -rwxr-xr-x | local/bin/battery-low-notify | 14 | ||||
| -rw-r--r-- | local/share/applications/mutt.desktop | 4 | ||||
| -rw-r--r-- | local/share/applications/st-mutt.desktop | 4 |
11 files changed, 49 insertions, 21 deletions
diff --git a/local/share/mimeapps.list b/config/mimeapps.list index 49a184b..db8d517 100644 --- a/local/share/mimeapps.list +++ b/config/mimeapps.list @@ -8,10 +8,11 @@ # 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; +application/epub+zip=zathura.desktop; image/png=sxiv.desktop; image/jpeg=sxiv.desktop; 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", 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' = [ ("<XF86AudioLowerVolume>", 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)) ] 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 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/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 @@ -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 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 |
