X-Git-Url: https://git.shemshak.org/gitweb.cgi/~bandali/configs/blobdiff_plain/b41bfb271ff22c360850ef24a59b1d4b5a82fdaf..f7f392c7cd4960eee6769b8c2310ffb78898e3f1:/rc.org diff --git a/rc.org b/rc.org index d1155f1..6843791 100644 --- a/rc.org +++ b/rc.org @@ -625,13 +625,71 @@ timeout = 0 Helvetica - + Liberation Sans - + #+end_src +** getmail + +*** getmailrc +:PROPERTIES: +:header-args+: :tangle ~/.getmail/getmailrc +:END: + +#+begin_src conf +[retriever] +type = SimplePOP3SSLRetriever +server = fencepost.gnu.org +username = bandali +password_command = ("gpg2", "--no-tty", "-q", "-d", "/home/amin/.passwd/gnu.gpg") +port = 995 +use_apop = True + +[destination] +type = Maildir +path = ~/mail/gnu/Inbox/ + +[options] +delete = True +#+end_src + +*** getmail.service +:PROPERTIES: +:header-args+: :tangle ~/.config/systemd/user/getmail.service +:END: + +#+begin_src conf :tangle no +[Unit] +Description=getmail service + +[Service] +Type=oneshot +ExecStart=/usr/bin/getmail +StandardOutput=syslog +StandardError=syslog +#+end_src + +*** getmail.timer +:PROPERTIES: +:header-args+: :tangle ~/.config/systemd/user/getmail.timer +:END: + +#+begin_src conf :tangle no +[Unit] +Description=getmail timer + +[Timer] +OnCalendar=*:0/30 +Persistent=true +Unit=getmail.service + +[Install] +WantedBy=timers.target +#+end_src + ** Git *** gitconfig @@ -643,8 +701,8 @@ timeout = 0 #+begin_src conf [user] name = Amin Bandali - email = amin@aminb.org - signingkey = 4E05246AB0BF7FFB + email = bandali@gnu.org + signingkey = BE6273738E616D6D1B3A08E8A21A020248816103 #+end_src **** signing @@ -686,6 +744,8 @@ timeout = 0 pr = pull --rebase ps = push psf = push --force + nmam = "!f() { notmuch show --format=raw $1 | git am -; }; f" + nmam3 = "!f() { notmuch show --format=raw $1 | git am -3 -; }; f" #+end_src **** color @@ -721,8 +781,8 @@ timeout = 0 **** send-email #+begin_src conf [sendemail] - smtpuser = amin@aminb.org - smtpserver = nix.aminb.org + smtpuser = bandali + smtpserver = fencepost.gnu.org smtpserverport = 587 smtpencryption = tls annotate = yes @@ -743,12 +803,60 @@ timeout = 0 *-autoloads.el #+end_src +** GnuPG +:PROPERTIES: +:header-args+: :tangle ~/.gnupg/gpg-agent.conf +:END: + +#+begin_src conf +default-cache-ttl 43200 +max-cache-ttl 43200 + +default-cache-ttl-ssh 10800 +max-cache-ttl-ssh 10800 + +# pinentry-program /usr/bin/pinentry-qt +#+end_src + +** GTK + +*** gtk-2.0 +:PROPERTIES: +:header-args+: :tangle ~/.gtkrc-2.0 +:END: + +#+begin_src conf +gtk-theme-name="Greybird" +gtk-icon-theme-name="Paper" +gtk-font-name="Ubuntu 10" +gtk-menu-images=0 +# gtk-key-theme-name = "Emacs" +#+end_src + +*** gtk-3.0 +:PROPERTIES: +:header-args+: :tangle ~/.config/gtk-3.0/settings.ini +:END: + +#+begin_src conf :tangle no +[Settings] +gtk-icon-theme-name = Paper +# gtk-theme-name = Adwaita + +gtk-theme-name = Greybird +# gtk-theme-name = Arc-Darker +# gtk-theme-name = Numix-ArchBlue + +gtk-font-name = Ubuntu 10 +# gtk-key-theme-name = Emacs +#+end_src + ** [[https://github.com/Leinnan/i3gs][i3gs]] :PROPERTIES: :header-args+: :tangle ~/.config/i3gs/config :END: -#+begin_src conf :comments none +#+begin_src conf :comments none :tangle no borders_width=0 0 2 0 separator_width=10 @@ -795,146 +903,79 @@ title=  borders_color=#FFDC00 separator_width=0 #+end_src -** Latexmk -:PROPERTIES: -:header-args+: :tangle ~/.latexmkrc -:END: - -#+begin_src conf -$pdf_previewer = "start zathura %O %S"; -$clean_ext = "aux out"; - -# $pdf_update_method = 4; -# $pdf_update_command = "zathura %O %S"; - -# Synctex allows one to jump to from the PDF in Zathura to the source in Emacs -# by Ctrl+click in the PDF. -# Tell latexmk to use Zathura as a previewer, and run emacsclient as the Synctex -# editor. -# $pdf_previewer = 'exec zathura --synctex-forward -x \'emacsclient --no-wait +%{line} %{input}\' %O %S'; -#+end_src - -** libinput - -Improve XPS 15 9560's touchpad experience. - -# begin_src conf :tangle (when (and (eq system-type 'gnu/linux) (string= (system-name) "plasma")) "/sudo::/etc/X11/xorg.conf.d/30-touchpad.conf") -#+begin_src conf :tangle no -Section "InputClass" - Identifier "libinput touchpad catchall" - Driver "libinput" - MatchIsTouchpad "on" - Option "ClickMethod" "clickfinger" - Option "NaturalScrolling" "true" - Option "Tapping" "on" - Option "TappingButtonMap" "lrm" -EndSection -#+end_src - -** getmail - -*** getmailrc -:PROPERTIES: -:header-args+: :tangle ~/.getmail/getmailrc -:END: - -#+begin_src conf -[retriever] -type = SimplePOP3SSLRetriever -server = fencepost.gnu.org -username = aminb -password_command = ("gpg2", "--no-tty", "-q", "-d", "/home/amin/.passwd/gnu.gpg") -port = 995 -use_apop = True - -[destination] -type = Maildir -path = ~/mail/gnu/Inbox/ - -[options] -delete = True -#+end_src - -*** getmail.service -:PROPERTIES: -:header-args+: :tangle ~/.config/systemd/user/getmail.service -:END: - -#+begin_src conf :tangle no -[Unit] -Description=getmail service - -[Service] -Type=oneshot -ExecStart=/usr/bin/getmail -StandardOutput=syslog -StandardError=syslog -#+end_src - -*** getmail.timer -:PROPERTIES: -:header-args+: :tangle ~/.config/systemd/user/getmail.timer -:END: - -#+begin_src conf :tangle no -[Unit] -Description=getmail timer - -[Timer] -OnCalendar=*:0/30 -Persistent=true -Unit=getmail.service - -[Install] -WantedBy=timers.target -#+end_src -** GnuPG +** i3status :PROPERTIES: -:header-args+: :tangle ~/.gnupg/gpg-agent.conf +:header-args+: :tangle ~/.config/i3status/config :END: -#+begin_src conf -default-cache-ttl 43200 -max-cache-ttl 43200 - -default-cache-ttl-ssh 10800 -max-cache-ttl-ssh 10800 +#+begin_src conf :comments none +# i3status configuration file. +# see "man i3status" for documentation. + +# It is important that this file is edited as UTF-8. +# The following line should contain a sharp s: +# ß +# If the above line is not correctly displayed, fix your editor first! + +general { + colors = true + interval = 5 + output_format = "i3bar" +} -# pinentry-program /usr/bin/pinentry-qt -#+end_src +# order += "ipv6" +order += "disk /" +order += "disk /data" +order += "wireless _first_" +order += "ethernet _first_" +order += "battery 0" +order += "volume master" +order += "load" +order += "tztime local" + +wireless _first_ { + format_up = "W:%quality %essid %ip" + format_down = "W: down" +} -** GTK +ethernet _first_ { + # if you use %speed, i3status requires root privileges + format_up = "E: %ip (%speed)" + format_down = "E: down" +} -*** gtk-2.0 -:PROPERTIES: -:header-args+: :tangle ~/.gtkrc-2.0 -:END: +battery 0 { + format = "%status %percentage %remaining (%consumption)" + path = "/sys/class/power_supply/BAT%d/uevent" + low_threshold = "10" + threshold_type = "percentage" + last_full_capacity = true + integer_battery_capacity = true + hide_seconds = true +} -#+begin_src conf -gtk-theme-name="Greybird" -gtk-icon-theme-name="Paper" -gtk-font-name="Ubuntu 10" -gtk-menu-images=0 -# gtk-key-theme-name = "Emacs" -#+end_src +tztime local { + format = "%-I:%M%P %a %b %d" +} -*** gtk-3.0 -:PROPERTIES: -:header-args+: :tangle ~/.config/gtk-3.0/settings.ini -:END: +volume master { + format = "♪ %volume" + format_muted = "🔇 %volume" + device = "pulse" +} -#+begin_src conf :tangle no -[Settings] -gtk-icon-theme-name = Paper -# gtk-theme-name = Adwaita +load { + format = "%1min" +} -gtk-theme-name = Greybird -# gtk-theme-name = Arc-Darker -# gtk-theme-name = Numix-ArchBlue +disk "/" { + format = "/ %avail" +} -gtk-font-name = Ubuntu 10 -# gtk-key-theme-name = Emacs +disk "/data" { + format = "/data %avail" +} #+end_src ** isync @@ -950,7 +991,7 @@ CopyArrivalDate yes ###### IMAPAccount amin -Host nix.aminb.org +Host mail.aminb.org User amin@aminb.org PassCmd "gpg -q --for-your-eyes-only --no-tty -d ~/.passwd/amin.gpg" SSLType IMAPS @@ -1027,19 +1068,55 @@ Unit=mbsync.service WantedBy=timers.target #+end_src -** mpd +** Latexmk :PROPERTIES: -:header-args+: :tangle ~/.config/mpd/mpd.conf +:header-args+: :tangle ~/.latexmkrc :END: #+begin_src conf -# An example configuration file for MPD. -# Read the user manual for documentation: http://www.musicpd.org/doc/user/ +$pdf_previewer = "start zathura %O %S"; +$clean_ext = "aux out"; +# $pdf_update_method = 4; +# $pdf_update_command = "zathura %O %S"; -# Files and directories ####################################################### -# -# This setting controls the top directory which MPD will search to discover the +# Synctex allows one to jump to from the PDF in Zathura to the source in Emacs +# by Ctrl+click in the PDF. +# Tell latexmk to use Zathura as a previewer, and run emacsclient as the Synctex +# editor. +# $pdf_previewer = 'exec zathura --synctex-forward -x \'emacsclient --no-wait +%{line} %{input}\' %O %S'; +#+end_src + +** libinput + +Improve XPS 15 9560's touchpad experience. + +# begin_src conf :tangle (when (and (eq system-type 'gnu/linux) (string= (system-name) "plasma")) "/sudo::/etc/X11/xorg.conf.d/30-touchpad.conf") +#+begin_src conf :tangle no +Section "InputClass" + Identifier "libinput touchpad catchall" + Driver "libinput" + MatchIsTouchpad "on" + Option "ClickMethod" "clickfinger" + Option "NaturalScrolling" "true" + Option "Tapping" "on" + Option "TappingButtonMap" "lrm" +EndSection +#+end_src + +** mpd +:PROPERTIES: +:header-args+: :tangle ~/.config/mpd/mpd.conf +:END: + +#+begin_src conf +# An example configuration file for MPD. +# Read the user manual for documentation: http://www.musicpd.org/doc/user/ + + +# Files and directories ####################################################### +# +# This setting controls the top directory which MPD will search to discover the # available audio files and add them to the daemon's online database. This # setting defaults to the XDG directory, otherwise the music directory will be # be disabled and audio files will only be accepted over ipc socket (using @@ -1458,8 +1535,9 @@ logfile ~/.msmtp.log # aminb account aminb -host nix.aminb.org -tls_fingerprint 65:DD:B8:32:D8:CD:F1:DC:B6:34:EE:35:04:18:AC:09:F3:1D:6D:20:F2:4A:E2:BD:64:48:B7:1F:90:BD:C4:BA +host mail.aminb.org +# use `msmtp -a aminb --serverinfo --tls --tls-certcheck=off --tls-fingerprint=` to get the current fingerprint +tls_fingerprint C7:A4:2E:A3:11:FA:80:45:C4:29:D6:62:4D:73:DB:34:43:67:8F:16:F1:2E:54:43:06:1B:41:B6:A9:09:E0:37 tls_starttls on from amin@aminb.org user amin@aminb.org @@ -1469,12 +1547,20 @@ passwordeval gpg2 --no-tty -q -d ~/.passwd/amin.gpg account gnu host fencepost.gnu.org # use `msmtp -a gnu --serverinfo --tls --tls-certcheck=off --tls-fingerprint=` to get the current fingerprint -tls_fingerprint 28:70:42:76:1C:EC:91:5F:D1:B3:27:A1:CD:3B:32:A4:8B:0B:DC:3A:CD:CA:F6:6F:E4:61:BA:69:D7:4D:0D:0B +tls_fingerprint 34:60:91:B5:71:5B:76:87:50:F3:83:13:26:0F:EE:75:42:83:93:9A:E2:AF:1E:87:72:02:C9:61:CE:28:1B:8E tls_starttls on -from aminb@gnu.org -user aminb +from bandali@gnu.org +user bandali passwordeval gpg2 --no-tty -q -d ~/.passwd/gnu.gpg +# gnu (old) +account gnu-aminb : gnu +from aminb@gnu.org +account gnu-amin : gnu +from amin@gnu.org +account gnu-mab : gnu +from mab@gnu.org + # uwaterloo account uwaterloo host connect.uwaterloo.ca @@ -1484,10 +1570,6 @@ user abandali passwordeval gpg2 --no-tty -q -d ~/.passwd/uwaterloo.gpg tls_trust_file /etc/ssl/certs/ca-certificates.crt -# uwaterloo (friendly address) -account uwaterloo-friendly : uwaterloo -from amin.bandali@uwaterloo.ca - # Set a default account account default : aminb #+end_src @@ -2110,7 +2192,7 @@ path=/home/amin/mail [user] name=Amin Bandali primary_email=amin@aminb.org -other_email=abandali@uwaterloo.ca;amin.bandali@uwaterloo.ca;aminb@gnu.org; +other_email=bandali@gnu.org;abandali@uwaterloo.ca; # Configuration for "notmuch new" # @@ -2196,31 +2278,32 @@ sieve-filter -eW -o postmaster_address=postmaster@aminb.org \ #+begin_src sh # apply sent tag to messages sent by me -notmuch tag -new +sent -- from:amin@aminb.org or from:aminb@gnu.org or from:abandali@uwaterloo.ca or from:amin.bandali@uwaterloo.ca +notmuch tag -new +sent -- from:amin@aminb.org or from:bandali@gnu.org or from:aminb@gnu.org or from:amin@gnu.org or from:mab@gnu.org or from:abandali@uwaterloo.ca # initial tagging -notmuch tag -latest -- tag:latest +notmuch tag -latest -- tag:latest notmuch tag +inbox +unread +latest -new -- tag:new # apply tags to lists # -notmuch tag -inbox +lists/~sircmpwn/srht-admins -- folder:amin/lists/~sircmpwn/srht-admins -notmuch tag -inbox +lists/~sircmpwn/srht-announce -- folder:amin/lists/~sircmpwn/srht-announce -notmuch tag -inbox +lists/~sircmpwn/srht-dev -- folder:amin/lists/~sircmpwn/srht-dev -notmuch tag -inbox +lists/~sircmpwn/srht-discuss -- folder:amin/lists/~sircmpwn/srht-discuss - notmuch tag -inbox +lists/hackernewsletter -- folder:amin/lists/hackernewsletter notmuch tag -inbox +lists/haskell-weekly -- folder:amin/lists/haskell-weekly -notmuch tag -inbox +pay -- folder:amin/pay +notmuch tag -inbox +pay -- folder:amin/pay +notmuch tag -inbox +banking -- folder:amin/banking +notmuch tag -inbox +work -- folder:amin/work # # -notmuch tag -inbox +uw/cs136 -- folder:uwaterloo/lists/cs136 -notmuch tag -inbox +uw/se463 -- folder:uwaterloo/lists/se463 +notmuch tag -inbox +uw/cs136 -- folder:uwaterloo/lists/cs136 +notmuch tag -inbox +uw/cs846 -- folder:uwaterloo/lists/cs846 +notmuch tag -inbox +uw/ece750 -- folder:uwaterloo/lists/ece750 +notmuch tag -inbox +uw/se212 -- folder:uwaterloo/lists/se212 +notmuch tag -inbox +uw/se463 -- folder:uwaterloo/lists/se463 +notmuch tag -inbox +lists/alloytools -- folder:uwaterloo/lists/alloytools notmuch tag -inbox +lists/clvsingle -- folder:uwaterloo/lists/Clvsingle notmuch tag -inbox +lists/gsa -- folder:uwaterloo/lists/GSA notmuch tag -inbox +lists/math-grad -- folder:uwaterloo/lists/Math-grad @@ -2229,22 +2312,28 @@ notmuch tag -inbox +lists/watform-students -- folder:uwaterloo/lists/Watform-stu # # -notmuch tag -inbox +lists/emacs-devel -- folder:gnu/l/emacs-devel -notmuch tag -inbox +lists/emacs-orgmode -- folder:gnu/l/emacs-orgmode -notmuch tag -inbox +lists/emacsconf-discuss -- folder:gnu/l/emacsconf-discuss -notmuch tag -inbox +lists/fencepost-users -- folder:gnu/l/fencepost-users -notmuch tag -inbox +lists/guix-devel -- folder:gnu/l/guix-devel -notmuch tag -inbox +lists/guile-devel -- folder:gnu/l/guile-devel -notmuch tag -inbox +lists/help-gnu-emacs -- folder:gnu/l/help-gnu-emacs -notmuch tag -inbox +lists/info-gnu-emacs -- folder:gnu/l/info-gnu-emacs -notmuch tag -inbox +lists/www-commits -- folder:gnu/l/www-commits -notmuch tag -inbox +lists/www-discuss -- folder:gnu/l/www-discuss -notmuch tag -inbox +webmasters -- folder:gnu/webmasters - -notmuch tag -inbox +lists/deepspec -- folder:gnu/l/deepspec -notmuch tag -inbox +lists/haskell-cafe -- folder:gnu/l/haskell-cafe -notmuch tag -inbox +lists/haskell-art -- folder:gnu/l/haskell-art -notmuch tag -inbox +lists/notmuch -- folder:gnu/l/notmuch +notmuch tag -inbox +l/emacs-devel -- folder:gnu/l/emacs-devel +notmuch tag -inbox +l/emacs-orgmode -- folder:gnu/l/emacs-orgmode +notmuch tag -inbox +l/emacsconf-discuss -- folder:gnu/l/emacsconf-discuss +notmuch tag -inbox +l/fencepost-users -- folder:gnu/l/fencepost-users +notmuch tag -inbox +l/guix-devel -- folder:gnu/l/guix-devel +notmuch tag -inbox +l/guile-devel -- folder:gnu/l/guile-devel +notmuch tag -inbox +l/help-gnu-emacs -- folder:gnu/l/help-gnu-emacs +notmuch tag -inbox +l/info-gnu-emacs -- folder:gnu/l/info-gnu-emacs +notmuch tag -inbox +l/www-commits -- folder:gnu/l/www-commits +notmuch tag -inbox +l/www-discuss -- folder:gnu/l/www-discuss +notmuch tag -inbox +webmasters -- folder:gnu/webmasters + +notmuch tag -inbox +l/deepspec -- folder:gnu/l/deepspec +notmuch tag -inbox +l/haskell-cafe -- folder:gnu/l/haskell-cafe +notmuch tag -inbox +l/haskell-art -- folder:gnu/l/haskell-art +notmuch tag -inbox +l/notmuch -- folder:gnu/l/notmuch + +notmuch tag -inbox +l/~aminb/test-priv -- folder:gnu/l/~aminb/test-priv +notmuch tag -inbox +l/~sircmpwn/sr.ht-admins -- folder:gnu/l/~sircmpwn/sr.ht-admins +notmuch tag -inbox +l/~sircmpwn/sr.ht-announce -- folder:gnu/l/~sircmpwn/sr.ht-announce +notmuch tag -inbox +l/~sircmpwn/sr.ht-dev -- folder:gnu/l/~sircmpwn/sr.ht-dev +notmuch tag -inbox +l/~sircmpwn/sr.ht-discuss -- folder:gnu/l/~sircmpwn/sr.ht-discuss # notmuch tag -inbox -unread +archive/notmuch -- path:archive/notmuch/** @@ -2427,6 +2516,19 @@ if anyof ( fileinto :create "l/${listname}"; } } + +if anyof ( + header :contains "list-id" "<~aminb/test-priv@lists.sr.ht>", + header :contains "list-id" "<~sircmpwn/sr.ht-admins@lists.sr.ht>", + header :contains "list-id" "<~sircmpwn/sr.ht-announce@lists.sr.ht>", + header :contains "list-id" "<~sircmpwn/sr.ht-dev@lists.sr.ht>", + header :contains "list-id" "<~sircmpwn/sr.ht-discuss@lists.sr.ht>") { + if header :regex "list-id" "(~[a-z_0-9-]+)/([a-z_0-9.-]+)@" { + set :lower "username" "${1}"; + set :lower "listname" "${2}"; + fileinto :create "l/${username}/${listname}"; + } +} #+end_src ** polybar @@ -3561,10 +3663,11 @@ adjustment-method=randr :END: #+begin_src conf -rofi.font: Ubuntu Mono 13 +! rofi.font: Ubuntu Mono 13 ! rofi.font: Inconsolata 16 ! rofi.font: Iosevka 13 ! rofi.font: Source Code Pro 11 +rofi.font: Source Code Pro 10.5 rofi.modi: run,window ! rofi.width: 640 rofi.width: 600 @@ -3663,13 +3766,13 @@ insert_pass="Alt+n" #+end_src ** sway + +*** main :PROPERTIES: :header-args+: :tangle ~/.config/sway/config :END: #+begin_src conf -exec xrdb .Xresources -exec dunst ### Variables # super set $mod Mod4 @@ -3694,21 +3797,290 @@ output * bg /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill # You can get the names of your outputs by running: swaymsg -t get_outputs ### Idle configuration + +exec swayidle \ + timeout 120 '[ -f ~/.nosleep ] || swaymsg "output * dpms off"' \ + resume '[ -f ~/.nosleep ] || swaymsg "output * dpms on"' \ + before-sleep swaylock + + +### Key bindings # -# Example configuration: +# Basics: +# + # start a terminal + bindsym $mod+Return exec $term + + # kill focused window + bindsym $mod+Shift+q kill + + # start your launcher + bindsym $mod+d exec $menu + + # password manager + bindsym $mod2+space exec rofi-pass + + # Drag floating windows by holding down $mod and left mouse button. + # Resize them with right mouse button + $mod. + # Despite the name, also works for non-floating windows. + # Change normal to inverse to use left mouse button for resizing and right + # mouse button for dragging. + floating_modifier $mod normal + + # reload the configuration file + bindsym $mod+Shift+c reload + + # exit sway (logs you out of your wayland session) + bindsym $mod+Shift+e exit + + bindsym $mod+apostrophe exec rofi-light # rofi-based brightness chooser + bindsym XF86MonBrightnessUp exec light -A 5 # increase screen brightness + bindsym XF86MonBrightnessDown exec light -U 5 # decrease screen brightness + + bindsym XF86AudioRaiseVolume exec pamixer --allow-boost --increase 5 + bindsym XF86AudioLowerVolume exec pamixer --allow-boost --decrease 5 + bindsym XF86AudioMute exec pamixer --toggle-mute + bindsym XF86AudioMicMute exec pactl set-source-mute 1 toggle + + # original sway workspace switch and window move + bindsym $mod+bracketleft workspace prev + bindsym $mod+bracketright workspace next + bindsym $mod+braceleft move container to workspace prev + bindsym $mod+braceright move container to workspace next + + # bspwm-esque workspace switch and window move + bindsym $mod2+bracketleft exec sway-ws-util switch prev + bindsym $mod2+bracketright exec sway-ws-util switch next + bindsym $mod2+braceleft exec sway-ws-util move prev follow + bindsym $mod2+braceright exec sway-ws-util move next follow +# +# Moving around: +# + # Move your focus around + bindsym $mod+$left focus left + bindsym $mod+$down focus down + bindsym $mod+$up focus up + bindsym $mod+$right focus right + # or use $mod+[up|down|left|right] + bindsym $mod+Left focus left + bindsym $mod+Down focus down + bindsym $mod+Up focus up + bindsym $mod+Right focus right + + # _move_ the focused window with the same, but add Shift + bindsym $mod+Shift+$left move left + bindsym $mod+Shift+$down move down + bindsym $mod+Shift+$up move up + bindsym $mod+Shift+$right move right + # ditto, with arrow keys + bindsym $mod+Shift+Left move left + bindsym $mod+Shift+Down move down + bindsym $mod+Shift+Up move up + bindsym $mod+Shift+Right move right +# +# Workspaces: # -#exec swayidle \ -# timeout 300 'swaylock -c 000000' \ -# timeout 600 'swaymsg "output * dpms off"' \ -# resume 'swaymsg "output * dpms on"' \ -# before-sleep 'swaylock -c 000000' + # switch to workspace + bindsym $mod+1 workspace 1 + bindsym $mod+2 workspace 2 + bindsym $mod+3 workspace 3 + bindsym $mod+4 workspace 4 + bindsym $mod+5 workspace 5 + bindsym $mod+6 workspace 6 + bindsym $mod+7 workspace 7 + bindsym $mod+8 workspace 8 + bindsym $mod+9 workspace 9 + bindsym $mod+0 workspace 10 + # move focused container to workspace + bindsym $mod+Shift+1 move container to workspace 1 + bindsym $mod+Shift+2 move container to workspace 2 + bindsym $mod+Shift+3 move container to workspace 3 + bindsym $mod+Shift+4 move container to workspace 4 + bindsym $mod+Shift+5 move container to workspace 5 + bindsym $mod+Shift+6 move container to workspace 6 + bindsym $mod+Shift+7 move container to workspace 7 + bindsym $mod+Shift+8 move container to workspace 8 + bindsym $mod+Shift+9 move container to workspace 9 + bindsym $mod+Shift+0 move container to workspace 10 + # Note: workspaces can have any name you want, not just numbers. + # We just use 1-10 as the default. +# +# Layout stuff: +# + # You can "split" the current object of your focus with + # $mod+b or $mod+v, for horizontal and vertical splits + # respectively. + bindsym $mod+b splith + bindsym $mod+v splitv + + # Switch the current container between different layout styles + bindsym $mod+s layout stacking + bindsym $mod+w layout tabbed + bindsym $mod+e layout toggle split + + # Make the current focus fullscreen + bindsym $mod+f fullscreen + + # Toggle the current focus between tiling and floating mode + bindsym $mod+Shift+space floating toggle + + # Swap focus between the tiling area and the floating area + bindsym $mod+space focus mode_toggle + + # move focus to the parent container + bindsym $mod+a focus parent +# +# Scratchpad: +# + # Sway has a "scratchpad", which is a bag of holding for windows. + # You can send windows there and get them back later. + + # Move the currently focused window to the scratchpad + bindsym $mod+Shift+minus move scratchpad + + # Show the next scratchpad window or hide the focused scratchpad window. + # If there are multiple scratchpad windows, this command cycles through them. + bindsym $mod+minus scratchpad show +# +# Resizing containers: +# +mode "resize" { + # left will shrink the containers width + # right will grow the containers width + # up will shrink the containers height + # down will grow the containers height + bindsym $left resize shrink width 10px + bindsym $down resize grow height 10px + bindsym $up resize shrink height 10px + bindsym $right resize grow width 10px + + # ditto, with arrow keys + bindsym Left resize shrink width 10px + bindsym Down resize grow height 10px + bindsym Up resize shrink height 10px + bindsym Right resize grow width 10px + + # return to default mode + bindsym Return mode "default" + bindsym Escape mode "default" +} +bindsym $mod+Shift+r mode "resize" + +# +# Power button +# + +set $mode_system System (l)ock, (e)xit sway, (s)uspend, (h)ibernate, (r)eboot, (S)hutdown +mode "$mode_system" { + bindsym l exec swaylock, mode "default" + bindsym e exec swaymsg exit, mode "default" + bindsym s exec systemctl suspend, mode "default" + bindsym h exec systemctl hibernate, mode "default" + bindsym r exec systemctl reboot, mode "default" + bindsym Shift+s exec systemctl poweroff -i, mode "default" + + # back to normal: Enter, Escape, or q + bindsym Return mode "default" + bindsym Escape mode "default" + bindsym q mode "default" +} +bindsym XF86PowerOff mode "$mode_system" + +# +# Presentation mode +# + +bindsym $mod+$mod2+p exec ([ ! -e ~/.nosleep ] && touch ~/.nosleep || rm ~/.nosleep) && killall -USR1 i3status + +# +# Notifications +# + +bindsym $mod+Shift+n mode notifications +mode notifications { + bindsym Return exec makoctl invoke; exec makoctl dismiss; mode default + bindsym d exec makoctl dismiss; mode default + bindsym Shift+d exec makoctl dismiss -a; mode default + + bindsym Escape mode default + bindsym q mode default +} + +# +# Screenshotting # -# This will lock your screen after 300 seconds of inactivity, then turn off -# your displays after another 600 seconds, and turn your screens back on when -# resumed. It will also lock your screen before your computer goes to sleep. -### Input configuration +bindsym $mod+Shift+s mode screenshot +mode screenshot { + bindsym a exec grim $(xdg-user-dir PICTURES)/shots/$(date +'%Y-%m-%d-%H%M%S.png'); mode default + bindsym r exec slurp | grim -g - $(xdg-user-dir PICTURES)/shots/$(date +'%Y-%m-%d-%H%M%S.png'); mode default + + bindsym Escape mode default + bindsym q mode default +} + +# +# Status Bar: +# +# Read `man 5 sway-bar` for more information about this section. +bar { + position bottom + colors { + statusline #ffffff + background #323232 + inactive_workspace #32323200 #32323200 #5c5c5c + } + status_command i3status | my-i3status.py +} + +# font pango: benis uushi 9 +# font pango: Ubuntu Mono 11 +# font pango: Inconsolata 11 +font pango: DejaVu Sans Mono 9 +# font pango: Liberation Mono 9 + +exec xrdb .Xresources +exec pgrep -x "systemd-inhibit" || \ + systemd-inhibit --what=handle-power-key --who=aminb \ + --why="Handle power button in sway" sleep infinity +exec mako 2>&1 >/tmp/mako.log +exec /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 + +include /etc/sway/config.d/* +include ~/.config/sway/`hostname` + +exec systemd-notify --ready || true + +#+end_src + +*** langa +:PROPERTIES: +:header-args+: :tangle ~/.config/sway/langa +:END: + +#+begin_src conf +input "2:7:SynPS/2_Synaptics_TouchPad" { + events disabled + dwt enabled + tap enabled + natural_scroll enabled + click_method clickfinger +} +input "1:1:AT_Translated_Set_2_keyboard" { + repeat_delay 200 + repeat_rate 45 + xkb_layout us_ab,ir + xkb_options ctrl:nocaps,altwin:swap_alt_win,grp:shifts_toggle +} +#+end_src + +*** shemshak +:PROPERTIES: +:header-args+: :tangle ~/.config/sway/shemshak +:END: + +#+begin_src conf input "1739:31251:DLL07BE:01_06CB:7A13_Touchpad" { dwt enabled tap enabled @@ -3723,190 +4095,335 @@ input "1:1:AT_Translated_Set_2_keyboard" { xkb_layout us,ir xkb_options ctrl:nocaps,altwin:swap_alt_win,ctrl:rctrl_ralt,grp:shifts_toggle } +#+end_src +** swaylock +:PROPERTIES: +:header-args+: :tangle ~/.config/swaylock/config +:END: +#+begin_src conf +image=/home/amin/usr/pics/wp/wp2445784-blurred-wallpapers.jpg +scaling=fill +#+end_src -### Key bindings -# -# Basics: -# - # start a terminal - bindsym $mod+Return exec $term +** TLP + +*** langa + +#+begin_src conf :tangle (when (and (eq system-type 'gnu/linux) (string= (system-name) "langa")) "/sudo::/etc/default/tlp") +# ------------------------------------------------------------------------------ +# tlp - Parameters for power saving +# See full explanation: http://linrunner.de/en/tlp/docs/tlp-configuration.html + +# Hint: some features are disabled by default, remove the leading # to enable +# them. + +# Set to 0 to disable, 1 to enable TLP. +TLP_ENABLE=1 + +# Operation mode when no power supply can be detected: AC, BAT. +# Concerns some desktop and embedded hardware only. +TLP_DEFAULT_MODE=AC + +# Operation mode select: 0=depend on power source, 1=always use TLP_DEFAULT_MODE +# Hint: use in conjunction with TLP_DEFAULT_MODE=BAT for BAT settings on AC. +TLP_PERSISTENT_DEFAULT=0 + +# Seconds laptop mode has to wait after the disk goes idle before doing a sync. +# Non-zero value enables, zero disables laptop mode. +DISK_IDLE_SECS_ON_AC=0 +DISK_IDLE_SECS_ON_BAT=2 + +# Dirty page values (timeouts in secs). +MAX_LOST_WORK_SECS_ON_AC=15 +MAX_LOST_WORK_SECS_ON_BAT=60 + +# Hint: CPU parameters below are disabled by default, remove the leading # +# to enable them, otherwise kernel default values are used. + +# Select a CPU frequency scaling governor. +# Intel Core i processor with intel_pstate driver: +# powersave(*), performance. +# Older hardware with acpi-cpufreq driver: +# ondemand(*), powersave, performance, conservative, schedutil. +# (*) is recommended. +# Hint: use tlp-stat -p to show the active driver and available governors. +# Important: +# powersave for intel_pstate and ondemand for acpi-cpufreq are power +# efficient for *almost all* workloads and therefore kernel and most +# distributions have chosen them as defaults. If you still want to change, +# you should know what you're doing! You *must* disable your distribution's +# governor settings or conflicts will occur. +#CPU_SCALING_GOVERNOR_ON_AC=powersave +#CPU_SCALING_GOVERNOR_ON_BAT=powersave + +# Set the min/max frequency available for the scaling governor. +# Possible values strongly depend on your CPU. For available frequencies see +# the output of tlp-stat -p. +#CPU_SCALING_MIN_FREQ_ON_AC=0 +#CPU_SCALING_MAX_FREQ_ON_AC=0 +#CPU_SCALING_MIN_FREQ_ON_BAT=0 +#CPU_SCALING_MAX_FREQ_ON_BAT=0 + +# Set energy performance hints (HWP) for Intel P-state governor: +# performance, balance_performance, default, balance_power, power +# Values are given in order of increasing power saving. +# Note: Intel Skylake or newer CPU and Kernel >= 4.10 required. +CPU_HWP_ON_AC=balance_performance +CPU_HWP_ON_BAT=balance_power + +# Set Intel P-state performance: 0..100 (%). +# Limit the max/min P-state to control the power dissipation of the CPU. +# Values are stated as a percentage of the available performance. +# Requires an Intel Core i processor with intel_pstate driver. +#CPU_MIN_PERF_ON_AC=0 +#CPU_MAX_PERF_ON_AC=100 +#CPU_MIN_PERF_ON_BAT=0 +#CPU_MAX_PERF_ON_BAT=30 + +# Set the CPU "turbo boost" feature: 0=disable, 1=allow +# Requires an Intel Core i processor. +# Important: +# - This may conflict with your distribution's governor settings +# - A value of 1 does *not* activate boosting, it just allows it +#CPU_BOOST_ON_AC=1 +#CPU_BOOST_ON_BAT=0 + +# Minimize number of used CPU cores/hyper-threads under light load conditions: +# 0=disable, 1=enable. +SCHED_POWERSAVE_ON_AC=0 +SCHED_POWERSAVE_ON_BAT=1 + +# Kernel NMI Watchdog: +# 0=disable (default, saves power), 1=enable (for kernel debugging only). +NMI_WATCHDOG=0 + +# Change CPU voltages aka "undervolting" - Kernel with PHC patch required. +# Frequency voltage pairs are written to: +# /sys/devices/system/cpu/cpu0/cpufreq/phc_controls +# CAUTION: only use this, if you thoroughly understand what you are doing! +#PHC_CONTROLS="F:V F:V F:V F:V" + +# Set CPU performance versus energy savings policy: +# performance, balance-performance, default, balance-power, power. +# Values are given in order of increasing power saving. +# Requires kernel module msr and x86_energy_perf_policy from linux-tools. +ENERGY_PERF_POLICY_ON_AC=performance +ENERGY_PERF_POLICY_ON_BAT=balance-power + +# Disk devices; separate multiple devices with spaces (default: sda). +# Devices can be specified by disk ID also (lookup with: tlp diskid). +DISK_DEVICES="sda sdb" + +# Disk advanced power management level: 1..254, 255 (max saving, min, off). +# Levels 1..127 may spin down the disk; 255 allowable on most drives. +# Separate values for multiple disks with spaces. Use the special value 'keep' +# to keep the hardware default for the particular disk. +DISK_APM_LEVEL_ON_AC="254 254" +DISK_APM_LEVEL_ON_BAT="128 128" + +# Hard disk spin down timeout: +# 0: spin down disabled +# 1..240: timeouts from 5s to 20min (in units of 5s) +# 241..251: timeouts from 30min to 5.5 hours (in units of 30min) +# See 'man hdparm' for details. +# Separate values for multiple disks with spaces. Use the special value 'keep' +# to keep the hardware default for the particular disk. +#DISK_SPINDOWN_TIMEOUT_ON_AC="0 0" +#DISK_SPINDOWN_TIMEOUT_ON_BAT="0 0" + +# Select IO scheduler for the disk devices: cfq, deadline, noop (Default: cfq). +# Separate values for multiple disks with spaces. Use the special value 'keep' +# to keep the kernel default scheduler for the particular disk. +#DISK_IOSCHED="cfq cfq" + +# AHCI link power management (ALPM) for disk devices: +# min_power, med_power_with_dipm(*), medium_power, max_performance. +# (*) Kernel >= 4.15 required, then recommended. +# Multiple values separated with spaces are tried sequentially until success. +SATA_LINKPWR_ON_AC="med_power_with_dipm max_performance" +SATA_LINKPWR_ON_BAT="med_power_with_dipm min_power" + +# Exclude host devices from AHCI link power management. +# Separate multiple hosts with spaces. +#SATA_LINKPWR_BLACKLIST="host1" + +# Runtime Power Management for AHCI host and disks devices: +# on=disable, auto=enable. +# EXPERIMENTAL ** WARNING: auto will most likely cause system lockups/data loss. +#AHCI_RUNTIME_PM_ON_AC=on +#AHCI_RUNTIME_PM_ON_BAT=on + +# Seconds of inactivity before disk is suspended. +AHCI_RUNTIME_PM_TIMEOUT=15 + +# PCI Express Active State Power Management (PCIe ASPM): +# default, performance, powersave. +PCIE_ASPM_ON_AC=performance +PCIE_ASPM_ON_BAT=powersave + +# Radeon graphics clock speed (profile method): low, mid, high, auto, default; +# auto = mid on BAT, high on AC; default = use hardware defaults. +RADEON_POWER_PROFILE_ON_AC=high +RADEON_POWER_PROFILE_ON_BAT=low + +# Radeon dynamic power management method (DPM): battery, performance. +RADEON_DPM_STATE_ON_AC=performance +RADEON_DPM_STATE_ON_BAT=battery + +# Radeon DPM performance level: auto, low, high; auto is recommended. +RADEON_DPM_PERF_LEVEL_ON_AC=auto +RADEON_DPM_PERF_LEVEL_ON_BAT=auto + +# WiFi power saving mode: on=enable, off=disable; not supported by all adapters. +WIFI_PWR_ON_AC=off +WIFI_PWR_ON_BAT=on + +# Disable wake on LAN: Y/N. +WOL_DISABLE=Y + +# Enable audio power saving for Intel HDA, AC97 devices (timeout in secs). +# A value of 0 disables, >=1 enables power saving (recommended: 1). +SOUND_POWER_SAVE_ON_AC=0 +SOUND_POWER_SAVE_ON_BAT=0 + +# Disable controller too (HDA only): Y/N. +SOUND_POWER_SAVE_CONTROLLER=N + +# Power off optical drive in UltraBay/MediaBay: 0=disable, 1=enable. +# Drive can be powered on again by releasing (and reinserting) the eject lever +# or by pressing the disc eject button on newer models. +# Note: an UltraBay/MediaBay hard disk is never powered off. +BAY_POWEROFF_ON_AC=0 +BAY_POWEROFF_ON_BAT=0 +# Optical drive device to power off (default sr0). +BAY_DEVICE="sr0" + +# Runtime Power Management for PCI(e) bus devices: on=disable, auto=enable. +RUNTIME_PM_ON_AC=on +RUNTIME_PM_ON_BAT=auto + +# Exclude PCI(e) device adresses the following list from Runtime PM +# (separate with spaces). Use lspci to get the adresses (1st column). +#RUNTIME_PM_BLACKLIST="bb:dd.f 11:22.3 44:55.6" + +# Exclude PCI(e) devices assigned to the listed drivers from Runtime PM. +# Default when unconfigured is "amdgpu nouveau nvidia radeon" which +# prevents accidential power-on of dGPU in hybrid graphics setups. +# Use "" to disable the feature completely. +# Separate multiple drivers with spaces. +#RUNTIME_PM_DRIVER_BLACKLIST="amdgpu nouveau nvidia radeon" + +# Set to 0 to disable, 1 to enable USB autosuspend feature. +USB_AUTOSUSPEND=1 + +# Exclude listed devices from USB autosuspend (separate with spaces). +# Use lsusb to get the ids. +# Note: input devices (usbhid) are excluded automatically +#USB_BLACKLIST="1111:2222 3333:4444" - # kill focused window - bindsym $mod+Shift+q kill +# Bluetooth devices are excluded from USB autosuspend: +# 0=do not exclude, 1=exclude. +USB_BLACKLIST_BTUSB=0 - # start your launcher - bindsym $mod+d exec $menu +# Phone devices are excluded from USB autosuspend: +# 0=do not exclude, 1=exclude (enable charging). +USB_BLACKLIST_PHONE=0 - # Drag floating windows by holding down $mod and left mouse button. - # Resize them with right mouse button + $mod. - # Despite the name, also works for non-floating windows. - # Change normal to inverse to use left mouse button for resizing and right - # mouse button for dragging. - floating_modifier $mod normal +# Printers are excluded from USB autosuspend: +# 0=do not exclude, 1=exclude. +USB_BLACKLIST_PRINTER=1 - # reload the configuration file - bindsym $mod+Shift+c reload +# WWAN devices are excluded from USB autosuspend: +# 0=do not exclude, 1=exclude. +USB_BLACKLIST_WWAN=1 - # exit sway (logs you out of your wayland session) - bindsym $mod+Shift+e exit +# Include listed devices into USB autosuspend even if already excluded +# by the blacklists above (separate with spaces). +# Use lsusb to get the ids. +#USB_WHITELIST="1111:2222 3333:4444" - bindsym $mod+apostrophe exec rofi-light # rofi-based brightness chooser - bindsym XF86MonBrightnessUp exec light -A 5 # increase screen brightness - bindsym XF86MonBrightnessDown exec light -U 5 # decrease screen brightness +# Set to 1 to disable autosuspend before shutdown, 0 to do nothing +# (workaround for USB devices that cause shutdown problems). +#USB_AUTOSUSPEND_DISABLE_ON_SHUTDOWN=1 - bindsym XF86AudioRaiseVolume exec pamixer --allow-boost --increase 5 - bindsym XF86AudioLowerVolume exec pamixer --allow-boost --decrease 5 - bindsym XF86AudioMute exec pamixer --toggle-mute - bindsym XF86AudioMicMute exec pactl set-source-mute 1 toggle +# Restore radio device state (Bluetooth, WiFi, WWAN) from previous shutdown +# on system startup: 0=disable, 1=enable. +# Hint: the parameters DEVICES_TO_DISABLE/ENABLE_ON_STARTUP/SHUTDOWN below +# are ignored when this is enabled! +#RESTORE_DEVICE_STATE_ON_STARTUP=0 +RESTORE_DEVICE_STATE_ON_STARTUP=0 - # original sway workspace switch and window move - bindsym $mod+bracketleft workspace prev - bindsym $mod+bracketright workspace next - bindsym $mod+braceleft move container to workspace prev - bindsym $mod+braceright move container to workspace next +# Radio devices to disable on startup: bluetooth, wifi, wwan. +# Separate multiple devices with spaces. +#DEVICES_TO_DISABLE_ON_STARTUP="bluetooth wifi wwan" +DEVICES_TO_DISABLE_ON_STARTUP="bluetooth" - # bspwm-esque workspace switch and window move - bindsym $mod2+bracketleft exec sway-ws-util switch prev - bindsym $mod2+bracketright exec sway-ws-util switch next - bindsym $mod2+braceleft exec sway-ws-util move prev follow - bindsym $mod2+braceright exec sway-ws-util move next follow -# -# Moving around: -# - # Move your focus around - bindsym $mod+$left focus left - bindsym $mod+$down focus down - bindsym $mod+$up focus up - bindsym $mod+$right focus right - # or use $mod+[up|down|left|right] - bindsym $mod+Left focus left - bindsym $mod+Down focus down - bindsym $mod+Up focus up - bindsym $mod+Right focus right +# Radio devices to enable on startup: bluetooth, wifi, wwan. +# Separate multiple devices with spaces. +#DEVICES_TO_ENABLE_ON_STARTUP="wifi" - # _move_ the focused window with the same, but add Shift - bindsym $mod+Shift+$left move left - bindsym $mod+Shift+$down move down - bindsym $mod+Shift+$up move up - bindsym $mod+Shift+$right move right - # ditto, with arrow keys - bindsym $mod+Shift+Left move left - bindsym $mod+Shift+Down move down - bindsym $mod+Shift+Up move up - bindsym $mod+Shift+Right move right -# -# Workspaces: -# - # switch to workspace - bindsym $mod+1 workspace 1 - bindsym $mod+2 workspace 2 - bindsym $mod+3 workspace 3 - bindsym $mod+4 workspace 4 - bindsym $mod+5 workspace 5 - bindsym $mod+6 workspace 6 - bindsym $mod+7 workspace 7 - bindsym $mod+8 workspace 8 - bindsym $mod+9 workspace 9 - bindsym $mod+0 workspace 10 - # move focused container to workspace - bindsym $mod+Shift+1 move container to workspace 1 - bindsym $mod+Shift+2 move container to workspace 2 - bindsym $mod+Shift+3 move container to workspace 3 - bindsym $mod+Shift+4 move container to workspace 4 - bindsym $mod+Shift+5 move container to workspace 5 - bindsym $mod+Shift+6 move container to workspace 6 - bindsym $mod+Shift+7 move container to workspace 7 - bindsym $mod+Shift+8 move container to workspace 8 - bindsym $mod+Shift+9 move container to workspace 9 - bindsym $mod+Shift+0 move container to workspace 10 - # Note: workspaces can have any name you want, not just numbers. - # We just use 1-10 as the default. -# -# Layout stuff: -# - # You can "split" the current object of your focus with - # $mod+b or $mod+v, for horizontal and vertical splits - # respectively. - bindsym $mod+b splith - bindsym $mod+v splitv +# Radio devices to disable on shutdown: bluetooth, wifi, wwan. +# (workaround for devices that are blocking shutdown). +#DEVICES_TO_DISABLE_ON_SHUTDOWN="bluetooth wifi wwan" - # Switch the current container between different layout styles - bindsym $mod+s layout stacking - bindsym $mod+w layout tabbed - bindsym $mod+e layout toggle split +# Radio devices to enable on shutdown: bluetooth, wifi, wwan. +# (to prevent other operating systems from missing radios). +#DEVICES_TO_ENABLE_ON_SHUTDOWN="wwan" - # Make the current focus fullscreen - bindsym $mod+f fullscreen +# Radio devices to enable on AC: bluetooth, wifi, wwan. +#DEVICES_TO_ENABLE_ON_AC="bluetooth wifi wwan" - # Toggle the current focus between tiling and floating mode - bindsym $mod+Shift+space floating toggle +# Radio devices to disable on battery: bluetooth, wifi, wwan. +#DEVICES_TO_DISABLE_ON_BAT="bluetooth wifi wwan" - # Swap focus between the tiling area and the floating area - bindsym $mod+space focus mode_toggle +# Radio devices to disable on battery when not in use (not connected): +# bluetooth, wifi, wwan. +#DEVICES_TO_DISABLE_ON_BAT_NOT_IN_USE="bluetooth wifi wwan" - # move focus to the parent container - bindsym $mod+a focus parent -# -# Scratchpad: -# - # Sway has a "scratchpad", which is a bag of holding for windows. - # You can send windows there and get them back later. +# Battery charge thresholds (ThinkPad only, tp-smapi or acpi-call kernel module +# required). Charging starts when the remaining capacity falls below the +# START_CHARGE_THRESH value and stops when exceeding the STOP_CHARGE_THRESH value. +# Main / Internal battery (values in %) +#START_CHARGE_THRESH_BAT0=75 +#STOP_CHARGE_THRESH_BAT0=80 +# Ultrabay / Slice / Replaceable battery (values in %) +#START_CHARGE_THRESH_BAT1=75 +#STOP_CHARGE_THRESH_BAT1=80 - # Move the currently focused window to the scratchpad - bindsym $mod+Shift+minus move scratchpad +# Restore charge thresholds when AC is unplugged: 0=disable, 1=enable. +#RESTORE_THRESHOLDS_ON_BAT=1 - # Show the next scratchpad window or hide the focused scratchpad window. - # If there are multiple scratchpad windows, this command cycles through them. - bindsym $mod+minus scratchpad show -# -# Resizing containers: -# -mode "resize" { - # left will shrink the containers width - # right will grow the containers width - # up will shrink the containers height - # down will grow the containers height - bindsym $left resize shrink width 10px - bindsym $down resize grow height 10px - bindsym $up resize shrink height 10px - bindsym $right resize grow width 10px +# ------------------------------------------------------------------------------ +# tlp-rdw - Parameters for the radio device wizard +# Possible devices: bluetooth, wifi, wwan. - # ditto, with arrow keys - bindsym Left resize shrink width 10px - bindsym Down resize grow height 10px - bindsym Up resize shrink height 10px - bindsym Right resize grow width 10px +# Hints: +# - Parameters are disabled by default, remove the leading # to enable them +# - Separate multiple radio devices with spaces - # return to default mode - bindsym Return mode "default" - bindsym Escape mode "default" -} -bindsym $mod+Shift+r mode "resize" +# Radio devices to disable on connect. +#DEVICES_TO_DISABLE_ON_LAN_CONNECT="wifi wwan" +#DEVICES_TO_DISABLE_ON_WIFI_CONNECT="wwan" +#DEVICES_TO_DISABLE_ON_WWAN_CONNECT="wifi" -# -# Status Bar: -# -# Read `man 5 sway-bar` for more information about this section. -bar { - position bottom - colors { - statusline #ffffff - background #323232 - inactive_workspace #32323200 #32323200 #5c5c5c - } - status_command i3gs ~/.config/i3gs/config -} +# Radio devices to enable on disconnect. +#DEVICES_TO_ENABLE_ON_LAN_DISCONNECT="wifi wwan" +#DEVICES_TO_ENABLE_ON_WIFI_DISCONNECT="" +#DEVICES_TO_ENABLE_ON_WWAN_DISCONNECT="" -include /etc/sway/config.d/* -#+end_src +# Radio devices to enable/disable when docked. +#DEVICES_TO_ENABLE_ON_DOCK="" +#DEVICES_TO_DISABLE_ON_DOCK="" -** TLP +# Radio devices to enable/disable when undocked. +#DEVICES_TO_ENABLE_ON_UNDOCK="wifi" +#DEVICES_TO_DISABLE_ON_UNDOCK="" +#+end_src -*** TODO enigma -*** plasma +*** shemshak -#+begin_src conf :tangle (when (and (eq system-type 'gnu/linux) (string= (system-name) "plasma")) "/sudo::/etc/default/tlp") +#+begin_src conf :tangle (when (and (eq system-type 'gnu/linux) (string= (system-name) "shemshak")) "/sudo::/etc/default/tlp") # ------------------------------------------------------------------------------ # tlp - Parameters for power saving # See full explanation: http://linrunner.de/en/tlp/docs/tlp-configuration.html @@ -4447,7 +4964,8 @@ Emacs.FontBackend: xft,x ! Emacs.font: Inconsolata:size=16 ! Emacs.font: Inconsolata LGC:size=14 ! Emacs.font: Source Code Pro Medium-10.5 -Emacs.font: Ubuntu Mono:size=16 +Emacs.font: Source Code Pro:size=14 +! Emacs.font: Ubuntu Mono:size=16 ! Emacs.font: Iosevka:size=16 #+end_src @@ -4458,10 +4976,10 @@ Emacs.font: Ubuntu Mono:size=16 #+begin_src conf-xdefaults ! Font -URxvt.font: xft:ubuntu mono:pixelsize=16:antialias=true:hinting=true, xft:dejavu sans mono:pixelsize=15:antialias=true:hinting=true -URxvt.boldFont: xft:ubuntu mono:pixelsize=16:antialias=true:hinting=true:bold, xft:dejavu sans mono:pixelsize=15:antialias=true:hinting=true:bold -URxvt.italicFont: xft:ubuntu mono:pixelsize=16:antialias=true:hinting=true:italic, xft:dejavu sans mono:pixelsize=15:antialias=true:hinting=true:italic -URxvt.bolditalicFont: xft:ubuntu mono:pixelsize=16:antialias=true:hinting=true:bold:italic, xft:dejavu sans mono:pixelsize=15:antialias=true:hinting=true:bolditalic +URxvt.font: xft:source code pro:pixelsize=14:antialias=true:hinting=true, xft:dejavu sans mono:pixelsize=15:antialias=true:hinting=true +URxvt.boldFont: xft:source code pro semibold:pixelsize=14:antialias=true:hinting=true:bold, xft:dejavu sans mono:pixelsize=15:antialias=true:hinting=true:bold +URxvt.italicFont: xft:source code pro italic:pixelsize=14:antialias=true:hinting=true:italic, xft:dejavu sans mono:pixelsize=15:antialias=true:hinting=true:italic +URxvt.bolditalicFont: xft:source code pro semibold italic:pixelsize=14:antialias=true:hinting=true:bold:italic, xft:dejavu sans mono:pixelsize=15:antialias=true:hinting=true:bolditalic URxvt.xftAntialias: true URxvt.letterSpace: 0 @@ -4480,8 +4998,6 @@ URxvt.keysym.Shift-Up: command:\033]720;1\007 URxvt.keysym.Shift-Down: command:\033]721;1\007 URxvt.perl-ext-common: default,clipboard,url-select,keyboard-select -URxvt.perl-ext: bidi -URxvt.bidi.enabled: 1 URxvt.url-select.launcher: firefox URxvt.url-select.underline: true URxvt.keysym.M-u: perl:url-select:select_next @@ -4583,14 +5099,26 @@ URxvt.color13: #AD7FA8 !URxvt.color6: #06989A !URxvt.color14: #34E2E2 ! orange (replaces cyan) -*color6: #ce5c00 -*color14: #fcaf3e +,*color6: #ce5c00 +,*color14: #fcaf3e ! White URxvt.color7: #D3D7CF URxvt.color15: #EEEEEC #+end_src +*** xkb us_ab keyboard layout + +#+begin_src conf :tangle "/sudo::/usr/share/X11/xkb/symbols/us_ab" :comments none +default partial alphanumeric_keys +xkb_symbols "us_ab" { + include "us(basic)" + name[Group1]= "English (US)(aminb)"; + + key { [ Alt_R ] }; +}; +#+end_src + ** XDG :PROPERTIES: :header-args+: :tangle ~/.config/user-dirs.dirs @@ -4717,7 +5245,7 @@ zhighlighters=(main brackets pattern) # # Load these ssh identities with the ssh module -zssh_ids=(id_rsa plasma_id_rsa id_ed25519 id_rsa_aur) +zssh_ids=(id_ed25519_bandali) # @@ -4780,6 +5308,8 @@ export MOZ_USE_XINPUT2=1 # precise scrolling in firefox #export JAVA_HOME=/usr/lib/jvm/java-8-openjdk #export ANDROID_JACK_VM_ARGS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4G" +export NIXPKGS=$HOME/src/git/nixpkgs + if [ -e /home/amin/.nix-profile/etc/profile.d/nix.sh ]; then . /home/amin/.nix-profile/etc/profile.d/nix.sh; fi # added by Nix installer #+end_src @@ -4830,7 +5360,7 @@ ZSH_HIGHLIGHT_PATTERNS+=('rm -rf *' 'fg=white,bold,bg=red') setopt globdots source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh -source ~/.zsh/zsh-autopair/autopair.zsh +# source ~/.zsh/zsh-autopair/autopair.zsh ### fzf ### @@ -4859,10 +5389,11 @@ alias mv="mv -iv" alias cp="cp -iv" alias scl=systemctl alias jcl=journalctl -alias m="mbsync -Va; getmail; notmuch new" +alias m="mbsync -a; notmuch new" alias best="youtube-dl -f best" -alias nixx="ssh amin@nix.aminb.org" -alias fence="ssh aminb@fencepost.gnu.org" +alias sd="ssh deb" +alias sf="ssh fp" +alias sn="ssh nix" aur() { cd ~/usr/build @@ -4889,7 +5420,7 @@ exact brightness value. :header-args+: :tangle ~/.local/bin/battery-percentage-time :shebang "#!/bin/sh" :END: -#+begin_src sh +#+begin_src sh :tangle no dbus_send() { label=$1 dbus-send --print-reply=literal --system \ @@ -4912,6 +5443,83 @@ fi printf '%s%%%%%2dh%02dm \n' "$perc" $((secs / 3600)) $((secs % 3600 / 60)) #+end_src +** my-i3status.py +:PROPERTIES: +:header-args+: :tangle ~/.local/bin/my-i3status.py :shebang "#!/usr/bin/env python2" +:END: + +#+begin_src python :comments none +# -*- coding: utf-8 -*- + +# This script is a simple wrapper which prefixes each i3status line with custom +# information. It is based on: +# https://github.com/i3/i3status/blob/master/contrib/wrapper.py +# +# In ~/.i3status.conf, add the following line: +# output_format = "i3bar" +# in the 'general' section. +# Then, in ~/.config/i3/config or ~/.config/sway/config add: +# status_command i3status | my-i3status.py +# in the 'bar' section. Make sure my-i3status.py is in $PATH. +# +# © 2012 Valentin Haenel +# © 2018 Amin Bandali +# +# This program is free software. It comes without any warranty, to the extent +# permitted by applicable law. You can redistribute it and/or modify it under +# the terms of the Do What The Fuck You Want To Public License (WTFPL), Version +# 2, as published by Sam Hocevar. See http://sam.zoy.org/wtfpl/COPYING for more +# details. + +import sys +import json +import os + +def get_nosleep(): + """ Return true if ~/.nosleep exists. """ + return os.path.isfile(os.path.expanduser("~/.nosleep")) + +def print_line(message): + """ Non-buffered printing to stdout. """ + sys.stdout.write(message + '\n') + sys.stdout.flush() + +def read_line(): + """ Interrupted respecting reader for stdin. """ + # try reading a line, removing any extra whitespace + try: + line = sys.stdin.readline().strip() + # i3status sends EOF, or an empty line + if not line: + sys.exit(3) + return line + # exit on ctrl-c + except KeyboardInterrupt: + sys.exit() + +if __name__ == '__main__': + # Skip the first line which contains the version header. + print_line(read_line()) + + # The second line contains the start of the infinite array. + print_line(read_line()) + + while True: + line, prefix = read_line(), '' + # ignore comma at start of lines + if line.startswith(','): + line, prefix = line[1:], ',' + + if get_nosleep(): + j = json.loads(line) + # insert information into the start of the json, but could be anywhere + j.insert(0, {'full_text' : '🖵 ', 'name' : 'nosleep'}) + # and echo back new encoded json + print_line(prefix+json.dumps(j)) + else: + print_line(prefix+line) +#+end_src + ** rofi-light :PROPERTIES: :header-args+: :tangle ~/.local/bin/rofi-light :shebang "#!/bin/bash" @@ -4931,7 +5539,7 @@ light -S $val #+begin_src bash export _JAVA_AWT_WM_NONREPARENTING=1 export _JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true' -light -Scrs "intel_backlight" 2 +light -Nr 2 source $HOME/.zprofile sway #+end_src @@ -4978,7 +5586,7 @@ fi :header-args+: :tangle ~/.local/bin/toggle-layout :shebang "#!/bin/bash" :END: -#+begin_src bash +#+begin_src bash :tangle no lang="$(setxkbmap -print | grep xkb_symbols | cut -d'+' -f 2)" if [ "$lang" = "us" ]; then @@ -4994,7 +5602,7 @@ fi :header-args+: :tangle ~/.local/bin/toggle-presentation-mode :shebang "#!/bin/bash" :END: -#+begin_src bash +#+begin_src bash :tangle no xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/presentation-mode -T #+end_src @@ -5013,7 +5621,7 @@ a few things: - properly rotates the stylus pen and touch screen pointers, and - toggles between RGB and Vertical BGR sub-pixel order. -#+begin_src bash +#+begin_src bash :tangle no case $(xfconf-query -c pointers -p /Wacom_ISDv4_E6_Pen_stylus/Properties/Wacom_Rotation) in 0) # Screen is not rotated, we should rotate it right (90°) xrandr -o 3 @@ -5041,7 +5649,7 @@ esac :header-args+: :tangle ~/.local/bin/unlock-def-gk.py :shebang "#!/usr/bin/env python2" :END: -#+begin_src python +#+begin_src python :tangle no import gnomekeyring as gk # list_item_ids_sync('login')[0] == 1L gk.unlock_sync('Default_keyring',gk.item_get_info_sync('login',1L).get_secret()) @@ -5052,7 +5660,7 @@ gk.unlock_sync('Default_keyring',gk.item_get_info_sync('login',1L).get_secret()) :header-args+: :tangle ~/.local/bin/volume-info :shebang "#!/bin/sh" :END: -#+begin_src sh +#+begin_src sh :tangle no cur_vol=$(pamixer --get-volume) if [ $(pamixer --get-mute) = true ]; then