diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..81a89df --- /dev/null +++ b/.editorconfig @@ -0,0 +1,13 @@ +# EditorConfig is awesome: https://EditorConfig.org + +# Unix-style newlines with a newline ending every file +[*] +end_of_line = lf +insert_final_newline = true + +# Matches multiple files with brace expansion notation +# Set default charset +[*.{js,json,lua}] +charset = utf-8 +indent_style = space +indent_size = 2 diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..1d1f98e --- /dev/null +++ b/.gitmodules @@ -0,0 +1,39 @@ +[submodule "zsh/.oh-my-zsh"] + path = zsh/.oh-my-zsh + url = git@github.com:nweldev/ohmyzsh.git +[submodule "zsh/.zshrc.d/spaceship-angular-prompt"] + path = zsh/.zshrc.d/spaceship-angular-prompt + url = git@gist.github.com:600f69b7bc8464ca67005a35eb0f7bb3.git +[submodule "zsh/.zsh-custom/themes/spaceship-prompt"] + path = zsh/.zsh-custom/themes/spaceship-prompt + url = https://github.com/denysdovhan/spaceship-prompt.git +[submodule "zsh/.zsh-custom/plugins/zsh-autosuggestions"] + path = zsh/.zsh-custom/plugins/zsh-autosuggestions + url = https://github.com/zsh-users/zsh-autosuggestions +[submodule "aur/all-repository-fonts"] + path = aur/all-repository-fonts + url = https://aur.archlinux.org/all-repository-fonts.git +[submodule "aur/nvm"] + path = aur/nvm + url = https://aur.archlinux.org/nvm.git +[submodule "aur/hyper"] + path = aur/hyper + url = git@github.com:nweldev/aur-hyper.git +[submodule "awesome/.config/awesome/copycats"] + path = awesome/.config/awesome/copycats + url = git@github.com:nweldev/awesome-copycats.git +[submodule "awesome/.config/awesome/lain"] + path = awesome/.config/awesome/lain + url = git@github.com:lcpz/lain.git +[submodule "awesome/.config/awesome/freedesktop"] + path = awesome/.config/awesome/freedesktop + url = git@github.com:lcpz/awesome-freedesktop.git +[submodule "awesome/.config/awesome/jsonlua"] + path = awesome/.config/awesome/jsonlua + url = git@github.com:rxi/json.lua.git +[submodule "nvm/.nvm"] + path = nvm/.nvm + url = git@github.com:nvm-sh/nvm.git +[submodule "vim/.config/nvim"] + path = vim/.config/nvim + url = https://github.com/NvChad/NvChad diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..e2f523b --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,23 @@ +{ + "workbench.colorCustomizations": { + "activityBar.background": "#6aac0e", + "activityBar.activeBorder": "#c4e4fa", + "activityBar.foreground": "#15202b", + "activityBar.inactiveForeground": "#15202b99", + "activityBarBadge.background": "#c4e4fa", + "activityBarBadge.foreground": "#15202b", + "titleBar.activeBackground": "#4d7d0a", + "titleBar.inactiveBackground": "#4d7d0a99", + "titleBar.activeForeground": "#e7e7e7", + "titleBar.inactiveForeground": "#e7e7e799", + "statusBar.background": "#4d7d0a", + "statusBarItem.hoverBackground": "#6aac0e", + "statusBar.foreground": "#e7e7e7", + "activityBar.activeBackground": "#6aac0e", + "sash.hoverBorder": "#6aac0e", + "statusBarItem.remoteBackground": "#4d7d0a", + "statusBarItem.remoteForeground": "#e7e7e7", + "commandCenter.border": "#e7e7e799" + }, + "peacock.color": "#4d7d0a" +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..ee71687 --- /dev/null +++ b/README.md @@ -0,0 +1,93 @@ +# My dotfiles (and more...) + +A bunch of dotfiles and some other stuff I use. That it. + +## Install + +``` +cd ~ +git clone --recurse-submodules -j8 https://github.com/nweldev/dotfiles.git +cd dotfiles +vim install.sh +bash install.sh +``` + +### Dotfiles + +Just clone this repository (or a fork) in your home directory, and use [GNU Stow](https://www.gnu.org/software/stow/) in order to use a specific configuration: + +`stow ` + +### and some other stuff... + +I also keep some other usefull system config and scripts here: +- [aur](./aur): some [Arch User Repositories](https://wiki.archlinux.org/index.php/Arch_User_Repository) repositories I use (and forked if needed) +- [etc](./etc): system config to link in /etc + +> _**FYI**: I mainly use Arch Linux, and sometimes Debian. Obviously, some parts of this project would need some tweaking if you don't use Arch Linux yourself._ + +For more details see [install.sh](./install.sh). _Don't use this script directly! I only use it when if need to take down any notes about some commands I use, not for automating system installs._ + +## Sub-projects + +- [Spaceship Angular Prompt](./zsh/.zshrc.d/spaceship-angular-prompt) + +## Tools + +### Hyper.js + +A terminal built on web technologies + +| :octocat: repo | :globe_with_meridians: website | :arrow_down: install | +|----------------|---------------------------------|------------------------| +| [zeit/hyper](https://github.com/zeit/hyper)| [hyper.is](https://hyper.is/) | forked [AUR](./aur) | + +### VS Code + +Code editing.\ +**Redefined.** + +| :octocat: repo | :globe_with_meridians: website | :arrow_down: install | +|----------------|---------------------------------|------------------------| +| [Microsoft/vscode](https://github.com/Microsoft/vscode)| [code.visualstudio.com](https://code.visualstudio.com) | `pacman -S code` | + +## Oh My ZSH + +Open source, community-driven framework for managing your zsh configuration. + +:electric_plug: Submodule in [/zsh](./zsh/) + +## Spaceship ZSH + +:rocket: :star: A Zsh prompt for Astronauts + +:electric_plug: Submodule in [/zsh/.zsh-custom/themes/](./zsh/.zsh-custom/themes/) + +## Awesome + +Highly configurable, next generation framework window manager for X. + +| :octocat: repo | :globe_with_meridians: website | :arrow_down: install | +|----------------|---------------------------------|------------------------| +| [awesomeWM/awesome](https://github.com/awesomeWM/awesome)| awesomewm.org | `pacman -S awesome` | + +## CLI + +### Hub + +A command-line tool that makes git easier to use with GitHub. + +| :octocat: repo | :globe_with_meridians: website | :arrow_down: install | +|----------------|---------------------------------|------------------------| +| [github/hub](https://github.com/github/hub)| [hub.github.com](https://hub.github.com/) | `$ sudo pacman -S hub` | + +### Physlock + +Lightweight linux console locking tool + +:octocat: [muennich/physlock](https://github.com/muennich/physlock) + + +## Misc + +See this repository [submodules](./.gitmodules). diff --git a/arandr/.config/autorandr/home-office/config b/arandr/.config/autorandr/home-office/config new file mode 100644 index 0000000..364ce71 --- /dev/null +++ b/arandr/.config/autorandr/home-office/config @@ -0,0 +1,18 @@ +output DP-1 +off +output VGA-1 +off +output VIRTUAL-1 +off +output LVDS-1 +crtc 1 +mode 1920x1080 +pos 0x0 +rate 59.93 +transform 0.799988,0.000000,0.000000,0.000000,0.799988,0.000000,0.000000,0.000000,1.000000 +output HDMI-1 +crtc 0 +mode 1920x1080 +pos 1920x0 +primary +rate 60.00 diff --git a/arandr/.config/autorandr/home-office/setup b/arandr/.config/autorandr/home-office/setup new file mode 100644 index 0000000..dcbf300 --- /dev/null +++ b/arandr/.config/autorandr/home-office/setup @@ -0,0 +1,2 @@ +HDMI1 00ffffffffffff0034a441360101010100140103813c22782aeed5a555489b26125054bfef80b300a940950081408180950f714f9040023a801871382d40582c450056502100001e662150b051001b304070360056502100001e000000fd00374c1d5111000a202020202020000000fc004d4432303134370a202020202001c4020322f14f9f1413121116151005040302070601230907018301000065030c001000023a80d072382d40102c458056502100001f011d80d0721c1620102c250056502100009f011d00bc52d01e20b828554056502100001e8c0ad090204031200c405500565021000018023a801871382d40582c450056502100001e00000047 +LVDS1 00ffffffffffff0030e459020000000000130103802313780a15d59e595098260e5054000000010101010101010101010101010101011a3680a070381f403020350059c210000019000000000000000000000000000000000000000000fe004c4720446973706c61790a2020000000fe004c503135365746312d544c4633003c diff --git a/arandr/.config/autorandr/laptop/config b/arandr/.config/autorandr/laptop/config new file mode 100644 index 0000000..4a9c6b5 --- /dev/null +++ b/arandr/.config/autorandr/laptop/config @@ -0,0 +1,13 @@ +output DP-1 +off +output HDMI-1 +off +output VGA-1 +off +output VIRTUAL-1 +off +output LVDS-1 +crtc 1 +mode 1920x1080 +pos 0x0 +rate 59.93 diff --git a/arandr/.config/autorandr/laptop/setup b/arandr/.config/autorandr/laptop/setup new file mode 100644 index 0000000..fb8a0ec --- /dev/null +++ b/arandr/.config/autorandr/laptop/setup @@ -0,0 +1 @@ +LVDS1 00ffffffffffff0030e459020000000000130103802313780a15d59e595098260e5054000000010101010101010101010101010101011a3680a070381f403020350059c210000019000000000000000000000000000000000000000000fe004c4720446973706c61790a2020000000fe004c503135365746312d544c4633003c diff --git a/arandr/.screenlayout/home-office.sh b/arandr/.screenlayout/home-office.sh new file mode 100755 index 0000000..9607a12 --- /dev/null +++ b/arandr/.screenlayout/home-office.sh @@ -0,0 +1,2 @@ +#!/bin/sh +xrandr --output LVDS-1 --mode 1920x1080 --scale 0.75x0.75 --pos 0x0 --rotate normal --output DP-1 --off --output HDMI-1 --primary --mode 1920x1080 --pos 1440x0 --rotate normal --output VGA-1 --off --output VIRTUAL-1 --off diff --git a/arandr/.screenlayout/laptop.sh b/arandr/.screenlayout/laptop.sh new file mode 100755 index 0000000..2262bf5 --- /dev/null +++ b/arandr/.screenlayout/laptop.sh @@ -0,0 +1,2 @@ +#!/bin/sh +xrandr --output LVDS1 --mode 1920x1080 --scale 1x1 --pos 0x0 --rotate normal --output DP1 --off --output HDMI1 --off --output VGA1 --off --output VIRTUAL1 --off diff --git a/arandr/.screenlayout/multi-game.sh b/arandr/.screenlayout/multi-game.sh new file mode 100755 index 0000000..4791e67 --- /dev/null +++ b/arandr/.screenlayout/multi-game.sh @@ -0,0 +1,2 @@ +#!/bin/sh +xrandr --output LVDS1 --gamma 1.5:1.5:1.5 --mode 1920x1080 --pos 0x0 --rotate normal --output DP1 --off --output HDMI1 --gamma 1:1:1 --primary --mode 1920x1080 --pos 1922x0 --rotate normal --output VGA1 --off --output VIRTUAL1 --off diff --git a/arandr/.screenlayout/prez-1280.sh b/arandr/.screenlayout/prez-1280.sh new file mode 100755 index 0000000..9db9b4f --- /dev/null +++ b/arandr/.screenlayout/prez-1280.sh @@ -0,0 +1,2 @@ +#!/bin/sh +xrandr --output eDP1 --primary --mode 1280x720_60.00 --pos 0x0 --rotate normal --output DP1 --mode 1280x720 --pos 0x0 --rotate normal --output DP2 --off diff --git a/aur.dsv b/aur.dsv new file mode 100644 index 0000000..db63ea0 --- /dev/null +++ b/aur.dsv @@ -0,0 +1,12 @@ +autojump 22.5.3-1 +cpupower-gui 0.7.0-1 +emoji-keyboard-git r27.afe17aa-3 +firefox-nightly 72.0a1.20191111-1 +google-chrome 78.0.3904.97-1 +google-chrome-dev 80.0.3962.2-1 +lsdesktopf 1.0.7-4 +msi-perkeyrgb 2.1-1 +scrcpy 1.10-2 +slack-desktop 4.1.2-2 +v4l2loopback-dkms 0.12.2-1 +visual-studio-code-bin 1.40.0-1 diff --git a/aur/all-repository-fonts b/aur/all-repository-fonts new file mode 160000 index 0000000..9901e39 --- /dev/null +++ b/aur/all-repository-fonts @@ -0,0 +1 @@ +Subproject commit 9901e39d4219b92d874a13765d3b05a99bbddd38 diff --git a/aur/hyper b/aur/hyper new file mode 160000 index 0000000..462a26d --- /dev/null +++ b/aur/hyper @@ -0,0 +1 @@ +Subproject commit 462a26d7397a2d222895d1a56036754977ecc091 diff --git a/aur/nvm b/aur/nvm new file mode 160000 index 0000000..d2f19cd --- /dev/null +++ b/aur/nvm @@ -0,0 +1 @@ +Subproject commit d2f19cde7b415aad0856cedc1de4426b8bd7f0cf diff --git a/aur/update.sh b/aur/update.sh new file mode 100644 index 0000000..3774e7c --- /dev/null +++ b/aur/update.sh @@ -0,0 +1,43 @@ +if [ ! -z "$1" ]; then + if [ ! -d "$1" ]; then + echo -e "\"$1\" isn't a valid directory. Aborting." + exit 1 + fi + DIRECTORIES="$1" +else + DIRECTORIES=$(ls -d */) +fi + +for aur in $DIRECTORIES; +do + cd $aur; + + echo -e "\n== $aur ==\n" + + BRANCH=$(git rev-parse --abbrev-ref HEAD) + + if [ "$BRANCH" != "master" ]; then + echo -e "Not on master. Aborting." + cd .. + continue + fi + + git fetch + HEADHASH=$(git rev-parse HEAD) + UPSTREAMHASH=$(git rev-parse master@{upstream}) + + if [ "$HEADHASH" = "$UPSTREAMHASH" ]; then + echo -e "Current branch is up to date with origin/master. No update needed." + cd .. + continue + fi + + git add --all + git stash save "Pre-update: $(date '+%Y-%m-%d %H:%M:%S')" + + git reset --hard && git clean -dfx + + git pull + makepkg -scCi + cd .. +done diff --git a/awesome/.config/awesome/README.md b/awesome/.config/awesome/README.md new file mode 100644 index 0000000..1b1bc48 --- /dev/null +++ b/awesome/.config/awesome/README.md @@ -0,0 +1,26 @@ +# Awesome WM custom config + +## configuration + +Edit [config.json](./config.json). + +### config.theme + +- "powerarrow-dark" (recommended) +- "blackburn" +- "copland" +- "dremora" +- "holo" +- "multicolor" +- "powerarrow" +- "rainbow" +- "steamburn" +- "vertex" + +### tags + +#### base + +`Array` + +name of the tags created when awesomewm starts \ No newline at end of file diff --git a/awesome/.config/awesome/buttons/client.lua b/awesome/.config/awesome/buttons/client.lua new file mode 100644 index 0000000..d8c4300 --- /dev/null +++ b/awesome/.config/awesome/buttons/client.lua @@ -0,0 +1,27 @@ +local gears = require("gears") + +return gears.table.join( + awful.button( + {}, + 1, + function(c) + c:emit_signal("request::activate", "mouse_click", {raise = true}) + end + ), + awful.button( + {modkey}, + 1, + function(c) + c:emit_signal("request::activate", "mouse_click", {raise = true}) + awful.mouse.client.move(c) + end + ), + awful.button( + {modkey}, + 3, + function(c) + c:emit_signal("request::activate", "mouse_click", {raise = true}) + awful.mouse.client.resize(c) + end + ) +) \ No newline at end of file diff --git a/awesome/.config/awesome/buttons/root.lua b/awesome/.config/awesome/buttons/root.lua new file mode 100644 index 0000000..542bd11 --- /dev/null +++ b/awesome/.config/awesome/buttons/root.lua @@ -0,0 +1,11 @@ +return tableCompat.join( + awful.button( + {}, + 3, + function() + awful.util.mymainmenu:toggle() + end + ), + awful.button({}, 4, awful.tag.viewnext), + awful.button({}, 5, awful.tag.viewprev) +) diff --git a/awesome/.config/awesome/buttons/tags.lua b/awesome/.config/awesome/buttons/tags.lua new file mode 100644 index 0000000..783a07d --- /dev/null +++ b/awesome/.config/awesome/buttons/tags.lua @@ -0,0 +1,42 @@ +return tableCompat.join( + awful.button( + {}, + 1, + function(t) + t:view_only() + end + ), + awful.button( + {modkey}, + 1, + function(t) + if client.focus then + client.focus:move_to_tag(t) + end + end + ), + awful.button({}, 3, awful.tag.viewtoggle), + awful.button( + {modkey}, + 3, + function(t) + if client.focus then + client.focus:toggle_tag(t) + end + end + ), + awful.button( + {}, + 4, + function(t) + awful.tag.viewnext(t.screen) + end + ), + awful.button( + {}, + 5, + function(t) + awful.tag.viewprev(t.screen) + end + ) +) diff --git a/awesome/.config/awesome/buttons/tasks.lua b/awesome/.config/awesome/buttons/tasks.lua new file mode 100644 index 0000000..c4e2685 --- /dev/null +++ b/awesome/.config/awesome/buttons/tasks.lua @@ -0,0 +1,61 @@ +return tableCompat.join( + awful.button( + {}, + 1, + function(c) + if c == client.focus then + c.minimized = true + else + --c:emit_signal("request::activate", "tasklist", {raise = true}) + + -- Without this, the following + -- :isvisible() makes no sense + c.minimized = false + if not c:isvisible() and c.first_tag then + c.first_tag:view_only() + end + -- This will also un-minimize + -- the client, if needed + client.focus = c + c:raise() + end + end + ), + awful.button( + {}, + 2, + function(c) + c:kill() + end + ), + awful.button( + {}, + 3, + function() + local instance = nil + + return function() + if instance and instance.wibox.visible then + instance:hide() + instance = nil + else + instance = awful.menu.clients({theme = {width = dpi(250)}}) + end + end + end + ), + awful.button( + {}, + 4, + function() + awful.client.focus.byidx(1) + end + ), + awful.button( + {}, + 5, + function() + awful.client.focus.byidx(-1) + end + ) +) \ No newline at end of file diff --git a/awesome/.config/awesome/config.json b/awesome/.config/awesome/config.json new file mode 100644 index 0000000..4dd803d --- /dev/null +++ b/awesome/.config/awesome/config.json @@ -0,0 +1,22 @@ +{ + "default": { + "terminal": "terminator", + "browser": "firefox", + "guieditor": "code", + "scrlocker": "physlock", + "editor": "vim" + }, + "keys": { + "mod": "Mod4", + "alt": "Mod1" + }, + "theme": "powerarrow-dark", + "tags": { + "base": ["🔍", "💻", "{}", "📖", "💬"] + }, + "menu": { + "mouseOnly": false + }, + "xdgAutostart": false, + "debug": false +} diff --git a/awesome/.config/awesome/copycats b/awesome/.config/awesome/copycats new file mode 160000 index 0000000..203d1c7 --- /dev/null +++ b/awesome/.config/awesome/copycats @@ -0,0 +1 @@ +Subproject commit 203d1c72cddbf79ead038d5c5af6a14d7a1833b2 diff --git a/awesome/.config/awesome/freedesktop b/awesome/.config/awesome/freedesktop new file mode 160000 index 0000000..6951b09 --- /dev/null +++ b/awesome/.config/awesome/freedesktop @@ -0,0 +1 @@ +Subproject commit 6951b09b9813a8c98c9927d8b1f78b710b8c993c diff --git a/awesome/.config/awesome/json.lua b/awesome/.config/awesome/json.lua new file mode 100644 index 0000000..9d6a4c8 --- /dev/null +++ b/awesome/.config/awesome/json.lua @@ -0,0 +1,18 @@ +local json = require("jsonlua.json") -- TODO: use luarocks + +json.load = function(path) + local contents = "" + local myTable = {} + local file = io.open( path, "r" ) + + if file then + -- read all contents of file into a string + local contents = file:read( "*a" ) + myTable = json.decode(contents); + io.close( file ) + return myTable + end + return nil +end + +return json \ No newline at end of file diff --git a/awesome/.config/awesome/jsonlua b/awesome/.config/awesome/jsonlua new file mode 160000 index 0000000..69b714a --- /dev/null +++ b/awesome/.config/awesome/jsonlua @@ -0,0 +1 @@ +Subproject commit 69b714ad2b7a848a16e1efb06496e02953cf1507 diff --git a/awesome/.config/awesome/keyboard/client.lua b/awesome/.config/awesome/keyboard/client.lua new file mode 100644 index 0000000..353e6e0 --- /dev/null +++ b/awesome/.config/awesome/keyboard/client.lua @@ -0,0 +1,71 @@ +local lain = require("lain") + +return tableCompat.join( + awful.key({altkey, "Shift"}, "m", lain.util.magnify_client, {description = "magnify client", group = "client"}), + awful.key( + {modkey}, + "f", + function(c) + c.fullscreen = not c.fullscreen + c:raise() + end, + {description = "toggle fullscreen", group = "client"} + ), + awful.key( + {modkey, "Shift"}, + "c", + function(c) + c:kill() + end, + {description = "close", group = "client"} + ), + awful.key( + {modkey, "Control"}, + "space", + awful.client.floating.toggle, + {description = "toggle floating", group = "client"} + ), + awful.key( + {modkey, "Control"}, + "Return", + function(c) + c:swap(awful.client.getmaster()) + end, + {description = "move to master", group = "client"} + ), + awful.key( + {modkey}, + "o", + function(c) + c:move_to_screen() + end, + {description = "move to screen", group = "client"} + ), + awful.key( + {modkey}, + "t", + function(c) + c.ontop = not c.ontop + end, + {description = "toggle keep on top", group = "client"} + ), + awful.key( + {modkey}, + "n", + function(c) + -- The client currently has the input focus, so it cannot be + -- minimized, since minimized clients can't have the focus. + c.minimized = true + end, + {description = "minimize", group = "client"} + ), + awful.key( + {modkey}, + "m", + function(c) + c.maximized = not c.maximized + c:raise() + end, + {description = "maximize", group = "client"} + ) +) \ No newline at end of file diff --git a/awesome/.config/awesome/keyboard/global/alsa-volume.lua b/awesome/.config/awesome/keyboard/global/alsa-volume.lua new file mode 100644 index 0000000..befd019 --- /dev/null +++ b/awesome/.config/awesome/keyboard/global/alsa-volume.lua @@ -0,0 +1,49 @@ +local beautiful = require("beautiful") + +return tableCompat.join( + awful.key( + {}, + "XF86AudioRaiseVolume", + function() + os.execute(string.format("amixer -q set %s 1%%+", beautiful.volume.channel)) + beautiful.volume.update() + end, + {description = "volume up", group = "hotkeys"} + ), + awful.key( + {}, + "XF86AudioLowerVolume", + function() + os.execute(string.format("amixer -q set %s 1%%-", beautiful.volume.channel)) + beautiful.volume.update() + end, + {description = "volume down", group = "hotkeys"} + ), + awful.key( + {}, + "XF86AudioMute", + function() + os.execute(string.format("amixer -q set %s toggle", beautiful.volume.togglechannel or beautiful.volume.channel)) + beautiful.volume.update() + end, + {description = "toggle mute", group = "hotkeys"} + ), + awful.key( + {altkey}, + "XF86AudioRaiseVolume", + function() + os.execute(string.format("amixer -q set %s 100%%", beautiful.volume.channel)) + beautiful.volume.update() + end, + {description = "volume 100%", group = "hotkeys"} + ), + awful.key( + {altkey}, + "XF86AudioLowerVolume", + function() + os.execute(string.format("amixer -q set %s 0%%", beautiful.volume.channel)) + beautiful.volume.update() + end, + {description = "volume 0%", group = "hotkeys"} + ) +) \ No newline at end of file diff --git a/awesome/.config/awesome/keyboard/global/apps.lua b/awesome/.config/awesome/keyboard/global/apps.lua new file mode 100644 index 0000000..227e502 --- /dev/null +++ b/awesome/.config/awesome/keyboard/global/apps.lua @@ -0,0 +1,70 @@ +return tableCompat.join( + awful.key( + {modkey}, + "Return", + function() + awful.spawn(terminal) + end, + {description = "open a terminal", group = "apps"} + ), + -- User programs + awful.key( + {modkey}, + "q", + function() + awful.spawn(browser) + end, + {description = "run browser", group = "apps"} + ), + awful.key( + {modkey}, + "a", + function() + awful.spawn(guieditor) + end, + {description = "run gui editor", group = "apps"} + ), + -- zotero + awful.key( + {modkey}, + "z", + function() + awful.spawn("zotero") + end, + {description = "zotero", group = "apps"} + ), + -- screen capture GUI + awful.key( + {modkey, altkey}, + "r", + function() + awful.spawn("peek", { + floating = true, + focus = true, + titlebars_enabled = false, + maximized = true + }) + end, + {description = "screen recording", group = "apps"} + ), + -- Writing + awful.key( + {modkey}, + "g", + function() + awful.spawn("ghostwriter") + end, + {description = "screen recording", group = "apps"} + ), + awful.key( + {modkey, "Shift"}, + "#" .. 9 + 9, + function() + awful.spawn(browser) + awful.spawn(guieditor) + awful.spawn(terminal) + awful.spawn("ghostwriter") + end, + {description = "open all favorite apps", group = "apps"} + ) +) diff --git a/awesome/.config/awesome/keyboard/global/awesome.lua b/awesome/.config/awesome/keyboard/global/awesome.lua new file mode 100644 index 0000000..00ff6ef --- /dev/null +++ b/awesome/.config/awesome/keyboard/global/awesome.lua @@ -0,0 +1,29 @@ +local hotkeys_popup = require("awful.hotkeys_popup").widget + +return tableCompat.join( + awful.key({modkey}, "s", hotkeys_popup.show_help, {description = "show help", group = "awesome"}), + awful.key({modkey, "Control"}, "r", awesome.restart, {description = "reload awesome", group = "awesome"}), + awful.key({modkey, "Shift"}, "q", awesome.quit, {description = "quit awesome", group = "awesome"}), + -- Show/Hide Wibox + awful.key( + {modkey}, + "b", + function() + for s in screen do + s.mywibox.visible = not s.mywibox.visible + if s.mybottomwibox then + s.mybottomwibox.visible = not s.mybottomwibox.visible + end + end + end, + {description = "toggle wibox", group = "awesome"} + ), + awful.key( + {modkey}, + "w", + function() + awful.util.mymainmenu:show() + end, + {description = "show main menu", group = "awesome"} + ) +) diff --git a/awesome/.config/awesome/keyboard/global/client-focus.lua b/awesome/.config/awesome/keyboard/global/client-focus.lua new file mode 100644 index 0000000..01f4216 --- /dev/null +++ b/awesome/.config/awesome/keyboard/global/client-focus.lua @@ -0,0 +1,105 @@ +return tableCompat.join( + awful.key( + {modkey, "Shift"}, + "j", + function() + awful.client.swap.byidx(1) + end, + {description = "swap with next client by index", group = "client"} + ), + awful.key( + {modkey, "Shift"}, + "k", + function() + awful.client.swap.byidx(-1) + end, + {description = "swap with previous client by index", group = "client"} + ), + awful.key({modkey}, "u", awful.client.urgent.jumpto, {description = "jump to urgent client", group = "client"}), + awful.key( + {modkey}, + "Tab", + function() + awful.client.focus.history.previous() + if client.focus then + client.focus:raise() + end + end, + {description = "go back", group = "client"} + ), + awful.key( + {modkey, "Control"}, + "n", + function() + local c = awful.client.restore() + -- Focus restored client + if c then + client.focus = c + c:raise() + end + end, + {description = "restore minimized", group = "client"} + ), + -- Default client focus + awful.key( + {altkey}, + "j", + function() + awful.client.focus.byidx(1) + end, + {description = "focus next by index", group = "client"} + ), + awful.key( + {altkey}, + "k", + function() + awful.client.focus.byidx(-1) + end, + {description = "focus previous by index", group = "client"} + ), + -- By direction client focus + awful.key( + {modkey}, + "j", + function() + awful.client.focus.global_bydirection("down") + if client.focus then + client.focus:raise() + end + end, + {description = "focus down", group = "client"} + ), + awful.key( + {modkey}, + "k", + function() + awful.client.focus.global_bydirection("up") + if client.focus then + client.focus:raise() + end + end, + {description = "focus up", group = "client"} + ), + awful.key( + {modkey}, + "h", + function() + awful.client.focus.global_bydirection("left") + if client.focus then + client.focus:raise() + end + end, + {description = "focus left", group = "client"} + ), + awful.key( + {modkey}, + "l", + function() + awful.client.focus.global_bydirection("right") + if client.focus then + client.focus:raise() + end + end, + {description = "focus right", group = "client"} + ) +) \ No newline at end of file diff --git a/awesome/.config/awesome/keyboard/global/dynamic-tagging.lua b/awesome/.config/awesome/keyboard/global/dynamic-tagging.lua new file mode 100644 index 0000000..dbb31e5 --- /dev/null +++ b/awesome/.config/awesome/keyboard/global/dynamic-tagging.lua @@ -0,0 +1,44 @@ +local lain = require("lain") + +return tableCompat.join( + awful.key( + {modkey, "Shift"}, + "n", + function() + lain.util.add_tag() + end, + {description = "add new tag", group = "dynamic tagging"} + ), + awful.key( + {modkey, "Shift"}, + "r", + function() + lain.util.rename_tag() + end, + {description = "rename tag", group = "dynamic tagging"} + ), + awful.key( + {modkey, "Shift"}, + "Left", + function() + lain.util.move_tag(-1) + end, + {description = "move tag to the left", group = "dynamic tagging"} + ), + awful.key( + {modkey, "Shift"}, + "Right", + function() + lain.util.move_tag(1) + end, + {description = "move tag to the right", group = "dynamic tagging"} + ), + awful.key( + {modkey, "Shift"}, + "d", + function() + lain.util.delete_tag() + end, + {description = "delete tag", group = "dynamic tagging"} + ) +) diff --git a/awesome/.config/awesome/keyboard/global/hotkeys.lua b/awesome/.config/awesome/keyboard/global/hotkeys.lua new file mode 100644 index 0000000..f0664c1 --- /dev/null +++ b/awesome/.config/awesome/keyboard/global/hotkeys.lua @@ -0,0 +1,72 @@ +return tableCompat.join( + -- Take a screenshot + -- https://github.com/lcpz/dots/blob/master/bin/screenshot + awful.key( + {}, + "Print", + function() + awful.spawn.with_shell("scrot ~/screenshots/%Y-%m-%d-%T.png") + end, + {description = "take a screenshot", group = "hotkeys"} + ), + -- X screen locker + awful.key( + {altkey, "Control"}, + "l", + function() + os.execute(scrlocker) + end, + {description = "lock screen", group = "hotkeys"} + ), + -- Brightness + awful.key( + {}, + "XF86MonBrightnessUp", + function() + os.execute("xbacklight -inc 5") + end, + {description = "+5%", group = "hotkeys"} + ), + awful.key( + {}, + "XF86MonBrightnessDown", + function() + os.execute("xbacklight -dec 5") + end, + {description = "-5%", group = "hotkeys"} + ), + awful.key( + {modkey}, + "XF86MonBrightnessUp", + function() + os.execute("xbacklight = 100") + end, + {description = "highest brightness", group = "hotkeys"} + ), + awful.key( + {modkey}, + "XF86MonBrightnessDown", + function() + os.execute("xbacklight = 1") + end, + {description = "lowest brightness", group = "hotkeys"} + ), + -- Copy primary to clipboard (terminals to gtk) + awful.key( + {modkey}, + "c", + function() + awful.spawn.with_shell("xsel | xsel -i -b") + end, + {description = "copy terminal to gtk", group = "hotkeys"} + ), + -- Copy clipboard to primary (gtk to terminals) + awful.key( + {modkey}, + "v", + function() + awful.spawn.with_shell("xsel -b | xsel") + end, + {description = "copy gtk to terminal", group = "hotkeys"} + ) +) \ No newline at end of file diff --git a/awesome/.config/awesome/keyboard/global/index.lua b/awesome/.config/awesome/keyboard/global/index.lua new file mode 100644 index 0000000..c0570ad --- /dev/null +++ b/awesome/.config/awesome/keyboard/global/index.lua @@ -0,0 +1,32 @@ +local hotkeys_popup = require("awful.hotkeys_popup").widget +local lain = require("lain") +local beautiful = require("beautiful") +local gears = require("gears") + +local alsaVolume = require("keyboard.global.alsa-volume") +local apps = require("keyboard.global.apps") +local awesome = require("keyboard.global.awesome") +local clientFocus = require("keyboard.global.client-focus") +local dynamicTaging = require("keyboard.global.dynamic-tagging") +local hotkeys = require("keyboard.global.hotkeys") +local layoutManipulation = require("keyboard.global.layout-manipulation") +local mpdControl = require("keyboard.global.mpd-control") +local numKeys = require("keyboard.global.num-keys") +local prompt = require("keyboard.global.prompt") +local tagBrowsing = require("keyboard.global.tag-browsing") +local widgets = require("keyboard.global.widgets") + +return tableCompat.join( + alsaVolume, + apps, + awesome, + clientFocus, + dynamicTaging, + hotkeys, + layoutManipulation, + mpdControl, + numKeys, + prompt, + tagBrowsing, + widgets +) diff --git a/awesome/.config/awesome/keyboard/global/layout-manipulation.lua b/awesome/.config/awesome/keyboard/global/layout-manipulation.lua new file mode 100644 index 0000000..96b17db --- /dev/null +++ b/awesome/.config/awesome/keyboard/global/layout-manipulation.lua @@ -0,0 +1,102 @@ +local lain = require("lain") + +return tableCompat.join( + awful.key( + {modkey, "Control"}, + "j", + function() + awful.screen.focus_relative(1) + end, + {description = "focus the next screen", group = "screen"} + ), + awful.key( + {modkey, "Control"}, + "k", + function() + awful.screen.focus_relative(-1) + end, + {description = "focus the previous screen", group = "screen"} + ), + awful.key( + {altkey, "Shift"}, + "l", + function() + awful.tag.incmwfact(0.05) + end, + {description = "increase master width factor", group = "layout"} + ), + awful.key( + {altkey, "Shift"}, + "h", + function() + awful.tag.incmwfact(-0.05) + end, + {description = "decrease master width factor", group = "layout"} + ), + awful.key( + {modkey, "Shift"}, + "h", + function() + awful.tag.incnmaster(1, nil, true) + end, + {description = "increase the number of master clients", group = "layout"} + ), + awful.key( + {modkey, "Shift"}, + "l", + function() + awful.tag.incnmaster(-1, nil, true) + end, + {description = "decrease the number of master clients", group = "layout"} + ), + awful.key( + {modkey, "Control"}, + "h", + function() + awful.tag.incncol(1, nil, true) + end, + {description = "increase the number of columns", group = "layout"} + ), + awful.key( + {modkey, "Control"}, + "l", + function() + awful.tag.incncol(-1, nil, true) + end, + {description = "decrease the number of columns", group = "layout"} + ), + awful.key( + {modkey}, + "space", + function() + awful.layout.inc(1) + end, + {description = "select next", group = "layout"} + ), + awful.key( + {modkey, "Shift"}, + "space", + function() + awful.layout.inc(-1) + end, + {description = "select previous", group = "layout"} + ), + -- On the fly useless gaps change + -- FIXME + awful.key( + {altkey, "Control"}, + "+", + function() + lain.util.useless_gaps_resize(1) + end, + {description = "increment useless gaps", group = "tag"} + ), + awful.key( + {altkey, "Control"}, + "-", + function() + lain.util.useless_gaps_resize(-1) + end, + {description = "decrement useless gaps", group = "tag"} + ) +) diff --git a/awesome/.config/awesome/keyboard/global/mpd-control.lua b/awesome/.config/awesome/keyboard/global/mpd-control.lua new file mode 100644 index 0000000..3e2bbcd --- /dev/null +++ b/awesome/.config/awesome/keyboard/global/mpd-control.lua @@ -0,0 +1,57 @@ +local beautiful = require("beautiful") +local naughty = require("naughty") + +return tableCompat.join( + awful.key( + {altkey, "Control"}, + "Up", + function() + os.execute("mpc toggle") + beautiful.mpd.update() + end, + {description = "mpc toggle", group = "widgets"} + ), + awful.key( + {altkey, "Control"}, + "Down", + function() + os.execute("mpc stop") + beautiful.mpd.update() + end, + {description = "mpc stop", group = "widgets"} + ), + awful.key( + {altkey, "Control"}, + "Left", + function() + os.execute("mpc prev") + beautiful.mpd.update() + end, + {description = "mpc prev", group = "widgets"} + ), + awful.key( + {altkey, "Control"}, + "Right", + function() + os.execute("mpc next") + beautiful.mpd.update() + end, + {description = "mpc next", group = "widgets"} + ), + awful.key( + {altkey}, + "0", + function() + local common = {text = "MPD widget ", position = "top_middle", timeout = 2} + if beautiful.mpd.timer.started then + beautiful.mpd.timer:stop() + common.text = common.text .. lain.util.markup.bold("OFF") + else + beautiful.mpd.timer:start() + common.text = common.text .. lain.util.markup.bold("ON") + end + naughty.notify(common) + end, + {description = "mpc on/off", group = "widgets"} + ) +) diff --git a/awesome/.config/awesome/keyboard/global/num-keys.lua b/awesome/.config/awesome/keyboard/global/num-keys.lua new file mode 100644 index 0000000..7b104a8 --- /dev/null +++ b/awesome/.config/awesome/keyboard/global/num-keys.lua @@ -0,0 +1,75 @@ +local numKeys = {} + +-- Bind all key numbers to tags. +-- Be careful: we use keycodes to make it works on any keyboard layout. +-- This should map on the top row of your keyboard, usually 1 to 9. +for i = 1, 8 do + -- Hack to only show tags 1 and 9 in the shortcut window (mod+s) + local descr_view, descr_toggle, descr_move, descr_toggle_focus + if i == 1 or i == 8 then + descr_view = {description = "view tag #", group = "tag"} + descr_toggle = {description = "toggle tag #", group = "tag"} + descr_move = {description = "move focused client to tag #", group = "tag"} + descr_toggle_focus = {description = "toggle focused client on tag #", group = "tag"} + end + numKeys = + tableCompat.join( + numKeys, + -- View tag only. + awful.key( + {modkey}, + "#" .. i + 9, + function() + local screen = awful.screen.focused() + local tag = screen.tags[i] + if tag then + tag:view_only() + end + end, + descr_view + ), + -- Toggle tag display. + awful.key( + {modkey, "Control"}, + "#" .. i + 9, + function() + local screen = awful.screen.focused() + local tag = screen.tags[i] + if tag then + awful.tag.viewtoggle(tag) + end + end, + descr_toggle + ), + -- Move client to tag. + awful.key( + {modkey, "Shift"}, + "#" .. i + 9, + function() + if client.focus then + local tag = client.focus.screen.tags[i] + if tag then + client.focus:move_to_tag(tag) + end + end + end, + descr_move + ), + -- Toggle tag on focused client. + awful.key( + {modkey, "Control", "Shift"}, + "#" .. i + 9, + function() + if client.focus then + local tag = client.focus.screen.tags[i] + if tag then + client.focus:toggle_tag(tag) + end + end + end, + descr_toggle_focus + ) + ) +end + +return numKeys diff --git a/awesome/.config/awesome/keyboard/global/prompt.lua b/awesome/.config/awesome/keyboard/global/prompt.lua new file mode 100644 index 0000000..b0ffcb5 --- /dev/null +++ b/awesome/.config/awesome/keyboard/global/prompt.lua @@ -0,0 +1,31 @@ +return tableCompat.join( + -- awful.key( + -- {modkey}, + -- "r", + -- function() + -- awful.screen.focused().mypromptbox:run() + -- end, + -- {description = "run prompt", group = "run"} + -- ), + awful.key( + {modkey}, + "r", + function() + os.execute("rofi -combi-modi window,drun -show combi -modi combi -show-icons") + end, + {description = "app launcher", group = "run"} + ), + awful.key( + {modkey}, + "x", + function() + awful.prompt.run { + prompt = "Run Lua code: ", + textbox = awful.screen.focused().mypromptbox.widget, + exe_callback = awful.util.eval, + history_path = awful.util.get_cache_dir() .. "/history_eval" + } + end, + {description = "lua execute prompt", group = "run"} + ) +) diff --git a/awesome/.config/awesome/keyboard/global/tag-browsing.lua b/awesome/.config/awesome/keyboard/global/tag-browsing.lua new file mode 100644 index 0000000..bc51976 --- /dev/null +++ b/awesome/.config/awesome/keyboard/global/tag-browsing.lua @@ -0,0 +1,25 @@ +local lain = require("lain") +local naughty = require("naughty") + +return tableCompat.join( + awful.key({modkey}, "Left", awful.tag.viewprev, {description = "view previous", group = "tag"}), + awful.key({modkey}, "Right", awful.tag.viewnext, {description = "view next", group = "tag"}), + awful.key({modkey}, "Escape", awful.tag.history.restore, {description = "go back", group = "tag"}), + -- Non-empty tag browsing + awful.key( + {altkey}, + "Left", + function() + lain.util.tag_view_nonempty(-1) + end, + {description = "view previous nonempty", group = "tag"} + ), + awful.key( + {altkey}, + "Right", + function() + lain.util.tag_view_nonempty(1) + end, + {description = "view previous nonempty", group = "tag"} + ) +) \ No newline at end of file diff --git a/awesome/.config/awesome/keyboard/global/widgets.lua b/awesome/.config/awesome/keyboard/global/widgets.lua new file mode 100644 index 0000000..a161697 --- /dev/null +++ b/awesome/.config/awesome/keyboard/global/widgets.lua @@ -0,0 +1,33 @@ +return tableCompat.join( + -- Widgets popups + awful.key( + {altkey}, + "c", + function() + if beautiful.cal then + beautiful.cal.show(7) + end + end, + {description = "show calendar", group = "widgets"} + ), + awful.key( + {altkey}, + "h", + function() + if beautiful.fs then + beautiful.fs.show(7) + end + end, + {description = "show filesystem", group = "widgets"} + ), + awful.key( + {altkey}, + "w", + function() + if beautiful.weather then + beautiful.weather.show(7) + end + end, + {description = "show weather", group = "widgets"} + ) +) \ No newline at end of file diff --git a/awesome/.config/awesome/lain b/awesome/.config/awesome/lain new file mode 160000 index 0000000..f1964b4 --- /dev/null +++ b/awesome/.config/awesome/lain @@ -0,0 +1 @@ +Subproject commit f1964b40e49dff92abdff97b7bd0408435ed589f diff --git a/awesome/.config/awesome/menu.lua b/awesome/.config/awesome/menu.lua new file mode 100644 index 0000000..0796c7e --- /dev/null +++ b/awesome/.config/awesome/menu.lua @@ -0,0 +1,42 @@ +local freedesktop = require("freedesktop") +local hotkeys_popup = require("awful.hotkeys_popup").widget +local beautiful = require("beautiful") +local dpi = require("beautiful.xresources").apply_dpi + +local myawesomemenu = { + { + "hotkeys", + function() + return false, hotkeys_popup.show_help + end + }, + {"manual", terminal .. " -e man awesome"}, + {"edit config", string.format("%s -e %s %s", terminal, editor, awesome.conffile)}, + {"restart", awesome.restart}, + { + "quit", + function() + awesome.quit() + end + } +} + +awful.util.mymainmenu = + freedesktop.menu.build( + { + icon_size = beautiful.menu_height or dpi(16), + before = { + {"Awesome", myawesomemenu, beautiful.awesome_icon} + -- other triads can be put here + }, + after = { + {"Open terminal", terminal} + -- other triads can be put here + } + } +) + +if (config.menu.mouseOnly) then + -- hide menu when mouse leaves it + awful.util.mymainmenu.wibox:connect_signal("mouse::leave", function() awful.util.mymainmenu:hide() end) +end \ No newline at end of file diff --git a/awesome/.config/awesome/rc.lua b/awesome/.config/awesome/rc.lua new file mode 100644 index 0000000..2de047b --- /dev/null +++ b/awesome/.config/awesome/rc.lua @@ -0,0 +1,136 @@ +local awesome, client, mouse, screen, tag = awesome, client, mouse, screen, tag +local ipairs, string, os, table, tostring, tonumber, type = ipairs, string, os, table, tostring, tonumber, type + +awful = require("awful") + +require("awful.autofocus") +require("awful.hotkeys_popup.keys") + +local gears = require("gears") +local beautiful = require("beautiful") +local lain = require("lain") +local hotkeys_popup = require("awful.hotkeys_popup").widget +local naughty = require("naughty") +local dpi = require("beautiful.xresources").apply_dpi +local json = require("json") + +tableCompat = awful.util.table or gears.table -- 4.{0,1} compatibility + +---------------- GLOBAL config ---------------- + +config = json.load(os.getenv("HOME") .. "/.config/awesome/config.json") + +modkey = config.keys.mod +altkey = config.keys.alt +userDebug = config.debug + +terminal = config.default.terminal +editor = os.getenv("EDITOR") or config.default.editor +browser = config.default.browser +guieditor = config.default.guieditor +scrlocker = config.default.scrlocker + +---------------- Error handling ---------------- + +-- Check if awesome encountered an error during startup and fell back to +-- another config (This code will only ever execute for the fallback config) +if awesome.startup_errors then + naughty.notify( + { + preset = naughty.config.presets.critical, + title = "Oops, there were errors during startup!", + text = awesome.startup_errors + } + ) +end + +-- Handle runtime errors after startup +do + local in_error = false + awesome.connect_signal( + "debug::error", + function(err) + if in_error then + return + end + in_error = true + + naughty.notify( + { + preset = naughty.config.presets.critical, + title = "Oops, an error happened!", + text = tostring(err) + } + ) + in_error = false + end + ) +end + +---------------- Autostart windowless processes ---------------- + +-- This function will run once every time Awesome is started +local function run_once(cmd_arr) + for _, cmd in ipairs(cmd_arr) do + awful.spawn.with_shell(string.format("pgrep -u $USER -fx '%s' > /dev/null || (%s)", cmd, cmd)) + end +end + +run_once({"urxvtd", "unclutter -root"}) -- entries must be separated by commas + +if (config.xdgAutostart) then + -- This function implements the XDG autostart specification + awful.spawn.with_shell( + 'if (xrdb -query | grep -q "^awesome\\.started:\\s*true$"); then exit; fi;' .. + 'xrdb -merge <<< "awesome.started:true";' .. + -- list each of your autostart commands, followed by ; inside single quotes, followed by .. + 'dex --environment Awesome --autostart --search-paths "$XDG_CONFIG_DIRS/autostart:$XDG_CONFIG_HOME/autostart"' -- https://github.com/jceb/dex + ) +end + +---------------- Layouts ---------------- + +awful.layout.layouts = { + awful.layout.suit.tile, + awful.layout.suit.tile.top, + awful.layout.suit.floating, + awful.layout.suit.max, + awful.layout.suit.max.fullscreen, + awful.layout.suit.tile.left + -- see https://awesomewm.org/apidoc/libraries/awful.layout.html#awful.layout.suit. + -- and https://github.com/lcpz/lain/wiki/Layouts +} + +---------------- Theme ---------------- + +awful.util.terminal = terminal +awful.util.tagnames = config.tags.base + +awful.util.taglist_buttons = require("buttons.tags") +awful.util.tasklist_buttons = require("buttons.tasks") + +local chosen_theme = config.theme + +beautiful.init(string.format("%s/.config/awesome/copycats/themes/%s/theme.lua", os.getenv("HOME"), chosen_theme)) + +---------------- + +require("menu") + +require("screen") + +-- mouse bindings +local globalButtons = require("buttons.root") +root.buttons(globalButtons) + +-- key bindings +local globalKeys = require("keyboard.global.index") +root.keys(globalKeys) + +-- Rules to apply to new clients (through the "manage" signal). +awful.rules.rules = require("rules") + +require("signals") + +-- possible workaround for tag preservation when switching back to default screen: +-- https://github.com/lcpz/awesome-copycats/issues/251 diff --git a/awesome/.config/awesome/rules.lua b/awesome/.config/awesome/rules.lua new file mode 100644 index 0000000..c190382 --- /dev/null +++ b/awesome/.config/awesome/rules.lua @@ -0,0 +1,65 @@ +local beautiful = require("beautiful") +local clientkeys = require("keyboard.client") +local clientbuttons = require("buttons.client") + +return { + -- All clients will match this rule. + { + rule = {}, + properties = { + border_width = beautiful.border_width, + border_color = beautiful.border_normal, + focus = awful.client.focus.filter, + raise = true, + keys = clientkeys, + buttons = clientbuttons, + screen = awful.screen.preferred, + placement = awful.placement.no_overlap + awful.placement.no_offscreen, + size_hints_honor = false + } + }, + -- Titlebars + { + rule_any = {type = {"dialog", "normal"}}, + properties = {titlebars_enabled = true} + }, + { + rule = {class = "Gimp", role = "gimp-image-window"}, + properties = {maximized = true} + }, + -- map clients to tag + { + rule_any = {class = {"firefox", "Google-chrome"} }, + properties = { tag = "🔍"} + }, + { + rule = {class = "Code"}, + properties = { tag = "{}"} + }, + { + rule_any = {class = {"ghostwriter"} }, + properties = { tag = "📖"} + }, + { + rule_any = {class = {"Terminator", "Hyper"} }, + properties = { tag = "💻"} + }, + { + rule_any = {class = { "Slack", "Signal"} }, + properties = { tag = "💬"} + }, + { + rule_any = {class = { "Zotero"} }, + properties = { tag = "📖"} + }, + -- floating clients + { + rule = {class = "firefox", role = "PictureInPicture"}, + properties = { + floating = true, + placement = awful.placement.bottom_left, + titlebars_enabled = true, + tags = awful.screen.focused().tags + } + } +} diff --git a/awesome/.config/awesome/screen.lua b/awesome/.config/awesome/screen.lua new file mode 100644 index 0000000..758b73f --- /dev/null +++ b/awesome/.config/awesome/screen.lua @@ -0,0 +1,40 @@ +local gears = require("gears") +local beautiful = require("beautiful") + +-- Re-set wallpaper when a screen's geometry changes (e.g. different resolution) +screen.connect_signal( + "property::geometry", + function(s) + -- Wallpaper + if beautiful.wallpaper then + local wallpaper = beautiful.wallpaper + -- If wallpaper is a function, call it with the screen + if type(wallpaper) == "function" then + wallpaper = wallpaper(s) + end + gears.wallpaper.centered(wallpaper, s) + end + end +) + +-- No borders when rearranging only 1 non-floating or maximized client +screen.connect_signal( + "arrange", + function(s) + local only_one = #s.tiled_clients == 1 + for _, c in pairs(s.clients) do + if only_one and not c.floating or c.maximized then + c.border_width = 0 + else + c.border_width = beautiful.border_width + end + end + end +) + +-- Create a wibox for each screen and add it +awful.screen.connect_for_each_screen( + function(s) + beautiful.at_screen_connect(s) + end +) diff --git a/awesome/.config/awesome/signals.lua b/awesome/.config/awesome/signals.lua new file mode 100644 index 0000000..1c3a977 --- /dev/null +++ b/awesome/.config/awesome/signals.lua @@ -0,0 +1,123 @@ +local dpi = require("beautiful.xresources").apply_dpi +local beautiful = require("beautiful") +local wibox = require("wibox") +local naughty = require("naughty") + +-- Signal function to execute when a new client appears. +client.connect_signal( + "manage", + function(c) + -- Set the windows at the slave, + -- i.e. put it at the end of others instead of setting it master. + if not awesome.startup then awful.client.setslave(c) end + + if awesome.startup and not c.size_hints.user_position and not c.size_hints.program_position then + -- Prevent clients from being unreachable after screen count changes. + awful.placement.no_offscreen(c) + end + + -- DEBUG: show client class + if userDebug then + naughty.notify({ + title = "DEBUG: client connected", + text = "class: " .. c.class .. "\ninstance: " .. (c.instance or "nil") .. "\nrole: " .. (c.role or "nil"), + timeout = 20 + }) + end + end +) + +-- Add a titlebar if titlebars_enabled is set to true in the rules. +client.connect_signal( + "request::titlebars", + function(c) + -- Custom + if beautiful.titlebar_fun then + beautiful.titlebar_fun(c) + return + end + + -- Default + -- buttons for the titlebar + local buttons = + tableCompat.join( + awful.button( + {}, + 1, + function() + c:emit_signal("request::activate", "titlebar", {raise = true}) + awful.mouse.client.move(c) + end + ), + awful.button( + {}, + 2, + function() + c:kill() + end + ), + awful.button( + {}, + 3, + function() + c:emit_signal("request::activate", "titlebar", {raise = true}) + awful.mouse.client.resize(c) + end + ) + ) + + awful.titlebar(c, {size = dpi(12)}):setup { + { + -- Left + awful.titlebar.widget.iconwidget(c), + buttons = buttons, + layout = wibox.layout.fixed.horizontal + }, + { + -- Middle + buttons = buttons, + layout = wibox.layout.flex.horizontal + }, + { + -- Right + awful.titlebar.widget.floatingbutton(c), + awful.titlebar.widget.maximizedbutton(c), + awful.titlebar.widget.stickybutton(c), + awful.titlebar.widget.ontopbutton(c), + awful.titlebar.widget.closebutton(c), + layout = wibox.layout.fixed.horizontal() + }, + layout = wibox.layout.align.horizontal + } + end +) + +-- Enable sloppy focus, so that focus follows mouse. +client.connect_signal( + "mouse::enter", + function(c) + c:emit_signal("request::activate", "mouse_enter", {raise = true}) + end +) + +client.connect_signal( + "focus", + function(c) + c.border_color = beautiful.border_focus + end +) +client.connect_signal( + "unfocus", + function(c) + c.border_color = beautiful.border_normal + end +) + +client.disconnect_signal("request::geometry", awful.ewmh.client_geometry_requests) +client.connect_signal("request::geometry", function(c, context, hints) + if c.class == "Emoji-keyboard" then + c:move_to_screen(awful.screen.focused()) + hints = awful.placement.centered(c) + end + awful.ewmh.client_geometry_requests(c, context, hints) +end) diff --git a/code-extensions.list b/code-extensions.list new file mode 100644 index 0000000..49679af --- /dev/null +++ b/code-extensions.list @@ -0,0 +1,40 @@ +bashmish.es6-string-css +bierner.emojisense +bierner.github-markdown-preview +bierner.markdown-checkbox +bierner.markdown-emoji +bierner.markdown-preview-github-styles +bierner.markdown-yaml-preamble +CodeStream.codestream +CoenraadS.bracket-pair-colorizer +DavidAnson.vscode-markdownlint +dbaeumer.vscode-eslint +DotJoshJohnson.xml +eamodio.gitlens +EditorConfig.EditorConfig +eg2.vscode-npm-script +esbenp.prettier-vscode +GitHub.vscode-pull-request-github +HookyQR.JSDocTagComplete +johnpapa.vscode-peacock +karigari.chat +keyring.Lua +lostintangent.vsls-pomodoro +lostintangent.vsls-whiteboard +mechatroner.rainbow-csv +mousetraps.selected-character-count +ms-vscode.vscode-typescript-tslint-plugin +ms-vsliveshare.vsliveshare +msjsdiag.debugger-for-chrome +naumovs.color-highlight +Perkovec.emoji +PKief.material-icon-theme +plievone.vscode-template-literal-editor +ryanluker.vscode-coverage-gutters +stkb.rewrap +streetsidesoftware.code-spell-checker +streetsidesoftware.code-spell-checker-french +thenikso.github-plus-theme +Tobermory.es6-string-html +trixnz.vscode-lua +Zignd.html-css-class-completion diff --git a/dell-xps-issues.md b/dell-xps-issues.md new file mode 100644 index 0000000..3bd2917 --- /dev/null +++ b/dell-xps-issues.md @@ -0,0 +1,26 @@ +# Dell XPS issues + +## Chrome & Electron Apps freeze + +``` +$ dmesg -T +[ven. juil. 12 08:49:47 2019] [drm:intel_pipe_update_end [i915]] *ERROR* Atomic update failure on pipe A (start=14710 end=14711) time 133 us, min 1073, max 1079, scanline start 1071, end 1080 +[ven. juil. 12 08:51:50 2019] [drm:intel_pipe_update_end [i915]] *ERROR* Atomic update failure on pipe A (start=22086 end=22087) time 110 us, min 1073, max 1079, scanline start 1072, end 1073 +[ven. juil. 12 08:59:13 2019] audit: type=1130 audit(1562914754.090:52): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-tmpfiles-clean comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success' +[ven. juil. 12 08:59:13 2019] audit: type=1131 audit(1562914754.090:53): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-tmpfiles-clean comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success' +``` + +Links: +- https://bbs.archlinux.org/viewtopic.php?id=233230 +- https://wiki.archlinux.org/index.php/kernel_mode_setting +- https://wiki.archlinux.org/index.php/Intel_graphics#Enable_GuC_/_HuC_firmware_loading + +``` +# vim /etc/modprobe.d/i915.conf +options i915 enable_guc=2 +``` + +``` +# cat /sys/kernel/debug/dri/0/i915_huc_load_status +# cat /sys/kernel/debug/dri/0/i915_guc_load_status +``` \ No newline at end of file diff --git a/desktop/.config/mimeapps.list b/desktop/.config/mimeapps.list new file mode 100644 index 0000000..5d02c1b --- /dev/null +++ b/desktop/.config/mimeapps.list @@ -0,0 +1,11 @@ +[Added Associations] + +[Default Applications] +x-scheme-handler/ssh=Hyper.desktop +text/html=google-chrome.desktop +x-scheme-handler/http=google-chrome.desktop +x-scheme-handler/https=google-chrome.desktop +x-scheme-handler/about=google-chrome.desktop +x-scheme-handler/unknown=google-chrome.desktop +x-scheme-handler/webcal=google-chrome.desktop +inode/directory=thunar.desktop diff --git a/desktop/.local/share/applications/README.md b/desktop/.local/share/applications/README.md new file mode 100644 index 0000000..1d6b122 --- /dev/null +++ b/desktop/.local/share/applications/README.md @@ -0,0 +1,9 @@ +A bunch of this files refer to PWAs installed with google-chrome-unstable. + +The associated configuration isn't in this repository for obvious privacy and security reasons. In order to use those, you'll need to: +1. open chrome and go the the associated website (ex: https://web.dev) +2. install the PWA (using the associated button, menu entry or install banner) +3. go the `chrome://apps` +4. right click on the PWA and select 'create shortcuts' +5. replace the app-id by the one you'll find in the new desktop entry in `.local/share/applications/chrome--Default.desktop` +5. delete this new desktop entry \ No newline at end of file diff --git a/desktop/.local/share/applications/chrome-com.desktop b/desktop/.local/share/applications/chrome-com.desktop new file mode 100644 index 0000000..6156b1b --- /dev/null +++ b/desktop/.local/share/applications/chrome-com.desktop @@ -0,0 +1,8 @@ +#!/usr/bin/env xdg-open +[Desktop Entry] +Version=1.0 +Terminal=false +Type=Application +Name=Com +Exec=/opt/google/chrome/google-chrome --new-window https://messages.google.com/web/conversations https://mail.google.com/mail/u/0/ https://mail.google.com/mail/u/1/ https://calendar.google.com/calendar/b/0/ https://github.com/notifications https://www.linkedin.com/feed/ https://www.facebook.com/messages/ +Icon=google-chrome diff --git a/desktop/.local/share/applications/google-messages.desktop b/desktop/.local/share/applications/google-messages.desktop new file mode 100644 index 0000000..0d8c784 --- /dev/null +++ b/desktop/.local/share/applications/google-messages.desktop @@ -0,0 +1,9 @@ +#!/usr/bin/env xdg-open +[Desktop Entry] +Version=1.0 +Terminal=false +Type=Application +Name=Messages +Exec=/opt/google/chrome/google-chrome --profile-directory=Default --app-id=hpfldicfbfomlpcikngkocigghgafkph +Icon=chrome-hpfldicfbfomlpcikngkocigghgafkph-Default +StartupWMClass=crx_hpfldicfbfomlpcikngkocigghgafkph diff --git a/desktop/.local/share/applications/netflix.desktop b/desktop/.local/share/applications/netflix.desktop new file mode 100644 index 0000000..5b25812 --- /dev/null +++ b/desktop/.local/share/applications/netflix.desktop @@ -0,0 +1,8 @@ +#!/usr/bin/env xdg-open +[Desktop Entry] +Version=1.0 +Terminal=false +Type=Application +Name=Netflix +Exec=/opt/google/chrome/google-chrome --app=https://www.netflix.com/ +Icon=google-chrome diff --git a/desktop/.local/share/applications/new-doc.desktop b/desktop/.local/share/applications/new-doc.desktop new file mode 100644 index 0000000..eeff1db --- /dev/null +++ b/desktop/.local/share/applications/new-doc.desktop @@ -0,0 +1,8 @@ +#!/usr/bin/env xdg-open +[Desktop Entry] +Version=1.0 +Terminal=false +Type=Application +Name=New Doc +Exec=/opt/google/chrome/google-chrome --app=https://doc.new +Icon=chrome-bojccfnmcnekjgjhcaklmcgofnngpjcl-Default diff --git a/desktop/.local/share/applications/new-sheet.desktop b/desktop/.local/share/applications/new-sheet.desktop new file mode 100644 index 0000000..d714b2f --- /dev/null +++ b/desktop/.local/share/applications/new-sheet.desktop @@ -0,0 +1,8 @@ +#!/usr/bin/env xdg-open +[Desktop Entry] +Version=1.0 +Terminal=false +Type=Application +Name=New Sheet +Exec=/opt/google/chrome/google-chrome --app=https://sheet.new +Icon=chrome-albjknpbljlpmmpfjicdohagjcifagdi-Default diff --git a/desktop/.local/share/applications/twitter.desktop b/desktop/.local/share/applications/twitter.desktop new file mode 100644 index 0000000..7cc5fe2 --- /dev/null +++ b/desktop/.local/share/applications/twitter.desktop @@ -0,0 +1,9 @@ +#!/usr/bin/env xdg-open +[Desktop Entry] +Version=1.0 +Terminal=false +Type=Application +Name=Twitter +Exec=/opt/google/chrome/google-chrome --profile-directory=Default --app-id=jgeocpdicgmkeemopbanhokmhcgcflmi +Icon=chrome-jgeocpdicgmkeemopbanhokmhcgcflmi-Default +StartupWMClass=crx_jgeocpdicgmkeemopbanhokmhcgcflmi diff --git a/desktop/.local/share/applications/youtube.desktop b/desktop/.local/share/applications/youtube.desktop new file mode 100644 index 0000000..151004e --- /dev/null +++ b/desktop/.local/share/applications/youtube.desktop @@ -0,0 +1,9 @@ +#!/usr/bin/env xdg-open +[Desktop Entry] +Version=1.0 +Terminal=false +Type=Application +Name=YouTube +Exec=/opt/google/chrome/google-chrome --profile-directory=Default --app-id=blpcfgokakmgnkcojhhkbfbldkacnbeo +Icon=chrome-blpcfgokakmgnkcojhhkbfbldkacnbeo-Default +StartupWMClass=crx_blpcfgokakmgnkcojhhkbfbldkacnbeo diff --git a/etc/X11/xorg.conf.d/00-keyboard.conf b/etc/X11/xorg.conf.d/00-keyboard.conf new file mode 100644 index 0000000..fb50bcf --- /dev/null +++ b/etc/X11/xorg.conf.d/00-keyboard.conf @@ -0,0 +1,8 @@ +Section "InputClass" + Identifier "system-keyboard" + MatchIsKeyboard "on" + Option "XkbLayout" "fr" + Option "XkbModel" "pc105" + Option "XkbVariant" "oss" +# Option "XkbOptions" "grp:ctrl_shift_space_toggle" +EndSection diff --git a/etc/X11/xorg.conf.d/20-intel.conf b/etc/X11/xorg.conf.d/20-intel.conf new file mode 100644 index 0000000..3cc7607 --- /dev/null +++ b/etc/X11/xorg.conf.d/20-intel.conf @@ -0,0 +1,6 @@ +Section "Device" + Identifier "Intel Graphics" + Driver "intel" + Option "TearFree" "true" + Option "AccelMethod" "uxa" +EndSection diff --git a/etc/fonts/conf.avail/75-noto-color-emoji.conf b/etc/fonts/conf.avail/75-noto-color-emoji.conf new file mode 100644 index 0000000..e4f4b0d --- /dev/null +++ b/etc/fonts/conf.avail/75-noto-color-emoji.conf @@ -0,0 +1,181 @@ + + + + + + + + emoji + + + Noto Color Emoji + + + + + + + sans + + + Noto Color Emoji + + + + + + serif + + + Noto Color Emoji + + + + + + sans-serif + + + Noto Color Emoji + + + + + + monospace + + + Noto Color Emoji + + + + + + + + + Symbola + + + + + + + + + Apple Color Emoji + + + Noto Color Emoji + + + + + + DejaVu Sans + + + Noto Color Emoji + + + + + + Segoe UI Emoji + + + Noto Color Emoji + + + + + + Segoe UI Symbol + + + Noto Color Emoji + + + + + + Android Emoji + + + Noto Color Emoji + + + + + + Twitter Color Emoji + + + Noto Color Emoji + + + + + + Twemoji + + + Noto Color Emoji + + + + + + Twemoji Mozilla + + + Noto Color Emoji + + + + + + TwemojiMozilla + + + Noto Color Emoji + + + + + + EmojiTwo + + + Noto Color Emoji + + + + + + Emoji Two + + + Noto Color Emoji + + + + + + EmojiSymbols + + + Noto Color Emoji + + + + + + Symbola + + + Noto Color Emoji + + + + diff --git a/etc/lightdm/lightdm.conf b/etc/lightdm/lightdm.conf new file mode 100644 index 0000000..e3870b7 --- /dev/null +++ b/etc/lightdm/lightdm.conf @@ -0,0 +1,171 @@ +# +# General configuration +# +# start-default-seat = True to always start one seat if none are defined in the configuration +# greeter-user = User to run greeter as +# minimum-display-number = Minimum display number to use for X servers +# minimum-vt = First VT to run displays on +# lock-memory = True to prevent memory from being paged to disk +# user-authority-in-system-dir = True if session authority should be in the system location +# guest-account-script = Script to be run to setup guest account +# logind-check-graphical = True to on start seats that are marked as graphical by logind +# log-directory = Directory to log information to +# run-directory = Directory to put running state in +# cache-directory = Directory to cache to +# sessions-directory = Directory to find sessions +# remote-sessions-directory = Directory to find remote sessions +# greeters-directory = Directory to find greeters +# backup-logs = True to move add a .old suffix to old log files when opening new ones +# dbus-service = True if LightDM provides a D-Bus service to control it +# +[LightDM] +#start-default-seat=true +#greeter-user=lightdm +#minimum-display-number=0 +#minimum-vt=7 # Setting this to a value < 7 implies security issues, see FS#46799 +#lock-memory=true +#user-authority-in-system-dir=false +#guest-account-script=guest-account +#logind-check-graphical=false +#log-directory=/var/log/lightdm +run-directory=/run/lightdm +#cache-directory=/var/cache/lightdm +#sessions-directory=/usr/share/lightdm/sessions:/usr/share/xsessions:/usr/share/wayland-sessions +#remote-sessions-directory=/usr/share/lightdm/remote-sessions +#greeters-directory=$XDG_DATA_DIRS/lightdm/greeters:$XDG_DATA_DIRS/xgreeters +#backup-logs=true +#dbus-service=true + +# +# Seat configuration +# +# Seat configuration is matched against the seat name glob in the section, for example: +# [Seat:*] matches all seats and is applied first. +# [Seat:seat0] matches the seat named "seat0". +# [Seat:seat-thin-client*] matches all seats that have names that start with "seat-thin-client". +# +# type = Seat type (local, xremote, unity) +# pam-service = PAM service to use for login +# pam-autologin-service = PAM service to use for autologin +# pam-greeter-service = PAM service to use for greeters +# xserver-backend = X backend to use (mir) +# xserver-command = X server command to run (can also contain arguments e.g. X -special-option) +# xmir-command = Xmir server command to run (can also contain arguments e.g. Xmir -special-option) +# xserver-config = Config file to pass to X server +# xserver-layout = Layout to pass to X server +# xserver-allow-tcp = True if TCP/IP connections are allowed to this X server +# xserver-share = True if the X server is shared for both greeter and session +# xserver-hostname = Hostname of X server (only for type=xremote) +# xserver-display-number = Display number of X server (only for type=xremote) +# xdmcp-manager = XDMCP manager to connect to (implies xserver-allow-tcp=true) +# xdmcp-port = XDMCP UDP/IP port to communicate on +# xdmcp-key = Authentication key to use for XDM-AUTHENTICATION-1 (stored in keys.conf) +# unity-compositor-command = Unity compositor command to run (can also contain arguments e.g. unity-system-compositor -special-option) +# unity-compositor-timeout = Number of seconds to wait for compositor to start +# greeter-session = Session to load for greeter +# greeter-hide-users = True to hide the user list +# greeter-allow-guest = True if the greeter should show a guest login option +# greeter-show-manual-login = True if the greeter should offer a manual login option +# greeter-show-remote-login = True if the greeter should offer a remote login option +# user-session = Session to load for users +# allow-user-switching = True if allowed to switch users +# allow-guest = True if guest login is allowed +# guest-session = Session to load for guests (overrides user-session) +# session-wrapper = Wrapper script to run session with +# greeter-wrapper = Wrapper script to run greeter with +# guest-wrapper = Wrapper script to run guest sessions with +# display-setup-script = Script to run when starting a greeter session (runs as root) +# display-stopped-script = Script to run after stopping the display server (runs as root) +# greeter-setup-script = Script to run when starting a greeter (runs as root) +# session-setup-script = Script to run when starting a user session (runs as root) +# session-cleanup-script = Script to run when quitting a user session (runs as root) +# autologin-guest = True to log in as guest by default +# autologin-user = User to log in with by default (overrides autologin-guest) +# autologin-user-timeout = Number of seconds to wait before loading default user +# autologin-session = Session to load for automatic login (overrides user-session) +# autologin-in-background = True if autologin session should not be immediately activated +# exit-on-failure = True if the daemon should exit if this seat fails +# +[Seat:*] +#type=local +#pam-service=lightdm +#pam-autologin-service=lightdm-autologin +#pam-greeter-service=lightdm-greeter +#xserver-backend= +#xserver-command=X +#xmir-command=Xmir +#xserver-config= +#xserver-layout= +#xserver-allow-tcp=false +#xserver-share=true +#xserver-hostname= +#xserver-display-number= +#xdmcp-manager= +#xdmcp-port=177 +#xdmcp-key= +#unity-compositor-command=unity-system-compositor +#unity-compositor-timeout=60 +greeter-session=lightdm-gtk-greeter +#greeter-session=lightdm-webkit2-greeter +#greeter-session=web-greeter +#greeter-hide-users=false +#greeter-allow-guest=true +#greeter-show-manual-login=false +#greeter-show-remote-login=true +#user-session=default +#allow-user-switching=true +#allow-guest=true +#guest-session= +session-wrapper=/etc/lightdm/Xsession +#greeter-wrapper= +#guest-wrapper= +#display-setup-script= +#display-stopped-script= +#greeter-setup-script= +#session-setup-script= +#session-cleanup-script= +#autologin-guest=false +#autologin-user= +#autologin-user-timeout=0 +#autologin-in-background=false +#autologin-session= +#exit-on-failure=false + +# +# XDMCP Server configuration +# +# enabled = True if XDMCP connections should be allowed +# port = UDP/IP port to listen for connections on +# listen-address = Host/address to listen for XDMCP connections (use all addresses if not present) +# key = Authentication key to use for XDM-AUTHENTICATION-1 or blank to not use authentication (stored in keys.conf) +# hostname = Hostname to report to XDMCP clients (defaults to system hostname if unset) +# +# The authentication key is a 56 bit DES key specified in hex as 0xnnnnnnnnnnnnnn. Alternatively +# it can be a word and the first 7 characters are used as the key. +# +[XDMCPServer] +#enabled=false +#port=177 +#listen-address= +#key= +#hostname= + +# +# VNC Server configuration +# +# enabled = True if VNC connections should be allowed +# command = Command to run Xvnc server with +# port = TCP/IP port to listen for connections on +# listen-address = Host/address to listen for VNC connections (use all addresses if not present) +# width = Width of display to use +# height = Height of display to use +# depth = Color depth of display to use +# +[VNCServer] +#enabled=false +#command=Xvnc +#port=5900 +#listen-address= +#width=1024 +#height=768 +#depth=8 diff --git a/etc/locale.conf b/etc/locale.conf new file mode 100644 index 0000000..102bd62 --- /dev/null +++ b/etc/locale.conf @@ -0,0 +1,8 @@ +## TODO: use english as the system language but keep other FR requirements + +# Spécifier fr par défaut +LANG="fr_FR.UTF-8" +# Préférer l'anglais à la langue par défaut si la traduction fr n'existe pas +LANGUAGE="fr_FR:en_US" +# Mais garder un tri par déut +LC_COLLATE=C diff --git a/git/.gitconfig b/git/.gitconfig new file mode 100644 index 0000000..90906e4 --- /dev/null +++ b/git/.gitconfig @@ -0,0 +1,57 @@ +[user] +# Please adapt and uncomment the following lines: + name = Nwel + email = nweldev@users.noreply.github.com + +[log] + date = iso + +[format] + #pretty = format:%C(yellow)%h %Cblue%>(14)%ad %Cgreen%<(15)%aN%Cred%d %Creset%s + +[alias] + + # Beautiful logs + # from http://stackoverflow.com/questions/1057564/pretty-git-branch-graphs + # this aliases are useless when using oh-my-zsh git plugin instead + + # quick look at all repo + # loggsa = log --color --date-order --graph --pretty=format:'%C(yellow)%h %Cgreen%aN%Cred%d %Creset%s' --decorate --simplify-by-decoration --all + # quick look at active branch (or refs pointed) + # loggs = log --color --date-order --graph --oneline --decorate --simplify-by-decoration + # extend look at all repo + # logga = log --color --date-order --graph --oneline --decorate --all + # #extend look at active branch + # logg = log --color --date-order --graph --oneline --decorate + # #Look with date + # logda = log --color --date-order --date=local --graph --format=\"%C(auto)%h%Creset %C(blue bold)%ad%Creset %C(auto)%d%Creset %s\" --all + # logd = log --color --date-order --date=local --graph --format=\"%C(auto)%h%Creset %C(blue bold)%ad%Creset %C(auto)%d%Creset %s\" + # #Look with relative date + # logdra = log --color --date-order --graph --format=\"%C(auto)%h%Creset %C(blue bold)%ar%Creset %C(auto)%d%Creset %s\" --all + # logdr = log --color --date-order --graph --format=\"%C(auto)%h%Creset %C(blue bold)%ar%Creset %C(auto)%d%Creset %s\" + + permission-reset = !git diff -p -R | grep -E \"^(diff|(old|new) mode)\" | git apply + + renameTag = "!sh -c 'set -e;git tag $2 $1; git tag -d $1;git push origin :refs/tags/$1;git push --tags' -" + +[push] + default = simple + +[diff] + tool = default-difftool + +[difftool] + prompt = false + +[difftool "default-difftool"] + cmd = code --wait --diff $LOCAL $REMOTE + +[core] + editor = code --wait + eol = lf + autocrlf = input +[pull] + rebase = false +[init] + defaultBranch = main + autoSquash = true diff --git a/hyper.js/.hyper.js b/hyper.js/.hyper.js new file mode 100644 index 0000000..a425257 --- /dev/null +++ b/hyper.js/.hyper.js @@ -0,0 +1,153 @@ +// Future versions of Hyper may add additional config options, +// which will not automatically be merged into this file. +// See https://hyper.is#cfg for all currently supported options. + +const isDemo = false; + +const plugins = ['hyperminimal']; + +if (isDemo) { + plugins.push('hyper-one-light'); +} + +module.exports = { + config: { + // choose either `'stable'` for receiving highly polished, + // or `'canary'` for less polished but more frequent updates + updateChannel: 'stable', + + // default font size in pixels for all tabs + fontSize: isDemo ? 32 : 14, + + // font family with optional fallbacks + fontFamily: '"Fira Code", Menlo, "DejaVu Sans Mono", Consolas, "Lucida Console", monospace', + + // default font weight: 'normal' or 'bold' + fontWeight: 'normal', + + // font weight for bold characters: 'normal' or 'bold' + fontWeightBold: 'bold', + + // terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk) + cursorColor: 'rgba(248,28,229,0.8)', + + // terminal text color under BLOCK cursor + cursorAccentColor: '#000', + + // `'BEAM'` for |, `'UNDERLINE'` for _, `'BLOCK'` for █ + cursorShape: 'BLOCK', + + // set to `true` (without backticks and without quotes) for blinking cursor + cursorBlink: false, + + // color of the text + foregroundColor: '#fff', + + // terminal background color + // opacity is only supported on macOS + backgroundColor: '#000', + + // terminal selection color + selectionColor: 'rgba(248,28,229,0.3)', + + // border color (window, tabs) + borderColor: '#333', + + // custom CSS to embed in the main window + css: '', + + // custom CSS to embed in the terminal window + termCSS: '', + + // if you're using a Linux setup which show native menus, set to false + // default: `true` on Linux, `true` on Windows, ignored on macOS + showHamburgerMenu: '', + + // set to `false` (without backticks and without quotes) if you want to hide the minimize, maximize and close buttons + // additionally, set to `'left'` if you want them on the left, like in Ubuntu + // default: `true` (without backticks and without quotes) on Windows and Linux, ignored on macOS + showWindowControls: '', + + // custom padding (CSS format, i.e.: `top right bottom left`) + padding: '12px 14px', + + // the full list. if you're going to provide the full color palette, + // including the 6 x 6 color cubes and the grayscale map, just provide + // an array here instead of a color map object + colors: { + black: '#000000', + red: '#C51E14', + green: '#1DC121', + yellow: '#C7C329', + blue: '#0A2FC4', + magenta: '#C839C5', + cyan: '#20C5C6', + white: '#C7C7C7', + lightBlack: '#686868', + lightRed: '#FD6F6B', + lightGreen: '#67F86F', + lightYellow: '#FFFA72', + lightBlue: '#6A76FB', + lightMagenta: '#FD7CFC', + lightCyan: '#68FDFE', + lightWhite: '#FFFFFF', + }, + + // the shell to run when spawning a new session (i.e. /usr/local/bin/fish) + // if left empty, your system's login shell will be used by default + // + // Windows + // - Make sure to use a full path if the binary name doesn't work + // - Remove `--login` in shellArgs + // + // Bash on Windows + // - Example: `C:\\Windows\\System32\\bash.exe` + // + // PowerShell on Windows + // - Example: `C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe` + shell: '', + + // for setting shell arguments (i.e. for using interactive shellArgs: `['-i']`) + // by default `['--login']` will be used + shellArgs: ['--login'], + + // for environment variables + env: {}, + + // set to `false` for no bell + bell: 'SOUND', + + // if `true` (without backticks and without quotes), selected text will automatically be copied to the clipboard + copyOnSelect: false, + + // if `true` (without backticks and without quotes), hyper will be set as the default protocol client for SSH + defaultSSHApp: true, + + // if `true` (without backticks and without quotes), on right click selected text will be copied or pasted if no + // selection is present (`true` by default on Windows and disables the context menu feature) + // quickEdit: true, + + // URL to custom bell + // bellSoundURL: 'http://example.com/bell.mp3', + + // for advanced config flags please refer to https://hyper.is/#cfg + }, + + // a list of plugins to fetch and install from npm + // format: [@org/]project[#version] + // examples: + // `hyperpower` + // `@company/project` + // `project#1.0.1` + plugins, + + // in development, you can create a directory under + // `~/.hyper_plugins/local/` and include it here + // to load it and avoid it being `npm install`ed + localPlugins: [], + + keymaps: { + // Example + // 'window:devtools': 'cmd+alt+o', + }, +}; diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..3addcbe --- /dev/null +++ b/install.sh @@ -0,0 +1,85 @@ +echo "You should check the install.sh file and modify it first." +exit 1 + +## Packages + +sudo pacman -Sy $(cat packages.dsv | cut -d' ' -f1) + +# X Window System +sudo pacman -S awesome xorg-xbacklight xorg-xmodmap +# CLI utils +sudo pacman -S xclip hub openssh vim sudo stow zsh autojump physlock +# WiFi +sudo pacman -S wpa_supplicant dialog iw elinks +# Fonts +sudo pacman -S powerline-fonts otf-fira-code noto-fonts-emoji +# HyperJS +sudo pacman -S libicns graphicsmagick xz yarn +# Sound +sudo pacman -S alsa-utils playerctl +# LightDM +sudo pacman -S lightdm lightdm-gtk-greeter +# Bluetooth (bluetoothctl) +sudo pacman -S bluez bluez-utils + +# NVM git install +stow nvm +cd nvm +. nvm.sh +cd .. + +# don't install yarn with pacman as it would install nodejs +sudo pacman -S yarn hyper --assume-installed nodejs=12.3.0 + +# install vs code extensions +cat code-extensions.list | xargs -L 1 echo code --install-extension + +## system config + +sudo ln -sf $PWD/etc/fonts/conf.avail/75-noto-color-emoji.conf /etc/fonts/conf.d/ +sudo ln -sf $PWD/etc/X11/xorg.conf.d/00-keyboard.conf /etc/X11/xorg.conf.d/ +sudo ln -sf $PWD/etc/X11/xorg.conf.d/20-intel.conf /etc/X11/xorg.conf.d/ +sudo ln -sf $PWD/etc/locale.conf /etc/ +sudo ln -sf $PWD/etc/lightdm/lightdm.conf /etc/lightdm + +## Services + +# disable Manjaro NetworkManager +sudo systemctl disable --now NetworkManager.service +sudo systemctl enable --now dhcpcd.service + +sudo systemctl enable netctl-auto@interface.service +# enable a profile (in /etc/netctl/, maybe create with wifi-menu) to start at boot +# sudo netctl enable my-profile +sudo systemctl enable lightdm.service + +## link user dotfiles +# this project should be clones in $HOME/dotfiles + +stow awesome +stow git +stow hyper.js +stow vsconf +stow zsh +stow arandr +stow nvm +stow vim +stow scripts + +## user services + +systemctl --user enable sleepprompt +systemctl --user enable sleepprompt.timer + +## Tools + +# unmute master with 'm' key +alsamixer +# configure WiFi +sudo wifi-menu +# check installed packages +grep -i installed /var/log/pacman.log + +## run awesome in a nested X server for tests +## ctrl+shift to capture keyboard and mouse +Xephyr :5 & sleep 1 ; DISPLAY=:5 awesome diff --git a/log.sh b/log.sh new file mode 100644 index 0000000..e9419b2 --- /dev/null +++ b/log.sh @@ -0,0 +1,3 @@ +pacman -Qen > packages.dsv +pacman -Qm > aur.dsv +code --list-extensions > code-extensions.list diff --git a/nvm/.nvm b/nvm/.nvm new file mode 160000 index 0000000..8fbf8ab --- /dev/null +++ b/nvm/.nvm @@ -0,0 +1 @@ +Subproject commit 8fbf8ab6943d0bcb402773c3c2b30c2f103d7fa2 diff --git a/packages.dsv b/packages.dsv new file mode 100644 index 0000000..0e804d9 --- /dev/null +++ b/packages.dsv @@ -0,0 +1,244 @@ +accountsservice 0.6.55-1 +acpi 1.7-2 +acpid 2.0.32-1 +alsa-firmware 1.0.29-2 +alsa-utils 1.1.9-1 +amd-ucode 20191022.2b016af-1 +android-tools 29.0.5-1 +android-udev 20191103-1 +appimagelauncher 2.0.3-1 +arandr 0.1.10-3 +autoconf 2.69-5 +automake 1.16.1-1 +autorandr 1.8.1-1 +avahi 0.7+18+g1b5f401-2 +b43-fwcutter 019-2 +bash 5.0.011-1 +binutils 2.33.1-1 +bison 3.4.2-1 +bluez 5.52-1 +bluez-utils 5.52-1 +btrfs-progs 5.3.1-1 +bzip2 1.0.8-3 +catfish 1.4.10-1 +coreutils 8.31-3 +cpupower 5.3-1 +crda 4.14-2 +cronie 1.5.5-1 +cryptsetup 2.2.1-1.1 +device-mapper 2.02.186-2 +dex 0.8.0-2 +dhclient 4.4.1-4 +dhcpcd 8.1.1-2 +dialog 1:1.3_20190808-1 +diffutils 3.7-2 +dmraid 1.0.0.rc16.3-11 +dnsmasq 2.80-4 +dosfstools 4.1-2 +downgrade 6.2.1-1 +e2fsprogs 1.45.4-1 +ecryptfs-utils 111-3 +efibootmgr 16-1 +exfat-utils 1.3.0-1 +f2fs-tools 1.13.0-1 +fakeroot 1.24-1 +feh 3.2.1-1 +ffmpeg 1:4.2.1-4 +ffmpegthumbnailer 2.2.2-1 +file 5.37-3 +file-roller 3.32.2-1 +filesystem 2019.10-3 +findutils 4.7.0-2 +firefox 70.0.1-1 +flameshot 0.6.0-3 +flex 2.6.4-2 +galculator 2.1.4-4 +gawk 5.0.1-2 +gcc 9.2.0-4 +gcc-libs 9.2.0-4 +gettext 0.20.1-2 +gimp 2.10.14-1 +gksu-polkit 0.0.3-2 +glibc 2.30-2 +gnome-keyring 1:3.34.0-2 +graphicsmagick 1.3.33-2 +grep 3.3-2 +groff 1.22.4-1 +grub 2.04-7 +grub-theme-manjaro 18.1-1 +gst-libav 1.16.1-1 +gst-plugins-bad 1.16.1-4 +gst-plugins-base 1.16.1-1 +gst-plugins-good 1.16.1-1 +gst-plugins-ugly 1.16.1-2 +gtk3-classic 3.24.12-1 +gvfs 1.42.1-1 +gvfs-afc 1.42.1-1 +gvfs-gphoto2 1.42.1-1 +gvfs-mtp 1.42.1-1 +gvfs-nfs 1.42.1-1 +gvfs-smb 1.42.1-1 +gzip 1.10-2 +haveged 1.9.8-1 +hibernator 0.5-1 +htop 2.2.0-2 +hub 2.13.0-1 +hunspell 1.7.0-2 +hyper 3.0.2-1 +hyphen 2.8.8-2 +i3-scrot 2-2 +inetutils 1.9.4-7 +intel-ucode 20191112-1 +inxi 3.0.36-1 +iproute2 5.3.0-1 +iptables 1:1.8.3-1 +iputils 20190709-1 +ipw2100-fw 1.3-9 +ipw2200-fw 3.1-7 +jfsutils 1.1.15-6 +kvantum-manjaro 0.13.5-1 +less 551-2 +libappindicator-gtk3 12.10.0-13 +libdvdcss 1.4.2-1 +libgsf 1.14.46+3+g7f927f0-1 +libicns 0.8.1-6 +libopenraw 0.1.3-1 +libreoffice-fresh 6.3.2-2 +libtool 2.4.6+42+gb88cebd5-6 +libva-mesa-driver 19.2.4-0.1 +libva-vdpau-driver 0.7.4-4 +licenses 20191011-1 +light-locker 1.8.0-2 +lightdm 1:1.30.0-2 +lightdm-slick-greeter 1.2.7-1 +linux-firmware 20191022.2b016af-1 +linux419 4.19.84-1 +logrotate 3.15.1-1 +lsb-release 1.4-13 +lvm2 2.02.186-2 +lxterminal 0.3.2-1 +m4 1.4.18-2 +make 4.2.1-3 +man-db 2.9.0-1 +man-pages 5.03-1 +manjaro-awesome-settings-18.0 20190508-1 +manjaro-browser-settings 20181222-1 +manjaro-firmware 20160419-1 +manjaro-hotfixes 2018.08-6 +manjaro-pulse 2012.11-1 +manjaro-release 18.1.3-1 +manjaro-settings-manager 0.5.6-3 +manjaro-system 20190429-1 +manjaro-zsh-config 0.11-1 +mate-polkit 1.22.0-1 +mdadm 4.1-1 +memtest86+ 5.01-3 +mesa-vdpau 19.2.4-0.1 +mhwd 0.6.3-1 +mhwd-db 0.6.3-13 +mkinitcpio-openswap 0.1.0-2 +mlocate 0.26.git.20170220-1 +modemmanager 1.12.0-1 +mousepad 0.4.2-2 +mtpfs 1.1-3 +nano 4.5-1 +netctl 1.20-1 +network-manager-applet 1.8.24-1 +networkmanager 1.20.6-1 +networkmanager-openconnect 1.2.6-1 +networkmanager-openvpn 1.8.10-1 +networkmanager-pptp 1.2.9dev+10+gb41b0d0-1 +networkmanager-vpnc 1.2.7dev+20+gdca3aea-1 +nfs-utils 2.4.1-2 +noto-fonts-emoji 20191016-1 +nss-mdns 0.14.1-1 +ntfs-3g 2017.3.23-3 +openresolv 3.9.2-1 +os-prober 1.77-1 +otf-fira-code 2-1 +p7zip 16.02-5 +pa-applet 1.0.2-3 +pacman 5.2.1-1 +pamac-gtk 9.1.0-2 +patch 2.7.6-7 +pavucontrol 1:4.0-1 +pciutils 3.6.2-1 +perl 5.30.0-3 +perl-file-mimeinfo 0.29-2 +physlock 13-1 +pkgconf 1.6.3-2 +playerctl 2.0.2-2 +powerline-fonts 2.7-3 +procps-ng 3.3.15-1.2 +psmisc 23.2-1 +pulseaudio-ctl 1.67-1 +pulseaudio-zeroconf 13.0-2 +python-dbus 1.2.10-1 +qt5ct 0.41-1 +reiserfsprogs 3.6.27-2 +ristretto 0.10.0-2 +rofi 1.5.4-1 +rsync 3.1.3-1 +s-nail 14.9.15-1 +sed 4.7-2 +shadow 4.7-2 +solaar 1.0.1-2 +spectre-meltdown-checker 0.42-1 +stow 2.3.1-2 +sudo 1.8.29-1 +sysfsutils 2.1.0-10 +systemd 242.153-1 +systemd-fsck-silent 239-1 +systemd-sysvcompat 242.153-1 +tar 1.32-2 +terminator 1.91-6 +texinfo 6.7-1 +thunar-archive-plugin-gtk3 2019.08.15-1 +thunar-gtk3 2019.08.15-1 +thunar-volman-gtk3 2019.08.15-1 +tlp 1.2.2-1.1 +tumbler 0.2.7-1 +udiskie 1.7.7-1 +udisks2 2.8.4-1 +ufw 0.36-1 +unace 2.5-10 +unrar 1:5.8.3-1 +usb_modeswitch 2.5.2-1 +usbutils 012-1 +util-linux 2.34-3 +vi 1:070224-3 +vim 8.1.2268-1 +vulkan-intel 19.2.4-0.1 +vulkan-radeon 19.2.4-0.1 +wget 1.20.3-2 +which 2.21-4 +wpa_supplicant 2:2.9-1 +xcape 1.2-3 +xclip 0.13-2 +xdg-su 1.2.3-1 +xdg-user-dirs 0.17-2 +xdg-utils 1.1.3+18+g0547886-2 +xf86-input-elographics 1.4.2-1 +xf86-input-evdev 2.10.6-1 +xf86-input-keyboard 1.9.0-3 +xf86-input-libinput 0.29.0-1 +xf86-input-mouse 1.9.3-1 +xf86-input-void 1.4.1-4 +xf86-video-amdgpu 19.1.0-1 +xf86-video-ati 1:19.1.0-1 +xf86-video-intel 1:2.99.917+893+gbff5eca4-1 +xf86-video-nouveau 1.0.16-1 +xfce4-power-manager-gtk3 2019.08.15-1 +xfce4-settings-gtk3 2019.08.15-1 +xfsprogs 5.2.1-1 +xorg-server 1.20.5-4.1 +xorg-xbacklight 1.2.3-1 +xorg-xev 1.2.3-1 +xorg-xinit 1.4.1-1 +xorg-xprop 1.2.4-1 +xterm 350-1 +yarn 1.19.1-1 +yay 9.4.2-1 +zathura-djvu 0.2.8-1 +zathura-pdf-poppler 0.2.9-1 +zsh 5.7.1-1 diff --git a/rofi/.config/rofi/config.rasi b/rofi/.config/rofi/config.rasi new file mode 100644 index 0000000..cbc5ba5 --- /dev/null +++ b/rofi/.config/rofi/config.rasi @@ -0,0 +1,198 @@ +/** + * ROFI Color theme + * User: Qball + * Copyright: Dave Davenport + */ + +configuration { + modi: "combi,:rofind"; + //combi-modi: "window,drun,\/:rofind,run"; + combi-modi: "window,drun,run"; + me-select-entry: "MouseSecondary"; + me-accept-entry: "MousePrimary"; + scroll-method: 1; + // The display name of this browser + display-ssh: "ssh"; + // The display name of this browser + display-run: "#! "; + // The display name of this browser + display-drun: ""; + // The display name of this browser + display-window: ""; + display-combi: "Go to"; + show-icons: true; +} + + +/** + * User: Qball + * Copyright: Dave Davenport + */ +* { + foreground: #ffeedd; + backlight: #ccffeedd; + background-color: transparent; + dark: #1c1c1c; + // Black + black: #2f343f; + lightblack: #554444; + tlightblack: #554444cc; + // + // Red + red: #cd5c5c; + lightred: #cc5533; + // + // Green + green: #86af80; + lightgreen: #88cc22; + // + // Yellow + yellow: #e8ae5b; + lightyellow: #ffa75d; + // + // Blue + blue: #6495ed; + lightblue: #87ceeb; + // + // Magenta + magenta: #deb887; + lightmagenta: #996600; + // + // Cyan + cyan: #1ABB9B; + tcyan: #ccb0c4de; + lightcyan: #b0c4de; + // + // White + white: #bbaa99; + lightwhite: #ddccbb; + // + // Bold, Italic, Underline + highlight: underline bold #ffffff; + + transparent: rgba(0,0,0,0); + font: "Fira Code Regular 16"; +} +#window { + location: center; + anchor: center; + transparency: "screenshot"; + padding: 10px; + border: 0px; + border-radius: 10px; + color: @magenta; + background-color: @transparent; + spacing: 0; + children: [vertb, mainbox]; + orientation: horizontal; +} + +#mainbox { + spacing: 0; + children: [ inputbar, message, listview ]; +} + +#message { + border-color: @foreground; + border: 0px 2px 2px 2px; +// border-radius: 10px; + padding: 5; + background-color: @tcyan; +} +#message { + font: "xos4 Terminus 10"; + color: @black; +} + +#inputbar { + color: @cyan; + padding: 11px; + background-color: @black; + border: 2px 2px 2px 2px; + border-radius: 30px 30px 0px 0px; + border-color: @foreground; + font: "xos4 Terminus 18"; +} +#entry,prompt,case-indicator { + text-font: inherit; + text-color:inherit; +} +#listview { + padding: 8px; + border-radius: 0px 0px 30px 30px; + border-color: @foreground; + border: 0px 2px 2px 2px; + background-color: #1c1c1ccc; + dynamic: false; + lines: 15; +} +#element { + padding: 3px; + vertical-align: 0.5; +// border: 2px; + border-radius: 4px; + background-color: transparent; + color: @foreground; + font:inherit; +} +#element selected.normal { + background-color: @cyan; +} +#element normal active { + foreground: @lightblue; +} +#element normal urgent { + foreground: @lightred; +} +#element alternate normal { +} +#element alternate active { + foreground: @lightblue; +} +#element alternate urgent { + foreground: @lightred; +} +#element selected active { + background-color: @cyan; + foreground: @dark; +} +#element selected urgent { + background-color: @lightred; + foreground: @dark; +} +#element normal normal { + +} + +#vertb { + expand: false; + children: [ dummy0, sidebar, dummy1 ]; +} +#dummy0, dummy1 { + expand: true; +} + +#sidebar { + expand: false; + orientation: vertical; + spacing: 0px; + border: 0px 0px 0px 0px; +} +#button { + font: "FontAwesome 26"; + padding: 6px; + border: 2px 0px 2px 2px; + border-radius: 4px 0px 0px 4px; + background-color: @tlightblack; + border-color: @foreground; + color: @foreground; + horizontal-align: 0.5; +} +#button selected normal { + color: @dark; + border: 2px 0px 2px 2px; + background-color: @backlight; + border-color: @foreground; +} + +@theme "/usr/share/rofi/themes/DarkBlue.rasi" diff --git a/scripts/.config/systemd/user/sleepprompt.service b/scripts/.config/systemd/user/sleepprompt.service new file mode 100644 index 0000000..b3f2196 --- /dev/null +++ b/scripts/.config/systemd/user/sleepprompt.service @@ -0,0 +1,6 @@ +[Unit] +Description=System Sleep with prompt + +[Service] +Type=oneshot +ExecStart=/home/noel/bin/sleepprompt diff --git a/scripts/.config/systemd/user/sleepprompt.timer b/scripts/.config/systemd/user/sleepprompt.timer new file mode 100644 index 0000000..6ec9122 --- /dev/null +++ b/scripts/.config/systemd/user/sleepprompt.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Prompt for system sleep every day at 21:30 + +[Timer] +# OnCalendar=monday-thursday,sunday 21:30 +OnCalendar=*-*-* 21:30 + +[Install] +WantedBy=timers.target diff --git a/scripts/.config/systemd/user/timers.target.wants/sleepprompt.timer b/scripts/.config/systemd/user/timers.target.wants/sleepprompt.timer new file mode 120000 index 0000000..65a3244 --- /dev/null +++ b/scripts/.config/systemd/user/timers.target.wants/sleepprompt.timer @@ -0,0 +1 @@ +/home/noel/.config/systemd/user/sleepprompt.timer \ No newline at end of file diff --git a/scripts/bin/assets/checkmark.png b/scripts/bin/assets/checkmark.png new file mode 100644 index 0000000..40fc963 Binary files /dev/null and b/scripts/bin/assets/checkmark.png differ diff --git a/scripts/bin/assets/cross.png b/scripts/bin/assets/cross.png new file mode 100644 index 0000000..5230142 Binary files /dev/null and b/scripts/bin/assets/cross.png differ diff --git a/scripts/bin/assets/nx-logo.png b/scripts/bin/assets/nx-logo.png new file mode 100644 index 0000000..afb2e25 Binary files /dev/null and b/scripts/bin/assets/nx-logo.png differ diff --git a/scripts/bin/assets/stop.png b/scripts/bin/assets/stop.png new file mode 100644 index 0000000..1b78ed2 Binary files /dev/null and b/scripts/bin/assets/stop.png differ diff --git a/scripts/bin/nxup b/scripts/bin/nxup new file mode 100755 index 0000000..aba7610 --- /dev/null +++ b/scripts/bin/nxup @@ -0,0 +1,113 @@ +#!/usr/bin/env bash + +set -eE + +trap 'notify-send "Nxup failed" "" --icon="$HOME/bin/assets/cross.png" -u "critical"; paplay /usr/share/sounds/freedesktop/stereo/complete.oga' ERR + +# VERSIONS=(8.9.0 9.0.4 9.1.4 9.2.4 9.3.0 9.4.5 9.5.1 9.6.0 9.7.1 9.8.0 10.0.13 10.1.0 10.2.1 10.3.3 10.4.15 11.0.20 11.1.5 11.2.12 11.3.2 11.4.0 11.5.2 11.6.3 12.0.8 12.1.1 12.2.0 12.3.4) + +if [ $# -eq 0 ]; then + # only majors + VERSIONS=(8.12.11 9.8.0 10.0.13 10.2.1 10.3.3 10.4.15 11.0.20 11.1.5 11.2.12 11.3.2 11.6.3 12.2.0 12.3.4) +else + VERSIONS=( "$@" ) +fi + +show-git() { + echo + echo "--- git ---" + echo $(git log --oneline --decorate -n 1) + git status -s + echo "----------" + echo + read -p "Show diff ? (N/y/t)" -n 1 -r + if [[ $REPLY =~ ^[Yy]$ ]]; then + git diff + elif [[ $REPLY =~ ^[Tt]$ ]]; then + git difftool + fi +} + +notify-and-stop() { + message=${1:?"A message must be specified."} + + notify-send "NX Upgrade" "$message" --icon="$HOME/bin/assets/nx-logo.png" -u critical + paplay /usr/share/sounds/freedesktop/stereo/complete.oga + + echo + read -p "$message (Y/n)" -n 1 -r + if [[ $REPLY =~ ^[Nn]$ ]]; then + exit 2 + fi +} + +migrate() { + TARGET_NX_VERSION=${1:?"The target version must be specified."} + PREV_NX_VERSION=${2:?"The previous version must be specified."} + NX_MINOR_VERSION=${TARGET_NX_VERSION%.*} + + echo + (set -x; nx migrate "@nrwl/workspace@$TARGET_NX_VERSION" --from="@nrwl/workspace@$PREV_NX_VERSION") + + notify-and-stop "Run npm install" + + npm install --legacy-peer-dep + + show-git + notify-and-stop "Commit update" + + git add --all + git commit -m "chore: nx migrate $TARGET_NX_VERSION" + + if [ -f "./migrations.json" ]; then + + echo + (set -x; nx migrate --run-migrations=migrations.json 2>&1 | tee nx-migrate-${NX_MINOR_VERSION//\./-}-0.log) + + show-git + notify-and-stop "Commit current migrations" + + rm -f migrations.json + git add --all + git commit -m "chore: run migration to $NX_MINOR_VERSION" + fi + + (set -x; rm -rf /tmp/tmp-*) +} + +for VERSION in ${VERSIONS[*]}; do + CURRENT_NX_VERSION=$(awk -F \" '/"@nrwl\/workspace": ".+"/ { print $4; exit; }' package.json) + echo "Current Nx Version: $CURRENT_NX_VERSION" + + if [[ "$CURRENT_NX_VERSION" == "$VERSION" ]]; then + echo + echo "skipping $VERSION (same as current version)" + echo + continue + fi + + IFS='.' read -ra currentVersionArray <<< "$CURRENT_NX_VERSION" + IFS='.' read -ra nextVersionArray <<< "$VERSION" + SKIP=false + + for i in ${!currentVersionArray[@]}; do + if [ ${currentVersionArray[i]} -gt ${nextVersionArray[i]} ]; then + SKIP=true + break + elif [ ${currentVersionArray[i]} -lt ${nextVersionArray[i]} ]; then + break + fi + done + + if $SKIP; then + echo + echo "skipping $VERSION (lower than current version)" + echo + continue + fi + + notify-and-stop "Run nx migration $VERSION" + echo + migrate ${VERSION} ${CURRENT_NX_VERSION} +done + diff --git a/scripts/bin/odt2txt b/scripts/bin/odt2txt new file mode 100755 index 0000000..f9a11a7 Binary files /dev/null and b/scripts/bin/odt2txt differ diff --git a/scripts/bin/sleepprompt b/scripts/bin/sleepprompt new file mode 100755 index 0000000..cd2a997 --- /dev/null +++ b/scripts/bin/sleepprompt @@ -0,0 +1,33 @@ +#!/usr/bin/env zsh + +echo "starting sleepprompt..." + +curTime=$(date +"%H:%M") +theTime="5" +unit="m" +longUnit="minutes" + +msg="It's ${curTime}. Time to stop! System will be suspended in ${theTime} ${longUnit}." +increasefactor=$(echo "${theTime}"/100|bc -l) + +echo "sending notification" +notify-send "${msg}" -u critical --icon="$HOME/bin/assets/stop.png" + +echo "showing question prompt" + +( + counter=0 + while [ "$counter" -le 100 ]; do + echo $counter; + sleep "${increasefactor}""${unit}" + counter=$(( $counter + 1 )) + done +) | zenity --progress --text="${msg}" --percentage=0 --auto-close; + +if [ $? = 0 ]; +then + echo "suspending system" + systemctl suspend +else + echo "suspend canceled" +fi diff --git a/scripts/bin/stt b/scripts/bin/stt new file mode 100755 index 0000000..26f553d --- /dev/null +++ b/scripts/bin/stt @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +set -e + +audioDir="${HOME}/Audio" +audioFileName=$(ls -t $audioDir | head -1) +audioFile="${audioDir}/${audioFileName}" +fileName="${audioFileName%.*}" +minAudioFile="/tmp/${fileName}.min.flac" +monoAudioFile="${HOME}/stt/${fileName}.flac" +txtOutput="${HOME}/stt/${fileName}.txt" + +echo $audioFile + +read -p "Is this the right file? [y/N]" -n 1 -r +echo +if [[ $REPLY =~ ^[Yy]$ ]]; then + set +x + sox "$audioFile" "$minAudioFile" silence -l 1 0.1 1% -1 2.0 1% + ffmpeg -i "$minAudioFile" -ac 1 "$monoAudioFile" + gcloud ml speech recognize "$monoAudioFile" --language-code='en-US' --project="en-nlp" --format="value[delimiter='. '](results.alternatives[0].transcript)" > "$txtOutput" +fi diff --git a/update.sh b/update.sh new file mode 100644 index 0000000..e31fe0e --- /dev/null +++ b/update.sh @@ -0,0 +1,36 @@ +## See https://wiki.archlinux.org/index.php/System_maintenance#Upgrading_the_system + +set -e + +# exec > >(tee -i pacman-update.out) +# exec 2>&1 + +# check for orphan packages +pacman -Qtd --info | less + +read -p "Ok with that? [Y/n]" -n 1 -r +if [[ $REPLY =~ ^[Nn]$ ]] +then + exit 1 +fi + +ORPHANS=$(pacman -Qtd | cut -d' ' -f1) + +if [ ! -z "$ORPHANS" ]; then + # remove orphan packages + sudo pacman -R $ORPHANS +fi + +# update +sudo pacman -Syu + +pacman -Qe > packages.dsv + +# update AUR packages +cd aur +bash update.sh + +# check if there is new orphan packages +pacman -Qtd | less + +# check /var/log/pacman.log if needed diff --git a/user/.local/share/fonts/.gitignore b/user/.local/share/fonts/.gitignore new file mode 100644 index 0000000..637df79 --- /dev/null +++ b/user/.local/share/fonts/.gitignore @@ -0,0 +1 @@ +.uuid diff --git a/user/.local/share/fonts/GameofThrones.ttf b/user/.local/share/fonts/GameofThrones.ttf new file mode 100644 index 0000000..dfd047e Binary files /dev/null and b/user/.local/share/fonts/GameofThrones.ttf differ diff --git a/user/.local/share/fonts/GreatVibes-Regular.ttf b/user/.local/share/fonts/GreatVibes-Regular.ttf new file mode 100644 index 0000000..2e01be3 Binary files /dev/null and b/user/.local/share/fonts/GreatVibes-Regular.ttf differ diff --git a/user/.local/share/fonts/LexendDeca-Regular.ttf b/user/.local/share/fonts/LexendDeca-Regular.ttf new file mode 100644 index 0000000..6b42154 Binary files /dev/null and b/user/.local/share/fonts/LexendDeca-Regular.ttf differ diff --git a/user/.local/share/fonts/Me Amanda.ttf b/user/.local/share/fonts/Me Amanda.ttf new file mode 100644 index 0000000..4671240 Binary files /dev/null and b/user/.local/share/fonts/Me Amanda.ttf differ diff --git a/user/.local/share/fonts/ROCCB.ttf b/user/.local/share/fonts/ROCCB.ttf new file mode 100644 index 0000000..d8d30fe Binary files /dev/null and b/user/.local/share/fonts/ROCCB.ttf differ diff --git a/user/.local/share/fonts/SansCulottes.ttf b/user/.local/share/fonts/SansCulottes.ttf new file mode 100644 index 0000000..2b14075 Binary files /dev/null and b/user/.local/share/fonts/SansCulottes.ttf differ diff --git a/user/.local/share/fonts/Scotchlidaires.ttf b/user/.local/share/fonts/Scotchlidaires.ttf new file mode 100644 index 0000000..2c4baba Binary files /dev/null and b/user/.local/share/fonts/Scotchlidaires.ttf differ diff --git a/vim/.config/nvim b/vim/.config/nvim new file mode 160000 index 0000000..bb87d70 --- /dev/null +++ b/vim/.config/nvim @@ -0,0 +1 @@ +Subproject commit bb87d70fd6dedce65c67a4390c9faecc55b0ed72 diff --git a/vscode/.config/Code/User/settings.json b/vscode/.config/Code/User/settings.json new file mode 100644 index 0000000..083c52b --- /dev/null +++ b/vscode/.config/Code/User/settings.json @@ -0,0 +1,190 @@ +{ + "files.autoSave": "onWindowChange", + "files.associations": { + "*.json": "jsonc" + }, + "gitlens.advanced.messages": { + "suppressShowKeyBindingsNotice": true + }, + "editor.formatOnSave": false, + "typescript.updateImportsOnFileMove.enabled": "always", + "editor.mouseWheelZoom": true, + "window.menuBarVisibility": "toggle", + "javascript.preferences.quoteStyle": "single", + "typescript.preferences.quoteStyle": "single", + "prettier.singleQuote": true, + "prettier.printWidth": 140, + "editor.tabSize": 2, + "editor.fontFamily": "'Fira Code', 'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback'", + "editor.fontLigatures": true, + "editor.fontSize": 14, + "editor.fontWeight": "500", + "editor.cursorBlinking": "phase", + "window.zoomLevel": -1, + "explorer.confirmDragAndDrop": false, + "editor.minimap.enabled": false, + "workbench.iconTheme": "material-icon-theme", + "[jsonc]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[javascript]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[html]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "editor.tabCompletion": "on", + "rewrap.wrappingColumn": 120, + "javascript.implicitProjectConfig.checkJs": true, + "[typescriptreact]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "peacock.favoriteColors": [ + { + "name": "Angular Red", + "value": "#b52e31" + }, + { + "name": "Auth0 Orange", + "value": "#eb5424" + }, + { + "name": "Azure Blue", + "value": "#007fff" + }, + { + "name": "C# Purple", + "value": "#68217A" + }, + { + "name": "Gatsby Purple", + "value": "#639" + }, + { + "name": "Go Cyan", + "value": "#5dc9e2" + }, + { + "name": "Java Blue-Gray", + "value": "#557c9b" + }, + { + "name": "JavaScript Yellow", + "value": "#f9e64f" + }, + { + "name": "Mandalorian Blue", + "value": "#1857a4" + }, + { + "name": "Node Green", + "value": "#215732" + }, + { + "name": "React Blue", + "value": "#00b3e6" + }, + { + "name": "Something Different", + "value": "#4d7d0a" + }, + { + "name": "Vue Green", + "value": "#42b883" + } + ], + "[json]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "peacock.darkForegroundColor": "", + "peacock.lightForegroundColor": "", + "workbench.colorCustomizations": { + "statusBar.background": "#4d7d0a" + }, + "[typescript]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "open-in-browser.default": "firefox", + "todo-tree.tree.showScanModeButton": false, + "[markdown]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "diffEditor.ignoreTrimWhitespace": false, + "ltex.additionalRules.motherTongue": "fr", + "cSpell.userWords": [ + "COVID", + "ICCB", + "aujourd'hui", + "devtools", + "gitkeep", + "gitmodules", + "npmlog", + "omnibox", + "postrelease", + "precache", + "promisify", + "submobule", + "subproject", + "subrepo", + "subtrees" + ], + "ltex.en-US.dictionary": [ + "lit-html", + "minification", + "Netlify", + "open-wc" + ], + "codesnap.transparentBackground": true, + "editor.wordWrap": "on", + "codesnap.backgroundColor": "#000", + "codesnap.boxShadow": "rgba(0, 0, 0, 0.55) 0px 10px 30px", + "cSpell.language": "en,en-GB,en-US,fr,fr-FR", + "go.useLanguageServer": true, + "go.gopath": "$HOME/go", + "go.inferGopath": false, + "[vue]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[javascriptreact]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "codesnap.containerPadding": "0em", + "codesnap.roundedCorners": false, + "codesnap.showLineNumbers": false, + "codesnap.showWindowControls": false, + "markdown.extension.orderedList.autoRenumber": false, + "extensions.ignoreRecommendations": false, + "svg.preview.mode": "svg", + "workbench.editorAssociations": { + "*.ipynb": "jupyter-notebook" + }, + "typescript.tsserver.log": "off", + "todo-tree.general.tags": [ + "BUG", + "HACK", + "FIXME", + "TODO", + "XXX", + "[ ]", + "[x]" + ], + "todo-tree.regex.regex": "(//|#|