Skip to content

Instantly share code, notes, and snippets.

@igavrysh
Last active December 28, 2024 19:54
Show Gist options
  • Save igavrysh/0bdca0741c521624e087b3950954f295 to your computer and use it in GitHub Desktop.
Save igavrysh/0bdca0741c521624e087b3950954f295 to your computer and use it in GitHub Desktop.

This is todo list for my frame.work setup with sway etc.

Ideas list

Good sample setup:

Todo

where login menu desktop environments options text file located in ubuntu 24.04

ChatGPT
In Ubuntu, the login menu desktop environments options are typically configured through the
Display Manager. Ubuntu 24.04    is a future release, but assuming it follows the standard
Ubuntu setup, the configurations for these options are likely      to be in the following locations:

GDM (GNOME Display Manager):

Configuration file: /etc/gdm3/custom.conf
Sessions and desktop environments are typically stored in /usr/share/xsessions/ for X
sessions and /usr/share/wayland-   sessions/ for Wayland sessions.
LightDM (Light Display Manager):

Configuration file: /etc/lightdm/lightdm.conf
Session files are typically stored in /usr/share/xsessions/.
For editing the desktop environment options available in the login menu, you would
likely be looking at the session files    in /usr/share/xsessions/ or /usr/share/wayland-sessions/.
Each desktop environment typically has a .desktop file in these    directories, defining the session.

For example, you might find files like:

/usr/share/xsessions/gnome.desktop
/usr/share/xsessions/xfce.desktop
/usr/share/wayland-sessions/gnome.desktop
  1. displaylink dock support:
    1. currently displaylink dock at my work (HP Dock G2) is not working with frame.work - I saw a couple posts in github with general suggestions on how to debug but still - to be studies
    2. to check if my home displaylink dock is working with sway
  2. tablet support for multimonitor setup, running manually bluetoothctrl solved the problem with pairing, however mapping problem still exists:
    1. when external monitor is connected, drawing tablet is mapped to both displays (laptop display + external) in extended way. whereas I want tablet to be mapped only to one monitor (at best, currently active/focused). There are couple instructions here, but they are kind of don't work: https://www.reddit.com/r/swaywm/comments/lgpity/map_wacom_tablet_to_active_monitor/ (e.g. manual mapping works, but autofocus does not)
  3. clamshell mode - when laptop is closed and connected to monitor - workspaces on closed display are not remppaed to external they stay within closed display - target behavior in clamshell mode - all workspaces should be remapped to external monitor https://www.reddit.com/r/swaywm/comments/eim1k1/conditional_clamshell_mode/ https://github.com/swaywm/sway/wiki#clamshell-mode - official guide has also some parts there
  4. clipboard - currently, copy paste in vim is not working when pasting externally, e.g. in browser (not always working)
  5. making screenshots? what app should be used?
  6. laptop setup automation with ansible? docker? https://frontendmasters.com/courses/developer-productivity/
  7. how to debug sway? how sway is launched from login screen (some commands in displaylink section might give ides how to push the log for sway into known file location)
  8. waybar is falling with segfault with when gnome is launched (e.g. gnome selected from login screen). Then logout gnome-login sway (without reboot) and waybar is not loading in sway - should I switch to standard bar by sway?
  9. change background?
  10. idle / hibernate mode - how to account for clamshell (login screen - I want it to be uniform and same across states e.g. in lock state currently shows sway lock screen (circle that is filled as you type password) vs initial start that shows standard gnome login (with prompt for entering login and password + selecting desktop env)
  11. how to start hibernate / sleep mode when lid is closed and no external keyboard / mouse / screen is connected?
  12. general sleep/hibernate issues - how to ensure that laptop hibernates on 5% left - how to ensure that laptop does not work when put in the bag with lid closed?
  13. cpu indicator on waybar always show 20 C degress - regardless of laptop temperature. Lm sensors work seemingly correctly (e.g. experimented with standard bar, lm sensors were showing 40-50 C degress when laptop was relatively hot - seems not too far from truth) - but block for couple seconds ?to read sensors info? - how to cache those values and update in background e.g. once per 30 sec, and read cached value from file in waybar or standard bar?
    1. Alexays/Waybar#2911
  14. traybar icon for bluetooth?
  15. cross out icon for audio muted state?
  16. waybar: laptop charging incon in waybar does not react instantly on plug in laptop action
  17. waybar: what does activated/deactivated crossed eye icon mean?
  18. waybar: show menu of top processes by memory / cpu whem memory or cpu usage is cliecked
  19. uniform reaction on hower / on click for way bar on icons
  20. uniform file manager / for viewing files / for save file as dialogs etc
  21. mako for system wide + app notifications
  22. swaylock: https://github.com/swaywm/swaylock

Solved

  1. Okular - used snap instead of sudo apt-get install okular - now icons in app are visible

    sudo snap install okular
    
  2. Connecting Wacom Intous One BT tablet by bluetooth: manually running search/pair/trust cycle with bluetoothctrl -

    sudo bluetoothctl
    # then in bluetoothctl console
    power on
    scan on
    pair <device_id>
    trust <device_id>
    

    without it standard bluetooth connect tool was pairing tablet, but stylus and buttons on table were not working (+installed blueman not sure how that affects the process)

  3. Keyboard layout - another language: added UA - Ukrainian as my native language - standard sway instructions in ~/.config/sway/config worked: some links I used: ' https://www.reddit.com/r/swaywm/comments/le3lg3/switching_keyboard_layout/

  4. java installation + update alternatives - used digital ocean instructions for java21 headless install

    sudo apt update
    sudo apt install default-jre
    java --version
    sudo apt install default-jdk
    javac --version
    sudo update-alternatives --config java
    sudo update-alternatives --config javac
    # add JAVA_HOME env based on update alternatives:
    sudo vim /etc/environment
    source /etc/environment
    echo $JAVA_HOME
    
  5. waybar was showing wrong icons/fonts, saved medium article in pdf doc in Documents

    # loaded fonts from here: https://fontawesome.com/download
    # used guide from here: https://medium.com/source-words/how-to-manually-install-update-and-uninstall-fonts-on-linux-a8d09a3853b0
    # put fonts in ~/.local/share/fonts folder
    mkdir ~/.local/share/fonts folder
    # ran rescan tool
    fc-cache -f -v
    
  6. for display manager: (way-displays: https://github.com/alex-courtis/way-displays)

    1. install libinput-dev

      sudo apt-get install libinput-dev
      sudo apt-cache serach libinput
      # ???
      sudo apt-get install -y libudev-dev
      pkg-config --modversion yaml-cpp
      sudo apt-get update --fix-missing
      
    2. needed to setup yaml-cpp to make it work: https://www.reddit.com/r/swaywm/comments/le3lg3/switching_keyboard_layout/ followed instructions from here to build + install yaml-cpp https://github.com/jbeder/yaml-cpp/blob/master/install.txt

      git clone https://github.com/jbeder/yaml-cpp.git
      
      *** With CMake ***
      yaml-cpp uses CMake to support cross-platform building. In a UNIX-like system, the basic steps to build are:
      1. Download and install CMake (if you don't have root privileges, just install to a local directory, like ~/bin)
      2. From the source directory, run:
          mkdir build
          cd build
          cmake ..
      and then the usual
          make
          make install
      3. To clean up, just remove the 'build' directory.
      *** Without CMake ***
      If you don't want to use CMake, just add all .cpp files to a makefile. yaml-cpp does not need any special build settings, so no 'configure' file is necessary.
      (Note: this is pretty tedious. It's sooo much easier to use CMake.)
      
    cp /etc/way-displays/cfg.yaml ~/.config/way-displays/cfg.yaml
    

    second try to install way-displays I ran make in the root folder & make install after that. way-display himt should become available in app launcher

  7. clamshell mode:

    https://github.com/swaywm/sway/wiki

    Open the logind configuration file for editing:

    sudo nano /etc/systemd/logind.conf
    

    Edit the line for HandleLidSwitch. You need to change or add the following line to disable suspension:

    HandleLidSwitch=ignore
    

    This ensures that closing the lid does not trigger suspension.

    lid sensor (lid closed): cat /proc/acpi/button/lid/LID0/state

  8. clamshell mode: exit sway shows black screen on external monitor and when laptop lid is opened, the same black screen is seen on internal monitor. Fix involves:

    By default, many distros will suspend or ignore displays when the lid is closed. Sometimes an external monitor won’t come up if the laptop lid is closed on exit from the session. You can adjust this in /etc/systemd/logind.conf:

    Open the file:

    sudo nano /etc/systemd/logind.conf
    

    Set or uncomment the following lines:

    HandleLidSwitch=ignore
    HandleLidSwitchDocked=ignore
    

    Then reload systemd-logind:

    sudo systemctl restart systemd-logind
    

    (reload has not helped but restart did)

    sudo reboot now
    
  9. brave sources list:

    cd /etc/apt/sources.list.d/
    
  10. installed the following tools:

    sudo apt install dmenu
    sudo apt install swaybg
    sudo apt install swayidle
    sudo apt install swaylock
    
  11. obs screen share is not working - cannot find how sway is started on my ubuntu. In the reddit: https://www.reddit.com/r/swaywm/comments/xldx5c/how_to_record_in_obs_studio_in_sway/ the talk about starting sway with some configs but I cannot find them as of now: Install following libs:

    sudo apt-get install xdg-desktop-portal
    sudo apt-get isntall xdg-desktop-portal-wlr
    

    I'll just copy paste what I wrote in a different thread:

    You need to have the xdg-desktop-portal and xdg-desktop-portal-wlr packages installed (that's what they're called on Arch, at least).

    Sway needs to be launched with the XDG_CURRENT_DESKTOP environment variable set to sway. I use the following wrapper script for this, which I place in ~/.local/bin/sway:

    #!/bin/bash
    export XDG_CURRENT_DESKTOP=sway
    exec /usr/bin/sway "$@"
    

    Finally, you need to run the XDG desktop portal by adding the following line to your Sway config to run xdg-desktop-portal from libexec folder (check that xdg-desktop-portal is avail. in this folders, some distros have lib instead of libexec directory for this

    exec --no-startup-id /usr/libexec/xdg-desktop-portal -r
    

    also the same problem was there when sharing screen on video call, e.g. google meets etc

    1. Make sure you have xdg-desktop-portal-wlr and xdg-desktop-portal installed
    2. In $HOME/.config/sway/config, add the line include /etc/sway/config.d/*
    3. Your drop-in file /etc/sway/config.d/50-systemd-user.conf you should somewhere have the lines
    exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP
    exec hash dbus-update-activation-environment 2>/dev/null && \
      dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_CURRENT_DESKTOP=sway
    
    1. Restart your computer
    2. systemctl --user show-environment should have XDG_CURRENT_DESKTOP=sway and systemctl --user status xdg-desktop-portal-wlr.service should be running.
    3. Screen sharing with Firefox (and probably most other browsers) should work now. On Firefox you can test this under https://mozilla.github.io/webrtc-landing/gum_test.html
    4. source https://forum.endeavouros.com/t/unable-to-share-screen-with-sway-wm/46654/5
    5. I also added the next line in sway start launcher. Edit /usr/share/wayland-sessions/sway.desktop like so:
    [Desktop Entry]
    Name=Sway
    Comment=An i3-compatible Wayland compositor
    Exec=env XDG_CURRENT_DESKTOP=sway dbus-run-session sway
    Type=Application
    
    1. source: https://github.com/emersion/xdg-desktop-portal-wlr/wiki/%22It-doesn't-work%22-Troubleshooting-Checklist#other-known-problems
  12. how to introduce dark mode, e.g. default application/system/os level style/theme? ref: https://major.io/p/sway-dark-mode/ If you happen to have GNOME on your system alongside sway, go into Settings, then Appearance and select Dark. You can also get dark mode by applying a setting in ~/.config/gtk-3.0/settings.ini:

    [Settings]
    gtk-application-prefer-dark-theme=1
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment