I've been working on setting up Manjaro Linux (i3) lately, and it's overall been a good experience. Hitting some snags with customizing the terminal (mostly with powerline and nerd fonts), and all my tinkering has led to a bad state that seems hard to recover from. I'm going ahead and doing a clean install, but before that I want to note down the apps and packages I've installed that I actually want to reinstall. In no particular order:
* bitwarden
* bitwarden-cli
* chromium
* mpv
* neovim
* with lazy.nvim package manager
* noto-fonts-emoji (if fonts aren't rendering properly in the browser)
* py3status
* docker
* spotifyd
* tmux
* ufw
Some of these might actually be there out of the box, so it's partially a list to remind me to configure them.
Finally, a big fat note to self: remember to backup all config files before changing them! Should prevent the need for a clean install if anything breaks
To update, so far I've done:
* backup i3 config, cp .i3/config .i3/config.bkup
* set resolution, echo 'xrandr -s 5120x1440' >> .i3/config
* update pacman mirrors, sudo pacman -f 30
* install brave browser, sudo pacman -S brave-browser
I'm partially following these guides:
* https://github.com/haraldwb/manjaro-i3wm-post-install-guide
* https://jasoneckert.github.io/myblog/configuring-i3/
Changing default browser:
* modify .i3/config, set bindsym $mod+F2 exec brave
* modify .config/mimeapps.list (:%s/userapp-Pale Moon/brave-browser/g)
* set $BROWSER in .profile, export BROWSER=/usr/bin/brave
On the issue of fonts in uxrvt:
Seems like the default .Xresources config shipped with Manjaro sets the URxv.font without escaping spaces. The correct thing seems to be to escape them using \
Finally doing a sudo pacman -Syu to update installed packages
Fix for missing emojis:
* pacman -S noto-fonts-emoji
* add the following to /etc/fonts/conf.d/66-noto-emoji.conf:
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<alias>
<family>emoji</family>
<prefer>
<family>Noto Color Emoji</family>
</prefer>
</alias>
</fontconfig>
TODO: get emojis working in the terminal
A few things done based on the aforementioned post-install guide:
# Enable fstrim
sudo systemctl status fstrim.timer
sudo systemctl enable fstrim.timer
# Set swappiness
sudo vim /etc/sysctl.d/99-swappiness.conf
vm.swappiness=10
# Enable ufw
sudo ufw enable
sudo systemctl status ufw
sudo systemctl enable ufw
I think I found a working font and procedure for urxvt:
sudo pacman -S ttf-0xproto-nerd
edit ~/.Xresources:
URxvt.font xfg:0xProto Nerd Font Mono:pixelsize=12 # no escaping
xrdb -merge ~/.Xresources
Close all running terminals to restart urxvt
AFter all this messing about with getting urxvt correctly rendering fonts, I think I'm going to swap to alacritty anyways (:
Install alacritty:
$ sudo pacman -S alacritty
Make it the default terminal:
$ vim /usr/bin/terminal
#!/bin/sh
alacritty "$@"
Create config file:
$ mkdir -p ~/.config/alacritty/alacritty.toml
Edit config file, set MesloLGS font:
[font]
size = 11
normal = { family = "MesloLGS NF", style = "Regular" }
bold = { family = "MesloLGS NF", style = "Bold" }
italic = { family = "MesloLGS NF", style = "Italic" }
bold_italic = { family = "MesloLGS NF", style = "Italic" }
Change default shell:
$ chsh -s /usr/bin/zsh
Configure poweline
$ p10k configure
I think I've been fairly successful in setting up neovim with the lazy.nvim package manager.
I've got this config structure:
$ tree .config/nvim
.config/nvim
├── init.lua
├── lazy-lock.json
└── lua
├── config
│ └── lazy.lua
└── plugins
├── cmp.lua
├── init.lua
├── lsp.lua
└── treesitter.lua
And the follwing plugins installed:
cmp-buffer, cmp-cmdline, cmp-nvim-lsp, cmp-path, cmp_luasnip, LuaSnip, nvim-cmp, nvim-lspconfig, nvim-treesitter, nvim-ts-autotag, tokyonight.nvim
Today I went ahead and installed oh-my-zsh. Plugins enabled: git, asdf, dotenv
Embarking on a new adventure, setting up ansible to automate my VPS configuration. I want to manage my python versions with asdf, and I used the zsh asdf plugin to easily install asdf. Just clone the repo and enable the plugin.
Next step is installing some dependencies that (I think?) are necessary for python, or at the very least recommended by asdf-python, though they link to pyenv docs for some reason, not digging in to that now:
pacman -S --needed base-devel openssl zlib xz tk
asdf plugin-add python
asdf install python 3.12.6
pacman -S python-pipx
pipx install poetry
The rest will be put in version control, so I won't bother writing everything down in this thread
If I find some time in the coming days, if like to revamp the profile page. Box in the user info section, add a header before the threads, maybe remove the username link from the threads as we’re already on the page it links to, increase margin between navbar and user info section, etc. Those are just things from the top of my head.
Made most of the aforementioned changes:
* Added margins to user info section
* Added border to user info section
* Added header before thread/note history
* Also tweaked padding and margins on threads and posts to separate things a little more and give a little breathing room
Because this is a hobby project, and everything is a nice-to-have, I'll jump on improving the user profile pages instead of ticking anything else of the todo-list.
* First of all, logged-in users should se a link in the navbar to their account page as well as their profile. Right now it says 'profile' but links to the account page
* Second, user profiles located at /u/<user> should include a list of threads by that user below a summary of user details
Both changes are now deployed. Need to fix ordering of threads on profiles to display latest first
Added some mobile nav bar fixes as well. Feels a bit hacky to add a on:click to all anchor tags on the mobile nav, there’s probably a better way to do it.
Considering rewriting micronotal in SvelteKit... I'm not a frontend developer by any means, and React's useEffect, useCallback, etc. keeps throwing me for a loop. SvelteKit seems to me to be more straightforward, and reactive values/statements are easier to understand when you have automatic dependency detection.
As I have barely any experience with any frontend frameworks, I might of course be entirely wrong, and moving to SvelteKit won't magically provide a better developer experience. Pretty sure I'm going to go through with it, though.
So, the rewrite is underway. I've implemented auth, moved some pages and routes around to make things cleaner, and got a frontpage full of threads rendering almost identically to the Next.js implementation. Still a couple of pages left to go before I'm done.
Didn’t get much further today, but I have to say: SvelteKit is so far a much more pleasant experience than Next.js. Way easier to understand what happens client side and what happens server side. Data fetching is a breeze. Automatic typing of load functions. And everything is way snappier! The list goes on.
Writing this from the preview deployment of micronotal written in SvelteKit. Have to say, I'm blown away by how easy SK is to work with compared to Next.
Looking through things, I see that I've got some broken links to profiles now, but that's an easy fix
Adding to the todo-list:
* I really should add a max length to post content
* I’m also thinking I should do something about the display of posts with a large number of newlines, but that’s a lot trickier to get right. I don’t want to limit creativity; I think posts should be allowed to contain whatever formatting you want, but it can be detrimental to the user experience if posts and threads can offset others by just containing a ton of whitespace.
One possible solution that allows whatever post content you want is crowd-sourced moderation through votes. At scale, this can become an unwieldy tool requiring safeguards against vote manipulation.
Perhaps disabling email login and only supporting social login is part of the answer to prevent botting. Essentially piggybacking on the abuse prevention systems of the large companies.
Unrelated, but also on the todo-list:
* use nextjs route groups to deduplicate some layout code
New day, new thread. On todays todo-list:
- get fragment links to work
- truncate post and thread ids
- clear post text area on submit
- create a seed.sql to improve local dev
Thread/post IDs are now truncated, and the post elements have gotten id attributes that make scrolling kind of work. The issue is that the div with the fragment id is not present on page load, but is loaded in afterwards. Will have to think a bit more on how to solve it, leaving it for now.
Text area should now be cleared on submit. I've also added a check to the database disallowing empty posts, as well as aborting post submission in the frontend if textarea is empty.
Only thing remaining is to create a little seed data (hello chatGPT)
After a chat with GPT-4 I now have a bunch of data available for seeding my local database. Doing so also revealed an issue with my RLS, where a user can add posts to a thread started by a different author. I also had an incorrect check in the frontend, where the textarea input was shown as long as you had a session. It's now only displayed if the logged in user is the same as the author of the thread.
RLS issue should be resolved now
made a couple more improvements:
- return a helpful message instead of exploding if you look up a thread that doesn't exist
- improve username constraints + set reasonable, semi-random username on creation
- user deletion qol improvements
I believe the solution to the scrolling-to-fragment issue is to ssr the single-thread pages. Will try it out when I get the time.
Also on the todo-list: decrease horizontal padding on small screens in order to avoid 'zooming in' when text area is selected