├── vimfx ├── frame.js └── config.js ├── X ├── Xmodmap ├── Xresources └── xinitrc ├── astroid ├── .gitignore ├── hooks │ ├── delete │ └── toggle ├── ui │ ├── part.scss │ └── thread-view.scss └── poll.sh ├── bin ├── vim-open ├── work-browser ├── mac-open-emacs.scpt ├── pio ├── fm ├── getquote ├── browser ├── daily-note ├── persian-date ├── sub ├── emc ├── sync-agenda-svg ├── switch-telegram ├── backup-telegram ├── emct ├── serve ├── backup-email ├── ranger ├── toggle-mute ├── switch-monitor ├── lock ├── launch_polybar ├── kindle-sync ├── notifs_count ├── toggle-layout ├── check-mem ├── key-whatsapp ├── viewport ├── router-reboot ├── todo-org ├── keyboard-configure ├── pixelate_lock ├── switch_media ├── wifi_ssid_2 ├── invert ├── numfa2en ├── reboot-p ├── telegram-key ├── nord-connected-p ├── restore ├── xautolock-running-p ├── arbtt-running ├── clocking ├── hdmi-sound-toggle ├── screenshot ├── wifi_ssid ├── flight.1500s.py ├── trayer-padding-icon.sh ├── hiweb.py ├── battery ├── rsync_parallel.sh ├── get-bing-wallpaper ├── mediaplayer ├── lightpomodoro.js ├── fund.py ├── stopwatch_countdown └── bandwidth ├── icons ├── README ├── cal.png ├── chat.png ├── code.png ├── home.png ├── puzzle.png ├── connections.png ├── background.svg ├── notifications.svg ├── microphone.svg ├── notifications_off.svg ├── microphone-off.svg ├── cook.svg ├── chromatic.svg ├── briefcase-2.svg ├── check.svg ├── home.svg ├── class.svg ├── search.svg ├── briefcase.svg ├── music.svg ├── plant.svg ├── community.svg ├── work.svg ├── blackboard.svg ├── inbox.svg ├── day.svg ├── book.svg ├── chore.svg ├── archive.svg └── events.svg ├── spacemacs ├── private │ ├── snippets │ │ ├── js2-mode │ │ ├── js-mode │ │ │ ├── arr │ │ │ └── promise │ │ ├── rjsx-mode │ │ │ ├── cdm │ │ │ ├── cwm │ │ │ └── cwrp │ │ └── react-mode │ │ │ ├── cdm │ │ │ ├── cwm │ │ │ ├── cwrp │ │ │ └── scu │ ├── aj-javascript │ │ ├── layers.el │ │ └── funcs.el │ ├── psamim-react │ │ ├── img │ │ │ └── react.png │ │ ├── layers.el │ │ ├── config.el │ │ ├── funcs.el │ │ └── packages.el │ ├── semicolon │ │ ├── funcs.el │ │ └── packages.el │ ├── psamim-defaults │ │ ├── keybindings.el │ │ ├── packages.el │ │ ├── funcs.el │ │ └── config.el │ ├── local │ │ └── README.md │ ├── psamim-diary │ │ ├── keybindings.el │ │ └── README.org │ ├── org-latex-classes │ │ └── README.org │ ├── README.md │ ├── psamim-org │ │ └── funcs.el │ ├── psamim-org-zotero │ │ ├── README.org │ │ └── packages.el │ ├── psamim-org-reftex │ │ ├── packages.el │ │ └── README.org │ └── psamim-js │ │ └── packages.el └── exclude ├── astronvim ├── neovim.yml ├── lua │ ├── plugins │ │ ├── ledger.lua │ │ ├── neo-tree.lua │ │ ├── treesitter.lua │ │ ├── mason.lua │ │ ├── vim-test.lua │ │ ├── none-ls.lua │ │ ├── astroui.lua │ │ └── mappings.lua │ ├── polish.lua │ ├── community.lua │ └── lazy_setup.lua ├── selene.toml ├── .stylua.toml ├── .neoconf.json ├── init.lua └── README.md ├── doom ├── secrets.el.gpg ├── snippets │ └── org-mode │ │ ├── Persian Time │ │ ├── Persian Time Farsi Layout │ │ ├── journal │ │ ├── Weekley Journal │ │ ├── Monthly Journal │ │ └── quarterly journal ├── bin │ └── org-export-to-html ├── custom.el └── org-agenda.html.template ├── nvim ├── init.vim └── coc-settings.json ├── tmux ├── vimo └── tmux.conf ├── autorandr ├── docked-off-laptop │ ├── config │ ├── postswitch │ └── setup ├── mobile │ ├── config │ ├── setup │ └── postswitch ├── docked │ ├── config │ ├── postswitch │ └── setup └── m7 │ ├── config │ └── setup ├── systemd ├── user │ ├── backup.service │ ├── backup-notes.service │ ├── prismatik.service │ ├── sync-agenda-svg.service │ ├── xcape.service │ ├── backup.timer │ ├── arbtt.service │ ├── feh-wallpaper.timer │ ├── backup-notes.timer │ ├── sync-agenda-svg.timer │ ├── get-bing-wallpaper.service │ ├── http.service │ ├── gpg-agent.service │ ├── get-bing-wallpaper.timer │ ├── xautolock.service │ ├── mpd.service │ ├── urserver.service │ ├── feh-wallpaper.service │ ├── grasp.service │ ├── snapclient.service │ └── snapcast-pulse.service └── system │ ├── disable-wakeup.service │ └── kmonad.service ├── phpcs ├── commands.sh └── standards │ └── datis.xml ├── desktop-files ├── Lock.desktop ├── Todo.desktop ├── DailyNote.desktop ├── passmenu.desktop ├── Emc.desktop ├── Browser.desktop └── Work Browser.desktop ├── beets └── config.yaml ├── pam_environment ├── gpg └── gpg-agent.conf ├── muttator └── muttatorrc ├── vrome └── vromerc ├── lazygit └── config.yml ├── paru └── paru.conf ├── rofi ├── config.rasi └── style_normal.rasi ├── .gitignore ├── git ├── ignore └── config ├── aria2 └── down.conf ├── eslintrc.js ├── karabiner └── assets │ └── complex_modifications │ ├── 1707925313.json │ ├── emacs_shortcuts.json │ ├── vscode.json │ ├── ctrl-tab.json │ └── fkeys_to_cmdf.json ├── fontconfig └── fonts.conf ├── vrapper └── vrapperrc.vim ├── .gitmodules ├── install.work.sh ├── i3 └── i3blocks.conf ├── surfingkeys └── settings.js ├── vscode └── keybindings.json ├── rofi-pass └── config ├── yaourt └── yaourtrc ├── kmonad └── config.kbd ├── dunst └── dunstrc ├── mbsync └── mbsyncrc ├── ledger-autosync └── plugins │ └── eghtesad.py ├── tridactyl └── tridactylrc ├── xmobar └── xmobarrc ├── ideavim └── ideavimrc ├── notmuch └── notmuch-config └── vimperator └── vimperatorrc /vimfx/frame.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /X/Xmodmap: -------------------------------------------------------------------------------- 1 | keycode 37 = 2 | -------------------------------------------------------------------------------- /astroid/.gitignore: -------------------------------------------------------------------------------- 1 | searches 2 | -------------------------------------------------------------------------------- /bin/vim-open: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | /usr/bin/alacritty -e nvim $@ 4 | -------------------------------------------------------------------------------- /icons/README: -------------------------------------------------------------------------------- 1 | https://www.flaticon.com/authors/flat_circular/flat/1 2 | -------------------------------------------------------------------------------- /icons/cal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/psamim/dotfiles/HEAD/icons/cal.png -------------------------------------------------------------------------------- /icons/chat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/psamim/dotfiles/HEAD/icons/chat.png -------------------------------------------------------------------------------- /icons/code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/psamim/dotfiles/HEAD/icons/code.png -------------------------------------------------------------------------------- /icons/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/psamim/dotfiles/HEAD/icons/home.png -------------------------------------------------------------------------------- /icons/puzzle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/psamim/dotfiles/HEAD/icons/puzzle.png -------------------------------------------------------------------------------- /spacemacs/private/snippets/js2-mode: -------------------------------------------------------------------------------- 1 | /home/samim/.emacs.d/private/snippets/js-mode -------------------------------------------------------------------------------- /astroid/hooks/delete: -------------------------------------------------------------------------------- 1 | #! /usr/bin/bash 2 | 3 | notmuch tag +trash -inbox thread:$1 4 | -------------------------------------------------------------------------------- /astronvim/neovim.yml: -------------------------------------------------------------------------------- 1 | --- 2 | base: lua51 3 | 4 | globals: 5 | vim: 6 | any: true 7 | -------------------------------------------------------------------------------- /bin/work-browser: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | google-chrome-stable --profile-directory="Profile 2" $@ 3 | -------------------------------------------------------------------------------- /doom/secrets.el.gpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/psamim/dotfiles/HEAD/doom/secrets.el.gpg -------------------------------------------------------------------------------- /icons/connections.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/psamim/dotfiles/HEAD/icons/connections.png -------------------------------------------------------------------------------- /bin/mac-open-emacs.scpt: -------------------------------------------------------------------------------- 1 | tell application "Emacs" 2 | reopen 3 | activate 4 | end tell 5 | -------------------------------------------------------------------------------- /bin/pio: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | source /home/samim/.platformio/penv/bin/activate 3 | platformio $@ 4 | -------------------------------------------------------------------------------- /spacemacs/private/aj-javascript/layers.el: -------------------------------------------------------------------------------- 1 | (configuration-layer/declare-layer '(javascript)) 2 | -------------------------------------------------------------------------------- /astronvim/lua/plugins/ledger.lua: -------------------------------------------------------------------------------- 1 | ---@type LazySpec 2 | return { 3 | "ledger/vim-ledger", 4 | } 5 | -------------------------------------------------------------------------------- /bin/fm: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Script to run my preferred file manager 4 | 5 | exec dolphin "$@" & 6 | -------------------------------------------------------------------------------- /bin/getquote: -------------------------------------------------------------------------------- 1 | #!/bin/zsh 2 | 3 | echo "$(date +%Y/%m/%d) ${1} $(curl --silent rate.sx/1${1}) USDB" 4 | -------------------------------------------------------------------------------- /bin/browser: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # google-chrome-stable --profile-directory="Profile 3" "$@" 3 | firefox "$@" 4 | -------------------------------------------------------------------------------- /bin/daily-note: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | emacsclient -c -eval "(progn (call-interactively 'org-journal-new-entry) )"& 3 | -------------------------------------------------------------------------------- /doom/snippets/org-mode/Persian Time: -------------------------------------------------------------------------------- 1 | # key: jtime 2 | # name: Persian Time 3 | # -- 4 | `(psamim-insert-persian-time)` -------------------------------------------------------------------------------- /nvim/init.vim: -------------------------------------------------------------------------------- 1 | set runtimepath^=~/.vim runtimepath+=~/.vim/after 2 | let &packpath = &runtimepath 3 | source ~/.vimrc 4 | -------------------------------------------------------------------------------- /tmux/vimo: -------------------------------------------------------------------------------- 1 | splitw -v -l 20% # Split pane 1 horizontally by 20% 2 | #selectp -t 0 # Select pane 0 3 | -------------------------------------------------------------------------------- /spacemacs/private/psamim-react/img/react.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/psamim/dotfiles/HEAD/spacemacs/private/psamim-react/img/react.png -------------------------------------------------------------------------------- /spacemacs/private/snippets/js-mode/arr: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | #name : arr 3 | #key : arr 4 | # -- 5 | $1 = ($2) => { 6 | $0 7 | }; 8 | -------------------------------------------------------------------------------- /autorandr/docked-off-laptop/config: -------------------------------------------------------------------------------- 1 | output eDP-1 2 | off 3 | output HDMI-1 4 | crtc 0 5 | mode 2560x1080 6 | pos 0x0 7 | primary 8 | rate 59.98 9 | -------------------------------------------------------------------------------- /doom/snippets/org-mode/Persian Time Farsi Layout: -------------------------------------------------------------------------------- 1 | # key: تفهپث 2 | # name: Persian Time in Farsi Layout 3 | # -- 4 | `(psamim-insert-persian-time)` -------------------------------------------------------------------------------- /systemd/user/backup.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Backup 3 | 4 | [Service] 5 | Type=oneshot 6 | ExecStart=/bin/bash -c '/home/samim/.bin/backup-and-upload' -------------------------------------------------------------------------------- /bin/persian-date: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | let o = new Intl.DateTimeFormat("fa", { 4 | dateStyle: "long", 5 | }); 6 | console.log(o.format(Date.now())); 7 | -------------------------------------------------------------------------------- /phpcs/commands.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo phpcs --config-set tab_width 4 3 | sudo phpcs --config-set default_standard /home/${USER}/.phpcs/standards/datis.xml 4 | -------------------------------------------------------------------------------- /astronvim/lua/plugins/neo-tree.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "nvim-neo-tree/neo-tree.nvim", 3 | opts = { 4 | window = { 5 | width = 80, 6 | }, 7 | }, 8 | } 9 | -------------------------------------------------------------------------------- /desktop-files/Lock.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Comment= 3 | Terminal=false 4 | Name=Lock 5 | Exec=/home/samim/.bin/lock 6 | Type=Application 7 | Icon=xfsm-hibernate 8 | -------------------------------------------------------------------------------- /systemd/user/backup-notes.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Backup my notes 3 | 4 | [Service] 5 | Type=oneshot 6 | ExecStart=/bin/bash -c '/home/samim/.bin/backup-notes' -------------------------------------------------------------------------------- /autorandr/mobile/config: -------------------------------------------------------------------------------- 1 | output HDMI1 2 | off 3 | output VIRTUAL1 4 | off 5 | output eDP1 6 | crtc 0 7 | mode 1920x1080 8 | pos 0x0 9 | primary 10 | rate 60.01 11 | -------------------------------------------------------------------------------- /systemd/user/prismatik.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Prismatik 3 | 4 | [Service] 5 | ExecStart=/usr/bin/prismatik --nogui 6 | 7 | [Install] 8 | WantedBy=default.target 9 | -------------------------------------------------------------------------------- /systemd/user/sync-agenda-svg.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Sync agenda svg 3 | 4 | [Service] 5 | Type=oneshot 6 | ExecStart=/bin/bash -c /home/samim/.bin/sync-agenda-svg 7 | -------------------------------------------------------------------------------- /beets/config.yaml: -------------------------------------------------------------------------------- 1 | directory: /media/hdd/Music/library 2 | library: ~/.config/beets/library.blb 3 | import: 4 | move: yes 5 | plugins: scrub play fetchart lastgenre thumbnails 6 | -------------------------------------------------------------------------------- /spacemacs/private/snippets/rjsx-mode/cdm: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | #name : componentDidMount 3 | #key : cdm 4 | #contributor : 5 | # -- 6 | componentDidMount() { 7 | $0 8 | } 9 | -------------------------------------------------------------------------------- /bin/sub: -------------------------------------------------------------------------------- 1 | #!/bin/zsh 2 | # -*- mode: sh; -*- 3 | 4 | CURRENT_DIR=`pwd` 5 | cd ~/src/subliminal/ 6 | ./.direnv/python-3.6.3/bin/subliminal download -l en --directory "$CURRENT_DIR" "$@" 7 | -------------------------------------------------------------------------------- /spacemacs/private/snippets/react-mode/cdm: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | #name : componentDidMount 3 | #key : cdm 4 | #contributor : 5 | # -- 6 | componentDidMount() { 7 | $0 8 | } 9 | -------------------------------------------------------------------------------- /spacemacs/private/snippets/react-mode/cwm: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | #name : componentWillMount 3 | #key : cwm 4 | #contributor : 5 | # -- 6 | componentWillMount() { 7 | $0 8 | } 9 | -------------------------------------------------------------------------------- /spacemacs/private/snippets/rjsx-mode/cwm: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | #name : componentWillMount 3 | #key : cwm 4 | #contributor : 5 | # -- 6 | componentWillMount() { 7 | $0 8 | } 9 | -------------------------------------------------------------------------------- /systemd/user/xcape.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=xcape 3 | 4 | [Service] 5 | ExecStart=/usr/bin/xcape -t 200 -e "Caps_Lock=Escape" -d 6 | 7 | [Install] 8 | WantedBy=default.target 9 | -------------------------------------------------------------------------------- /pam_environment: -------------------------------------------------------------------------------- 1 | PATH DEFAULT=${PATH}:${HOME}/.bin 2 | /* SSH_ASKPASS=/usr/bin/ksshaskpass */ 3 | SSH_AGENT_PID DEFAULT= 4 | SSH_AUTH_SOCK DEFAULT="${XDG_RUNTIME_DIR}/gnupg/S.gpg-agent.ssh" 5 | -------------------------------------------------------------------------------- /systemd/user/backup.timer: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Backup 3 | 4 | [Timer] 5 | Persistent=true 6 | OnBootSec=15min 7 | OnUnitActiveSec=1d 8 | 9 | [Install] 10 | WantedBy=default.target -------------------------------------------------------------------------------- /gpg/gpg-agent.conf: -------------------------------------------------------------------------------- 1 | default-cache-ttl 34560000 2 | # max-cache-ttl-ssh 3600 3 | allow-emacs-pinentry 4 | # enable-ssh-support 5 | pinentry-program /usr/bin/pinentry-qt 6 | max-cache-ttl 34560000 7 | -------------------------------------------------------------------------------- /spacemacs/private/snippets/js-mode/promise: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet; require-final-newline: nil -*- 2 | # name: promise 3 | # key: npr 4 | # -- 5 | return new Promise((resolve, reject) => { 6 | $0 7 | }); -------------------------------------------------------------------------------- /systemd/user/arbtt.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=arbtt service 3 | 4 | [Service] 5 | Type=simple 6 | ExecStart=/home/samim/.cabal/bin/arbtt-capture 7 | 8 | [Install] 9 | WantedBy=default.target -------------------------------------------------------------------------------- /bin/emc: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Script to run emacsclient in window mode 4 | 5 | if [[ -z $(pidof emacs) ]] 6 | then 7 | emacs "$@" 8 | else 9 | emacsclient -c --no-wait "$@" 10 | fi 11 | -------------------------------------------------------------------------------- /bin/sync-agenda-svg: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | export ICALENDAR_FILE=/tmp/org.ics 3 | xvfb-run --server-args="-screen 0 840x2600x24" emacs --eval -fs '(psamim/sync)' 4 | # rclone copy "$ICALENDAR_FILE" webdav: 5 | -------------------------------------------------------------------------------- /spacemacs/private/semicolon/funcs.el: -------------------------------------------------------------------------------- 1 | (defun add-semicolon-at-end-of-line () 2 | """Add a semicolon at the end of the current line.""" 3 | (interactive) 4 | (end-of-line) 5 | (insert ";")) 6 | -------------------------------------------------------------------------------- /systemd/user/feh-wallpaper.timer: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Random wallpaper with feh 3 | 4 | [Timer] 5 | OnUnitActiveSec=300s 6 | Unit=feh-wallpaper.service 7 | 8 | [Install] 9 | WantedBy=default.target -------------------------------------------------------------------------------- /bin/switch-telegram: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # -*- mode: sh; -*- 3 | 4 | BASEDIR="/home/samim/Backup/tg-auth" 5 | rm -rf ~/.telegram-cli 6 | ln -sf "${BASEDIR}/${1}" ~/.telegram-cli 7 | ls -alh ~/.telegram-cli 8 | -------------------------------------------------------------------------------- /bin/backup-telegram: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # -*- mode: sh; -*- 3 | 4 | telegram-cli --json -P 9009 & 5 | PID=$! 6 | ~/src/telegram-history-dump/telegram-history-dump.rb -c ~/Backup/tg/config.yaml 7 | kill -KILL $PID 8 | -------------------------------------------------------------------------------- /bin/emct: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Script to run emacs client in terminal without window 4 | 5 | if [[ -z $(pidof emacs) ]] 6 | then 7 | emacs "$@" 8 | else 9 | emacsclient -nw -c "$@" 10 | fi 11 | -------------------------------------------------------------------------------- /spacemacs/private/snippets/react-mode/cwrp: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | #name : componentWillReceiveProps 3 | #key : cwrp 4 | #contributor : 5 | # -- 6 | componentWillReceiveProps(nextProps) { 7 | $0 8 | } 9 | -------------------------------------------------------------------------------- /spacemacs/private/snippets/rjsx-mode/cwrp: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | #name : componentWillReceiveProps 3 | #key : cwrp 4 | #contributor : 5 | # -- 6 | componentWillReceiveProps(nextProps) { 7 | $0 8 | } 9 | -------------------------------------------------------------------------------- /systemd/user/backup-notes.timer: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Backup notes daily 3 | 4 | [Timer] 5 | Persistent=true 6 | OnBootSec=15min 7 | OnUnitActiveSec=1d 8 | 9 | [Install] 10 | WantedBy=default.target -------------------------------------------------------------------------------- /astronvim/selene.toml: -------------------------------------------------------------------------------- 1 | std = "neovim" 2 | 3 | [rules] 4 | global_usage = "allow" 5 | if_same_then_else = "allow" 6 | incorrect_standard_library_use = "allow" 7 | mixed_table = "allow" 8 | multiple_statements = "allow" 9 | -------------------------------------------------------------------------------- /systemd/user/sync-agenda-svg.timer: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Sync agenda svg 3 | 4 | [Timer] 5 | Persistent=true 6 | OnBootSec=15min 7 | OnUnitActiveSec=15min 8 | 9 | [Install] 10 | WantedBy=default.target 11 | -------------------------------------------------------------------------------- /astronvim/.stylua.toml: -------------------------------------------------------------------------------- 1 | column_width = 120 2 | line_endings = "Unix" 3 | indent_type = "Spaces" 4 | indent_width = 2 5 | quote_style = "AutoPreferDouble" 6 | call_parentheses = "None" 7 | collapse_simple_statement = "Always" 8 | -------------------------------------------------------------------------------- /bin/serve: -------------------------------------------------------------------------------- 1 | #!/bin/env python 2 | 3 | from twisted.web.server import Site 4 | from twisted.web.static import File 5 | from twisted.internet import reactor 6 | 7 | reactor.listenTCP(8000, Site(File("."))) 8 | reactor.run() 9 | -------------------------------------------------------------------------------- /muttator/muttatorrc: -------------------------------------------------------------------------------- 1 | nmap :tabnext 2 | nmap :tabprevious 3 | nmap a :moveto p.samim@gmail.com: All Mail 4 | set editor="emacsclient -c --socket-name='/tmp/samim/emacs1000/server/server'" 5 | -------------------------------------------------------------------------------- /systemd/user/get-bing-wallpaper.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Get Bing wallpaper 3 | 4 | [Service] 5 | Type=oneshot 6 | ExecStart=/bin/bash -c '/home/samim/.bin/get-bing-wallpaper' 7 | 8 | [Install] 9 | WantedBy=default.target -------------------------------------------------------------------------------- /autorandr/docked/config: -------------------------------------------------------------------------------- 1 | output VIRTUAL1 2 | off 3 | output HDMI1 4 | crtc 0 5 | mode 2560x1080 6 | pos 0x0 7 | primary 8 | rate 59.98 9 | output eDP1 10 | crtc 1 11 | mode 1920x1080 12 | pos 169x1080 13 | rate 60.01 14 | -------------------------------------------------------------------------------- /systemd/user/http.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=http service 3 | 4 | [Service] 5 | Type=simple 6 | ExecStart=/usr/bin/althttpd --root /home/samim/Notes/html --port 8080 7 | 8 | [Install] 9 | WantedBy=default.target 10 | -------------------------------------------------------------------------------- /desktop-files/Todo.desktop: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env xdg-open 2 | [Desktop Entry] 3 | GenericName=Todo 4 | Terminal=false 5 | Name=Todo 6 | Exec=/home/samim/.bin/todo-org 7 | Type=Application 8 | Icon=emblem-ubuntuone-synchronized 9 | Comment=Todo -------------------------------------------------------------------------------- /vrome/vromerc: -------------------------------------------------------------------------------- 1 | map gt 2 | map gT 3 | map d 4 | map H 5 | map L 6 | 7 | set disable_autofocus 8 | set editor=emc 9 | set disablesites=tweetdeck.twitter.com, web.telegram.org, web.whatsapp.com 10 | -------------------------------------------------------------------------------- /lazygit/config.yml: -------------------------------------------------------------------------------- 1 | gui: 2 | language: en 3 | os: 4 | # editPreset: "nvim-remote" 5 | editPreset: "nvim" 6 | # edit: "nvim" 7 | # editCommandTemplate: '{{editor}} --server /tmp/nvim-server.pipe --remote-tab "$(pwd)/{{filename}}"' 8 | -------------------------------------------------------------------------------- /spacemacs/private/snippets/react-mode/scu: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | #name : shouldComponentUpdate 3 | #key : scu 4 | #contributor : 5 | # -- 6 | shouldComponentUpdate(nextProps, nextState) { 7 | $0 8 | return true; 9 | } 10 | -------------------------------------------------------------------------------- /systemd/system/disable-wakeup.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Disable HXCi USB wakeup 3 | 4 | [Service] 5 | Type=oneshot 6 | ExecStart=/bin/bash -c 'echo XHC > /proc/acpi/wakeup' 7 | 8 | [Install] 9 | WantedBy=default.target 10 | -------------------------------------------------------------------------------- /systemd/system/kmonad.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=kmonad keyboard daemon 3 | 4 | [Service] 5 | Type=simple 6 | ExecStart=/usr/bin/kmonad /home/samim/.config/kmonad/config.kbd -l info 7 | 8 | [Install] 9 | WantedBy=default.target 10 | -------------------------------------------------------------------------------- /paru/paru.conf: -------------------------------------------------------------------------------- 1 | # See the paru.conf(5) manpage for options 2 | 3 | [options] 4 | SudoLoop 5 | Devel 6 | PgpFetch 7 | Provides 8 | DevelSuffixes = -git -cvs -svn -bzr -darcs -always -hg 9 | CombinedUpgrade 10 | NewsOnUpgrade 11 | Limit = 20 12 | -------------------------------------------------------------------------------- /spacemacs/private/psamim-defaults/keybindings.el: -------------------------------------------------------------------------------- 1 | (spacemacs/set-leader-keys "d" 'deer) 2 | (spacemacs/set-leader-keys "o" 'helm-mini) 3 | (define-key evil-normal-state-map "W" 'save-buffer) 4 | (global-set-key (kbd "M-q") 'spacemacs/kill-this-buffer ) 5 | -------------------------------------------------------------------------------- /systemd/user/gpg-agent.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=GnuPG private key agent 3 | IgnoreOnIsolate=true 4 | 5 | [Service] 6 | Type=forking 7 | ExecStart=/usr/bin/gpg-agent --daemon 8 | Restart=on-abort 9 | 10 | [Install] 11 | WantedBy=default.target -------------------------------------------------------------------------------- /bin/backup-email: -------------------------------------------------------------------------------- 1 | source gmvalut/gmvault-1.7-beta/bin/activate 2 | gmvault sync p.samim@gmail.com --resume 3 | tar cfvj ~/email.tar.bz ~/gmvault-db/ 4 | gpg -o ~/email.tar.bz.gpg --symmetric ~/email.tar.bz 5 | rclone copy --stats=10s -v ~/email.tar.bz.gpg psamim: -------------------------------------------------------------------------------- /astronvim/lua/polish.lua: -------------------------------------------------------------------------------- 1 | if true then return end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE 2 | 3 | -- This will run last in the setup process. 4 | -- This is just pure lua so anything that doesn't 5 | -- fit in the normal config locations above can go here 6 | -------------------------------------------------------------------------------- /systemd/user/get-bing-wallpaper.timer: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Get bing wallpaper once a day 3 | 4 | [Timer] 5 | OnBootSec=15min 6 | OnUnitActiveSec=1d 7 | Persistent=true 8 | Unit=get-bing-wallpaper.service 9 | 10 | [Install] 11 | WantedBy=default.target -------------------------------------------------------------------------------- /astroid/ui/part.scss: -------------------------------------------------------------------------------- 1 | /* ui-version: 5 (do not change when modifying theme for yourself) */ 2 | 3 | $font-base-size: 13pt; 4 | $font-mono: "Iosevka"; 5 | $font-sans: "Iosevka Etoile"; 6 | $font-family-default: $font-sans; 7 | 8 | @import "/usr/share/astroid/ui/part.scss"; 9 | -------------------------------------------------------------------------------- /spacemacs/private/local/README.md: -------------------------------------------------------------------------------- 1 | # Private directory for local packages 2 | 3 | The content of this directory is ignored by Git. 4 | 5 | This is the place to store the local packages that you define in 6 | the `dotspacemacs-additional-packages` variable of your dotfile. 7 | -------------------------------------------------------------------------------- /systemd/user/xautolock.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=xautolock service 3 | 4 | [Service] 5 | Type=simple 6 | ExecStart=/usr/bin/xautolock -time 5 -locker /home/samim/.bin/lock -detectsleep -secure -notifier notify-send -notify 10 7 | 8 | [Install] 9 | WantedBy=default.target -------------------------------------------------------------------------------- /bin/ranger: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Open ranger file manager in emacs 4 | 5 | emacsclient -c --frame-parameters="((width . 48) (height . 20) (name . \"Ranger\") (top . 180) (left . 440) (left-fringe . 0) (right-fringe . 0) (auto-raise t) (alpha . 0.8))" --eval "(progn (deer))" 6 | -------------------------------------------------------------------------------- /autorandr/mobile/setup: -------------------------------------------------------------------------------- 1 | eDP1 00ffffffffffff000daed41400000000241a0104a51f11780228659759548e271e505400000001010101010101010101010101010101b43b804a71383440503c680035ad10000018000000fe004e3134304843412d4541430a20000000fe00434d4e0a202020202020202020000000fe004e3134304843412d4541430a200005 2 | -------------------------------------------------------------------------------- /icons/background.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /astroid/ui/thread-view.scss: -------------------------------------------------------------------------------- 1 | /* ui-version: 5 (do not change when modifying theme for yourself) */ 2 | 3 | $font-base-size: 13pt; 4 | $font-mono: "Iosevka"; 5 | $font-sans: "Iosevka Etoile"; 6 | $font-family-default: $font-sans; 7 | 8 | @import "/usr/share/astroid/ui/thread-view.scss"; 9 | -------------------------------------------------------------------------------- /autorandr/docked/postswitch: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | notify-send "Switched to docked mode" 4 | /home/samim/.bin/hdmi-sound-toggle 5 | # /home/samim/.bin/launch_polybar 6 | /home/samim/.bin/keyboard-configure 7 | echo 'awesome.restart()' | awesome-client 8 | # systemctl --user restart feh-wallpaper 9 | -------------------------------------------------------------------------------- /doom/snippets/org-mode/journal: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: Daily Journal 3 | # key: -------------------------------------------------------------------------------- /systemd/user/mpd.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Music Player Daemon 3 | Documentation=man:mpd(1) man:mpd.conf(5) 4 | After=network.target sound.target 5 | 6 | [Service] 7 | ExecStart=/usr/bin/mpd --no-daemon /home/samim/.config/mpd/mpd.conf 8 | 9 | [Install] 10 | WantedBy=default.target 11 | -------------------------------------------------------------------------------- /systemd/user/urserver.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Unified Remote Server 3 | After=network.target 4 | 5 | [Service] 6 | RemainAfterExit=yes 7 | ExecStart=/bin/bash /opt/urserver/urserver-start 8 | ExecStop=/bin/bash /opt/urserver/urserver-stop 9 | 10 | [Install] 11 | WantedBy=network.target -------------------------------------------------------------------------------- /bin/toggle-mute: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | amixer -D pulse sset Capture toggle > /dev/null 3 | amixer get Capture | grep '\[off\]' > /dev/null 4 | 5 | if [ "$?" -eq "0" ]; then 6 | echo -n OFF 7 | notify-send 'Mic turned off!' 8 | else 9 | echo -n ON 10 | notify-send 'Mic turned on!' 11 | fi 12 | -------------------------------------------------------------------------------- /autorandr/docked-off-laptop/postswitch: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | notify-send "Switched to docked mode" 4 | /home/samim/.bin/hdmi-sound-toggle 5 | # /home/samim/.bin/launch_polybar 6 | /home/samim/.bin/keyboard-configure 7 | echo 'awesome.restart()' | awesome-client 8 | # systemctl --user restart feh-wallpaper 9 | -------------------------------------------------------------------------------- /autorandr/mobile/postswitch: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | notify-send "Switched to mobile mode" 4 | /home/samim/.bin/hdmi-sound-toggle 5 | # /home/samim/.bin/launch_polybar 6 | /home/samim/.bin/keyboard-configure 7 | echo 'awesome.restart()' | awesome-client 8 | # systemctl --user restart feh-wallpaper 9 | 10 | -------------------------------------------------------------------------------- /rofi/config.rasi: -------------------------------------------------------------------------------- 1 | /* vi: ft=css */ 2 | configuration { 3 | combi-modi: "window,drun,run"; 4 | font: "Iosevka 13"; 5 | modi: "combi"; 6 | display-drun: " App:"; 7 | display-window: " Window:"; 8 | display-run: " Run:"; 9 | show-icons: true; 10 | } 11 | 12 | @theme "./style_normal.rasi" 13 | -------------------------------------------------------------------------------- /bin/switch-monitor: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | prefix=${SCREEN_LAYOUT_DIR-~/.screenlayout} 4 | layout_files=( "$prefix"/* ) 5 | layout_files=( "${layout_files[@]#"$prefix"/}" ) 6 | 7 | layout=$(printf '%s\n' "${layout_files[@]}" | rofi -dmenu -p select:) 8 | 9 | [[ -n $layout ]] || exit 10 | 11 | exec $prefix/$layout -------------------------------------------------------------------------------- /spacemacs/exclude: -------------------------------------------------------------------------------- 1 | # git ls-files --others --exclude-from=.git/info/exclude 2 | # Lines that start with '#' are comments. 3 | # For a project mostly in C, the following would be a good set of 4 | # exclude patterns (uncomment them if you want to use them): 5 | # *.[oa] 6 | # *~ 7 | private/ 8 | private 9 | recentf 10 | -------------------------------------------------------------------------------- /bin/lock: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # My screen locker 4 | 5 | # Switch to us layout to prevent problems in unlocking 6 | xkb-switch -s us 7 | 8 | # Locker 9 | # pixelate_lock 10 | # physlock -ds -u samim 11 | # i3lock-wrapper 12 | betterlockscreen -s 13 | 14 | # Suspend 15 | # systemctl suspend 16 | # pm-suspend 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /bin/local 2 | # fish 3 | /fish/fish_history 4 | /fish/fishd.* 5 | # vim 6 | /vim/.netrwhist 7 | /vim/bundle/ 8 | !/vim/bundle/vundle 9 | /vim/session 10 | # muttator 11 | /muttator/info 12 | # vimperator 13 | /vimperator/info 14 | /tmux/plugins/ 15 | /systemd/default.target.wants/ 16 | /karabiner/automatic_backups 17 | -------------------------------------------------------------------------------- /autorandr/m7/config: -------------------------------------------------------------------------------- 1 | output VIRTUAL1 2 | off 3 | output eDP1 4 | off 5 | output HDMI1 6 | crtc 0 7 | mode 2560x1440 8 | pos 0x0 9 | primary 10 | rate 59.95 11 | x-prop-aspect_ratio Automatic 12 | x-prop-audio auto 13 | x-prop-broadcast_rgb Automatic 14 | x-prop-colorspace Default 15 | x-prop-max_bpc 12 16 | x-prop-non_desktop 0 17 | -------------------------------------------------------------------------------- /desktop-files/DailyNote.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Categories=Accessories 3 | Comment= 4 | Exec=/home/samim/.bin/daily-note 5 | Icon=knotes 6 | Name=Daily Note 7 | NoDisplay=false 8 | Path[$e]= 9 | StartupNotify=true 10 | Terminal=0 11 | TerminalOptions= 12 | Type=Application 13 | X-KDE-SubstituteUID=false 14 | X-KDE-Username= 15 | -------------------------------------------------------------------------------- /bin/launch_polybar: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Terminate already running bar instances 4 | killall -q polybar 5 | # If all your bars have ipc enabled, you can also use 6 | # polybar-msg cmd quit 7 | 8 | echo "---" | tee -a /tmp/polybar1.log 9 | polybar xmonad >>/tmp/polybar1.log 2>&1 & disown 10 | 11 | echo "Bars launched..." 12 | -------------------------------------------------------------------------------- /desktop-files/passmenu.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Categories=Accessories 3 | Comment=Pass 4 | Exec=rofi-pass 5 | GenericName=Pass 6 | Icon=keepass 7 | Name=Pass 8 | NoDisplay=false 9 | Path[$e]= 10 | StartupNotify=true 11 | Terminal=0 12 | TerminalOptions= 13 | Type=Application 14 | X-KDE-SubstituteUID=false 15 | X-KDE-Username= 16 | -------------------------------------------------------------------------------- /astroid/poll.sh: -------------------------------------------------------------------------------- 1 | set -e 2 | # mbsync --all 3 | cd ~/.mail/account.gmail && gmi sync 4 | notmuch new 5 | 6 | notmuch tag --batch </dev/null)|tr -s ' '|cut -d' ' -f 3 | head -n 1) 4 | 5 | if [ "$count" -eq "0" ]; then 6 | exit; 7 | fi 8 | 9 | echo " $count " 10 | -------------------------------------------------------------------------------- /bin/toggle-layout: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | CURRENT_WIN=$(kdotool getactivewindow) 3 | EMACS=$(kdotool search --name 'Doom Emacs') 4 | 5 | if echo $EMACS|grep -q $CURRENT_WIN; then 6 | ydotool key --key-delay=200 29:1 43:1 43:0 29:0 7 | else 8 | ydotool key --key-delay=200 56:1 54:1 54:0 56:0 ─╯ 9 | fi 10 | -------------------------------------------------------------------------------- /doom/bin/org-export-to-html: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env doomscript 2 | 3 | (defcli! export-notes (&args files) 4 | (require 'core-start) ; load your user config 5 | (dolist (file files) ; supports multiple files, if you want 6 | (find-file file) ; open an org file 7 | (org-html-export-to-html))) ; and export it 8 | 9 | (run! "export-notes" (cdr (member "--" argv))) 10 | -------------------------------------------------------------------------------- /spacemacs/private/psamim-react/layers.el: -------------------------------------------------------------------------------- 1 | ;;; layers.el --- react Layer layers File for Spacemacs 2 | ;; 3 | ;; Copyright (c) 2012-2018 Sylvain Benner & Contributors 4 | ;; 5 | ;; Author: Andrea Moretti 6 | ;; URL: https://github.com/axyz 7 | ;; 8 | ;; This file is not part of GNU Emacs. 9 | ;; 10 | ;;; License: GPLv3 11 | 12 | (configuration-layer/declare-layers '(html javascript)) 13 | -------------------------------------------------------------------------------- /spacemacs/private/psamim-react/config.el: -------------------------------------------------------------------------------- 1 | ;;; config.el --- react Layer packages File for Spacemacs 2 | ;; 3 | ;; Copyright (c) 2012-2018 Sylvain Benner & Contributors 4 | ;; 5 | ;; Author: Andrea Moretti 6 | ;; URL: https://github.com/axyz 7 | ;; 8 | ;; This file is not part of GNU Emacs. 9 | ;; 10 | ;;; License: GPLv3 11 | 12 | ;; Variables 13 | 14 | (spacemacs|define-jump-handlers react-mode) 15 | -------------------------------------------------------------------------------- /bin/check-mem: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | threshold=6200 4 | 5 | while : 6 | do 7 | total_mem=$(free -m |awk '/^Mem:/{print $3}') 8 | echo $total_mem 9 | 10 | if [ $total_mem -gt $threshold ] 11 | then 12 | notify-send "Low memory!!" 13 | curl http://192.168.1.234/hex=FF0000 14 | else 15 | curl http://192.168.1.234/stop 16 | fi 17 | 18 | sleep 5 19 | 20 | done 21 | 22 | exit 23 | -------------------------------------------------------------------------------- /bin/key-whatsapp: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | CURRENT_WIN=$(xdotool getactivewindow) 3 | WHATSAPP=$(xdotool search --name WhatsApp) 4 | DIR=$1 5 | 6 | if [ "$CURRENT_WIN" = "$WHATSAPP" ]; then 7 | if [ "$DIR" = "down" ]; then 8 | xdotool keydown alt keydown ctrl key Tab keyup alt keyup ctrl 9 | fi 10 | 11 | if [ "$DIR" = "up" ]; then 12 | xdotool keydown alt keydown ctrl keydown shift key Tab keyup alt keyup ctrl keyup shift 13 | fi 14 | fi 15 | -------------------------------------------------------------------------------- /bin/viewport: -------------------------------------------------------------------------------- 1 | #!/bin/python 2 | 3 | from subprocess import check_output 4 | 5 | command = "xprop -root -notype _NET_CURRENT_DESKTOP | perl -pe 's/.*?= (\d+)/$1/'" 6 | 7 | try: 8 | output = check_output(command, shell=True) 9 | except Exception: 10 | output = 0 11 | 12 | viewport = int(int(output)) 13 | name = ['', '', '', '♬', ''] 14 | try: 15 | print(" " + name[viewport] + " ") 16 | except: 17 | print("No.: " + str(viewport)) 18 | -------------------------------------------------------------------------------- /bin/router-reboot: -------------------------------------------------------------------------------- 1 | #!/usr/bin/expect 2 | 3 | # If it all goes pear shaped the script will timeout after 20 seconds. 4 | set timeout 20 5 | 6 | # First argument is assigned to the variable name 7 | set password [lindex $argv 0] 8 | 9 | spawn telnet 192.168.1.1 10 | expect "Username: " 11 | send "admin\r" 12 | expect "Password: " 13 | send "$password\r" 14 | 15 | # This hands control of the keyboard over two you (Nice expect feature!) 16 | send "reboot\r" -------------------------------------------------------------------------------- /bin/todo-org: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Open my todo list in emacs org-mode 4 | 5 | # emacsclient -c --frame-parameters="((font . \"Ubuntu Mono-12\")(internal-border-width . 15) (width . 72) (height . 20) (name . \"TODOs\") (top . 180) (left . 440) (left-fringe . 0) (right-fringe . 0) (auto-raise t) (alpha . 0.9))" --eval "(progn (org-agenda nil \"u\") (setq mode-line-format nil) (delete-other-windows))" 6 | 7 | emacs --file="~/Notes/todo.org" --name="TODOs" --title="TODOs" -mm 8 | -------------------------------------------------------------------------------- /bin/keyboard-configure: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # Keyboard layout 3 | 4 | # Also have this under /etc/udev/rules.d/60-usb-keyboard.rules 5 | # ACTION=="add", ATTRS{phys}=="usb-0000:00:14.0-3/input0", RUN="/home/samim/.bin/keyboard-configure" 6 | 7 | export DISPLAY=:0 8 | export XAUTHORITY=/home/samim/.Xauthority 9 | setxkbmap -layout us,ir -option '' 10 | setxkbmap -option caps:ctrl_modifier 11 | xmodmap ~/.Xmodmap 12 | echo 2 | sudo tee /sys/module/hid_apple/parameters/fnmode 13 | -------------------------------------------------------------------------------- /systemd/user/snapclient.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Snapcast client 3 | After=network-online.target sound.target 4 | Requires=network-online.target 5 | After=avahi-daemon.service 6 | Requires=avahi-daemon.service 7 | 8 | [Service] 9 | EnvironmentFile=-/etc/default/snapclient 10 | Type=forking 11 | ExecStart=/usr/bin/snapclient -d $USER_OPTS $SNAPCLIENT_OPTS 12 | PIDFile=/var/run/snapclient/pid 13 | Restart=always 14 | 15 | [Install] 16 | WantedBy=multi-user.target 17 | -------------------------------------------------------------------------------- /desktop-files/Emc.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Comment= 3 | GenericName=Text Editor 4 | Terminal=false 5 | Name=Emc 6 | Exec=/home/samim/.bin/emc %F 7 | Type=Application 8 | Icon=emacs 9 | Comment=Edit text 10 | MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++; 11 | Categories=Development;TextEditor; 12 | StartupWMClass=Emacs -------------------------------------------------------------------------------- /eslintrc.js: -------------------------------------------------------------------------------- 1 | /* global module */ 2 | 3 | module.exports = { 4 | 'env': { 5 | 'browser': true, 6 | 'es6': true 7 | }, 8 | 'extends': 'eslint:recommended', 9 | 'rules': { 10 | 'indent': [ 11 | 'error', 12 | 2 13 | ], 14 | 'linebreak-style': [ 15 | 'error', 16 | 'unix' 17 | ], 18 | 'quotes': [ 19 | 'error', 20 | 'single' 21 | ], 22 | 'semi': [ 23 | 'error', 24 | 'always' 25 | ] 26 | } 27 | }; 28 | -------------------------------------------------------------------------------- /astroid/hooks/toggle: -------------------------------------------------------------------------------- 1 | #! /usr/bin/bash 2 | # 3 | # get a tag as first argument and thread id as second argument 4 | # 5 | 6 | if [[ $(notmuch search thread:$2 and tag:$1) ]]; then # check if the thread matches the tag 7 | echo "removing tag: $1 from thread:$2" # 8 | notmuch tag -$1 thread:$2 # remove the tag 9 | else 10 | echo "adding tag: $1 to thread:$2" # 11 | notmuch tag +$1 thread:$2 # add the tag 12 | fi 13 | -------------------------------------------------------------------------------- /icons/microphone.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /bin/pixelate_lock: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Pixelate screen and lock 4 | 5 | set -e 6 | 7 | scrot /tmp/screen.png 8 | convert /tmp/screen.png -scale 10% -scale 1000% /tmp/screen.png 9 | # [[ -f ~/.i3/lock-icon.png ]] && convert /tmp/screen.png ~/.i3/lock-icon.png -gravity center -composite -matte /tmp/screen.png 10 | # [[ -f ~/.i3/lock-icon.png ]] && convert /tmp/screen.png -gravity center -composite -matte /tmp/screen.png 11 | # i3lock -u -i /tmp/screen.png 12 | i3lock -i /tmp/screen.png 13 | 14 | 15 | -------------------------------------------------------------------------------- /doom/snippets/org-mode/Weekley Journal: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: Weekley Journal 3 | # key: -------------------------------------------------------------------------------- /bin/switch_media: -------------------------------------------------------------------------------- 1 | source=$1 2 | IP=192.168.1.7:8123 3 | entities=('media_player.snapcast_group_ba5b10e48aaffd72f94f5f2f4f5304c7' 4 | 'media_player.snapcast_group_14acc4f321241f0d0eb3255beae1124e') 5 | 6 | 7 | for entity in "${entities[@]}" 8 | do 9 | curl -X POST -H "x-ha-access: YOUR_PASSWORD" \ 10 | -H "Content-Type: application/json" \ 11 | -d '{"entity_id": "'$entity'", "source": "'$source'"}' \ 12 | http://$IP/api/services/media_player/select_source 13 | done 14 | 15 | -------------------------------------------------------------------------------- /spacemacs/private/semicolon/packages.el: -------------------------------------------------------------------------------- 1 | (setq semicolon-packages 2 | '( 3 | key-chord 4 | )) 5 | 6 | (defun semicolon/init-key-chord () 7 | """Forces Spacemacs to install key-chord-mode.""") 8 | (defun semicolon/post-init-key-chord () 9 | """Add the proper shortcuts.""" 10 | (add-hook 'prog-mode-hook 11 | (lambda () 12 | (key-chord-mode 1) 13 | (key-chord-define evil-insert-state-map "jj" 14 | 'add-semicolon-at-end-of-line)))) 15 | -------------------------------------------------------------------------------- /karabiner/assets/complex_modifications/1707925313.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Prevent unintended command-h hide window (rev 2)", 3 | "rules": [ 4 | { 5 | "description": "Disable Cmd+H Hide (rev 2)", 6 | "manipulators": [ 7 | { 8 | "type": "basic", 9 | "description": "", 10 | "from": { 11 | "key_code": "h", 12 | "modifiers": { 13 | "mandatory": ["command"] 14 | } 15 | } 16 | } 17 | ] 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /autorandr/docked-off-laptop/setup: -------------------------------------------------------------------------------- 1 | HDMI-1 00ffffffffffff001e6d9f5b6a5c0100061e010380502278eaca95a6554ea1260f5054256b807140818081c0a9c0b300d1c08100d1cfcd4600a0a0381f4030203a001e4e3100001a023a801871382d40582c45001e4e3100001e000000fd00384b1e5a19000a202020202020000000fc004c472048445220574648440a2001d6020332f1230907074c100403011f13595a125d5e5f830100006d030c001000b83c200060010203e305c000e60605014a4a56295900a0a038274030203a001e4e3100001a565e00a0a0a02950302035001e4e3100001a000000ff003030364e544456324d3139340a000000000000000000000000000000000000000000000038 2 | -------------------------------------------------------------------------------- /systemd/user/snapcast-pulse.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=PalseAudio configuration for snapserver 3 | After=sound.target 4 | 5 | [Service] 6 | Type=oneshot 7 | RemainAfterExit=yes 8 | ExecStartPre=/usr/bin/pacmd load-module module-pipe-sink file=/tmp/snapfifopulse sink_name=Snapcast 9 | ExecStart=/usr/bin/pacmd load-module module-pipe-sink file=/tmp/snapfifopulse sink_name=Snapcast 10 | ExecStartPost=/usr/bin/pacmd update-sink-proplist Snapcast device.description=Snapcast 11 | 12 | [Install] 13 | WantedBy=multi-user.target 14 | 15 | 16 | -------------------------------------------------------------------------------- /desktop-files/Browser.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Version=1.0 3 | Name=My Browser 4 | StartupWMClass=Google-chrome 5 | Exec=/home/samim/.bin/browser %U 6 | StartupNotify=true 7 | Terminal=false 8 | Icon=google-chrome 9 | Type=Application 10 | Categories=Network;WebBrowser; 11 | MimeType=application/pdf;application/rdf+xml;application/rss+xml;application/xhtml+xml;application/xhtml_xml;application/xml;image/gif;image/jpeg;image/png;image/webp;text/html;text/xml;x-scheme-handler/http;x-scheme-handler/https; 12 | Actions=new-window;new-private-window; 13 | -------------------------------------------------------------------------------- /bin/wifi_ssid_2: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #------------------------------------------------------------------------ 4 | 5 | INTERFACE="${BLOCK_INSTANCE:-wlp3s0}" 6 | 7 | #------------------------------------------------------------------------ 8 | 9 | # if the machine has no battery or wireless connection, the corresponding block should not be displayed. 10 | [[ ! -d /sys/class/net/${INTERFACE}/wireless ]] || 11 | [[ "$(cat /sys/class/net/$INTERFACE/operstate)" = 'down' ]] && exit 12 | 13 | SSID=$(iwgetid $INTERFACE -r) 14 | 15 | echo " $SSID " 16 | -------------------------------------------------------------------------------- /spacemacs/private/psamim-diary/keybindings.el: -------------------------------------------------------------------------------- 1 | (spacemacs|define-transient-state psamim-diary 2 | :title "Diary Transient State" 3 | :doc " 4 | [_p_] [_N_] previous day [_n_] next day [_d_] previous years today [_t_] today [_q_] quit" 5 | :bindings 6 | ("n" psamim-diary-show-next) 7 | ("p" psamim-diary-show-prev) 8 | ("N" psamim-diary-show-prev) 9 | ("d" psamim-diary-dired-day) 10 | ("t" psamim-diary-open-today) 11 | ("q" nil :exit t)) 12 | 13 | (spacemacs/set-leader-keys 14 | "aa" 'spacemacs/psamim-diary-transient-state/body) 15 | 16 | -------------------------------------------------------------------------------- /desktop-files/Work Browser.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Version=1.0 3 | Name=Global Browser 4 | StartupWMClass=work-Google-chrome 5 | Exec=/home/samim/.bin/work-browser %U 6 | StartupNotify=true 7 | Terminal=false 8 | Icon=google-chrome 9 | Type=Application 10 | Categories=Network;WebBrowser; 11 | MimeType=application/pdf;application/rdf+xml;application/rss+xml;application/xhtml+xml;application/xhtml_xml;application/xml;image/gif;image/jpeg;image/png;image/webp;text/html;text/xml;x-scheme-handler/http;x-scheme-handler/https; 12 | Actions=new-window;new-private-window; 13 | -------------------------------------------------------------------------------- /bin/invert: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | # This script inverts colors of the currently active window using picom 4 | # and toggles it. 5 | 6 | if [[ -e ~/.inverted ]] 7 | then 8 | echo "Already inverted" 9 | rm -f ~/.inverted 10 | pkill picom 11 | sleep 1 12 | picom & 13 | else 14 | echo "Try to invert" 15 | touch ~/.inverted 16 | pkill picom 17 | sleep 1 18 | ID=$(xdotool getactivewindow) 19 | CLASS=$(xprop -id "$ID" | grep "WM_CLASS" | awk '{print $4}') 20 | COND="class_g=${CLASS}" 21 | picom --invert-color-include "$COND" & 22 | fi 23 | exit 24 | 25 | -------------------------------------------------------------------------------- /karabiner/assets/complex_modifications/emacs_shortcuts.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "No minimize", 3 | "rules": [ 4 | { 5 | "description": "Emacs Shortcuts", 6 | "manipulators": [ 7 | { 8 | "from": { 9 | "key_code": "m", 10 | "modifiers": { "mandatory": ["command"] } 11 | }, 12 | "to": [{ 13 | "key_code": "m", 14 | "modifiers": ["left_command", "left_shift", "left_control"] 15 | }], 16 | "type": "basic" 17 | } 18 | ] 19 | } 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /bin/numfa2en: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | // -*- mode: js2; -*- 3 | 4 | function convertNumbers2English(string) { 5 | return string.replace(/[\u0660-\u0669]/g, function (c) { 6 | return c.charCodeAt(0) - 0x0660; 7 | }).replace(/[\u06f0-\u06f9]/g, function (c) { 8 | return c.charCodeAt(0) - 0x06f0; 9 | }); 10 | } 11 | 12 | 13 | process.stdin.resume(); 14 | process.stdin.setEncoding('utf8'); 15 | process.stdin.on('data', function(chunk) { 16 | var out = convertNumbers2English(chunk); 17 | out = out.trim(); 18 | process.stdout.write(out); 19 | }); 20 | 21 | -------------------------------------------------------------------------------- /bin/reboot-p: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Script to check if kernel needs a reboot to upgrade 4 | 5 | NEXTLINE=0 6 | FIND="" 7 | for I in `file /boot/vmlinuz*`; do 8 | if [ ${NEXTLINE} -eq 1 ]; then 9 | FIND="${I}" 10 | NEXTLINE=0 11 | else 12 | if [ "${I}" = "version" ]; then NEXTLINE=1; fi 13 | fi 14 | done 15 | if [ ! "${FIND}" = "" ]; then 16 | CURRENT_KERNEL=`uname -r` 17 | if [ ! "${CURRENT_KERNEL}" = "${FIND}" ]; then 18 | echo " REBOOT REQUIRED " 19 | echo 20 | echo \#D32F2F 21 | # exit 33 22 | fi 23 | fi 24 | -------------------------------------------------------------------------------- /fontconfig/fonts.conf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | monospace 6 | 7 | Iosevka 8 | Iosevka Nerd Font 9 | Noto Color Emoji 10 | 11 | 12 | ~/.fonts 13 | 14 | 15 | rgb 16 | 17 | 18 | 19 | 20 | true 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /bin/telegram-key: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Usage: bind alt+j to "telegram-key alt+j" 4 | 5 | CURRENT_WINDOW_ID=$(xdotool getwindowfocus) 6 | TELEGRAM_WINDOW_ID=$(xdotool search --class telegramdesktop | tail -n 1) 7 | 8 | if [ $TELEGRAM_WINDOW_ID -eq $CURRENT_WINDOW_ID ]; then 9 | if [ $1 == "alt+j" ]; then 10 | xdotool key --clearmodifiers --window $TELEGRAM_WINDOW_ID Ctrl+Tab 11 | fi 12 | 13 | if [ $1 == "alt+k" ]; then 14 | xdotool key --clearmodifiers --window $TELEGRAM_WINDOW_ID Ctrl+Shift+Tab 15 | fi 16 | else 17 | xdotool key --clearmodifiers --window $CURRENT_WINDOW_ID $1 18 | fi 19 | -------------------------------------------------------------------------------- /bin/nord-connected-p: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo --user=nordvpnteams nordvpnteams status|grep -i vpn|grep -q Connected 3 | 4 | connected=$? 5 | 6 | if [ $connected -ne 0 ]; then 7 | echo "" 8 | exit 9 | fi 10 | 11 | SERVERS=$(cat <<'END_HEREDOC' 12 | { 13 | "84.252.94.19": "G-GB", 14 | "66.115.147.11": "G-CA", 15 | "87.101.95.155": "US" 16 | } 17 | END_HEREDOC 18 | ) 19 | 20 | IP=$(sudo --user=nordvpnteams nordvpnteams status | grep Address:) 21 | IP=${IP:9} 22 | 23 | FOUND=$(echo $SERVERS | jq -r '.["'$IP'"]') 24 | 25 | if [ "$FOUND" = "null" ]; then 26 | echo " $IP" 27 | exit 28 | else 29 | echo " $FOUND" 30 | fi 31 | -------------------------------------------------------------------------------- /bin/restore: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | mkdir restore && cd restore 4 | echo "secret" | gpg --batch --passphrase-fd 0 --output out.tar --decrypt a.txt.gpg 5 | tar -xvzf out.tar 6 | rm -rf ~/.gnugpg 7 | mv gnupg ~/.gnupg 8 | 9 | gpg --pinentry-mode loopback -d pass.tgz.gpg > d.tgz 10 | mkdir ~/.password-store 11 | tar -xvzf d.tgz -C ~/.password-store 12 | 13 | export NAME="backups" 14 | export BORG_CONFIG_DIR=/home/samim/borg 15 | export BORG_CACHE_DIR=/home/samim/borg/cache 16 | export BORG_PASSPHRASE=`pass show borg-$NAME | head -n 1` 17 | chown -R $USER:$USER ~/borg/repos 18 | borg list ~/borg/repos/$NAME 19 | mkdir mnt && borg mount ~/borg/repo/$NAME mnt 20 | -------------------------------------------------------------------------------- /spacemacs/private/org-latex-classes/README.org: -------------------------------------------------------------------------------- 1 | #+TITLE: org-latex-classes layer 2 | 3 | * Table of Contents :TOC_4_org:noexport: 4 | - [[Description][Description]] 5 | - [[Install][Install]] 6 | 7 | * Description 8 | This layer consists of my personal latex classes, [[https://github.com/gpoore/minted][minted]] preferences and latex export configurations. 9 | I use these classes for English or Persian assignments and articles. 10 | 11 | * Install 12 | To use this contribution add it to your =~/.spacemacs= 13 | 14 | #+begin_src emacs-lisp 15 | (setq-default dotspacemacs-configuration-layers '(org-latex-classes)) 16 | #+end_src 17 | -------------------------------------------------------------------------------- /bin/xautolock-running-p: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Toggles xautolock on or off on click 4 | 5 | SERVICE='xautolock.service' 6 | 7 | STATUS=`systemctl --user is-active $SERVICE` 8 | # Toggle process if block is clicked 9 | if [ -n "$BLOCK_BUTTON" ]; then 10 | if [[ $STATUS == "active" ]]; then 11 | systemctl --user stop $SERVICE 12 | else 13 | systemctl --user start $SERVICE 14 | fi 15 | fi 16 | 17 | 18 | STATUS=`systemctl --user is-active $SERVICE` 19 | # Current status of arbtt 20 | if [[ $STATUS == "active" ]]; then 21 | echo " " 22 | exit 0 23 | else 24 | echo "  " 25 | echo 26 | echo \#D32F2F 27 | exit 33 28 | fi 29 | 30 | -------------------------------------------------------------------------------- /doom/snippets/org-mode/Monthly Journal: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: Monthly Journal 3 | # key: 2 | -------------------------------------------------------------------------------- /spacemacs/private/aj-javascript/funcs.el: -------------------------------------------------------------------------------- 1 | (defun aj-javascript/eslintd-set-flycheck-executable () 2 | (interactive) 3 | (when-let (eslintd-executable (executable-find "eslint_d")) 4 | (make-variable-buffer-local 'flycheck-javascript-eslint-executable) 5 | (setq flycheck-javascript-eslint-executable eslintd-executable))) 6 | 7 | ;; Inspired by http://blog.binchen.org/posts/indent-jsx-in-emacs.html 8 | (defun aj-javascript/js-jsx-indent-line-align-closing-bracket () 9 | "Workaround sgml-mode and align closing bracket with opening bracket" 10 | (save-excursion 11 | (beginning-of-line) 12 | (when (looking-at-p "^ +\/?> *$") 13 | (delete-char sgml-basic-offset)))) 14 | -------------------------------------------------------------------------------- /spacemacs/private/psamim-diary/README.org: -------------------------------------------------------------------------------- 1 | #+TITLE: psamim-diary layer 2 | 3 | * Table of Contents :TOC_4_org:noexport: 4 | - [[Description][Description]] 5 | - [[Install][Install]] 6 | - [[Key bindings][Key bindings]] 7 | 8 | * Description 9 | Provide diary micro-state to move between days easily. 10 | 11 | * Install 12 | To use this contribution add it to your =~/.spacemacs= 13 | 14 | #+begin_src emacs-lisp 15 | (setq-default dotspacemacs-configuration-layers '(psamim-diary)) 16 | #+end_src 17 | 18 | * Key bindings 19 | 20 | | Key Binding | Description | 21 | |-------------+-------------------| 22 | | ~ a a~ | diary micro-state | 23 | -------------------------------------------------------------------------------- /astronvim/lua/plugins/mason.lua: -------------------------------------------------------------------------------- 1 | ---@type LazySpec 2 | return { 3 | -- use mason-tool-installer for automatically installing Mason packages 4 | { 5 | "WhoIsSethDaniel/mason-tool-installer.nvim", 6 | -- overrides `require("mason-tool-installer").setup(...)` 7 | opts = { 8 | -- Make sure to use the names found in `:Mason` 9 | ensure_installed = { 10 | -- install language servers 11 | "lua-language-server", 12 | 13 | -- install formatters 14 | "stylua", 15 | 16 | -- install debuggers 17 | -- "debugpy", 18 | 19 | -- install any other package 20 | -- "tree-sitter-cli", 21 | "prettier", 22 | "eslint-lsp", 23 | }, 24 | }, 25 | }, 26 | } 27 | -------------------------------------------------------------------------------- /vrapper/vrapperrc.vim: -------------------------------------------------------------------------------- 1 | " Editing 2 | map :w 3 | inoremap jk 4 | inoremap kj 5 | inoremap jj A; 6 | nmap ;; : 7 | nnoremap tl :tabnext 8 | nnoremap th :tabprev 9 | nnoremap tt :tabedit 10 | nnoremap tn :tabnew 11 | nnoremap tm :tabm 12 | nnoremap td :tabclose 13 | 14 | 15 | " Eclipse Actions 16 | eclipseaction cm org.eclipse.jdt.ui.edit.text.java.toggle.comment 17 | nnoremap \cc :cm 18 | 19 | eclipseaction! fm org.eclipse.jdt.ui.edit.text.java.quick.format 20 | nnoremap == :fm 21 | 22 | eclipseaction! fmm org.eclipse.jdt.ui.edit.text.java.format 23 | nnoremap === :fmm 24 | 25 | eclipseaction! import org.eclipse.jdt.ui.edit.text.java.add.import 26 | nnoremap im :import 27 | -------------------------------------------------------------------------------- /autorandr/m7/setup: -------------------------------------------------------------------------------- 1 | HDMI1 00ffffffffffff004c2d0371000e0001011e0103804627782a64a5a4544d9a260f5054bdef80714f81c0810081809500a9c0b300d1c008e80030f2705a80b0588a00501d7400001e565e00a0a0a0295030203500501d7400001a000000fd00184b0f873c000a202020202020000000fc0053414d53554e470a2020202020016b02034ef05261101f041305142021225d5e5f60071603122c09070715075057070067540083010000e2004fe305c3016d030c001000b83c28006001020368d85dc40178800902e3060d01e30f0120023a801871382d40582c4500501d7400001e0000000000000000000000000000000000000000000000000000000000000044 2 | eDP1 00ffffffffffff000daed41400000000241a0104a51f11780228659759548e271e505400000001010101010101010101010101010101b43b804a71383440503c680035ad10000018000000fe004e3134304843412d4541430a20000000fe00434d4e0a202020202020202020000000fe004e3134304843412d4541430a200005 3 | -------------------------------------------------------------------------------- /autorandr/docked/setup: -------------------------------------------------------------------------------- 1 | HDMI1 00ffffffffffff001e6d9f5b6a5c0100061e010380502278eaca95a6554ea1260f5054256b807140818081c0a9c0b300d1c08100d1cfcd4600a0a0381f4030203a001e4e3100001a023a801871382d40582c45001e4e3100001e000000fd00384b1e5a19000a202020202020000000fc004c472048445220574648440a2001d6020332f1230907074c100403011f13595a125d5e5f830100006d030c001000b83c200060010203e305c000e60605014a4a56295900a0a038274030203a001e4e3100001a565e00a0a0a02950302035001e4e3100001a000000ff003030364e544456324d3139340a000000000000000000000000000000000000000000000038 2 | eDP1 00ffffffffffff000daed41400000000241a0104a51f11780228659759548e271e505400000001010101010101010101010101010101b43b804a71383440503c680035ad10000018000000fe004e3134304843412d4541430a20000000fe00434d4e0a202020202020202020000000fe004e3134304843412d4541430a200005 3 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "zgen"] 2 | path = zgen 3 | url = https://github.com/tarjoilija/zgen.git 4 | [submodule "tpm"] 5 | path = tpm 6 | url = https://github.com/tmux-plugins/tpm 7 | [submodule "awesomewm/sharedtags"] 8 | path = awesomewm/sharedtags 9 | url = https://github.com/Drauthius/awesome-sharedtags.git 10 | branch = v4.0 11 | [submodule "awesomewm/awesome-wm-widgets"] 12 | path = awesomewm/awesome-wm-widgets 13 | url = https://github.com/streetturtle/awesome-wm-widgets.git 14 | branch = master 15 | [submodule "awesomewm/revelation"] 16 | path = awesomewm/revelation 17 | url = https://github.com/guotsuan/awesome-revelation.git 18 | branch = master 19 | [submodule "alacritty/catppuccin"] 20 | path = alacritty/catppuccin 21 | url = git@github.com:catppuccin/alacritty.git 22 | -------------------------------------------------------------------------------- /karabiner/assets/complex_modifications/vscode.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "VS Code", 3 | "rules": [ 4 | { 5 | "description": "VS Code Ctrl_r", 6 | "manipulators": [ 7 | { 8 | "type": "basic", 9 | "from": { 10 | "modifiers": { 11 | "mandatory": ["left_command"] 12 | }, 13 | "key_code": "r" 14 | }, 15 | "conditions": [ 16 | { 17 | "type": "frontmost_application_if", 18 | "description": "com.microsoft.VSCode" 19 | } 20 | ], 21 | "to": [ 22 | { 23 | "repeat": false, 24 | "key_code": "r", 25 | "modifiers": ["left_control"] 26 | } 27 | ] 28 | } 29 | ] 30 | } 31 | ] 32 | } 33 | -------------------------------------------------------------------------------- /git/config: -------------------------------------------------------------------------------- 1 | # vim:ft=gitconfig: 2 | [user] 3 | name = Samim Pezeshki 4 | email = psamim@gmail.com 5 | [core] 6 | editor = nvim 7 | excludesfile = ~/.gitignore 8 | autocrlf = input 9 | [interactive] 10 | diffFilter = delta --color-only 11 | [alias] 12 | st = status 13 | mr = push -u origin HEAD -o merge_request.create -o merge_request.draft 14 | recent = !git for-each-ref --sort=-committerdate refs/heads/ | head -n 5 15 | [push] 16 | default = simple 17 | autoSetupRemote = true 18 | # [http] 19 | # proxy = http://127.0.0.1:7777 20 | # [https] 21 | # proxy = http://127.0.0.1:7777 22 | [magit] 23 | hideCampaign = true 24 | [pull] 25 | rebase = false 26 | [init] 27 | defaultBranch = main 28 | [credential] 29 | helper = cache --timeout=3600 30 | [diff "gpg"] 31 | textconv = gpg --no-tty --decrypt 32 | [url "git@github.com:"] 33 | insteadOf = https://github.com/ 34 | -------------------------------------------------------------------------------- /astronvim/lua/plugins/vim-test.lua: -------------------------------------------------------------------------------- 1 | -- ~/.config/nvim/lua/plugins/vim-test.lua 2 | return { 3 | "vim-test/vim-test", 4 | config = function() 5 | vim.g["test#javascript#runner"] = "nx" 6 | -- vim.g["test#javascript#jest#executable"] = "pnpm exec jest" 7 | vim.g["test#strategy"] = "neovim" 8 | vim.g["test#echo_command"] = 1 9 | 10 | -- vim.g["test#javascript#jest#options"] = "-c jest.config.ts" 11 | -- vim.g["test#javascript#jest#file_pattern"] = [[\v(test|spec)\.(js|jsx|coffee|ts|tsx)$]] 12 | -- vim.g["test#javascript#jest#file_pattern"] = [[\.(test|spec)\.(js|jsx|ts|tsx)$]] 13 | -- Force vim-test to recognize your file as a Jest test 14 | -- vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, { 15 | -- pattern = { "*.test.tsx", "*.spec.tsx" }, 16 | -- callback = function() vim.b.test_runner = "jest" end, 17 | -- }) 18 | end, 19 | } 20 | -------------------------------------------------------------------------------- /spacemacs/private/README.md: -------------------------------------------------------------------------------- 1 | # Private directory 2 | 3 | The content of this directory is ignored by Git. This is the default place 4 | where to store your private configuration layers. 5 | 6 | To create a new configuration layer: 7 | 8 | : configuration-layer/create-layer RET 9 | 10 | Then enter the name of your configuration in the prompt. 11 | 12 | A directory named after the created configuration layer will be created here 13 | along with template files within it (packages.el and extensions.el, more info 14 | on the meaning of those files can be found in the [documentation][conf_layers]). 15 | 16 | Each created file has further guidance written in them. 17 | 18 | Once the configuration is done, restart Emacs to load, install and configure 19 | your layer. 20 | 21 | [conf_layers]: https://github.com/syl20bnr/spacemacs/blob/master/doc/DOCUMENTATION.org#extensions-and-packages 22 | -------------------------------------------------------------------------------- /bin/arbtt-running: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Displays the overall time spent today 4 | # If arbtt-capture is not running displays a red alert showing OFF 5 | # Toggles arbtt-capture on or off on click 6 | 7 | SERVICE='arbtt.service' 8 | 9 | STATUS=`systemctl --user is-active $SERVICE` 10 | # Toggle process if block is clicked 11 | if [ -n "$BLOCK_BUTTON" ]; then 12 | if [[ $STATUS == "active" ]]; then 13 | systemctl --user stop $SERVICE 14 | else 15 | systemctl --user start $SERVICE 16 | fi 17 | fi 18 | 19 | STATUS=`systemctl --user is-active $SERVICE` 20 | # Current status of arbtt 21 | if [[ $STATUS == "active" ]]; then 22 | today=$(arbtt-stats -o today --filter='$date>='$(date +"%Y-%m-%d") --output-format=csv|grep today|cut -d, -f2|head -c -4) 23 | echo " $today " 24 | exit 0 25 | else 26 | echo " " 27 | echo 28 | echo \#D32F2F 29 | exit 33 30 | fi 31 | -------------------------------------------------------------------------------- /astronvim/init.lua: -------------------------------------------------------------------------------- 1 | -- This file simply bootstraps the installation of Lazy.nvim and then calls other files for execution 2 | -- This file doesn't necessarily need to be touched, BE CAUTIOUS editing this file and proceed at your own risk. 3 | local lazypath = vim.env.LAZY or vim.fn.stdpath "data" .. "/lazy/lazy.nvim" 4 | if not (vim.env.LAZY or (vim.uv or vim.loop).fs_stat(lazypath)) then 5 | -- stylua: ignore 6 | vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath }) 7 | end 8 | vim.opt.rtp:prepend(lazypath) 9 | 10 | -- validate that lazy is available 11 | if not pcall(require, "lazy") then 12 | -- stylua: ignore 13 | vim.api.nvim_echo({ { ("Unable to load lazy from: %s\n"):format(lazypath), "ErrorMsg" }, { "Press any key to exit...", "MoreMsg" } }, true, {}) 14 | vim.fn.getchar() 15 | vim.cmd.quit() 16 | end 17 | 18 | require "lazy_setup" 19 | require "polish" 20 | -------------------------------------------------------------------------------- /bin/clocking: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Displays the title of current active (clocked) task in org-mode 4 | # along with its pomodoro counter and overall spent time. 5 | 6 | elisp=$(cat <<'END_HEREDOC' 7 | (concat 8 | ;; (setq org-duration-format 'h:mm) 9 | (if (org-clock-is-active) (org-clock-get-clock-string) "") 10 | ;; " " 11 | ;; (when (org-pomodoro-active-p) 12 | ;; (format 13 | ;; (propertize org-pomodoro-format 'face 'org-pomodoro-mode-line) 14 | ;; (org-pomodoro-format-seconds))) 15 | ) 16 | END_HEREDOC 17 | ) 18 | 19 | if [[ -z $(pidof emacs) ]] 20 | then 21 | echo "" 22 | else 23 | TIME=`emacsclient --eval "$elisp" \ 24 | | grep -s -o "\".*\"" | sed 's/\"//g' | sed 's/^ //g' | sed 's/ $//g' | sed 's/\[//g' | sed 's/\]//g'` 25 | if [ -n "$TIME" ]; then 26 | # echo "    $TIME   " 27 | echo " $TIME" 28 | else 29 | exit 1 30 | fi 31 | fi 32 | -------------------------------------------------------------------------------- /astronvim/README.md: -------------------------------------------------------------------------------- 1 | # AstroNvim Template 2 | 3 | **NOTE:** This is for AstroNvim v5+ 4 | 5 | A template for getting started with [AstroNvim](https://github.com/AstroNvim/AstroNvim) 6 | 7 | ## 🛠️ Installation 8 | 9 | #### Make a backup of your current nvim and shared folder 10 | 11 | ```shell 12 | mv ~/.config/nvim ~/.config/nvim.bak 13 | mv ~/.local/share/nvim ~/.local/share/nvim.bak 14 | mv ~/.local/state/nvim ~/.local/state/nvim.bak 15 | mv ~/.cache/nvim ~/.cache/nvim.bak 16 | ``` 17 | 18 | #### Create a new user repository from this template 19 | 20 | Press the "Use this template" button above to create a new repository to store your user configuration. 21 | 22 | You can also just clone this repository directly if you do not want to track your user configuration in GitHub. 23 | 24 | #### Clone the repository 25 | 26 | ```shell 27 | git clone https://github.com// ~/.config/nvim 28 | ``` 29 | 30 | #### Start Neovim 31 | 32 | ```shell 33 | nvim 34 | ``` 35 | -------------------------------------------------------------------------------- /spacemacs/private/psamim-react/funcs.el: -------------------------------------------------------------------------------- 1 | ;;; funcs.el --- React Layer functions File for Spacemacs 2 | ;; 3 | ;; Copyright (c) 2012-2018 Sylvain Benner & Contributors 4 | ;; 5 | ;; Author: Muneeb Shaikh 6 | ;; URL: https://github.com/syl20bnr/spacemacs 7 | ;; 8 | ;; This file is not part of GNU Emacs. 9 | ;; 10 | ;;; License: GPLv3 11 | 12 | 13 | ;; react mode 14 | 15 | (defun spacemacs//setup-react-mode () 16 | "Adjust web-mode to accommodate react-mode" 17 | (emmet-mode 0) 18 | ;; See https://github.com/CestDiego/emmet-mode/commit/3f2904196e856d31b9c95794d2682c4c7365db23 19 | (setq-local emmet-expand-jsx-className? t) 20 | ;; Enable js-mode snippets 21 | (yas-activate-extra-mode 'js-mode) 22 | ;; Force jsx content type 23 | (web-mode-set-content-type "jsx") 24 | ;; Don't auto-quote attribute values 25 | (setq-local web-mode-enable-auto-quoting nil) 26 | ;; See https://github.com/syl20bnr/spacemacs/issues/8222 27 | (set (make-local-variable 'company-minimum-prefix-length) 2)) 28 | -------------------------------------------------------------------------------- /astronvim/lua/community.lua: -------------------------------------------------------------------------------- 1 | -- AstroCommunity: import any community modules here 2 | -- We import this file in `lazy_setup.lua` before the `plugins/` folder. 3 | -- This guarantees that the specs are processed before any user plugins. 4 | 5 | ---@type LazySpec 6 | return { 7 | "AstroNvim/astrocommunity", 8 | { import = "astrocommunity.completion.copilot-lua-cmp" }, 9 | { import = "astrocommunity.pack.lua" }, 10 | { import = "astrocommunity.pack.typescript" }, 11 | { import = "astrocommunity.pack.php" }, 12 | -- { import = "astrocommunity.pack.prettier" }, 13 | { import = "astrocommunity.test.vim-test" }, 14 | { import = "astrocommunity.utility.noice-nvim" }, 15 | { import = "astrocommunity.colorscheme.catppuccin" }, 16 | { import = "astrocommunity.motion.nvim-surround" }, 17 | { import = "astrocommunity.scrolling.satellite-nvim" }, 18 | { import = "astrocommunity.scrolling.mini-animate" }, 19 | { import = "astrocommunity.diagnostics.tiny-inline-diagnostic-nvim" }, 20 | -- import/override with your plugins folder 21 | } 22 | -------------------------------------------------------------------------------- /spacemacs/private/psamim-defaults/packages.el: -------------------------------------------------------------------------------- 1 | (setq psamim-defaults-packages 2 | '(ranger 3 | ;; sublimity 4 | olivetti)) 5 | 6 | (defun psamim-defaults/post-init-ranger () 7 | (use-package ranger 8 | :config (progn 9 | (ranger-override-dired-mode t) 10 | (setq ranger-footer-delay 0.7) 11 | (define-key ranger-mode-map (kbd "M-n") 'ranger-new-tab) 12 | (define-key ranger-mode-map (kbd "M-l") 'ranger-next-tab) 13 | (define-key ranger-mode-map (kbd "M-h") 'ranger-prev-tab)))) 14 | 15 | ;; (defun psamim-defaults/init-sublimity () 16 | ;; (use-package sublimity 17 | ;; :config (progn 18 | ;; (require 'sublimity) 19 | ;; (require 'sublimity-scroll) 20 | ;; (setq sublimity-attractive-centering-width 110) 21 | ;; (require 'sublimity-attractive) 22 | ;; ;; (sublimity-mode 1) 23 | ;; ))) 24 | 25 | (defun psamim-defaults/init-olivetti () 26 | (use-package olivetti)) 27 | -------------------------------------------------------------------------------- /spacemacs/private/psamim-org/funcs.el: -------------------------------------------------------------------------------- 1 | (defun org-babel-python-strip-session-chars () 2 | "Remove >>> and ... from a Python session output." 3 | (when (and (string= 4 | "python" 5 | (org-element-property :language (org-element-at-point))) 6 | (string-match 7 | ":session" 8 | (org-element-property :parameters (org-element-at-point)))) 9 | 10 | (save-excursion 11 | (when (org-babel-where-is-src-block-result) 12 | (goto-char (org-babel-where-is-src-block-result)) 13 | (end-of-line 1) 14 | ;(while (looking-at "[\n\r\t\f ]") (forward-char 1)) 15 | (while (re-search-forward 16 | "\\(>>> \\|\\.\\.\\. \\|: $\\|: >>>$\\)" 17 | (org-element-property :end (org-element-at-point)) 18 | t) 19 | (replace-match "") 20 | ;; this enables us to get rid of blank lines and blank : >>> 21 | (beginning-of-line) 22 | (when (looking-at "^$") 23 | (kill-line))))))) 24 | -------------------------------------------------------------------------------- /bin/hdmi-sound-toggle: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This scripts checks if HDMI is connected, if is connected it switches pulseaudio profile to HDMI 4 | # Otherwise switches to a default profile 5 | 6 | # USER_NAME=$(who | awk -v vt=tty$(fgconsole) '$0 ~ vt {print $1}') 7 | USER_NAME=$(whoami) 8 | USER_ID=$(id -u "$USER_NAME") 9 | CARD_PATH="/sys/class/drm/card0/" 10 | AUDIO_OUTPUT="analog-stereo" 11 | PULSE_SERVER="unix:/run/user/"$USER_ID"/pulse/native" 12 | 13 | for OUTPUT in $(cd "$CARD_PATH" && echo card*); do 14 | OUT_STATUS=$(<"$CARD_PATH"/"$OUTPUT"/status) 15 | if [[ $OUT_STATUS == connected ]] 16 | then 17 | echo $OUTPUT connected 18 | case "$OUTPUT" in 19 | "card0-HDMI-A-1") 20 | AUDIO_OUTPUT="hdmi-stereo-extra1" # Digital Stereo (HDMI 1) 21 | ;; 22 | "card0-HDMI-A-2") 23 | AUDIO_OUTPUT="hdmi-stereo-extra1" # Digital Stereo (HDMI 2) 24 | ;; 25 | esac 26 | fi 27 | done 28 | echo selecting output $AUDIO_OUTPUT 29 | sudo -u "$USER_NAME" pactl --server "$PULSE_SERVER" set-card-profile 0 output:$AUDIO_OUTPUT+input:analog-stereo 30 | -------------------------------------------------------------------------------- /bin/screenshot: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Take a screenshot using dmenu and maim 4 | 5 | IMG_PATH=/home/samim/Pictures/ 6 | FILE=$(date +%F-%T).png 7 | 8 | prog="fullscreen 9 | section" 10 | 11 | # cmd=$(dmenu -dim 0.15 -x 183 -y 150 -w 1000 -h 70 -i -nf '#c5c8c6' -nb '#1d1f21' -sf '#1d1f21' -sb '#b4b7b4' -l 0 -fn 'Fantasque Sans Mono-16:normal' <<< "$prog") 12 | cmd=$(rofi -dmenu <<< "$prog") 13 | cd $IMG_PATH 14 | 15 | case ${cmd%% *} in 16 | fullscreen) 17 | # pkill compton 18 | # maim -d 4 "$FILE" && notify-send -u low 'Screenshot' 'Fullscreen taken and saved' 19 | scrot -d 4 "$FILE" && notify-send -u low 'Screenshot' 'Fullscreen taken and saved' 20 | # compton --config ~/.compton & 21 | ;; 22 | section) 23 | # pkill compton 24 | # maim --select --color 1,0,0,0.6 "$FILE" && notify-send -u low 'Screenshot' 'Section Screenshot saved' 25 | scrot -s "$FILE" && notify-send -u low 'Screenshot' 'Fullscreen taken and saved' 26 | # compton --config ~/.compton & 27 | ;; 28 | esac 29 | xdg-open "$FILE" 30 | -------------------------------------------------------------------------------- /karabiner/assets/complex_modifications/ctrl-tab.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "complex_modifications", 3 | "rules": [ 4 | { 5 | "manipulators": [ 6 | { 7 | "description": "Ctrl+Tab to Cmd+Tab", 8 | "from": { 9 | "key_code": "tab", 10 | "modifiers": { 11 | "mandatory": ["left_control"], 12 | "optional": ["any"] 13 | } 14 | }, 15 | "to": [ 16 | { 17 | "key_code": "tab", 18 | "modifiers": ["left_command"] 19 | } 20 | ], 21 | "type": "basic" 22 | }, 23 | { 24 | "description": "Cmd+Tab to Ctrl+Tab", 25 | "from": { 26 | "key_code": "tab", 27 | "modifiers": { 28 | "mandatory": ["left_command"], 29 | "optional": ["any"] 30 | } 31 | }, 32 | "to": [ 33 | { 34 | "key_code": "tab", 35 | "modifiers": ["left_control"] 36 | } 37 | ], 38 | "type": "basic" 39 | } 40 | ] 41 | } 42 | ] 43 | } 44 | -------------------------------------------------------------------------------- /icons/cook.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /astronvim/lua/plugins/none-ls.lua: -------------------------------------------------------------------------------- 1 | ---@type LazySpec 2 | return { 3 | "nvimtools/none-ls.nvim", 4 | opts = function(_, opts) 5 | local null_ls = require "null-ls" 6 | 7 | -- Check supported formatters and linters 8 | -- https://github.com/nvimtools/none-ls.nvim/tree/main/lua/null-ls/builtins/formatting 9 | -- https://github.com/nvimtools/none-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics 10 | 11 | -- Only insert new sources, do not replace the existing ones 12 | -- (If you wish to replace, use `opts.sources = {}` instead of the `list_insert_unique` function) 13 | opts.sources = require("astrocore").list_insert_unique(opts.sources, { 14 | -- Set a formatter 15 | -- null_ls.builtins.formatting.stylua, 16 | -- null_ls.builtins.formatting.prettier, 17 | -- 18 | null_ls.builtins.formatting.prettier.with { 19 | -- Specify your preferred settings here 20 | prefer_local = "node_modules/.bin", -- Use project-local prettier 21 | -- You can add other options like: 22 | -- args = { "--print-width", "100", "--no-semi" }, 23 | -- or let it use your .prettierrc file 24 | }, 25 | }) 26 | end, 27 | } 28 | -------------------------------------------------------------------------------- /vimfx/config.js: -------------------------------------------------------------------------------- 1 | /* global vimfx */ 2 | 3 | vimfx.set('hint_chars', 'asdfjkl'); 4 | vimfx.set('ignore_keyboard_layout', true); 5 | 6 | vimfx.addKeyOverrides( 7 | [ (location) => location.host === 'www.facebook.com', 8 | 'jkl'.split('') 9 | ], 10 | [ (location) => location.host === 'inbox.google.com', 11 | 'jkcnp/ie[]raf#?!xs'.split('') 12 | ], 13 | [ (location) => location.host === 'outlook.office.com', 14 | '?gijkxcraf#e'.split('') 15 | ], 16 | [ (location) => location.host === 'tweetdeck.twitter.com', 17 | 'jklhrlfg?'.split('') 18 | ] 19 | ); 20 | 21 | let map = (shortcuts, command, custom=false) => { 22 | vimfx.set(`${custom ? 'custom.' : ''}mode.normal.${command}`, shortcuts); 23 | }; 24 | 25 | function disable_cmd ( cmd ) { 26 | map('', cmd); 27 | } 28 | 29 | //disable a-prefixed cmds 30 | [ 31 | 'reload_all', 32 | ].map(disable_cmd); 33 | 34 | map('', 'tab_select_next'); 35 | map('', 'tab_select_previous'); 36 | map('', 'tab_select_most_recent'); 37 | map('', 'history_back'); 38 | map('', 'history_forward'); 39 | map('d', 'tab_close'); 40 | map('u', 'tab_restore'); 41 | map('','scroll_half_page_down'); 42 | map('','scroll_half_page_up'); 43 | -------------------------------------------------------------------------------- /spacemacs/private/psamim-defaults/funcs.el: -------------------------------------------------------------------------------- 1 | (defun psamim-write-room () 2 | (interactive) 3 | (writeroom-mode) 4 | (visual-line-mode) 5 | (spacemacs/toggle-vi-tilde-fringe-off) 6 | (spacemacs/toggle-line-numbers-off) 7 | (writeroom-adjust-width)) 8 | 9 | (defun get-string-from-file (filePath) 10 | "Return filePath's file content." 11 | (with-temp-buffer 12 | (insert-file-contents filePath) 13 | (buffer-string))) 14 | 15 | (defun psamim-journal-prefix (time) 16 | (let* 17 | ((diary-in-a-while "5") ;; Fridays 18 | (diary-template "/home/samim/Notes/archive/template.org") 19 | (diary-template-in-a-while "/home/samim/Notes/archive/template-in-a-while.org") 20 | (decodedTime (decode-time time)) 21 | (now (list (nth 4 decodedTime) (nth 3 decodedTime) (nth 5 decodedTime))) 22 | (template 23 | (if (string= (format-time-string "%w" time) diary-in-a-while) 24 | diary-template-in-a-while diary-template))) 25 | (concat 26 | "* " 27 | (format-time-string "%B %e, %Y" time) "\n" 28 | (format-time-string "%A" time) "\n" 29 | (calendar-persian-date-string now) "\n" 30 | (calendar-bahai-date-string now) "\n\n" 31 | (get-string-from-file template)))) 32 | -------------------------------------------------------------------------------- /spacemacs/private/psamim-org-zotero/README.org: -------------------------------------------------------------------------------- 1 | #+TITLE: psamim-org-zotero layer 2 | #+HTML_HEAD_EXTRA: 3 | 4 | #+CAPTION: logo 5 | 6 | # The maximum height of the logo should be 200 pixels. 7 | [[img/psamim-org-zotero.png]] 8 | 9 | * Table of Contents :TOC_4_org:noexport: 10 | - [[Description][Description]] 11 | - [[Install][Install]] 12 | - [[Key bindings][Key bindings]] 13 | 14 | * Description 15 | This layer integrates [[https://github.com/egh/zotxt-emacs][zotxt]] and [[https://github.com/vspinu/zotelo][zotelo]] into org-mode and Spacemacs. 16 | 17 | * Install 18 | To use this contribution add it to your =~/.spacemacs= 19 | 20 | #+begin_src emacs-lisp 21 | (setq-default dotspacemacs-configuration-layers '(psamim-org-zotero)) 22 | #+end_src 23 | 24 | * Key bindings 25 | 26 | | Key Binding | Description | 27 | |-------------+---------------------------------| 28 | | ~SPC m z i~ | org-zotxt-insert-reference-link | 29 | | ~SPC m i z~ | org-zotxt-insert-reference-link | 30 | | ~SPC m z o~ | org-zotxt-open-attachment | 31 | | ~SPC m z u~ | zotelo-update-database | 32 | | ~SPC m z s~ | zotelo-set-collection | 33 | -------------------------------------------------------------------------------- /doom/snippets/org-mode/quarterly journal: -------------------------------------------------------------------------------- 1 | # key: 2 | 3 | 4 | -------------------------------------------------------------------------------- /spacemacs/private/psamim-org-zotero/packages.el: -------------------------------------------------------------------------------- 1 | ;;; packages.el --- psamim-org-zotero layer packages file for Spacemacs. 2 | ;; 3 | ;; Copyright (c) 2012-2016 Sylvain Benner & Contributors 4 | ;; 5 | ;; Author: Samim Pezeshki 6 | ;; URL: https://github.com/syl20bnr/spacemacs 7 | ;; 8 | ;; This file is not part of GNU Emacs. 9 | ;; 10 | ;;; License: GPLv3 11 | 12 | (defconst psamim-org-zotero-packages 13 | '(zotxt 14 | zotelo)) 15 | 16 | (defun psamim-org-zotero/init-zotxt () 17 | (spacemacs|diminish org-zotxt-mode " Ⓩ" " z") 18 | (spacemacs/declare-prefix-for-mode 'org-mode "mz" "zotero") 19 | (spacemacs/set-leader-keys-for-major-mode 'org-mode 20 | "zi" 'org-zotxt-insert-reference-link 21 | "iz" 'org-zotxt-insert-reference-link 22 | "zo" 'org-zotxt-open-attachment) 23 | (add-hook 'org-mode-hook 'org-zotxt-mode)) 24 | 25 | ;; (defun org-psamim/post-init-zotxt () 26 | ;; This citation style should be installed in Zotero 27 | ;; http://www.mkbehr.com/files/mkbehr-short.csl 28 | ;; It's nothing special or needed, only a shorter text 29 | ;; (setq zotxt-default-bibliography-style "mkbehr-short")) 30 | 31 | (defun psamim-org-zotero/init-zotelo () 32 | (spacemacs/set-leader-keys-for-major-mode 'org-mode 33 | "zu" 'zotelo-update-database 34 | "zs" 'zotelo-set-collection)) 35 | -------------------------------------------------------------------------------- /karabiner/assets/complex_modifications/fkeys_to_cmdf.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Map F1–F4 to Command+F1–F4", 3 | "rules": [ 4 | { 5 | "description": "Map F1 to Command+F1, F2 to Command+F2, ..., F4 to Command+F4", 6 | "manipulators": [ 7 | { 8 | "type": "basic", 9 | "from": { "key_code": "f1" }, 10 | "to": [ 11 | { 12 | "key_code": "f1", 13 | "modifiers": ["left_command"] 14 | } 15 | ] 16 | }, 17 | { 18 | "type": "basic", 19 | "from": { "key_code": "f2" }, 20 | "to": [ 21 | { 22 | "key_code": "f2", 23 | "modifiers": ["left_command"] 24 | } 25 | ] 26 | }, 27 | { 28 | "type": "basic", 29 | "from": { "key_code": "f3" }, 30 | "to": [ 31 | { 32 | "key_code": "f3", 33 | "modifiers": ["left_command"] 34 | } 35 | ] 36 | }, 37 | { 38 | "type": "basic", 39 | "from": { "key_code": "f4" }, 40 | "to": [ 41 | { 42 | "key_code": "f4", 43 | "modifiers": ["left_command"] 44 | } 45 | ] 46 | } 47 | ] 48 | } 49 | ] 50 | } 51 | -------------------------------------------------------------------------------- /bin/wifi_ssid: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #------------------------------------------------------------------------ 4 | 5 | INTERFACE="${BLOCK_INSTANCE:-wlan0}" 6 | 7 | #------------------------------------------------------------------------ 8 | 9 | # if the machine has no battery or wireless connection, the corresponding block should not be displayed. 10 | [[ ! -d /sys/class/net/${INTERFACE}/wireless ]] || 11 | [[ "$(cat /sys/class/net/$INTERFACE/operstate)" = 'down' ]] && exit 12 | 13 | SSID=$(iwgetid $INTERFACE -r) 14 | 15 | echo $SSID 16 | echo $SSID 17 | echo "#000000" 18 | 19 | case $1 in 20 | -4) 21 | AF=inet ;; 22 | -6) 23 | AF=inet6 ;; 24 | *) 25 | AF=inet6? ;; 26 | esac 27 | 28 | # if no interface is found, use the first device with a global scope 29 | IPADDR=$(ip addr show $IF | perl -n -e "/$AF ([^\/]+).* scope global/ && print \$1 and exit") 30 | 31 | case $BLOCK_BUTTON in 32 | 1) xdotool key Super_L+slash ;; # chrome launcher shortcut 33 | 3) termite --name "WiFi-Menu" -e "sh -c 'echo 'WiFi-menu:' && sudo wifi-menu -o'" ;; #wifi connect 34 | 2) echo -n "$IPADDR" | xclip -q -se c | notify-send 'IP-adres' 'naar klembord gekopieerd' ;; #copy ip to clipboard 35 | esac 36 | 37 | #------------------------------------------------------------------------ 38 | 39 | echo "$IPADDR" # full text 40 | echo "$IPADDR" # short text 41 | -------------------------------------------------------------------------------- /icons/briefcase-2.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /astronvim/lua/lazy_setup.lua: -------------------------------------------------------------------------------- 1 | require("lazy").setup({ 2 | { 3 | "AstroNvim/AstroNvim", 4 | version = "^5", -- Remove version tracking to elect for nightly AstroNvim 5 | import = "astronvim.plugins", 6 | opts = { -- AstroNvim options must be set here with the `import` key 7 | mapleader = " ", -- This ensures the leader key must be configured before Lazy is set up 8 | maplocalleader = ",", -- This ensures the localleader key must be configured before Lazy is set up 9 | icons_enabled = true, -- Set to false to disable icons (if no Nerd Font is available) 10 | pin_plugins = nil, -- Default will pin plugins when tracking `version` of AstroNvim, set to true/false to override 11 | update_notifications = true, -- Enable/disable notification about running `:Lazy update` twice to update pinned plugins 12 | }, 13 | }, 14 | { import = "community" }, 15 | { import = "plugins" }, 16 | } --[[@as LazySpec]], { 17 | -- Configure any other `lazy.nvim` configuration options here 18 | install = { colorscheme = { "astrotheme", "habamax" } }, 19 | ui = { backdrop = 100 }, 20 | performance = { 21 | rtp = { 22 | -- disable some rtp plugins, add more to your liking 23 | disabled_plugins = { 24 | "gzip", 25 | "netrwPlugin", 26 | "tarPlugin", 27 | "tohtml", 28 | "zipPlugin", 29 | }, 30 | }, 31 | }, 32 | } --[[@as LazyConfig]]) 33 | -------------------------------------------------------------------------------- /icons/check.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /install.work.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # This scripts installs all conf files 3 | # by creating appropriate symbolic links 4 | 5 | # aria2 6 | mkdir -p "$HOME/.aria2" 7 | ln -sf $PWD/aria2/* $HOME/.aria2/ 8 | 9 | # bin 10 | rm -rf "$HOME/.bin" 11 | ln -sf "$PWD/bin" "$HOME/.bin" 12 | 13 | # git 14 | ln -sf "$PWD/git/config" "$HOME/.gitconfig" 15 | ln -sf "$PWD/git/ignore" "$HOME/.gitignore" 16 | git config --global core.excludesfile '~/.gitignore' 17 | 18 | # tmux 19 | ln -sf "$PWD/tmux/tmux.conf" "$HOME/.tmux.conf" 20 | rm -rf "$HOME/.tmux" 21 | ln -sf "$PWD/tmux" "$HOME/.tmux" 22 | mkdir -p $HOME/.tmux/plugins 23 | ln -sf $PWD/tpm $HOME/.tmux/plugins/tpm 24 | 25 | # emacs 26 | rm -rf "$HOME/.emacs.d" 27 | rm -rf "$HOME/.doom.d" 28 | ln -sf "$PWD/doom" "$HOME/.doom.d" 29 | 30 | # zsh 31 | ln -sf "$PWD/zsh/zshrc" "$HOME/.zshrc" 32 | 33 | # Vim 34 | rm -rf "$HOME/.vimrc" 35 | rm -rf "$HOME/.config/nvim" 36 | ln -sf "$PWD/astronvim" "$HOME/.config/nvim" 37 | 38 | # ideavim 39 | ln -sf $PWD/ideavim/ideavimrc $HOME/.ideavimrc 40 | 41 | # alacritty 42 | rm -rf $HOME/.config/alacritty 43 | ln -sf $PWD/alacritty $HOME/.config/alacritty 44 | 45 | # Karabiner 46 | rm -rf $HOME/.config/karabiner 47 | ln -sf $PWD/karabiner $HOME/.config/karabiner 48 | 49 | # Code 50 | ln -sf $PWD/vscode/keybindings.json "$HOME/Library/Application Support/Code/User/keybindings.json" 51 | ln -sf $PWD/vscode/settings.json "$HOME/Library/Application Support/Code/User/settings.json" 52 | -------------------------------------------------------------------------------- /astronvim/lua/plugins/astroui.lua: -------------------------------------------------------------------------------- 1 | if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE 2 | 3 | -- AstroUI provides the basis for configuring the AstroNvim User Interface 4 | -- Configuration documentation can be found with `:h astroui` 5 | -- NOTE: We highly recommend setting up the Lua Language Server (`:LspInstall lua_ls`) 6 | -- as this provides autocomplete and documentation while editing 7 | 8 | ---@type LazySpec 9 | return { 10 | "AstroNvim/astroui", 11 | ---@type AstroUIOpts 12 | opts = { 13 | -- change colorscheme 14 | colorscheme = "catppuccin", 15 | -- AstroUI allows you to easily modify highlight groups easily for any and all colorschemes 16 | highlights = { 17 | init = { -- this table overrides highlights in all themes 18 | -- Normal = { bg = "#000000" }, 19 | }, 20 | astrodark = { -- a table of overrides/changes when applying the astrotheme theme 21 | -- Normal = { bg = "#000000" }, 22 | }, 23 | }, 24 | -- Icons can be configured throughout the interface 25 | icons = { 26 | -- configure the loading of the lsp in the status line 27 | LSPLoading1 = "⠋", 28 | LSPLoading2 = "⠙", 29 | LSPLoading3 = "⠹", 30 | LSPLoading4 = "⠸", 31 | LSPLoading5 = "⠼", 32 | LSPLoading6 = "⠴", 33 | LSPLoading7 = "⠦", 34 | LSPLoading8 = "⠧", 35 | LSPLoading9 = "⠇", 36 | LSPLoading10 = "⠏", 37 | }, 38 | }, 39 | } 40 | -------------------------------------------------------------------------------- /doom/custom.el: -------------------------------------------------------------------------------- 1 | (custom-set-variables 2 | ;; custom-set-variables was added by Custom. 3 | ;; If you edit it by hand, you could mess it up, so be careful. 4 | ;; Your init file should contain only one such instance. 5 | ;; If there is more than one, they won't work right. 6 | '(custom-safe-themes 7 | '("afa47084cb0beb684281f480aa84dab7c9170b084423c7f87ba755b15f6776ef" "02f57ef0a20b7f61adce51445b68b2a7e832648ce2e7efb19d217b6454c1b644" default)) 8 | '(emojify-display-style 'unicode) 9 | '(org-capture-templates 10 | '(("t" "todo" entry 11 | (file "~/Notes/projects/misc.org") 12 | "* TODO %?\12%a\12" :clock-keep t) 13 | ("e" "event" entry 14 | (file+headline "~/Notes/events.org" "Inbox") 15 | "* %?\12" :clock-keep t) 16 | ("s" "schedule" entry 17 | (file+headline "~/Notes/events.org" "Inbox") 18 | "* %?\12SCHEDULED: %t" :clock-keep t))) 19 | '(org-safe-remote-resources 20 | '("\\`https://fniessen\\.github\\.io/org-html-themes/org/theme-readtheorg\\.setup\\'")) 21 | '(safe-local-variable-values 22 | '((org-use-property-inheritance . reveal_) 23 | (org-re-reveal-title-slide) 24 | (org-archive-location . "~/Notes/archive/work.org.gpg::")))) 25 | (custom-set-faces 26 | ;; custom-set-faces was added by Custom. 27 | ;; If you edit it by hand, you could mess it up, so be careful. 28 | ;; Your init file should contain only one such instance. 29 | ;; If there is more than one, they won't work right. 30 | ) 31 | -------------------------------------------------------------------------------- /bin/flight.1500s.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | import requests 3 | from datetime import datetime 4 | 5 | # Config: 6 | source = "IFN" 7 | destination = "AWZ" 8 | start_str = "2018/01/24" 9 | end_str = "2018/02/12" 10 | sthreshold = 140 # hezar toman, color (soft) threshold 11 | hthreshold = 180 # toggle (hard) threshold 12 | 13 | # Request: 14 | r = requests.post( 15 | url='https://sepehr360.com/fa/Api/CalendarApi/SetFlightMonthHistory', 16 | data={ 17 | "source": source, 18 | "destination": destination, 19 | "currencyType": "IRR" 20 | }) 21 | 22 | result = r.json() 23 | start = datetime.strptime(start_str, "%Y/%m/%d") 24 | end = datetime.strptime(end_str, "%Y/%m/%d") 25 | filtered_result = [ 26 | i for i in result['Arrival'] 27 | if (datetime.strptime(i['FlightDate'][:10], "%Y-%m-%d") >= start 28 | and datetime.strptime(i['FlightDate'][:10], "%Y-%m-%d") <= end) 29 | ] 30 | 31 | event = min(filtered_result, key=lambda ev: int(ev['Price'])) 32 | 33 | if float(event['Price']) <= hthreshold: 34 | print( 35 | "✈ {source}->{dest}: {date}, {price:,.0f}". 36 | format( 37 | source=source[:3], 38 | dest=destination[:3], 39 | date=event["Date"], 40 | price=float(event["Price"]), 41 | color='green' 42 | if float(event["Price"]) <= sthreshold else 'darkgrey')) 43 | else: 44 | print(" ") 45 | -------------------------------------------------------------------------------- /nvim/coc-settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "suggest.noselect": true, 3 | "python.formatting.provider": "autopep8", 4 | "tsserver.enable": true, 5 | "snippets.extends": { 6 | "javascript.jsx": ["javascript"], 7 | "javascriptreact": ["javascript"] 8 | }, 9 | "coc.preferences.formatOnSave": true, 10 | "eslint.autoFixOnSave": false, 11 | "eslint.nodePath": "./node_modules", 12 | "diagnostic.errorSign": "•", 13 | "diagnostic.warningSign": "•", 14 | "diagnostic.infoSign": "•", 15 | "languageserver": { 16 | "haskell": { 17 | "command": "haskell-language-server-wrapper", 18 | "args": ["--lsp"], 19 | "rootPatterns": [ 20 | "*.cabal", 21 | "stack.yaml", 22 | "cabal.project", 23 | "package.yaml", 24 | "hie.yaml" 25 | ], 26 | "filetypes": ["haskell", "lhaskell"] 27 | }, 28 | "lua": { 29 | "command": "java", 30 | "args": [ 31 | "-cp", 32 | "/home/samim/Downloads/EmmyLua-LS-all.jar", 33 | "com.tang.vscode.MainKt" 34 | ], 35 | "filetypes": ["lua"], 36 | "rootPatterns": [".git/"] 37 | } 38 | }, 39 | "cSpell.userWords": [ 40 | "Instalments", 41 | "Licences", 42 | "Subroute", 43 | "Subroutes", 44 | "Swiper", 45 | "Twilio", 46 | "camelcase", 47 | "cloudinary", 48 | "rudderanalytics" 49 | ], 50 | "coc.preferences.extensionUpdateCheck": "daily", 51 | "snippets.ultisnips.pythonPrompt": false 52 | } 53 | -------------------------------------------------------------------------------- /X/Xresources: -------------------------------------------------------------------------------- 1 | URxvt*.depth: 32 2 | ! URxvt*.background: [90]#232323 3 | ! urxvt*foreground: #DDDDDD 4 | URxvt.perl-ext-common: default,matcher 5 | URxvt.url-launcher: /usr/bin/firefox -new-tab 6 | URxvt.matcher.button: 1 7 | URxvt*.scrollBar: false 8 | URxvt*.font: xft:source code pro:size=13 9 | URxvt*.letterSpace: -2 10 | 11 | URxvt*.background: [80]#002b36 12 | URxvt*.foreground: #657b83 13 | 14 | !!*fading: 40 15 | URxvt*.fadeColor: #002b36 16 | URxvt*.cursorColor: #93a1a1 17 | URxvt*.pointerColorBackground: #586e75 18 | URxvt*.pointerColorForeground: #93a1a1 19 | 20 | !! black dark/light 21 | URxvt*.color0: #073642 22 | URxvt*.color8: #002b36 23 | 24 | !! red dark/light 25 | URxvt*.color1: #dc322f 26 | URxvt*.color9: #cb4b16 27 | 28 | !! green dark/light 29 | URxvt*.color2: #859900 30 | URxvt*.color10: #586e75 31 | 32 | !! yellow dark/light 33 | URxvt*.color3: #b58900 34 | URxvt*.color11: #657b83 35 | 36 | !! blue dark/light 37 | URxvt*.color4: #268bd2 38 | URxvt*.color12: #839496 39 | 40 | !! magenta dark/light 41 | URxvt*.color5: #d33682 42 | URxvt*.color13: #6c71c4 43 | 44 | !! cyan dark/light 45 | URxvt*.color6: #2aa198 46 | URxvt*.color14: #93a1a1 47 | 48 | !! white dark/light 49 | URxvt*.color7: #eee8d5 50 | URxvt*.color15: #fdf6e3 51 | 52 | /* Xft.dpi: 162 */ 53 | Xft.dpi: 96 54 | /* Xft.dpi: 91.79 */ 55 | Xft.autohint: 0 56 | Xft.antialias: 1 57 | Xft.hinting: 1 58 | Xft.rgba: rgb 59 | Xft.hintstyle: hintslight 60 | Xft.lcdfilter: lcddefault 61 | -------------------------------------------------------------------------------- /bin/trayer-padding-icon.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Detects the width of running trayer-srg window (xprop name 'panel') 3 | # and creates an XPM icon of that width, 1px height, and transparent. 4 | # Outputs an -tag for use in xmobar to display the generated 5 | # XPM icon. 6 | # 7 | # Run script from xmobar: 8 | # `Run Com "/where/ever/trayer-padding-icon.sh" [] "trayerpad" 10` 9 | # and use `%trayerpad%` in your template. 10 | 11 | 12 | # Function to create a transparent Wx1 px XPM icon 13 | create_xpm_icon () { 14 | timestamp=$(date) 15 | pixels=$(for i in `seq $1`; do echo -n "."; done) 16 | 17 | cat << EOF > "$2" 18 | /* XPM * 19 | static char * trayer_pad_xpm[] = { 20 | /* This XPM icon is used for padding in xmobar to */ 21 | /* leave room for trayer-srg. It is dynamically */ 22 | /* updated by by trayer-pad-icon.sh which is run */ 23 | /* by xmobar. */ 24 | /* Created: ${timestamp} */ 25 | /* */ 26 | "$1 1 1 1", 27 | /* Colors (none: transparent) */ 28 | ". c none", 29 | /* Pixels */ 30 | "$pixels" 31 | }; 32 | EOF 33 | } 34 | 35 | # Width of the trayer window 36 | width=$(xprop -name panel | grep 'program specified minimum size' | cut -d ' ' -f 5) 37 | 38 | # Icon file name 39 | iconfile="/tmp/trayer-padding-${width}px.xpm" 40 | 41 | # If the desired icon does not exist create it 42 | if [ ! -f $iconfile ] 43 | then 44 | create_xpm_icon $width $iconfile 45 | fi 46 | 47 | # Output the icon tag for xmobar 48 | echo "" 49 | -------------------------------------------------------------------------------- /spacemacs/private/psamim-org-reftex/packages.el: -------------------------------------------------------------------------------- 1 | ;;; packages.el --- psamim-org-reftex layer packages file for Spacemacs. 2 | ;; 3 | ;; Copyright (c) 2012-2016 Sylvain Benner & Contributors 4 | ;; 5 | ;; Author: Samim Pezeshki 6 | ;; URL: https://github.com/syl20bnr/spacemacs 7 | ;; 8 | ;; This file is not part of GNU Emacs. 9 | ;; 10 | ;;; License: GPLv3 11 | 12 | (defconst psamim-org-reftex-packages 13 | '((reftex :location built-in))) 14 | 15 | (defun psamim-org-reftex/init-reftex () 16 | (add-hook 'org-mode-hook 'turn-on-reftex) 17 | (spacemacs|diminish reftex-mode " ⓡ" " r") 18 | (spacemacs/declare-prefix-for-mode 'org-mode "mr" "reftex") 19 | (setq reftex-cite-format 20 | '((?\C-m . "\\cite[]{%l}") 21 | (?f . "\\footcite[][]{%l}") 22 | (?t . "\\textcite[]{%l}") 23 | (?p . "\\parencite[]{%l}") 24 | (?o . "\\citepr[]{%l}") 25 | (?n . "\\nocite{%l}"))) 26 | (spacemacs/set-leader-keys-for-major-mode 'org-mode 27 | "rc" 'reftex-citation 28 | "ic" 'reftex-citation 29 | "rg" 'reftex-grep-document 30 | "ri" 'reftex-index-selection-or-word 31 | "rI" 'reftex-display-index 32 | "r TAB" 'reftex-index 33 | "rl" 'reftex-label 34 | "rp" 'reftex-index-phrase-selection-or-word 35 | "rP" 'reftex-index-visit-phrases-buffer 36 | "rr" 'reftex-reference 37 | "rs" 'reftex-search-document 38 | "rt" 'reftex-toc 39 | "rT" 'reftex-toc-recenter 40 | "rv" 'reftex-view-crossref)) 41 | -------------------------------------------------------------------------------- /i3/i3blocks.conf: -------------------------------------------------------------------------------- 1 | separator_block_width=15 2 | color=#000000 3 | align=center 4 | markup=pango 5 | # separator=false 6 | command=~/.bin/$BLOCK_NAME 7 | 8 | [online-status] 9 | command=ping -c 3 google.com >> /dev/null||echo 'Internet!' 10 | color=#D32F2F 11 | interval=10 12 | label= 13 | 14 | [reboot-p] 15 | interval=600 16 | 17 | # [mediaplayer] 18 | # signal=10 19 | # label= 20 | # interval=5 21 | # color=#ABB59F 22 | 23 | [clocking] 24 | color=#85290d 25 | interval=1 26 | label= 27 | 28 | [volume] 29 | command=/usr/lib/i3blocks/volume 5% pulse 30 | signal=10 31 | label= 32 | 33 | [temp] 34 | command=/usr/lib/i3blocks/temperature 35 | interval=10 36 | label= 37 | 38 | [disk-home] 39 | command=/usr/lib/i3blocks/disk 40 | interval=30 41 | label= 42 | 43 | [wireless] 44 | command=/usr/lib/i3blocks/iface 45 | instance=wlp3s0 46 | interval=10 47 | label= 48 | 49 | [memory] 50 | command=/usr/lib/i3blocks/memory 51 | separator_block_width=13 52 | interval=30 53 | label= 54 | 55 | [cpu] 56 | command=/usr/lib/i3blocks/cpu_usage 57 | interval=10 58 | label= 59 | 60 | [battery] 61 | interval=30 62 | # label= 63 | 64 | [bandwidth] 65 | command=/home/samim/.bin/bandwidth 66 | instance=wlp3s0 67 | interval=5 68 | 69 | [wifi_ssid] 70 | label= 71 | instance=wlp3s0 72 | interval=10 73 | 74 | [date] 75 | command=jdate '+%W' 76 | interval=60 77 | 78 | [time] 79 | command=jdate '+%X' 80 | interval=1 81 | label= 82 | 83 | [arbtt-running] 84 | interval=60 85 | separator=false 86 | separator_block_width=3 87 | 88 | [xautolock-running-p] 89 | interval=60 90 | -------------------------------------------------------------------------------- /icons/home.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /surfingkeys/settings.js: -------------------------------------------------------------------------------- 1 | // an example to create a new mapping `ctrl-y` 2 | 3 | const { mapkey, map, unmap } = api; 4 | 5 | mapkey("", "Show me the money", function () { 6 | Front.showPopup( 7 | "a well-known phrase uttered by characters in the 1996 film Jerry Maguire (Escape to close)." 8 | ); 9 | }); 10 | 11 | // an example to replace `T` with `gt`, click `Default mappings` to see how `T` works. 12 | map("", "u"); 13 | map("", "d"); 14 | unmap("d"); 15 | map("d", "x"); 16 | map("", "R"); 17 | map("", "E"); 18 | map("L", "D"); 19 | map("H", "S"); 20 | settings.tabsThreshold = 0; 21 | map("u", "X"); 22 | 23 | // removeSearchAliasX("w"); 24 | // addSearchAliasX( 25 | // "w", 26 | // "Wikipedia", 27 | // "https://en.wikipedia.org/w/index.php?search=", 28 | // "s", 29 | // "https://en.wikipedia.org/w/api.php?action=opensearch&format=json&search=", 30 | // function (response) { 31 | // var res = JSON.parse(response.text); 32 | // Omnibar.listWords(res[1]); 33 | // } 34 | // ); 35 | // removeSearchAliasX("b"); 36 | 37 | if (window.location.origin === "https://mail.google.com") { 38 | unmap("j"); 39 | unmap("k"); 40 | unmap("x"); 41 | unmap("c"); 42 | unmap("r"); 43 | unmap("m"); 44 | } 45 | settings.modeAfterYank = "Normal"; 46 | settings.showModeStatus = true; 47 | settings.hintShiftNonActive = true; 48 | 49 | settings.theme = 50 | "\ 51 | #sk_omnibar {\ 52 | width: 100%;\ 53 | top: 0px;\ 54 | left: 0;\ 55 | }\ 56 | "; 57 | 58 | if (window.location.origin === "https://meet.google.com") { 59 | unmap(""); 60 | } 61 | -------------------------------------------------------------------------------- /bin/hiweb.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import subprocess 4 | import time 5 | import jdatetime 6 | from datetime import date 7 | 8 | 9 | TMP_FILE = '/tmp/hiweb' 10 | COOKIE_FILE = '/tmp/hiwebcoockie' 11 | 12 | 13 | def run(command): 14 | output = subprocess.check_output(command, shell=True) 15 | return output.decode('UTF-8').strip() 16 | 17 | 18 | run("wget -qO {} http://p.hiweb.ir --save-cookies={} --keep-session-cookies".format(TMP_FILE, COOKIE_FILE)) 19 | remain = run("cat {} | grep -Poh '' | grep 'مگابایت' | grep -o '[0-9.]*' | head -n1".format(TMP_FILE)) 20 | remain = round(float(remain) / 4000, 2) 21 | service_days = run("cat {} | grep -Poh '' | grep 'روزهای باقیمانده'| grep -o '[0-9]*'".format(TMP_FILE)) 22 | service_days = int(service_days) 23 | run("wget -qO {} http://panel.hiweb.ir/xhr/usl.php\?user\=551402\&action\=load_usl --load-cookies={}".format(TMP_FILE, COOKIE_FILE)) 24 | credit = run("cat {} | grep -Poh '' | sed '7q;d' | grep -oh '[0-9]*\/[0-9]*\/[0-9]*'".format(TMP_FILE)) 25 | d = time.strptime('13' + credit, '%Y/%m/%d') 26 | credit_end_date = jdatetime.date(d.tm_year, d.tm_mon, d.tm_mday).togregorian() 27 | delta = credit_end_date - date.today() 28 | credit_days = delta.days 29 | days = min(credit_days, service_days) 30 | 31 | if days >= 0 and days < 3: 32 | print("🌐 {} GB in {} days".format(remain, days)) 33 | else: 34 | print("🌐 {} GB".format(remain)) 35 | 36 | print("---") 37 | print("In {} days (service)".format(service_days)) 38 | 39 | if credit_days >= 0: 40 | print("In {} days (credit)".format(credit_days)) 41 | 42 | -------------------------------------------------------------------------------- /X/xinitrc: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # ~/.xinitrc 4 | # 5 | # Executed by startx (run your window manager from here) 6 | 7 | if [ -d /etc/X11/xinit/xinitrc.d ]; then 8 | for f in /etc/X11/xinit/xinitrc.d/*; do 9 | [ -x "$f" ] && . "$f" 10 | done 11 | unset f 12 | fi 13 | 14 | # Make sure this is before the 'exec' command or it won't be sourced. 15 | [ -f /etc/xprofile ] && source /etc/xprofile 16 | [ -f ~/.xprofile ] && source ~/.xprofile 17 | 18 | # export DE=xfce 19 | export PATH="${PATH}:/home/samim/.bin" 20 | 21 | autorandr -c 22 | 23 | /home/samim/.bin/keyboard-configure 24 | perWindowLayoutD 25 | 26 | # Disable touchpad taps while typing 27 | syndaemon -t -k -i 1 & 28 | 29 | # Set background 30 | [ -e ~/.fehbg ] && source ~/.fehbg 31 | 32 | # Hide mouse when not used 33 | unclutter & 34 | 35 | # dunst & 36 | # i3-notifier 37 | 38 | # Picom window compositor 39 | # /usr/bin/picom & 40 | 41 | # screen powersave 42 | xset +dpms 43 | xset dpms 0 0 300 44 | 45 | # Automount disks 46 | thunar --daemon & 47 | 48 | greenclip daemon & 49 | 50 | xrdb -merge ~/.Xresources 51 | 52 | # trayer --edge top --align right --SetDockType true --SetPartialStrut true \ 53 | # --expand true --width 5 --transparent true --alpha 70 --tint 0x000000 --height 20 \ 54 | # --monitor 0 & 55 | # launch_polybar 56 | 57 | nm-applet & 58 | # blueman-applet & 59 | # redshift-gtk & 60 | xfce-power-manager & 61 | # kdeconnect-indicator & 62 | eval $(/usr/bin/gnome-keyring-daemon --start --components=pkcs11,secrets) 63 | # pasystray & 64 | # volctl & 65 | synclient TapButton1=1 66 | 67 | # exec xmonad 68 | # exec startxfce4 69 | exec awesome 70 | -------------------------------------------------------------------------------- /icons/class.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /vscode/keybindings.json: -------------------------------------------------------------------------------- 1 | // Place your key bindings in this file to override the defaultsauto[] 2 | [ 3 | { 4 | "key": "ctrl+j", 5 | "command": "workbench.action.terminal.focus", 6 | "when": "!terminalFocus" 7 | }, 8 | { 9 | "key": "cmd+k", 10 | "command": "workbench.action.focusActiveEditorGroup", 11 | "when": "terminalFocus" 12 | }, 13 | { 14 | "key": "alt+l", 15 | "command": "workbench.action.nextEditor" 16 | }, 17 | { 18 | "key": "alt+h", 19 | "command": "workbench.action.previousEditor" 20 | }, 21 | { 22 | "key": "alt+q", 23 | "command": "workbench.action.closeActiveEditor" 24 | }, 25 | { 26 | "key": "cmd+d", 27 | "command": "cursorPageDown" 28 | }, 29 | { 30 | "key": "ctrl+j", 31 | "command": "workbench.action.togglePanel" 32 | }, 33 | { 34 | "key": "cmd+j", 35 | "command": "-workbench.action.togglePanel" 36 | }, 37 | { 38 | "key": "ctrl+r", 39 | "command": "-workbench.action.quickOpenNavigateNextInRecentFilesPicker", 40 | "when": "inQuickOpen && inRecentFilesPicker" 41 | }, 42 | { 43 | "key": "ctrl+r", 44 | "command": "-workbench.action.openRecent" 45 | }, 46 | { 47 | "key": "cmd+f2", 48 | "command": "editor.action.rename", 49 | "when": "editorHasRenameProvider && editorTextFocus && !editorReadonly" 50 | }, 51 | { 52 | "key": "f2", 53 | "command": "-editor.action.rename", 54 | "when": "editorHasRenameProvider && editorTextFocus && !editorReadonly" 55 | }, 56 | { 57 | "key": "alt+cmd+=", 58 | "command": "editor.action.fontZoomIn" 59 | }, 60 | { 61 | "key": "alt+cmd+-", 62 | "command": "editor.action.fontZoomOut" 63 | } 64 | ] 65 | -------------------------------------------------------------------------------- /rofi-pass/config: -------------------------------------------------------------------------------- 1 | # permanently set alternative root dir 2 | # root=/path/to/root 3 | 4 | # rofi command. Make sure to have "$@" as last argument 5 | _rofi () { 6 | rofi -i -no-auto-select -kb-mode-previous "" -kb-mode-next "" -width 700 -no-levenshtein-sort -normal-window -steal-focus "$@" 7 | } 8 | 9 | # keyboard layout (set this to your actual layout. E.g. keyboard="de us" 10 | #keyboard=us 11 | 12 | # fields to be used 13 | URL_field='url' 14 | USERNAME_field='user' 15 | AUTOTYPE_field='autotype' 16 | 17 | # delay to be used for :delay keyword 18 | delay=2 19 | 20 | ## Programs to be used 21 | # Editor 22 | EDITOR='/home/samim/.bin/emc' 23 | 24 | # Browser 25 | BROWSER='firefox-developer-edition' 26 | 27 | ## Misc settings 28 | 29 | default_do='menu' # menu, autotype, copyPass, typeUser, typePass, copyUser, copyUrl, viewEntry, typeMenu, actionMenu, copyMenu, openUrl 30 | auto_enter='false' 31 | notify='false' 32 | 33 | # color of the help messages 34 | # leave empty for autodetection 35 | help_color="#4872FF" 36 | 37 | # Clipboard settings 38 | # Possible options: primary, clipboard, both 39 | clip=primary 40 | 41 | # Options for generating new password entries 42 | default_user=psamim 43 | default_user2=samim.pezeshki 44 | password_length=12 45 | 46 | # Custom Keybindings 47 | # autotype="Alt+1" 48 | # type_user="Alt+2" 49 | # type_pass="Alt+3" 50 | # open_url="Alt+4" 51 | # copy_name="Alt+u" 52 | # copy_url="Alt+l" 53 | # copy_pass="Alt+p" 54 | show="Alt+s" 55 | # copy_entry="Alt+c" 56 | # type_entry="Alt+1" 57 | copy_menu="Alt+c" 58 | action_menu="Alt+a" 59 | # type_menu="Alt+t" 60 | help="Alt+h" 61 | # switch="Alt+x" 62 | # insert_pass="Alt+i" 63 | 64 | backend=wtype 65 | clibpoard_backend=wl-clipboard 66 | -------------------------------------------------------------------------------- /yaourt/yaourtrc: -------------------------------------------------------------------------------- 1 | # yaourtrc - Configuration for yaourt 2 | # 3 | # See yaourtrc(5) for more information 4 | # 5 | # 6 | 7 | # General 8 | #AUTOSAVEBACKUPFILE=0 9 | #DEVEL=0 10 | DEVELSRCDIR="/var/abs/local/devel/" 11 | #FORCE=0 12 | #NO_TESTDB=0 13 | 14 | # Environment variables 15 | #EDITOR="$EDITOR" 16 | TMPDIR="/tmp" 17 | #VISUAL="$VISUAL" 18 | 19 | # SUDO 20 | #SUDONOVERIF=0 # Avoid multiple sudo checks when timestamp_timeout=0 21 | #SUDOREDIRECT=1 # Define to 0 in case you use a fingerprint device 22 | 23 | # ABS 24 | #USE_GIT=0 25 | # If the package "abs" is installed, those var are parsed from abs.conf 26 | #REPOS=() # REPOS available at $SYNCSERVER 27 | #SYNCSERVER="" 28 | 29 | # AUR 30 | #AURURL="https://aur.archlinux.org" 31 | #AURCOMMENT=5 32 | #AURDEVELONLY=0 33 | #AURSEARCH=1 34 | #AURSHOWDIFF=0 35 | #AURUPGRADE=0 36 | #AURVOTE=1 37 | #AURUSEGIT=0 38 | 39 | # Build 40 | EXPORT=2 # Export to 1: EXPORTDIR or PKGDEST 41 | # 2: pacman cache (as root) 42 | #EXPORTSRC=0 # Need EXPORT>0 to be used 43 | #EXPORTDIR="" # If empty, use makepkg's configuration (see makepkg.conf) 44 | 45 | # Prompt 46 | #NOCONFIRM=0 47 | #UP_NOCONFIRM=0 # No prompt while build upgrades (including -Sbu) 48 | #BUILD_NOCONFIRM=0 # Only prompt for editing files 49 | #PU_NOCONFIRM=0 # Add --noconfirm to $PACMAN -U 50 | #EDITFILES=1 51 | #NOENTER=1 52 | 53 | # Output 54 | USECOLOR=1 55 | #USEPAGER=0 56 | #DETAILUPGRADE=1 57 | #SHOWORPHANS=1 58 | #TERMINALTITLE=1 59 | 60 | # Command 61 | #PACMAN="pacman" 62 | #MAKEPKG="makepkg" 63 | #DIFFEDITCMD="vimdiff" 64 | 65 | # pacdiffviewer 66 | #P_LOCATE=0 # Use locate instead of find 67 | #P_SEARCHDIR=(/etc/ /boot/) 68 | #P_SAVEDIR='/var/lib/yaourt/backupfiles' 69 | -------------------------------------------------------------------------------- /spacemacs/private/psamim-org-reftex/README.org: -------------------------------------------------------------------------------- 1 | #+TITLE: psamim-org-reftex layer 2 | #+HTML_HEAD_EXTRA: 3 | 4 | #+CAPTION: logo 5 | 6 | # The maximum height of the logo should be 200 pixels. 7 | [[img/psamim-org-reftex.png]] 8 | 9 | * Table of Contents :TOC_4_org:noexport: 10 | - [[Description][Description]] 11 | - [[Install][Install]] 12 | - [[Key bindings][Key bindings]] 13 | 14 | * Description 15 | This layer integrates reftex into org-mode in Spacemacs. 16 | 17 | * Install 18 | To use this contribution add it to your =~/.spacemacs= 19 | 20 | #+begin_src emacs-lisp 21 | (setq-default dotspacemacs-configuration-layers '(psamim-org-reftex)) 22 | #+end_src 23 | 24 | * Key bindings 25 | | Key Binding | Description | 26 | |---------------+---------------------------------------| 27 | | ~SPC m r c~ | reftex-citation | 28 | | ~SPC m i c~ | reftex-citation | 29 | | ~SPC m r g~ | reftex-grep-document | 30 | | ~SPC m r i~ | reftex-index-selection-or-word | 31 | | ~SPC m r I~ | reftex-display-index | 32 | | ~SPC m r TAB~ | reftex-index | 33 | | ~SPC m r l~ | reftex-label | 34 | | ~SPC m r p~ | reftex-index-phrase-selection-or-word | 35 | | ~SPC m r P~ | reftex-index-visit-phrases-buffer | 36 | | ~SPC m r r~ | reftex-reference | 37 | | ~SPC m r s~ | reftex-search-document | 38 | | ~SPC m r t~ | reftex-toc | 39 | | ~SPC m r T~ | reftex-toc-recenter | 40 | | ~SPC m r v~ | reftex-view-crossref | 41 | -------------------------------------------------------------------------------- /icons/search.svg: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 15 | 16 | 19 | 20 | 21 | 22 | 23 | 24 | 26 | 27 | 28 | 29 | 30 | 31 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /phpcs/standards/datis.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Datis Coding Standards 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /icons/briefcase.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /icons/music.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 8 | 14 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /kmonad/config.kbd: -------------------------------------------------------------------------------- 1 | (defcfg 2 | input (device-file "/dev/input/by-path/platform-i8042-serio-0-event-kbd") 3 | output (uinput-sink 4 | "KMonad: Keyboard" 5 | "/usr/bin/sleep 1 && /usr/bin/setxkbmap -option compose:ralt -option caps:none -layout us,ir") 6 | allow-cmd true 7 | fallthrough true 8 | ) 9 | 10 | 11 | (defalias 12 | caps (tap-next esc lctl) 13 | ) 14 | 15 | 16 | (defsrc 17 | esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 sys ins prnt del 18 | ` 1 2 3 4 5 6 7 8 9 0 - = bspc 19 | tab q w e r t y u i o p [ ] \ 20 | caps a s d f g h j k l ; ' ret 21 | lsft z x c v b n m , . / rsft 22 | lctl lmet lalt spc ralt rctrl left up down rght 23 | 24 | home pgup pgdn end 25 | ) 26 | 27 | (deflayer default 28 | esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 prnt prnt prnt del 29 | ` 1 2 3 4 5 6 7 8 9 0 - = bspc 30 | tab q w e r t y u i o p [ ] \ 31 | @caps a s d f g h j k l ; ' ret 32 | lsft z x c v b n m , . / rsft 33 | lctl lmet lalt spc ralt rctrl left up down rght 34 | 35 | home pgup pgdn end 36 | ) 37 | 38 | 39 | ;; vim: ft=lisp 40 | -------------------------------------------------------------------------------- /dunst/dunstrc: -------------------------------------------------------------------------------- 1 | [global] 2 | monitor = 0 3 | follow = mouse 4 | geometry = "320x5-15+45" 5 | indicate_hidden = yes 6 | shrink = no 7 | transparency = 0 8 | notification_height = 0 9 | separator_height = 2 10 | padding = 10 11 | horizontal_padding = 10 12 | frame_width = 1 13 | frame_color = "#232323" 14 | separator_color = frame 15 | sort = yes 16 | idle_threshold = 120 17 | font = Iosevka Etoile 12 18 | line_height = 0 19 | markup = full 20 | format = "%s %p\n%b" 21 | alignment = left 22 | vertical_alignment = center 23 | show_age_threshold = 60 24 | word_wrap = yes 25 | ellipsize = middle 26 | ignore_newline = no 27 | stack_duplicates = true 28 | hide_duplicate_count = false 29 | show_indicators = yes 30 | icon_position = left 31 | max_icon_size = 32 32 | icon_path = /usr/share/icons/Paper/16x16/status/:/usr/share/icons/Paper/16x16/devices/:/usr/share/icons/Paper/16x16/apps/ 33 | sticky_history = yes 34 | history_length = 20 35 | always_run_script = true 36 | startup_notification = false 37 | verbosity = mesg 38 | corner_radius = 0 39 | ignore_dbusclose = false 40 | force_xinerama = false 41 | mouse_left_click = close_current 42 | mouse_middle_click = do_action, close_current 43 | mouse_right_click = close_all 44 | 45 | [shortcuts] 46 | close = ctrl+space 47 | close_all = ctrl+shift+space 48 | history = ctrl+grave 49 | context = ctrl+shift+period 50 | 51 | [urgency_low] 52 | background = "#232323" 53 | foreground = "#a8a8a8" 54 | timeout = 10 55 | 56 | [urgency_normal] 57 | background = "#232323" 58 | foreground = "#a8a8a8" 59 | timeout = 10 60 | 61 | [urgency_critical] 62 | background = "#d64e4e" 63 | foreground = "#f0e0e0" 64 | frame_color = "#d64e4e" 65 | timeout = 0 66 | icon = /usr/share/icons/Paper/16x16/status/dialog-warning.png 67 | -------------------------------------------------------------------------------- /spacemacs/private/psamim-js/packages.el: -------------------------------------------------------------------------------- 1 | (defconst psamim-js-packages 2 | '( 3 | (eslintd-fix :location (recipe :fetcher github :repo "aaronjensen/eslintd-fix")) 4 | flycheck 5 | company-flow 6 | prettier-js 7 | )) 8 | 9 | (defun aj-javascript/init-company-flow () 10 | (use-package company-flow 11 | :defer t 12 | :init 13 | (progn 14 | (push 'company-flow company-backends-js2-mode) 15 | (push 'company-flow company-backends-rjsx-mode) 16 | (when (configuration-layer/package-usedp 'web-mode) 17 | (push 'company-flow company-backends-react-mode)) 18 | ) 19 | :config 20 | (when (configuration-layer/package-usedp 'web-mode) 21 | (push 'react-mode company-flow-modes)))) 22 | 23 | (defun psamim-js/init-eslintd-fix () 24 | (use-package eslintd-fix 25 | :defer t 26 | :commands eslintd-fix-mode 27 | :init 28 | (progn 29 | (add-hook 'rjsx-mode-hook #'eslintd-fix-mode t) 30 | (add-hook 'react-mode-hook #'eslintd-fix-mode t)))) 31 | 32 | (defun psamim-js/post-init-flycheck () 33 | (with-eval-after-load 'flycheck 34 | (push 'javascript-jshint flycheck-disabled-checkers) 35 | (push 'json-jsonlint flycheck-disabled-checkers)) 36 | (spacemacs/enable-flycheck 'react-mode)) 37 | 38 | (defun psamim-js/init-prettier-js () 39 | (use-package prettier-js 40 | :defer t 41 | :init 42 | (progn 43 | (spacemacs/set-leader-keys-for-major-mode 'react-mode "p" 'prettier-js-mode) 44 | (spacemacs/set-leader-keys-for-major-mode 'react-mode "e" 'eslintd-fix-mode) 45 | (spacemacs/set-leader-keys-for-major-mode 'rjsx-mode "p" 'prettier-js-mode) 46 | (spacemacs/set-leader-keys-for-major-mode 'rjsx-mode "e" 'eslintd-fix-mode) 47 | ;; (add-hook 'react-mode-hook 'prettier-js-mode) 48 | (setq 49 | prettier-js-command "prettier_d" 50 | prettier-js-args '( 51 | "--trailing-comma" "es5" 52 | "--single-quote"))))) 53 | -------------------------------------------------------------------------------- /icons/plant.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /bin/battery: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # 3 | # Copyright 2014 Pierre Mavro 4 | # Copyright 2014 Vivien Didelot 5 | # 6 | # Licensed under the terms of the GNU GPL v3, or any later version. 7 | # 8 | # This script is meant to use with i3blocks. It parses the output of the "acpi" 9 | # command (often provided by a package of the same name) to read the status of 10 | # the battery, and eventually its remaining time (to full charge or discharge). 11 | # 12 | # The color will gradually change for a percentage below 85%, and the urgency 13 | # (exit code 33) is set if there is less that 5% remaining. 14 | 15 | use strict; 16 | use warnings; 17 | use utf8; 18 | 19 | my $acpi; 20 | my $status; 21 | my $percent; 22 | my $full_text; 23 | my $short_text; 24 | my $bat_number = $ENV{BLOCK_INSTANCE} || 0; 25 | 26 | # read the first line of the "acpi" command output 27 | open (ACPI, "acpi -b | grep 'Battery $bat_number' |") or die; 28 | $acpi = ; 29 | close(ACPI); 30 | 31 | # fail on unexpected output 32 | if ($acpi !~ /: (\w+), (\d+)%/) { 33 | die "$acpi\n"; 34 | } 35 | 36 | $status = $1; 37 | $percent = $2; 38 | $full_text = "$percent%"; 39 | 40 | if ($status eq 'Discharging') { 41 | $full_text = " $full_text"; 42 | } else { 43 | $full_text = " $full_text"; 44 | } 45 | 46 | $short_text = $full_text; 47 | 48 | if ($acpi =~ /(\d\d:\d\d):/) { 49 | $full_text .= " ($1)"; 50 | } 51 | 52 | # print text 53 | print "$full_text\n"; 54 | print "$short_text\n"; 55 | 56 | # consider color and urgent flag only on discharge 57 | if ($status eq 'Discharging') { 58 | 59 | if ($percent < 20) { 60 | print "#FF0000\n"; 61 | } elsif ($percent < 40) { 62 | print "#FFAE00\n"; 63 | } elsif ($percent < 60) { 64 | print "#FFF600\n"; 65 | } elsif ($percent < 85) { 66 | print "#A8FF00\n"; 67 | } 68 | 69 | if ($percent < 12) { 70 | system("notify-send -u critical 'Battery %$percent!'"); 71 | } 72 | 73 | if ($percent < 5) { 74 | exit(33); 75 | } 76 | } 77 | 78 | exit(0); 79 | -------------------------------------------------------------------------------- /doom/org-agenda.html.template: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Index 7 | 57 | 58 | 59 | 68 | 69 | 70 |
71 | 72 |
73 |
74 |
75 |
76 | 77 | 78 | -------------------------------------------------------------------------------- /icons/community.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /icons/work.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /icons/blackboard.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 8 | 9 | 10 | 12 | 14 | 15 | 16 | 17 | 18 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /bin/rsync_parallel.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | # Usage: 5 | # rsync_parallel.sh [--parallel=N] [rsync args...] 6 | # 7 | # Options: 8 | # --parallel=N Use N parallel processes for transfer. Defaults to 10. 9 | # 10 | # Notes: 11 | # * Requires GNU Parallel 12 | # * Use with ssh-keys. Lots of password prompts will get very annoying. 13 | # * Does an itemize-changes first, then chunks the resulting file list and launches N parallel 14 | # rsyncs to transfer a chunk each. 15 | # * be a little careful with the options you pass through to rsync. Normal ones will work, you 16 | # might want to test weird options upfront. 17 | # 18 | 19 | if [[ "$1" == --parallel=* ]]; then 20 | PARALLEL="${1##*=}" 21 | shift 22 | else 23 | PARALLEL=10 24 | fi 25 | echo "Using up to $PARALLEL processes for transfer..." 26 | 27 | TMPDIR=$(mktemp -d) 28 | trap "rm -rf $TMPDIR" EXIT 29 | 30 | echo "Figuring out file list..." 31 | # sorted by size (descending) 32 | rsync $@ --out-format="%l %n" --no-v --dry-run | sort -n -r > $TMPDIR/files.all 33 | 34 | # check for nothing-to-do 35 | TOTAL_FILES=$(cat $TMPDIR/files.all | wc -l) 36 | if [ "$TOTAL_FILES" -eq "0" ]; then 37 | echo "Nothing to transfer :)" 38 | exit 0 39 | fi 40 | 41 | function array_min { 42 | # return the (index, value) of the minimum element in the array 43 | IC=($(tr ' ' '\n' <<<$@ | cat -n | sort -k2,2nr | tail -n1)) 44 | echo $((${IC[0]} - 1)) ${IC[1]} 45 | } 46 | 47 | echo "Calculating chunks..." 48 | # declare chunk-size array 49 | for ((I = 0 ; I < PARALLEL ; I++ )); do 50 | CHUNKS["$I"]=0 51 | done 52 | 53 | # add each file to the emptiest chunk, so they're as balanced by size as possible 54 | while read FSIZE FPATH; do 55 | MIN=($(array_min ${CHUNKS[@]})) 56 | CHUNKS["${MIN[0]}"]=$((${CHUNKS["${MIN[0]}"]} + $FSIZE)) 57 | echo $FPATH >> $TMPDIR/chunk.${MIN[0]} 58 | done < $TMPDIR/files.all 59 | 60 | find "$TMPDIR" -type f -name "chunk.*" -printf "\n*** %p ***\n" -exec cat {} \; 61 | 62 | echo "Starting transfers..." 63 | find "$TMPDIR" -type f -name "chunk.*" | parallel -j $PARALLEL -t --verbose --progress rsync --files-from={} $@ 64 | -------------------------------------------------------------------------------- /icons/inbox.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 19 | 20 | 22 | 23 | 24 | 26 | 27 | 28 | 30 | 31 | 32 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /rofi/style_normal.rasi: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Author : Aditya Shakya (adi1090x) 4 | * Mail : adi1090x@gmail.com 5 | * Github : @adi1090x 6 | * Reddit : @adi1090x 7 | * 8 | */ 9 | 10 | /* configuration { */ 11 | /* drun-display-format: "{icon} {name}"; */ 12 | /* show-icons: true; */ 13 | /* icon-theme: "Papirus-Dark"; */ 14 | /* location: 2; */ 15 | /* fake-transparency: false; */ 16 | /* hide-scrollbar: true; */ 17 | /* bw: 0; */ 18 | /* } */ 19 | 20 | // black version 21 | * { 22 | bg: #222222EE; 23 | ac: #869fa214; 24 | ac-txt: #869fa2; 25 | item: #bdc3c3; 26 | txt: #d1d5da; 27 | } 28 | 29 | // white version 30 | 31 | /* * { 32 | bg: #ffffff; 33 | ac: #e5e5e5; 34 | ac-txt: #101010; 35 | item: #454545; 36 | txt: #252525; 37 | } 38 | */ 39 | 40 | 41 | * { 42 | background-color: rgba(0,0,0,0); 43 | font: "Iosevka 12"; 44 | } 45 | 46 | window { 47 | transparency: "real"; 48 | height: 60%; 49 | } 50 | 51 | mainbox { 52 | children: [ inputbar, listview ]; 53 | background-color: @bg; 54 | /* border-radius: 12; */ 55 | border: 2; 56 | border-color: #ffffff0A; 57 | } 58 | 59 | listview { 60 | columns: 1; 61 | padding: 8; 62 | spacing: 0; 63 | } 64 | 65 | element { 66 | border: 1; 67 | text-color: @item; 68 | orientation: horizontal; 69 | padding: 8 12 8 12; 70 | border-radius: 6; 71 | } 72 | 73 | element selected { 74 | background-color: @ac; 75 | border-color: #ffffff0A; 76 | text-color: @ac-txt; 77 | transition: 20; 78 | } 79 | 80 | element-icon { 81 | size: 40; 82 | horizontal-align: 0.5; 83 | vertical-align: 0.5; 84 | } 85 | 86 | element-text { 87 | text-color: inherit; 88 | horizontal-align: 0; 89 | padding: 8 12 8 12; 90 | } 91 | 92 | inputbar { 93 | children: [entry]; 94 | padding: 4 8 4 8; 95 | background-color: @bg; 96 | border: 0 0 1 0; 97 | border-color: #ffffff0A; 98 | } 99 | 100 | prompt { 101 | enabled: false; 102 | } 103 | 104 | entry { 105 | text-color: @txt; 106 | padding: 8 12 8 12; 107 | } 108 | 109 | -------------------------------------------------------------------------------- /icons/day.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /icons/book.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /icons/chore.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /bin/get-bing-wallpaper: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # export {http,https,ftp}_proxy=http://127.0.0.1:7777 4 | 5 | # The market, can be "en-US" "zh-CN" "ja-JP" "en-AU" "en-UK" "de-DE" "en-NZ" "en-CA" 6 | mkt="en-US" 7 | 8 | bing="www.bing.com" 9 | 10 | # The idx parameter determines where to start from. 0 is the current day, 11 | # 1 the previous day, etc. 12 | idx="0" 13 | 14 | # $xmlURL is needed to get the xml data 15 | xmlURL="http://www.bing.com/HPImageArchive.aspx?format=xml&idx=$idx&n=1&mkt=$mkt" 16 | 17 | # $saveDir is used to set the location where Bing pics of the day are stored. 18 | saveDir=$HOME'/Pictures/Bing/' 19 | 20 | # Create saveDir if it does not already exist 21 | mkdir -p $saveDir 22 | 23 | # Extract the relative URL of the Bing pic of the day 24 | xml=$(curl "$bing/HPImageArchive.aspx?format=rss&idx=$idx&n=1&mkt=$mkt") 25 | 26 | picUrl=$bing$( \ 27 | echo $xml\ 28 | | xmllint --xpath "/rss/channel/item/link/text()" - \ 29 | | sed 's/1366x768/1920x1080/g' \ 30 | ) 31 | 32 | # Get title, remove copyright notice and html entities 33 | picTitle=$( \ 34 | echo $xml\ 35 | | xmllint --xpath "/rss/channel/item/title/text()" - \ 36 | | sed s/'([^)]*)'/''/g \ 37 | | perl -MHTML::Entities -e 'while(<>) {print decode_entities($_);}'\ 38 | ) 39 | 40 | picName="${picUrl##*/}" 41 | 42 | # Download the Bing pic of the day 43 | cd $saveDir && curl -O $picUrl 44 | 45 | # Test if download was successful. 46 | downloadResult=$? 47 | if [[ $downloadResult -ge 1 ]]; then 48 | rm -rf $saveDir$picName 49 | echo "Couldn't download any picture." 50 | exit 1; 51 | fi 52 | 53 | # Test if it's a pic 54 | file --mime-type -b $saveDir$picName | grep "^image/" > /dev/null 55 | downloadResult=$? 56 | if [[ $downloadResult -ge 1 ]]; then 57 | rm -rf $saveDir$picName 58 | echo "Downloaded file is not an image." 59 | exit 1; 60 | fi 61 | 62 | # Add title to image 63 | width=$(identify -format %w $saveDir$picName) 64 | height=$(identify -format %h $saveDir$picName) 65 | convert -background '#0008' -fill white -gravity center -size $(($width/4))x$(($height/6)) -font Ubuntu \ 66 | caption:"$picTitle" \ 67 | $saveDir$picName +swap -gravity east -composite $saveDir$picName 68 | -------------------------------------------------------------------------------- /spacemacs/private/psamim-react/packages.el: -------------------------------------------------------------------------------- 1 | ;;; packages.el --- react Layer packages File for Spacemacs 2 | ;; 3 | ;; Copyright (c) 2012-2018 Sylvain Benner & Contributors 4 | ;; 5 | ;; Author: Andrea Moretti 6 | ;; URL: https://github.com/axyz 7 | ;; 8 | ;; This file is not part of GNU Emacs. 9 | ;; 10 | ;;; License: GPLv3 11 | 12 | (setq psamim-react-packages 13 | '( 14 | evil-matchit 15 | flycheck 16 | js-doc 17 | smartparens 18 | web-beautify 19 | web-mode 20 | )) 21 | 22 | (defun psamim-react/post-init-evil-matchit () 23 | (with-eval-after-load 'evil-matchit 24 | (plist-put evilmi-plugins 'react-mode 25 | '((evilmi-simple-get-tag evilmi-simple-jump) 26 | (evilmi-javascript-get-tag evilmi-javascript-jump) 27 | (evilmi-html-get-tag evilmi-html-jump))))) 28 | 29 | (defun psamim-react/post-init-flycheck () 30 | (with-eval-after-load 'flycheck 31 | (dolist (checker '(javascript-eslint javascript-standard)) 32 | (flycheck-add-mode checker 'react-mode))) 33 | (spacemacs/enable-flycheck 'react-mode)) 34 | 35 | (defun psamim-react/post-init-js-doc () 36 | (add-hook 'react-mode-hook 'spacemacs/js-doc-require) 37 | (spacemacs/js-doc-set-key-bindings 'react-mode)) 38 | 39 | (defun psamim-react/post-init-smartparens () 40 | (if dotspacemacs-smartparens-strict-mode 41 | (add-hook 'react-mode-hook #'smartparens-strict-mode) 42 | (add-hook 'react-mode-hook #'smartparens-mode))) 43 | 44 | (defun psamim-react/post-init-web-beautify () 45 | (spacemacs/set-leader-keys-for-major-mode 'react-mode "=" 'web-beautify-js)) 46 | 47 | (defun psamim-react/post-init-web-mode () 48 | (define-derived-mode react-mode web-mode "react") 49 | (add-to-list 'auto-mode-alist '("\\.jsx\\'" . react-mode)) 50 | (add-to-list 'auto-mode-alist '("\\.react.js\\'" . react-mode)) 51 | (add-to-list 'auto-mode-alist '("\\index.android.js\\'" . react-mode)) 52 | (add-to-list 'auto-mode-alist '("\\index.ios.js\\'" . react-mode)) 53 | (add-to-list 'magic-mode-alist '("/\\*\\* @jsx .*\\*/" . react-mode)) 54 | (add-to-list 'magic-mode-alist '("import\s+[^\s]+\s+from\s+['\"]react['\"]" . react-mode)) 55 | (add-hook 'react-mode-hook 'spacemacs//setup-react-mode)) 56 | -------------------------------------------------------------------------------- /mbsync/mbsyncrc: -------------------------------------------------------------------------------- 1 | # mbsyncrc based on 2 | # http://www.ict4g.net/adolfo/notes/2014/12/27/EmacsIMAP.html 3 | # ACCOUNT INFORMATION 4 | IMAPAccount gmail 5 | # Address to connect to 6 | Host imap.gmail.com 7 | User psamim@gmail.com 8 | PassCmd "pass mbsync" 9 | AuthMechs LOGIN 10 | SSLType IMAPS 11 | SSLVersions SSLv3 12 | # CertificateFile /opt/local/share/curl/curl-ca-bundle.crt 13 | 14 | # THEN WE SPECIFY THE LOCAL AND REMOTE STORAGE 15 | # - THE REMOTE STORAGE IS WHERE WE GET THE MAIL FROM (E.G., THE 16 | # SPECIFICATION OF AN IMAP ACCOUNT) 17 | # - THE LOCAL STORAGE IS WHERE WE STORE THE EMAIL ON OUR COMPUTER 18 | 19 | # REMOTE STORAGE (USE THE IMAP ACCOUNT SPECIFIED ABOVE) 20 | IMAPStore gmail-remote 21 | Account gmail 22 | 23 | # LOCAL STORAGE (CREATE DIRECTORIES with mkdir -p Maildir/gmail) 24 | MaildirStore gmail-local 25 | Path ~/.mbsync/ 26 | Inbox ~/.mbsync/INBOX 27 | 28 | # CONNECTIONS SPECIFY LINKS BETWEEN REMOTE AND LOCAL FOLDERS 29 | # 30 | # CONNECTIONS ARE SPECIFIED USING PATTERNS, WHICH MATCH REMOTE MAIl 31 | # FOLDERS. SOME COMMONLY USED PATTERS INCLUDE: 32 | # 33 | # 1 "*" TO MATCH EVERYTHING 34 | # 2 "!DIR" TO EXCLUDE "DIR" 35 | # 3 "DIR" TO MATCH DIR 36 | 37 | Channel gmail-inbox 38 | Master :gmail-remote: 39 | Slave :gmail-local: 40 | Patterns "INBOX" 41 | Create Both 42 | Expunge Both 43 | SyncState * 44 | 45 | Channel gmail-trash 46 | Master :gmail-remote:"[Gmail]/Trash" 47 | Slave :gmail-local:"[Gmail].Bin" 48 | Create Both 49 | Expunge Both 50 | SyncState * 51 | 52 | Channel gmail-sent 53 | Master :gmail-remote:"[Gmail]/Sent Mail" 54 | Slave :gmail-local:"[Gmail].Sent Mail" 55 | Create Both 56 | Expunge Both 57 | SyncState * 58 | 59 | Channel gmail-all 60 | Master :gmail-remote:"[Gmail]/All Mail" 61 | Slave :gmail-local:"[Gmail].All Mail" 62 | Create Both 63 | Expunge Both 64 | SyncState * 65 | 66 | Channel gmail-starred 67 | Master :gmail-remote:"[Gmail]/Starred" 68 | Slave :gmail-local:"[Gmail].Starred" 69 | Create Both 70 | Expunge Both 71 | SyncState * 72 | 73 | # GROUPS PUT TOGETHER CHANNELS, SO THAT WE CAN INVOKE 74 | # MBSYNC ON A GROUP TO SYNC ALL CHANNELS 75 | # 76 | # FOR INSTANCE: "mbsync gmail" GETS MAIL FROM 77 | # "gmail-inbox", "gmail-sent", and "gmail-trash" 78 | # 79 | Group gmail 80 | Channel gmail-inbox 81 | Channel gmail-sent 82 | Channel gmail-trash 83 | Channel gmail-all 84 | Channel gmail-starred 85 | -------------------------------------------------------------------------------- /bin/mediaplayer: -------------------------------------------------------------------------------- 1 | #!/bin/perl 2 | # Copyright (C) 2014 Tony Crisci 3 | 4 | # This program is free software: you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation, either version 3 of the License, or 7 | # (at your option) any later version. 8 | 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program. If not, see . 16 | 17 | # Requires playerctl binary to be in your path (except cmus) 18 | # See: https://github.com/acrisci/playerctl 19 | 20 | # Set instance=NAME in the i3blocks configuration to specify a music player 21 | # (playerctl will attempt to connect to org.mpris.MediaPlayer2.[NAME] on your 22 | # DBus session). 23 | 24 | use Env qw(BLOCK_INSTANCE); 25 | 26 | my @metadata = (); 27 | my $player_arg = ""; 28 | 29 | if ($BLOCK_INSTANCE) { 30 | $player_arg = "--player='$BLOCK_INSTANCE'"; 31 | } 32 | 33 | if ($player_arg eq '' or $player_arg =~ /cmus$/) { 34 | # try cmus first 35 | my @cmus = split /^/, qx(cmus-remote -Q); 36 | if ($? == 0) { 37 | foreach my $line (@cmus) { 38 | my @data = split /\s/, $line; 39 | if (shift @data eq 'tag') { 40 | my $key = shift @data; 41 | my $value = join ' ', @data; 42 | 43 | @metadata[0] = $value if $key eq 'artist'; 44 | @metadata[1] = $value if $key eq 'title'; 45 | } 46 | } 47 | 48 | if (@metadata) { 49 | # metadata found so we are done 50 | print(join ' - ', @metadata); 51 | exit 0; 52 | } 53 | } 54 | 55 | # if cmus was given, we are done 56 | exit 0 unless $player_arg eq ''; 57 | } 58 | 59 | my $artist = qx(playerctl $player_arg metadata artist); 60 | # exit status will be nonzero when playerctl cannot find your player 61 | exit(0) if $?; 62 | push(@metadata, $artist) if $artist; 63 | 64 | my $title = qx(playerctl $player_arg metadata title); 65 | exit(0) if $?; 66 | push(@metadata, $title) if $title; 67 | 68 | print(join(" - ", @metadata)) if @metadata; 69 | -------------------------------------------------------------------------------- /astronvim/lua/plugins/mappings.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "AstroNvim/astrocore", 4 | ---@type AstroCoreOpts 5 | opts = { 6 | mappings = { 7 | -- first key is the mode 8 | n = { 9 | ["fs"] = { ":w!", desc = "Save File" }, -- change description but the same command 10 | [""] = { function() require("astrocore.buffer").nav(vim.v.count1) end, desc = "Next buffer" }, 11 | [""] = { function() require("astrocore.buffer").nav(-vim.v.count1) end, desc = "Previous buffer" }, 12 | ["bd"] = { function() require("astrocore.buffer").close() end, desc = "Close buffer" }, 13 | [""] = { function() require("astrocore.buffer").close() end, desc = "Close buffer" }, 14 | [""] = { 15 | function() 16 | require("snacks").picker.smart { 17 | multi = { "buffers", "recent", "files" }, 18 | format = "file", -- use `file` format for all sources 19 | matcher = { 20 | fuzzy = true, -- use fuzzy matching 21 | smartcase = true, -- use smartcase 22 | ignorecase = true, -- use ignorecase 23 | cwd_bonus = true, -- boost cwd matches 24 | frecency = true, -- use frecency boosting 25 | sort_empty = true, -- sort even when the filter is empty 26 | }, 27 | transform = "unique_file", 28 | } 29 | end, 30 | desc = "Find commands", 31 | }, 32 | ["d"] = { 33 | function() 34 | if vim.bo.filetype == "neo-tree" then 35 | vim.cmd.wincmd "p" 36 | else 37 | vim.cmd.Neotree "focus" 38 | end 39 | end, 40 | desc = "Toggle Explorer Focus", 41 | }, 42 | }, 43 | t = { 44 | -- setting a mapping to false will disable it 45 | -- [""] = false, 46 | }, 47 | }, 48 | }, 49 | }, 50 | { 51 | "AstroNvim/astrolsp", 52 | ---@type AstroLSPOpts 53 | opts = { 54 | mappings = { 55 | n = { 56 | -- condition for only server with declaration capabilities 57 | gD = { 58 | function() vim.lsp.buf.declaration() end, 59 | desc = "Declaration of current symbol", 60 | cond = "textDocument/declaration", 61 | }, 62 | }, 63 | }, 64 | }, 65 | }, 66 | } 67 | -------------------------------------------------------------------------------- /icons/archive.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 25 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /spacemacs/private/psamim-defaults/config.el: -------------------------------------------------------------------------------- 1 | (setq-default 2 | ;; js2-mode 3 | js2-basic-offset 2 4 | js-indent-level 2 5 | ;; web-mode 6 | css-indent-offset 2 7 | web-mode-markup-indent-offset 2 8 | web-mode-css-indent-offset 2 9 | web-mode-code-indent-offset 2 10 | web-mode-attr-indent-offset 2) 11 | 12 | ;; Different font for Farsi characters 13 | (set-fontset-font 14 | "fontset-default" 15 | (cons (decode-char 'ucs #x0600) (decode-char 'ucs #x06ff)) ; arabic 16 | ;; "Vazir Code-13") 17 | "Shabnam-12") 18 | ;; "DejaVu Sans-12") 19 | 20 | (add-hook 'dired-mode-hook 'dired-hide-details-mode) 21 | 22 | ;; Add icons 23 | ;; (add-hook 'dired-mode-hook 'all-the-icons-dired-mode) 24 | ;; (setq neo-theme (if (display-graphic-p) 'icons 'arrow)) 25 | 26 | ;; Hide mode names 27 | (spacemacs|diminish super-save-mode nil) 28 | (spacemacs|diminish prettier-js-mode nil) 29 | (spacemacs|diminish eslintd-fix-mode nil) 30 | (spacemacs|diminish centered-window-mode nil) 31 | (spacemacs|diminish all-the-icons-dired-mode nil) 32 | 33 | ;; Configure org-journal 34 | (custom-set-variables 35 | '(org-journal-date-format 'psamim-journal-prefix)) 36 | 37 | ;(use-package spaceline-all-the-icons 38 | ; :after spaceline 39 | ; :config (spaceline-all-the-icons-theme)) 40 | 41 | ;; (add-hook 'org-mode-hook 42 | ;; (lambda () 43 | ;; (visual-line-mode) 44 | ;; (spacemacs/toggle-vi-tilde-fringe-off) 45 | ;; (spacemacs/toggle-line-numbers-off) 46 | ;; (setq bidi-paragraph-direction t))) 47 | 48 | ;; (keychain-refresh-environment) 49 | ;; (super-save-mode +1) 50 | 51 | ;; http://emacs.stackexchange.com/a/21207 52 | ;; (defun my/use-eslint-from-node-modules () 53 | ;; (let* ((root (locate-dominating-file 54 | ;; (or (buffer-file-name) default-directory) 55 | ;; "node_modules")) 56 | ;; (eslint (and root 57 | ;; (expand-file-name "node_modules/eslint/bin/eslint.js" 58 | ;; root)))) 59 | ;; (when (and eslint (file-executable-p eslint)) 60 | ;; (setq-local flycheck-javascript-eslint-executable eslint)))) 61 | 62 | ;; (add-hook 'flycheck-mode-hook #'my/use-eslint-from-node-modules) 63 | 64 | (add-hook 'text-mode-hook (lambda () 65 | (interactive) 66 | (olivetti-set-width 120) 67 | (olivetti-mode 1))) 68 | (add-hook 'prog-mode-hook (lambda () 69 | (interactive) 70 | (olivetti-set-width 120) 71 | (olivetti-mode 1))) 72 | -------------------------------------------------------------------------------- /ledger-autosync/plugins/eghtesad.py: -------------------------------------------------------------------------------- 1 | from ledgerautosync.converter import CsvConverter, Posting, Transaction, Amount 2 | import datetime 3 | import re 4 | import jdatetime 5 | import persian 6 | import json 7 | import os 8 | 9 | 10 | class Eghtesad(CsvConverter): 11 | FIELDSET = set(['enbank']) 12 | 13 | def __init__(self, *args, **kwargs): 14 | super(Eghtesad, self).__init__(*args, **kwargs) 15 | self.name = 'Assets:Bank:Eghtesad' 16 | dirname = os.path.dirname(os.path.abspath(__file__)) 17 | with open(os.path.join(dirname, 'accounts.json')) as f: 18 | self.accounts = json.load(f) 19 | 20 | def convert(self, row): 21 | desc = persian.convert_fa_numbers(row['enbank']) 22 | metadata = { 23 | 'Desc.': desc 24 | } 25 | inputAmount = int(row['3']) 26 | outputAmount = int(row['4']) 27 | amount = 0 28 | reverse = True 29 | 30 | accountNumber = "" 31 | matchNumber = re.findall('(\d{7,9})', desc) 32 | if matchNumber: 33 | accountNumber = int(matchNumber[0]) 34 | 35 | fromAccount = self.unknownaccount 36 | foundAccount = self.accounts.get(str(accountNumber), None) 37 | payee = 'Unknown' 38 | if accountNumber != '' and foundAccount: 39 | fromAccount = foundAccount['account'] 40 | payee = foundAccount['name'] 41 | 42 | if accountNumber != '': 43 | payee = "(" + str(accountNumber) + ") " + payee 44 | 45 | if outputAmount > 0: 46 | amount = outputAmount / 10000 47 | reverse = True 48 | else: 49 | amount = inputAmount / 10000 50 | reverse = False 51 | fromAccount = 'Income:Salary' 52 | 53 | jdatestring = row['1'] 54 | jdate = jdatetime.date( 55 | int(jdatestring[0:4]), int(jdatestring[5:7]), 56 | int(jdatestring[8:])) 57 | date = jdate.togregorian() 58 | metadata['Date'] = jdate.isoformat() + ', ' + jdate.j_weekdays_en[ 59 | jdate.weekday()] 60 | metadata['Time'] = row['2'] 61 | 62 | unit = 'kIRT' 63 | 64 | return Transaction( 65 | cleared=True, 66 | date=date, 67 | payee=payee, 68 | metadata=metadata, 69 | postings=[ 70 | Posting( 71 | account=fromAccount, 72 | amount=Amount(amount, unit, reverse=not reverse)), 73 | Posting( 74 | account=self.name, 75 | amount=Amount(amount, unit, reverse=reverse)) 76 | ]) 77 | -------------------------------------------------------------------------------- /tridactyl/tridactylrc: -------------------------------------------------------------------------------- 1 | " bovine3dom's dogfood -*- mode: vimrc; -*- 2 | 3 | " Provided only as an example. 4 | " Do not install/run without reading through as you may be surprised by some 5 | " of the settings. 6 | 7 | " May require the latest beta builds. 8 | 9 | " Move this to $XDG_CONFIG_DIR/tridactyl/tridactylrc (that's 10 | " ~/.config/tridactyl/tridactylrc to mere mortals) or ~/.tridactylrc and 11 | " install the native messenger (:installnative in Tridactyl). Run :source to 12 | " get it in the browser, or just restart. 13 | 14 | " NB: If you want "vim-like" behaviour where removing a line from 15 | " here makes the setting disappear, uncomment the line below. 16 | 17 | sanitise tridactyllocal tridactylsync 18 | 19 | " 20 | " Binds 21 | " 22 | 23 | " Comment toggler for Reddit and Hacker News 24 | bind ;c hint -c [class*="expand"],[class="togg"] 25 | bind tabprev 26 | bind tabnext_gt 27 | bind j scrollline 3 28 | bind k scrollline -3 29 | bind gs tab 3 30 | bind changelistjump -1 31 | " Use Firefox find 32 | unbind 33 | bind n exclaim_quiet xdotool getactivewindow key Ctrl+g 34 | 35 | " 36 | " Misc settings 37 | " 38 | 39 | " Sane hinting mode 40 | set hintfiltermode vimperator-reflow 41 | set hintchars asdfjkl 42 | set theme dark 43 | 44 | " Make Tridactyl work on more sites at the expense of some security 45 | set csp clobber 46 | fixamo_quiet 47 | 48 | " 49 | " URL redirects 50 | " 51 | 52 | " New reddit is bad 53 | " autocmd DocStart www.reddit.com js tri.excmds.urlmodify("-t", "www", "old") 54 | 55 | autocmd TabEnter .* unfocus 56 | 57 | 58 | unbindurl mail.google.com j 59 | unbindurl mail.google.com k 60 | unbindurl mail.google.com gi 61 | unbindurl mail.google.com x 62 | unbindurl daskpos.slack.com 63 | unbindurl meet.google.com 64 | unbindurl app.clickup.com k 65 | unbindurl app.clickup.com j 66 | unbindurl app.clickup.com / 67 | unbindurl app.clickup.com n 68 | unbindurl pinafore.social c 69 | unbindurl pinafore.social j 70 | unbindurl pinafore.social k 71 | unbindurl pinafore.social r 72 | unbindurl pinafore.social 1 73 | unbindurl pinafore.social 2 74 | unbindurl pinafore.social 3 75 | unbindurl pinafore.social 4 76 | unbindurl pinafore.social 5 77 | unbindurl pinafore.social . 78 | unbindurl pinafore.social b 79 | unbindurl pinafore.social ? 80 | unbindurl pinafore.social p 81 | unbindurl pinafore.social f 82 | 83 | blacklistadd central.psam.im 84 | 85 | set searchurls.r https://old.reddit.com/r/%s 86 | set searchurls.d https://duckduckgo.com/?q=%s 87 | quickmark l http://libgen.io/ 88 | set editorcmd konsole -e nvim -c "call feedkeys('GA')" 89 | 90 | " This will have to do until someone writes us a nice syntax file :) 91 | " vim: set filetype=vim: 92 | -------------------------------------------------------------------------------- /bin/lightpomodoro.js: -------------------------------------------------------------------------------- 1 | #! env node 2 | const http = require('http'); 3 | const fs = require('fs'); 4 | 5 | const totalSeconds = (process.argv[2] || 25) * 60; 6 | const token = process.env.HASS_TOKEN; 7 | let isOn = true; 8 | let leftSeconds = totalSeconds; 9 | let interval = 2 * 1000; 10 | 11 | var options = { 12 | 'method': 'POST', 13 | 'hostname': '192.168.31.20', 14 | 'port': 8123, 15 | 'path': '/api/services/light/turn_on', 16 | 'headers': { 17 | 'Content-Type': 'application/json', 18 | 'Authorization': `Bearer ${token}` 19 | } 20 | }; 21 | 22 | const send = (postData, callback) => { 23 | 24 | var req = http.request(options, function (res) { 25 | var chunks = []; 26 | 27 | res.on("data", function (chunk) { 28 | chunks.push(chunk); 29 | }); 30 | 31 | res.on("end", function (chunk) { 32 | var body = Buffer.concat(chunks); 33 | // console.log(body.toString()); 34 | if (callback) callback(); 35 | }); 36 | 37 | res.on("error", function (error) { 38 | console.error(error); 39 | if (callback) callback(); 40 | }); 41 | }); 42 | 43 | 44 | req.write(JSON.stringify(postData)); 45 | req.end(); 46 | } 47 | 48 | const lerp = (endRGB, startRGB, percent) => { 49 | const p = percent / 100; 50 | const color = startRGB.map((color, index) => Math.floor((1 - p) * color + p* endRGB[index])) 51 | return color; 52 | }; 53 | 54 | setInterval(() => { 55 | leftSeconds = leftSeconds - 1; 56 | }, 1 * 1000); 57 | 58 | setColors = () => { 59 | const percent = leftSeconds * 100 / totalSeconds; 60 | 61 | let postData = { 62 | "entity_id": "light.small_neolight", 63 | }; 64 | 65 | const startRGB = [255, 240, 124]; 66 | const endRGB = [255, 0, 0]; 67 | 68 | if (percent > 10) { 69 | postData = { 70 | ...postData, 71 | "rgb_color": lerp(startRGB, endRGB, percent) 72 | }; 73 | } else { 74 | postData = { 75 | ...postData, 76 | "rgb_color": [255, 0, 0], 77 | "brightness": isOn ? 0 : 255, 78 | }; 79 | isOn = !isOn; 80 | interval = 500; 81 | } 82 | 83 | send(postData); 84 | 85 | setTimeout(setColors, interval); 86 | 87 | if (leftSeconds < 1) { 88 | // process.exit(); 89 | } 90 | }; 91 | 92 | setTimeout(setColors , interval); 93 | 94 | const clear = () => { 95 | const postData = { 96 | "entity_id": "light.small_neolight", 97 | "brightness": 0, 98 | }; 99 | send(postData, process.exit); 100 | } 101 | 102 | process.on('exit', clear); 103 | process.on('SIGINT', clear); 104 | process.on('SIGUSR1', clear); 105 | process.on('SIGUSR2', clear); 106 | process.on('uncaughtException', clear); 107 | -------------------------------------------------------------------------------- /bin/fund.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import subprocess 3 | from datetime import date, timedelta 4 | import re 5 | 6 | TMP_FILE = '/tmp/fund' 7 | COOKIE_FILE = '/tmp/fundcoockie' 8 | 9 | 10 | def run(command): 11 | output = subprocess.check_output(command, shell=True) 12 | return output.decode('UTF-8').strip() 13 | 14 | 15 | def scrape(regno, name): 16 | URL = 'http://www.fipiran.com/Fund/MFwithRegNo?regno={}'.format(regno) 17 | 18 | run("wget -qO {} {} --save-cookies={} --keep-session-cookies".format( 19 | TMP_FILE, URL, COOKIE_FILE)) 20 | table_line_no = int( 21 | run("cat {} | grep -n ' 4 | 5 | # ---------------------------------------------------------------------------- 6 | # "THE BEER-WARE LICENSE" (Revision 42): 7 | # wrote this file. As long as you retain this notice you 8 | # can do whatever you want with this stuff. If we meet some day, and you think 9 | # this stuff is worth it, you can buy me a beer in return. Paulo F. Smorigo 10 | # ---------------------------------------------------------------------------- 11 | 12 | # Stopwatch and countdown v1.0 13 | 14 | # Use right click to start/stop the counter and the scroll wheel to adjust the 15 | # time. If you start on 00:00 you will be in stopwatch mode (S), otherwise you 16 | # will be in countdown timer mode (C). 17 | 18 | # added a easy way to use symbol icons below by leofa 19 | S= 20 | C= 21 | #C= 22 | #S= 23 | #S= 24 | #C= 25 | 26 | TIME_FRACTION=${1:-300} 27 | TIME_FORMAT=${2:-%H:%M:%S} 28 | 29 | STORE_FILE=/tmp/i3blocks_stopwatch_countdown 30 | NOW=$(date +%s) 31 | 32 | # load values from the file if exists 33 | [ -f $STORE_FILE ] && IFS=, read MODE COUNTER EPOCH < $STORE_FILE 34 | 35 | # sanity check and reset it if necessary 36 | [[ $MODE =~ ^($C|$S)$ ]] || MODE=$C 37 | [[ $COUNTER =~ ^-?[0-9]+$ ]] || COUNTER=0 38 | [[ $EPOCH =~ ^-?[0-9]+$ ]] || EPOCH=0 39 | 40 | # event handler 41 | case $BLOCK_BUTTON in 42 | 3) # right click 43 | if [ $EPOCH -eq 0 ]; then 44 | case $MODE in 45 | $S) EPOCH=$(expr $NOW - $COUNTER) ;; 46 | $C) EPOCH=$(date -d "$COUNTER sec" +%s) ;; 47 | esac 48 | else 49 | EPOCH=0 50 | fi 51 | ;; 52 | 53 | 4|5) # scroll up or scroll down 54 | [ $BLOCK_BUTTON = 4 ] && OP=+ || OP=- 55 | 56 | # update the counter 57 | let "COUNTER = $COUNTER $OP $TIME_FRACTION" 58 | 59 | # change mode depending on the counter value 60 | [ $COUNTER -le 0 ] && MODE=$S || MODE=$C 61 | 62 | # stop the clock 63 | EPOCH=0 64 | ;; 65 | esac 66 | 67 | # update counter if is on 68 | if [ $EPOCH -gt 0 ]; then 69 | case $MODE in 70 | $S) let "COUNTER = $NOW - $EPOCH" ;; 71 | $C) let "COUNTER = $EPOCH - $NOW" ;; 72 | esac 73 | fi 74 | 75 | # stop the clock if it reaches the target 76 | [ $COUNTER -lt 0 ] && COUNTER=0 77 | 78 | # if it reachs 0 trigger the alarm 79 | [ $MODE = $C -a $COUNTER -eq 0 -a $EPOCH -ne 0 ] && EXIT=33 80 | 81 | # if instance is set and alarm is set, execute its content 82 | [ -n "$EXIT" -a -n "$BLOCK_INSTANCE" ] && $BLOCK_INSTANCE && EPOCH=0 83 | 84 | # store the current state 85 | echo "$MODE,$COUNTER,$EPOCH" > $STORE_FILE 86 | 87 | # print 88 | echo "$MODE $(date -u -d @$COUNTER +$TIME_FORMAT)" 89 | echo "" 90 | [ $EPOCH -eq 0 ] && echo "#b4b7b4" || echo "#c7c7c7" 91 | 92 | exit $EXIT 93 | -------------------------------------------------------------------------------- /xmobar/xmobarrc: -------------------------------------------------------------------------------- 1 | Config { 2 | font = "xft:Iosevka Etoile:style=Regular:size=10,FontAwesome:size=9" 3 | , position = Static { xpos = 0, ypos = 0, width = 1920, height = 20 } 4 | , bgColor = "#000000" 5 | , fgColor = "#FFFFFF" 6 | , border = BottomB 2 7 | , borderColor = "#000000" 8 | , lowerOnStart = True 9 | , hideOnStart = False 10 | , persistent = True 11 | , allDesktops = True 12 | , alpha = 185 13 | , commands = [ 14 | Run Network "eno1" [ 15 | "-L", "8", "-H", "32", "-l", "#C9A34E", "-n", "#429942" ,"-h", "#A36666", "-t", ": : "] 10 16 | , Run Cpu ["-L","3","-H","50","--normal","#429942","--high","#A36666"] 10 17 | , Run Memory ["-t","Mem: %"] 10 18 | , Run Date "%a %b %_d %Y %H:%M:%S" "date" 10 19 | , Run Battery [ "--template" , " " 20 | , "--Low" , "10" -- units: % 21 | , "--High" , "80" -- units: % 22 | , "--low" , "darkred" 23 | , "--normal" , "darkorange" 24 | , "--high" , "#429942" 25 | 26 | , "--" -- battery specific options 27 | -- discharging status 28 | , "-o" , "% ()" 29 | -- AC "on" status 30 | , "-O" , "Charging" 31 | -- charged status 32 | , "-i" , "Charged" 33 | ] 50 34 | , Run StdinReader 35 | , Run DynNetwork [ "--template" , " kB/s|kB/s" 36 | , "--Low" , "1000" -- units: B/s 37 | , "--High" , "5000" -- units: B/s 38 | -- , "--low" , "darkgreen" 39 | -- , "--normal" , "darkorange" 40 | -- , "--high" , "darkred" 41 | ] 10 42 | -- keyboard layout indicator 43 | , Run Kbd [] 44 | , Run Com "/home/samim/.bin/reboot-p" [] "reboot" 10 45 | , Run Com "/home/samim/.bin/clocking" [] "clocking" 10 46 | , Run Com "/home/samim/.bin/notifs_count" [] "notifs" 10 47 | , Run Com "/home/samim/.bin/trayer-padding-icon.sh" ["trayer"] "tray" 10 48 | ] 49 | , sepChar = "%" 50 | , alignSep = "}{" 51 | , template = " %StdinReader% }{ %notifs% %reboot% %clocking% | %dynnetwork% | %cpu% | %memory% | %battery% | %kbd% | %date% %tray%" 52 | } 53 | -------------------------------------------------------------------------------- /ideavim/ideavimrc: -------------------------------------------------------------------------------- 1 | " https://github.com/JetBrains/ideavim/discussions/303 2 | 3 | source ~/.intellimacs/spacemacs.vim 4 | 5 | " (Optional) Enable other Intellimacs modules 6 | source ~/.intellimacs/extra.vim 7 | source ~/.intellimacs/major.vim 8 | " source ~/.intellimacs/hybrid.vim 9 | 10 | " (Optional) Enable which-key plugin 11 | source ~/.intellimacs/which-key.vim 12 | 13 | let mapleader=" " 14 | 15 | """ Plugins -------------------------------- 16 | set surround 17 | set multiple-cursors 18 | set commentary 19 | set argtextobj 20 | set easymotion 21 | set textobj-entire 22 | set ReplaceWithRegister 23 | set exchange 24 | " Trying the new syntax 25 | Plug 'machakann/vim-highlightedyank' 26 | 27 | """ Common settings ------------------------- 28 | set showmode 29 | set so=5 30 | set incsearch 31 | set nu 32 | set ignorecase smartcase 33 | set hlsearch 34 | 35 | """ Idea specific settings ------------------ 36 | set ideajoin 37 | set ideastatusicon=gray 38 | set clipboard+=unnamed 39 | set which-key 40 | 41 | """ My Mappings ----------------------------- 42 | inoremap jj :action EditorCompleteStatement 43 | 44 | nnoremap q :action ShowErrorDescription 45 | nnoremap k :action FileStructurePopup 46 | " nnoremap :action SearchEverywhere 47 | nnoremap aw :action ShowIntentionActions 48 | 49 | nnoremap pp :action ManageRecentProjects 50 | nnoremap pr :action Run 51 | nnoremap pd :action Debug 52 | nnoremap pn :action WelcomeScreen.OpenProject 53 | 54 | " nnoremap gs :action ChangesView.Commit 55 | " nnoremap gg :action Vcs.QuickListPopupAction 56 | 57 | " nnoremap en :action GotoNextError 58 | " nnoremap ep :action GotoPreviousError 59 | nnoremap d :action SelectInProjectView 60 | " nnoremap wh :action HideAllWindows 61 | 62 | nnoremap ,f :action ReformatCode 63 | nnoremap ,r :action Refactorings.QuickListPopupAction 64 | nnoremap ,g :action Generate 65 | 66 | """ Find --------------------------------------- 67 | nnoremap / :action FindInPath 68 | " nnoremap / :action Find 69 | " nnoremap n :action FindNext 70 | " nnoremap N :actjon FindPrevious 71 | 72 | nnoremap rr :source ~/.ideavimrc 73 | 74 | " built-in navigation to navigated items works better 75 | nnoremap :action Back 76 | nnoremap :action Forward 77 | " JumpToLastChange JumpToNextChange 78 | 79 | " nnoremap U :action $Redo 80 | " nnoremap ; :action AceJumpAction 81 | " nnoremap o :action GotoClass 82 | " nnoremap O :action GotoFile 83 | " nnoremap h :action QuickJavaDoc 84 | 85 | " window 86 | nmap (PreviousTab) 87 | nmap (NextTab) 88 | nmap (CloseEditor) 89 | -------------------------------------------------------------------------------- /tmux/tmux.conf: -------------------------------------------------------------------------------- 1 | set -g prefix M-m 2 | 3 | # unbind-key C-b 4 | 5 | # Rather than constraining window size to the maximum size of any client 6 | # connected to the *session*, constrain window size to the maximum size of any 7 | # client connected to *that window*. Much more reasonable. 8 | setw -g aggressive-resize on 9 | 10 | # Mouse Integration 11 | set-option -g mouse on 12 | # bind -n WheelUpPane select-pane -t= \; copy-mode -e \; send-keys -M 13 | # bind -n WheelDownPane select-pane -t= \; send-keys -M 14 | 15 | bind-key r source-file ~/.tmux.conf 16 | bind-key | split-window -h 17 | bind-key - split-window -v 18 | 19 | # cycles thru windows 20 | # bind-key -n M-l next 21 | # bind-key -n M-h prev 22 | 23 | # Create new window 24 | bind-key -n M-n new-window 25 | 26 | # Kill windows 27 | # bind-key -n M-q kill-pane 28 | 29 | # copy-mode 30 | bind-key -n M-c copy-mode 31 | 32 | # enable activity alerts 33 | set -g visual-activity on 34 | 35 | # Opens a pane 36 | bind -n M-t source-file ~/.tmux/vimo 37 | 38 | # vi-style controls for copy mode 39 | setw -g mode-keys vi 40 | 41 | # control automatic window renaming 42 | setw -g automatic-rename on 43 | 44 | # 0 is too far from ` ;) 45 | set -g base-index 1 46 | 47 | # set -g default-terminal "xterm" 48 | set -g default-terminal "tmux-256color" 49 | # statusbar 50 | # set -g status-position bottom 51 | # set -g status-justify left 52 | # set -g status-style 'bg=#303030 fg=#4e4e4e dim' 53 | # set -g status-left '' 54 | # set -g status-right '' 55 | # set -g status-right-length 50 56 | # set -g status-left-length 20 57 | set -g default-shell "/bin/zsh" 58 | set -g default-command "/bin/zsh" 59 | 60 | # setw -g window-status-current-style 'fg=white bg=#4e4e4e bold' 61 | # setw -g window-status-style 'fg=white bg=#4e4e4e' 62 | 63 | # setw -g window-status-current-format ' #I#[fg=colour249]:#[fg=colour255]#W#[fg=colour249] ' 64 | # setw -g window-status-format ' #I#[fg=colour237]:#[fg=colour250]#W#[fg=colour244] ' 65 | set -g @thumbs-command 'echo -n {} | /usr/bin/xclip -sel clip' 66 | 67 | bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel '/usr/bin/xclip -in -selection clipboard' 68 | 69 | set -g @catppuccin_flavor 'mocha' # latte, frappe, macchiato or mocha 70 | set -g @catppuccin_window_status_style "basic" 71 | set -g status-right-length 100 72 | set -g status-left-length 100 73 | set -g status-left "" 74 | set -g status-right "" 75 | 76 | # Plugins 77 | set -g @plugin 'tmux-plugins/tmux-sensible' 78 | set -g @plugin 'fcsonline/tmux-thumbs' 79 | set -g @plugin 'catppuccin/tmux#v2.1.3' # See https://github.com/catppuccin/tmux/tags for additional tags 80 | # set -g @plugin 'tmux-plugins/tmux-open' 81 | # set -g @plugin 'tmux-plugins/tmux-yank' 82 | # set -g @plugin 'seebi/tmux-colors-solarized' 83 | # set -g @plugin 'Morantron/tmux-fingers' 84 | set -g @plugin 'tmux-plugins/tmux-pain-control' 85 | set -g @plugin 'tmux-plugins/tpm' 86 | 87 | run '~/.tmux/plugins/tpm/tpm' 88 | 89 | new-session 90 | -------------------------------------------------------------------------------- /notmuch/notmuch-config: -------------------------------------------------------------------------------- 1 | # .notmuch-config - Configuration file for the notmuch mail system 2 | # 3 | # For more information about notmuch, see https://notmuchmail.org 4 | 5 | # Database configuration 6 | # 7 | # The only value supported here is 'path' which should be the top-level 8 | # directory where your mail currently exists and to where mail will be 9 | # delivered in the future. Files should be individual email messages. 10 | # Notmuch will store its database within a sub-directory of the path 11 | # configured here named ".notmuch". 12 | # 13 | 14 | [database] 15 | path=/home/samim/.mail/account.gmail 16 | 17 | # User configuration 18 | # 19 | # Here is where you can let notmuch know how you would like to be 20 | # addressed. Valid settings are 21 | # 22 | # name Your full name. 23 | # primary_email Your primary email address. 24 | # other_email A list (separated by ';') of other email addresses 25 | # at which you receive email. 26 | # 27 | # Notmuch will use the various email addresses configured here when 28 | # formatting replies. It will avoid including your own addresses in the 29 | # recipient list of replies, and will set the From address based on the 30 | # address to which the original email was addressed. 31 | # 32 | 33 | [user] 34 | name=Samim Pezeshki 35 | primary_email=psamim@gmail.com 36 | 37 | # Configuration for "notmuch new" 38 | # 39 | # The following options are supported here: 40 | # 41 | # tags A list (separated by ';') of the tags that will be 42 | # added to all messages incorporated by "notmuch new". 43 | # 44 | # ignore A list (separated by ';') of file and directory names 45 | # that will not be searched for messages by "notmuch new". 46 | # 47 | # NOTE: *Every* file/directory that goes by one of those 48 | # names will be ignored, independent of its depth/location 49 | # in the mail store. 50 | # 51 | 52 | [new] 53 | tags=new 54 | ignore=/.*[.](json|lock|bak)$/ 55 | 56 | # Search configuration 57 | # 58 | # The following option is supported here: 59 | # 60 | # exclude_tags 61 | # A ;-separated list of tags that will be excluded from 62 | # search results by default. Using an excluded tag in a 63 | # query will override that exclusion. 64 | # 65 | 66 | [search] 67 | exclude_tags=trash;spam; 68 | 69 | # Maildir compatibility configuration 70 | # 71 | # The following option is supported here: 72 | # 73 | # synchronize_flags Valid values are true and false. 74 | # 75 | # If true, then the following maildir flags (in message filenames) 76 | # will be synchronized with the corresponding notmuch tags: 77 | # 78 | # Flag Tag 79 | # ---- ------- 80 | # D draft 81 | # F flagged 82 | # P passed 83 | # R replied 84 | # S unread (added when 'S' flag is not present) 85 | # 86 | # The "notmuch new" command will notice flag changes in filenames 87 | # and update tags, while the "notmuch tag" and "notmuch restore" 88 | # commands will notice tag changes and update flags in filenames 89 | # 90 | 91 | [maildir] 92 | synchronize_flags=true 93 | -------------------------------------------------------------------------------- /vimperator/vimperatorrc: -------------------------------------------------------------------------------- 1 | " -*- mode: vimrc -*- 2 | source! /home/samim/.vimperatorrc.local 3 | 4 | " set gui=noaddons,nobookmarks,nomenu,navigation,tabs 5 | set gui=none,tabs,navigation 6 | set hintchars=jkl 7 | set editor="emc" 8 | set wildmode animations 9 | set complete=lS 10 | set focuscontent 11 | set hlsearch 12 | set ignorecase 13 | set incsearch 14 | set titlestring=Firefox 15 | set smartcase 16 | 17 | nmap :forward 18 | nmap :back 19 | nmap :tabnext 20 | nmap :tabprevious 21 | nmap :tabopen 22 | nmap m :bmarks! 23 | noremap j 4j 24 | noremap k 4k 25 | " Switch between alternate tabs 26 | nmap 27 | " Stop 28 | map :st 29 | " Reload vimperator 30 | map R :source ~/.vimperatorrc 31 | 32 | " Only works in Pentadactyl 33 | " set passkeys+=mail.google.com:!#*+-./?INU[]jkacefpqrsuvxyz,*a,*n,*r,*s,*t,*u,ga,gc,gd,gi,gl,gs,gt,yo 34 | " set passkeys+=tweetdeck.twitter.com:jkfrlhxspnt,rt 35 | " set passkeys+=facebook.com:jkfrlhlc 36 | " set passkeys+=bitly.com:a 37 | 38 | " Only works with feedsomekeys plugin 39 | " command! -nargs=+ lazy autocmd VimperatorEnter .* <args> 40 | " fmaps -u='mail\.google\.com/mail' c / j k n p o u e x s r a # [ ] ? gi gs gt gd ga gc 41 | 42 | ignorekeys add -except=t,o,O,:,/,,,d,, mail.google.com 43 | ignorekeys add -except=t,o,O,:,/,,,d,, inbox.google.com 44 | ignorekeys add -except=,,, docs.google.com 45 | ignorekeys add -except=t,o,O,:,/,,,d, facebook.com$ 46 | ignorekeys add -except=t,o,O,:,/,,,d, tweetdeck.twitter.com 47 | ignorekeys add -except=t,o,O,:,/,,,d, web.whatsapp.com 48 | ignorekeys add -except=t,o,O,:,/,,,d, web.telegram.org 49 | 50 | " Authohide the status bar 51 | " https://github.com/vimperator/vimperator-labs/issues/26 52 | noremap :js toggle_bottombar() 53 | noremap : :js toggle_bottombar('on'): 54 | noremap o :js toggle_bottombar('on')o 55 | noremap O :js toggle_bottombar('on')O 56 | noremap t :js toggle_bottombar('on')t 57 | noremap T :js toggle_bottombar('on')t 58 | noremap / :js toggle_bottombar('on')/ 59 | cnoremap :js toggle_bottombar('off') 60 | cnoremap :js toggle_bottombar('off') 61 | inoremap 62 | highlight ContentSeparator border-top: 0px dotted gray; display: -moz-box; 63 | 64 | :js << EOF 65 | function toggle_bottombar(p) { 66 | var bb = document.getElementById('liberator-bottombar'); 67 | if (!bb) 68 | return; 69 | if (p == 'on'){ 70 | bb.style.height = ''; 71 | bb.style.overflow = ''; 72 | return; 73 | } 74 | if (p == 'off'){ 75 | bb.style.height = '0px'; 76 | bb.style.overflow = 'hidden'; 77 | return; 78 | } 79 | bb.style.height = (bb.style.height == '') ? '0px' : ''; 80 | bb.style.overflow = (bb.style.height == '') ? '' : 'hidden'; 81 | } 82 | toggle_bottombar(); 83 | EOF 84 | 85 | -------------------------------------------------------------------------------- /icons/events.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /bin/bandwidth: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (C) 2012 Stefan Breunig 3 | # Copyright (C) 2014 kaueraal 4 | # Copyright (C) 2015 Thiago Perrotta 5 | 6 | # This program is free software: you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation, either version 3 of the License, or 9 | # (at your option) any later version. 10 | 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program. If not, see . 18 | 19 | # Use the provided interface, otherwise the device used for the default route. 20 | if [[ -n $BLOCK_INSTANCE ]]; then 21 | INTERFACE=$BLOCK_INSTANCE 22 | else 23 | INTERFACE=$(ip route | awk '/^default/ { print $5 ; exit }') 24 | fi 25 | 26 | # Issue #36 compliant. 27 | if ! [ -e "/sys/class/net/${INTERFACE}/operstate" ] || ! [ "`cat /sys/class/net/${INTERFACE}/operstate`" = "up" ] 28 | then 29 | echo "$INTERFACE down" 30 | echo "$INTERFACE down" 31 | echo "#FF0000" 32 | exit 0 33 | fi 34 | 35 | # path to store the old results in 36 | path="/dev/shm/$(basename $0)-${INTERFACE}" 37 | 38 | # grabbing data for each adapter. 39 | read rx < "/sys/class/net/${INTERFACE}/statistics/rx_bytes" 40 | read tx < "/sys/class/net/${INTERFACE}/statistics/tx_bytes" 41 | 42 | # get time 43 | time=$(date +%s) 44 | 45 | # write current data if file does not exist. Do not exit, this will cause 46 | # problems if this file is sourced instead of executed as another process. 47 | if ! [[ -f "${path}" ]]; then 48 | echo "${time} ${rx} ${tx}" > "${path}" 49 | chmod 0666 "${path}" 50 | fi 51 | 52 | # read previous state and update data storage 53 | read old < "${path}" 54 | echo "${time} ${rx} ${tx}" > "${path}" 55 | 56 | # parse old data and calc time passed 57 | old=(${old//;/ }) 58 | time_diff=$(( $time - ${old[0]} )) 59 | 60 | # sanity check: has a positive amount of time passed 61 | [[ "${time_diff}" -gt 0 ]] || exit 62 | 63 | # calc bytes transferred, and their rate in byte/s 64 | rx_diff=$(( $rx - ${old[1]} )) 65 | tx_diff=$(( $tx - ${old[2]} )) 66 | rx_rate=$(( $rx_diff / $time_diff )) 67 | tx_rate=$(( $tx_diff / $time_diff )) 68 | 69 | # shift by 10 bytes to get KiB/s. If the value is larger than 70 | # 1024^2 = 1048576, then display MiB/s instead 71 | 72 | # incoming 73 | echo -n " " 74 | rx_kib=$(( $rx_rate >> 10 )) 75 | if [[ "$rx_rate" -gt 1048576 ]]; then 76 | printf '%sM' "`echo "scale=1; $rx_kib / 1024" | bc`" 77 | else 78 | echo -n "${rx_kib}K" 79 | fi 80 | 81 | echo -n " " 82 | 83 | # outgoing 84 | echo -n " " 85 | tx_kib=$(( $tx_rate >> 10 )) 86 | if [[ "$tx_rate" -gt 1048576 ]]; then 87 | printf '%sM' "`echo "scale=1; $tx_kib / 1024" | bc`" 88 | else 89 | echo -n "${tx_kib}K" 90 | fi 91 | --------------------------------------------------------------------------------