joplin-notes/joplin notion extension/linux/mint/i3 wm.md
2026-11-04 00:33:23 +05:30

8.2 KiB

i3 wm

todo lock screen change dark mode sleep mode

dmenu : win+D to include desktop shortcut

  1. nano ~/.config/i3/config
  2. Find the keybinding for your application launcher (usually bindsym $mod+d).
  3. Change dmenu_run to i3-dmenu-desktop: bindsym $mod+d exec --no-startup-id i3-dmenu-desktop or for with icons and better use bindsym $mod+d exec --no-startup-id rofi -show drun -show-icons (make sure to install rofi)
  4. Reload i3 with $mod+Shift+c or $mod+Shift+r to apply the changes  

tabbed mode : win + w split mode : win + e stack mode : win + s3

log out and log in of sway (to apply effects) : win+shift+r logout : mod+shift+e

themes and something else (llm generated) dark theme i3.md 1st step fixed flatpak and some other theme (xdg protal one) 2nd step fixed xfce apps (gtk settings one321) or this can be installed too for gui changes sudo apt install lxappearance gtk-chtheme qt4-qtconfig

qt4qtconfig is outdated so use qt5ct to make changes

in /etc/environment have this echo $QT_QPA_PLATFORMTHEME=qt5ct:qt6ct and reboot also install these sudo apt install breeze qt6-gtk-platformtheme qt6ct qt5ct

now in toolbar set the theme like breeze dark

for flatpak flatpak --user override --env=GTK_THEME=Adwaita:dark

and to unset it flatpak --user override --unset-env=GTK_THEME

and for gtk4 and libwaita this will help for dark theme ADW_DEBUG_COLOR_SCHEME=prefer-dark

theme that are availables in mine

Adwaita       Mint-L-Aqua       Mint-L-Dark-Brown    Mint-L-Darker-Orange  Mint-L-Dark-Grey    Mint-L-Dark-Teal  Mint-L-Sand   Mint-X-compact  Mint-X-Sand  Mint-Y-Dark-Aqua    Mint-Y-Dark-Red   Mint-Y-Purple
Adwaita-dark  Mint-L-Blue       Mint-L-Darker        Mint-L-Darker-Pink    Mint-L-Dark-Orange  Mint-L-Grey       Mint-L-Teal   Mint-X-Grey     Mint-X-Teal  Mint-Y-Dark-Blue    Mint-Y-Dark-Sand  Mint-Y-Red
Default       Mint-L-Brown      Mint-L-Darker-Aqua   Mint-L-Darker-Purple  Mint-L-Dark-Pink    Mint-L-Orange     Mint-X        Mint-X-Orange   Mint-Y       Mint-Y-Dark-Grey    Mint-Y-Dark-Teal  Mint-Y-Sand
Emacs         Mint-L-Dark       Mint-L-Darker-Blue   Mint-L-Darker-Red     Mint-L-Dark-Purple  Mint-L-Pink       Mint-X-Aqua   Mint-X-Pink     Mint-Y-Aqua  Mint-Y-Dark-Orange  Mint-Y-Grey       Mint-Y-Teal
HighContrast  Mint-L-Dark-Aqua  Mint-L-Darker-Brown  Mint-L-Darker-Sand    Mint-L-Dark-Red     Mint-L-Purple     Mint-X-Blue   Mint-X-Purple   Mint-Y-Blue  Mint-Y-Dark-Pink    Mint-Y-Orange     Raleigh
Mint-L        Mint-L-Dark-Blue  Mint-L-Darker-Grey   Mint-L-Darker-Teal    Mint-L-Dark-Sand    Mint-L-Red        Mint-X-Brown  Mint-X-Red      Mint-Y-Dark  Mint-Y-Dark-Purple  Mint-Y-Pink

lock, suspend

instead of using one like cinnamon login manager, it will use something like i3lock https://github.com/betterlockscreen/betterlockscreen

wget https://raw.githubusercontent.com/betterlockscreen/betterlockscreen/main/install.sh -O - -q | bash -s user and then store ~/.local/.bin in PATH and

sudo apt install imagemagick

also install this https://github.com/Raymo111/i3lock-color

in i3 config file exec no-startup-id xautolock -time 15 -locker "systemctl suspend" use exec_always if u want changes to take place after reload instead of just reloading configs via mod+shift+r. exec_always --no-startup-id xautolock -time 15 -locker "systemctl suspend" for wakelock to prevent sleep , this alias

alias nosl="systemd-inhibit --what=sleep --who="bot" --why="discord bot running" sleep infinity"

about waking up after suspend

# Shows the hardware-level wake reason (e.g. "PCI PME#", "Power Switch", "RTC")
sudo dmidecode | grep Wake-up   


# Check which IRQ caused the last wake
cat /sys/power/pm_wakeup_irq   

kernel sources

# Shows all wakeup sources with event counts
cat /sys/kernel/debug/wakeup_sources   

# and for more

# List all wakeup-capable devices
ls /sys/class/wakeup/

# Check event counts (compare before/after suspend to find the culprit)
for i in /sys/class/wakeup/wakeup*; do
  echo "$i: $(cat $i/event_count)"
done   

better status bar install i3blocks

sudo apt install i3blocks
cp /etc/i3blocks.conf ~/.config/i3/i3blocks.conf

then replacing i3status with i3blocks:

bar {
    status_command i3blocks
}

 

brightness and volume keybinds

sudo apt install brightnessctl

to prevent brightnessctl to require sudo, do this sudo usermod -aG video $USER

then in config

bindsym XF86MonBrightnessUp exec --no-startup-id brightnessctl set +5%
bindsym XF86MonBrightnessDown exec --no-startup-id brightnessctl set 5%-

for volume as it is changed to i3blocks do this. basically this first line is important so change that

set $refresh_i3status pkill -SIGRTMIN+10 i3blocks
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status
bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status

and also cinnamon-settings sound to open cinnamon inbuilt sound control or pavucontrol for another one

natural scroling add this in i3 config

this touchpad device can be listed by finding from xinput list

exec_always --no-startup-id xinput set-prop "ELAN0708:00 04F3:30A0 Touchpad" "libinput Natural Scrolling Enabled" 1

for pasting content from clipboard to markdown in config

bindsym $mod+shift+p exec --no-startup-id bash /home/hpmi/Videos/imp/scripts/attachment-clipboard.sh "normal"
bindsym $mod+shift+Mod1+p exec --no-startup-id bash /home/hpmi/Videos/imp/scripts/attachment-clipboard.sh "alt"

and the script used

pasteToArea(){
    MY_VAR="$1"

    # 1. Copy the variable to the clipboard
    echo -n "$MY_VAR" | xclip -selection clipboard

    # 2. Force xdotool to wait until you release the physical hotkey,
    #    then clear modifiers and paste. This prevents key conflicts.
    
    sleep 1
    xdotool key --clearmodifiers ctrl+v
    
}



DESTINATION="$HOME/.gram-md/_assets"


# normal or alt
mode=$1
echo $mode
if xclip -selection clipboard -t TARGETS -o | grep -q "image/png"; then
    random=$(tr -dc 'A-Za-z0-9' < /dev/urandom | head -c 16)
    file="$DESTINATION/$random.png"

    xclip -selection clipboard -t image/png -o > $file
    echo "Image successfully saved as $random.png"
    echo "![](<$file>)"
    pasteToArea "![](<$file>)"
    
     # replacing the  new paste with old image
     xclip -selection clipboard -t image/png -i "$file"
else
    
    echo "Error: No image found in the clipboard!"
    fullfilepath=$(xclip -selection clipboard -o)
    


    filename=$(basename -- "$fullfilepath")
    extension="${filename##*.}"
    filename_with_noext="${filename%.*}"
    file="$DESTINATION/$filename_with_noext $(date +%s).$extension"

    if [[ $mode == "alt" ]]; then
        pasteToArea "[$filename](<$fullfilepath>)"
        # replacing the  new paste with old one
        echo -n "$fullfilepath" | xclip -selection clipboard
        exit 0
    fi

    cp "$fullfilepath" "$file"
    echo "[$filename](<$file>)"
    pasteToArea "[$filename](<$file>)"

    # replacing the  new paste with old one
    echo -n "$fullfilepath" | xclip -selection clipboard
fi

this will have absolute paths which can be resolved by adding a script on save in zed settings.jsonc file

"languages": {
      "Markdown": {
        "format_on_save": "on",
        "formatter": {
          "external": {
                    "command": "python3",
                    "arguments": [
                      "-c",
                      "import sys, re, os\n\ncurrent_dir = os.path.dirname('{buffer_path}')\npattern = re.compile(r'(\\!?\\[.*?\\]\\()([^\\)]+)(\\))')\n\ndef replacer(match):\n    prefix, path, suffix = match.groups()\n    p = path.strip('<>')\n    if os.path.isabs(p) and os.path.exists(p):\n        return f'{prefix}{os.path.relpath(p, current_dir)}{suffix}'\n    return match.group(0)\n\ntext = sys.stdin.read()\nsys.stdout.write(pattern.sub(replacer, text))"
                    ]
                  }
        }
      }
    }