regolith-linux / regolith-desktop

Meta package for the Regolith Desktop Environment
1.5k stars 31 forks source link

Cannot switch keyboard layout on a per application basis, it stays global #480

Open srosato opened 4 years ago

srosato commented 4 years ago

Describe the bug I have a small issue, not sure its related to regolith and maybe more with gnome. I went on slack and Ken said that maybe it was related to gnome-flashback but he is not sure. I installed regolith-desktop this week on both a fresh install of popOS and my older ubuntu mint mate install (based on 18.04).

On both my popOS/ubuntu 20.04 and Ubuntu 18.04 Mint Mate 19 instances with regolith-desktop installed, I cannot seem to be able to have "per application" keyboard layout. I went into gnome-control-center > region-and-languages > gear icon near input sources and checked the allow different sources for each window. I logged out, rebooted, also tried gnome tweaks, using gsettings, but no matter what I do, if I switch my keyboard layout using the default keyboard shortcut mod+alt+backspace it switches the layout globally. I have been searching for a couple of hours now on Google and cannot find anything. The setting also stay correctly checked after re-opening gnome-control-center.

Only thing I was able to do is sudo dpkg-reconfigure keyboard-configuration to configure so I can hold the right-alt key to temporarily switch to latin keyboard. But I'd like the more persistent way of layout per application that gnome offers. My two configured input languages are English (US) and French (CA)

gnome-shell version: 3.36.4

Any clues to help me find out whats wrong? Thanks a bunch

To Reproduce Steps to reproduce the behavior: install regolith desktop on a fresh popOS (ubuntu 20.04) or Linux Mate 19 - Ubuntu 18.04 (that uses gnome2, so I expected it to be impossible to have regolith-desktop, but it works like a charm).

Setup two keyboard layouts. Try to switch them with keyboard shortcut on a per application basis.

Expected behavior Each application remembers its keyboard layout

Configuration file(s) ~/.config/regolith/i3/config was staged with this override:

###############################################################################
# i3-gaps config file for the Regolith Desktop Environment
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
# 
###############################################################################
#
# In this config file, may values are taken from Xresources with the directive 
# set_from_resource:
#
# set_from_resource <i3 variable name> <Xresources key> <default value>
# 
# This configuration file utilizes Xresource variables to enable users to
# change the configuration without having to make a copy of this config file.
# The benefit to not copying this file is easier upgrading in the future.
# To update a value in this config without making a copy, update the Xresource 
# value in the file ~/.config/regolith/Xresources.
# 
# For example, to change the bar position to the top of the screen this is the
# i3 config entry:
# set_from_resource $i3-wm.bar.position i3-wm.bar.position bottom
#
# So add this line to ~/.config/regolith/Xresources to change it's value:
# i3-wm.bar.position: top
#
# Reload i3 after making Xresource changes.  Learn more at 
# https://regolith-linux.org/docs/howto/override-xres/
#
###############################################################################
#
# This file uses a machine-parsable format for comments. The schema:
# ## <Category> // <Action> // <Keybinding> ##
# Learn more at https://github.com/regolith-linux/remontoire
#
###############################################################################

###############################################################################
# Meta Key Mappings
# Alt key is Mod1, and Windows key is Mod4
###############################################################################

set_from_resource $mod  i3-wm.mod Mod4
set_from_resource $alt  i3-wm.alt Mod1

###############################################################################
# Workspace Names
# These are the labels which define each i3 workspace.
###############################################################################

set_from_resource $ws1  i3-wm.workspace.01.name "1"
set_from_resource $ws2  i3-wm.workspace.02.name "2"
set_from_resource $ws3  i3-wm.workspace.03.name "3"
set_from_resource $ws4  i3-wm.workspace.04.name "4"
set_from_resource $ws5  i3-wm.workspace.05.name "5"
set_from_resource $ws6  i3-wm.workspace.06.name "6"
set_from_resource $ws7  i3-wm.workspace.07.name "7"
set_from_resource $ws8  i3-wm.workspace.08.name "8"
set_from_resource $ws9  i3-wm.workspace.09.name "9"
set_from_resource $ws10 i3-wm.workspace.10.name "10"
set_from_resource $ws11 i3-wm.workspace.11.name "11"
set_from_resource $ws12 i3-wm.workspace.12.name "12"
set_from_resource $ws13 i3-wm.workspace.13.name "13"
set_from_resource $ws14 i3-wm.workspace.14.name "14"
set_from_resource $ws15 i3-wm.workspace.15.name "15"
set_from_resource $ws16 i3-wm.workspace.16.name "16"
set_from_resource $ws17 i3-wm.workspace.17.name "17"
set_from_resource $ws18 i3-wm.workspace.18.name "18"
set_from_resource $ws19 i3-wm.workspace.19.name "19"

###############################################################################
# Launcher dialogs
###############################################################################

## Launch // Terminal // <> Enter ##
bindsym $mod+Return exec /usr/bin/x-terminal-emulator

## Launch // Browser // <><Shift> Enter ##
bindsym $mod+Shift+Return exec gtk-launch $(xdg-settings get default-web-browser)

set_from_resource $rofiTheme rofi.theme /etc/regolith/styles/lascaille/rofi.rasi

## Launch // Application // <> Space ##
set_from_resource $i3-wm.program.launcher.app i3-wm.program.launcher.app rofi -show drun -theme $rofiTheme
bindsym $mod+space exec $i3-wm.program.launcher.app

## Launch // Command // <><Shift> Space ##
set_from_resource $i3-wm.program.launcher.cmd i3-wm.program.launcher.cmd rofi -show run -theme $rofiTheme
bindsym $mod+Shift+space exec $i3-wm.program.launcher.cmd

## Navigate // Window by Name // <><Ctrl> Space ##
set_from_resource $i3-wm.program.launcher.window i3-wm.program.launcher.window rofi -show window -theme $rofiTheme
bindsym $mod+Ctrl+space exec $i3-wm.program.launcher.window

## Launch // This Dialog // <><Shift> ? ##
set_from_resource $i3-wm.program.help i3-wm.program.help /usr/bin/remontoire-toggle
bindsym $mod+Shift+question exec --no-startup-id $i3-wm.program.help

## Launch // File Search // <><Alt> Space ##
set_from_resource $i3-wm.program.file_search i3-wm.program.file_search rofi -show find -modi find:/usr/share/rofi/modi/finder.sh
bindsym $mod+$alt+space exec $i3-wm.program.file_search

###############################################################################
# Window and Workspace Navigation
###############################################################################

## Navigate // Relative Window // <> ↑ ↓ ← → ##
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right

## Navigate // Relative Window // <> k j h l ##
bindsym $mod+h focus left
bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l focus right

## Navigate // Workspaces 1-10 // <> 0..9 ##
bindsym $mod+1 workspace number $ws1
bindsym $mod+2 workspace number $ws2
bindsym $mod+3 workspace number $ws3
bindsym $mod+4 workspace number $ws4
bindsym $mod+5 workspace number $ws5
bindsym $mod+6 workspace number $ws6
bindsym $mod+7 workspace number $ws7
bindsym $mod+8 workspace number $ws8
bindsym $mod+9 workspace number $ws9
bindsym $mod+0 workspace number $ws10
## Navigate // Workspace 11 - 19 // <><Ctrl> 0..9 ##
bindsym $mod+Ctrl+1 workspace number $ws11
bindsym $mod+Ctrl+2 workspace number $ws12
bindsym $mod+Ctrl+3 workspace number $ws13
bindsym $mod+Ctrl+4 workspace number $ws14
bindsym $mod+Ctrl+5 workspace number $ws15
bindsym $mod+Ctrl+6 workspace number $ws16
bindsym $mod+Ctrl+7 workspace number $ws17
bindsym $mod+Ctrl+8 workspace number $ws18
bindsym $mod+Ctrl+9 workspace number $ws19

## Navigate // Next Workspace // <> Tab ##
bindsym $mod+Tab workspace next

## Navigate // Next Workspace // <><Alt> → ##
bindsym $mod+$alt+Right workspace next

## Navigate // Previous Workspace // <><Shift> Tab ##
bindsym $mod+Shift+Tab workspace prev

## Navigate // Previous Workspace // <><Alt> ← ##
bindsym $mod+$alt+Left workspace prev

## Navigate // Scratchpad // <><Ctrl> a ##
bindsym $mod+Ctrl+a scratchpad show

###############################################################################
# Window and Workspace Configuration
###############################################################################

## Modify // Window Position // <><Shift> ↑ ↓ ← → ##
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right

## Modify // Window Position // <><Shift> k j h l ##
bindsym $mod+Shift+h move left
bindsym $mod+Shift+j move down
bindsym $mod+Shift+k move up
bindsym $mod+Shift+l move right

## Modify // Containing Workspace // <><Ctrl><Shift> ↑ ↓ ← → ##
bindsym $mod+Ctrl+Shift+Left move workspace to output left
bindsym $mod+Ctrl+Shift+Down move workspace to output down
bindsym $mod+Ctrl+Shift+Up move workspace to output up
bindsym $mod+Ctrl+Shift+Right move workspace to output right

## Modify // Next Window Orientation // <> Backspace ##
bindsym $mod+BackSpace split toggle

## Modify // Window Fullscreen Toggle // <> f ##
bindsym $mod+f fullscreen toggle

## Modify // Window Floating Toggle // <><Shift> f ##
bindsym $mod+Shift+f floating toggle

## Modify // Move to Scratchpad // <><Ctrl> m ##
bindsym $mod+Ctrl+m move to scratchpad

## Modify // Tile/Float Focus Toggle // <><Shift> t ##
bindsym $mod+Shift+t focus mode_toggle

## Modify // Window Layout Mode // <> t ##
bindsym $mod+t layout toggle tabbed splith splitv

## Modify // Move Window to Workspace 1 - 10 // <><Shift> 0..9 ##
bindsym $mod+Shift+1 move container to workspace number $ws1
bindsym $mod+Shift+2 move container to workspace number $ws2
bindsym $mod+Shift+3 move container to workspace number $ws3
bindsym $mod+Shift+4 move container to workspace number $ws4
bindsym $mod+Shift+5 move container to workspace number $ws5
bindsym $mod+Shift+6 move container to workspace number $ws6
bindsym $mod+Shift+7 move container to workspace number $ws7
bindsym $mod+Shift+8 move container to workspace number $ws8
bindsym $mod+Shift+9 move container to workspace number $ws9
bindsym $mod+Shift+0 move container to workspace number $ws10
## Modify // Move Window to Workspace 11 - 19// <><Ctrl><Shift> 0..9 ##
bindsym $mod+Shift+Ctrl+1 move container to workspace number $ws11
bindsym $mod+Shift+Ctrl+2 move container to workspace number $ws12
bindsym $mod+Shift+Ctrl+3 move container to workspace number $ws13
bindsym $mod+Shift+Ctrl+4 move container to workspace number $ws14
bindsym $mod+Shift+Ctrl+5 move container to workspace number $ws15
bindsym $mod+Shift+Ctrl+6 move container to workspace number $ws16
bindsym $mod+Shift+Ctrl+7 move container to workspace number $ws17
bindsym $mod+Shift+Ctrl+8 move container to workspace number $ws18
bindsym $mod+Shift+Ctrl+9 move container to workspace number $ws19

# move focused container to workspace, move to workspace
## Modify // Carry Window to Workspace 1 - 10// <><Alt> 0..9 ##
bindsym $mod+$alt+1 move container to workspace number $ws1; workspace number $ws1  
bindsym $mod+$alt+2 move container to workspace number $ws2; workspace number $ws2
bindsym $mod+$alt+3 move container to workspace number $ws3; workspace number $ws3
bindsym $mod+$alt+4 move container to workspace number $ws4; workspace number $ws4
bindsym $mod+$alt+5 move container to workspace number $ws5; workspace number $ws5
bindsym $mod+$alt+6 move container to workspace number $ws6; workspace number $ws6
bindsym $mod+$alt+7 move container to workspace number $ws7; workspace number $ws7
bindsym $mod+$alt+8 move container to workspace number $ws8; workspace number $ws8
bindsym $mod+$alt+9 move container to workspace number $ws9; workspace number $ws9
bindsym $mod+$alt+0 move container to workspace number $ws10; workspace number $ws10
## Modify // Carry Window to Workspace 11 - 19 // <><Alt><Ctrl> 0..9 ##
bindsym $mod+$alt+Ctrl+1 move container to workspace number $ws11; workspace number $ws11
bindsym $mod+$alt+Ctrl+2 move container to workspace number $ws12; workspace number $ws12
bindsym $mod+$alt+Ctrl+3 move container to workspace number $ws13; workspace number $ws13
bindsym $mod+$alt+Ctrl+4 move container to workspace number $ws14; workspace number $ws14
bindsym $mod+$alt+Ctrl+5 move container to workspace number $ws15; workspace number $ws15
bindsym $mod+$alt+Ctrl+6 move container to workspace number $ws16; workspace number $ws16
bindsym $mod+$alt+Ctrl+7 move container to workspace number $ws17; workspace number $ws17
bindsym $mod+$alt+Ctrl+8 move container to workspace number $ws18; workspace number $ws18
bindsym $mod+$alt+Ctrl+9 move container to workspace number $ws19; workspace number $ws19

# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod

hide_edge_borders smart

###############################################################################
# Session Management
###############################################################################

## Session // Exit App // <><Shift> q ##
bindsym $mod+Shift+q [con_id="__focused__"] kill

## Session // Terminate App // <><Alt> q ##
bindsym $mod+$alt+q [con_id="__focused__"] exec --no-startup-id kill -9 $(xdotool getwindowfocus getwindowpid)

## Session // Reload i3 Config // <><Shift> c ##
bindsym $mod+Shift+c reload

## Session // Refresh Session // <><Shift> r ##
set_from_resource $i3-wm.program.refresh_ui i3-wm.program.refresh_ui /usr/bin/regolith-look refresh
bindsym $mod+Shift+r exec --no-startup-id $i3-wm.program.refresh_ui

## Session // Restart i3 // <><Ctrl> r ##
bindsym $mod+Ctrl+r restart

## Session // Logout // <><Shift> e ##
set_from_resource $i3-wm.program.logout i3-wm.program.logout /usr/bin/gnome-session-quit --logout
bindsym $mod+Shift+e exec $i3-wm.program.logout

## Session // Reboot // <><Shift> b ##
set_from_resource $i3-wm.program.reboot i3-wm.program.reboot /usr/bin/gnome-session-quit --reboot
bindsym $mod+Shift+b exec $i3-wm.program.reboot

## Session // Power Down // <><Shift> p ##
set_from_resource $i3-wm.program.shutdown i3-wm.program.shutdown /usr/bin/gnome-session-quit --power-off
bindsym $mod+Shift+p exec $i3-wm.program.shutdown

## Session // Lock Screen // <> Escape ##
set_from_resource $i3-wm.program.lock i3-wm.program.lock dbus-send --type=method_call --dest=org.gnome.ScreenSaver /org/gnome/ScreenSaver org.gnome.ScreenSaver.Lock
bindsym $mod+Escape exec $i3-wm.program.lock

## Session // Sleep // <><Shift> s ##
set_from_resource $i3-wm.program.sleep i3-wm.program.sleep systemctl suspend
bindsym $mod+Shift+s exec $i3-wm.program.sleep

###############################################################################
# System Management
###############################################################################

## Modify // Settings // <> c ##
set_from_resource $i3-wm.program.settings i3-wm.program.settings gnome-control-center
bindsym $mod+c exec $i3-wm.program.settings

## Modify // Bluetooth Settings // <> b ##
set_from_resource $i3-wm.program.bluetooth i3-wm.program.bluetooth gnome-control-center bluetooth
bindsym $mod+b exec $i3-wm.program.bluetooth

## Launch // File Browser // <><Shift> n ##
set_from_resource $i3-wm.program.files i3-wm.program.files /usr/bin/nautilus --new-window
bindsym $mod+Shift+n exec $i3-wm.program.files

## Launch // Notification Viewer // <> n ##
set_from_resource $i3-wm.program.notification_ui i3-wm.program.notification_ui /usr/bin/rofication-gui
bindsym $mod+n exec $i3-wm.program.notification_ui

###############################################################################
# Workspace Management
###############################################################################

# i3-snapshot for load/save current layout
## Modify // Save Window Layout // <> , ##
bindsym $mod+comma  exec /usr/bin/i3-snapshot -o > /tmp/i3-snapshot 
## Modify // Load Window Layout // <> . ##
bindsym $mod+period exec /usr/bin/i3-snapshot -c < /tmp/i3-snapshot

# Toggle bar visibility
## Modify // Toggle Bar // <> i ##
bindsym $mod+i bar mode toggle

# Cause Settings app to float above tiled windows
floating_maximum_size -1 x -1
for_window [class="Gnome-control-center"] floating enable

###############################################################################
# Window Resize and Gaps
###############################################################################

## Resize // Enter Resize Mode // <> r ##
mode "Resize Mode" {
        # These bindings trigger as soon as you enter the resize mode

        ## Resize // Resize Window // ↑ ↓ ← → ##
        bindsym Left resize shrink width 6 px or 6 ppt
        bindsym Down resize grow height 6 px or 6 ppt
        bindsym Up resize shrink height 6 px or 6 ppt
        bindsym Right resize grow width 6 px or 6 ppt

        bindsym Shift+Left resize shrink width 12 px or 12 ppt
        bindsym Shift+Down resize grow height 12 px or 12 ppt
        bindsym Shift+Up resize shrink height 12 px or 12 ppt
        bindsym Shift+Right resize grow width 12 px or 12 ppt

        ## Resize // Resize Window // k j h l ##
        bindsym h resize shrink width 6 px or 6 ppt
        bindsym k resize grow height 6 px or 6 ppt
        bindsym j resize shrink height 6 px or 6 ppt
        bindsym l resize grow width 6 px or 6 ppt

        bindsym Shift+h resize shrink width 12 px or 12 ppt
        bindsym Shift+k resize grow height 12 px or 12 ppt
        bindsym Shift+j resize shrink height 12 px or 12 ppt
        bindsym Shift+l resize grow width 12 px or 12 ppt

        ## Resize // Window Gaps // + - ##
        bindsym minus gaps inner current minus 6
        bindsym plus gaps inner current plus 6
        bindsym Shift+minus gaps inner current minus 12
        bindsym Shift+plus gaps inner current plus 12

        ## Resize // Exit Resize Mode // Escape or Enter ## 
        bindsym Return mode "default"
        bindsym Escape mode "default"
        bindsym $mod+r mode "default"
}
bindsym $mod+r mode "Resize Mode"

###############################################################################
# i3 Appearance and Behavior
###############################################################################

# Disable titlebar
set_from_resource $i3-wm.window.border.size i3-wm.window.border.size 1
set_from_resource $i3-wm.floatingwindow.border.size i3-wm.floatingwindow.border.size 1
default_border pixel $i3-wm.window.border.size
default_floating_border pixel $i3-wm.floatingwindow.border.size

# Specify the distance between windows in pixels. (i3-gaps)
set_from_resource $i3-wm.gaps.inner.size i3-wm.gaps.inner.size 5
set_from_resource $i3-wm.gaps.outer.size i3-wm.gaps.outer.size 0
gaps inner $i3-wm.gaps.inner.size
gaps outer $i3-wm.gaps.outer.size

# Only enable gaps on a workspace when there is at least one container
set_from_resource $i3-wm.gaps.smart i3-wm.gaps.smart on
smart_gaps $i3-wm.gaps.smart

# Enable popup during fullscreen
set_from_resource $i3-wm.gaps.popup_during_fullscreen i3-wm.gaps.popup_during_fullscreen smart
popup_during_fullscreen $i3-wm.gaps.popup_during_fullscreen

# window focus follows your mouse movements as the mouse crosses window borders
set_from_resource $i3-wm.gaps.focus_follows_mouse i3-wm.gaps.focus_follows_mouse no
focus_follows_mouse $i3-wm.gaps.focus_follows_mouse

###############################################################################
# i3 Colors and Fonts
###############################################################################

# Create variables from Xresources for i3's look.
set_from_resource $focused.color.border i3-wm.client.focused.color.border "#002b36"
set_from_resource $focused.color.background i3-wm.client.focused.color.background "#586e75"
set_from_resource $focused.color.text i3-wm.client.focused.color.text "#fdf6e3"
set_from_resource $focused.color.indicator i3-wm.client.focused.color.indicator "#268bd2"
set_from_resource $focused.color.child_border i3-wm.client.focused.color.child_border

set_from_resource $focused_inactive.color.border i3-wm.client.focused_inactive.color.border "#002b36"
set_from_resource $focused_inactive.color.background i3-wm.client.focused_inactive.color.background "#073642"
set_from_resource $focused_inactive.color.text i3-wm.client.focused_inactive.color.text "#839496"
set_from_resource $focused_inactive.color.indicator i3-wm.client.focused_inactive.color.indicator "#073642"
set_from_resource $focused_inactive.color.child_border i3-wm.client.focused_inactive.color.child_border

set_from_resource $unfocused.color.border i3-wm.client.unfocused.color.border "#002b36"
set_from_resource $unfocused.color.background i3-wm.client.unfocused.color.background "#073642"
set_from_resource $unfocused.color.text i3-wm.client.unfocused.color.text "#839496"
set_from_resource $unfocused.color.indicator i3-wm.client.unfocused.color.indicator "#073642"
set_from_resource $unfocused.color.child_border i3-wm.client.unfocused.color.child_border

set_from_resource $urgent.color.border i3-wm.client.urgent.color.border "#002b36"
set_from_resource $urgent.color.background i3-wm.client.urgent.color.background "#dc322f"
set_from_resource $urgent.color.text i3-wm.client.urgent.color.text "#fdf6e3"
set_from_resource $urgent.color.indicator i3-wm.client.urgent.color.indicator "#002b36"
set_from_resource $urgent.color.child_border i3-wm.client.urgent.color.child_border

# Window Border color
# class                 border                             background                         text                               indicator                          child_border
client.focused          $focused.color.border              $focused.color.background          $focused.color.text                $focused.color.indicator           $focused.color.child_border
client.focused_inactive $focused_inactive.color.border     $focused_inactive.color.background $focused_inactive.color.text       $focused_inactive.color.indicator  $focused_inactive.color.child_border
client.unfocused        $unfocused.color.border            $unfocused.color.background        $unfocused.color.text              $unfocused.color.indicator         $unfocused.color.child_border
client.urgent           $urgent.color.border               $urgent.color.background           $urgent.color.text                 $urgent.color.indicator            $urgent.color.child_border

# Create variables from Xresources for i3bars's look.
set_from_resource $i3-wm.bar.background.color i3-wm.bar.background.color "#002b36"
set_from_resource $i3-wm.bar.statusline.color i3-wm.bar.statusline.color "#93a1a1"
set_from_resource $i3-wm.bar.separator.color i3-wm.bar.separator.color "#268bd2"

set_from_resource $i3-wm.bar.workspace.focused.border.color i3-wm.bar.workspace.focused.border.color "#073642"
set_from_resource $i3-wm.bar.workspace.focused.background.color i3-wm.bar.workspace.focused.background.color "#073642"
set_from_resource $i3-wm.bar.workspace.focused.text.color i3-wm.bar.workspace.focused.text.color "#eee8d5"

set_from_resource $i3-wm.bar.workspace.active.border.color i3-wm.bar.workspace.active.border.color "#073642"
set_from_resource $i3-wm.bar.workspace.active.background.color i3-wm.bar.workspace.active.background.color "#073642"
set_from_resource $i3-wm.bar.workspace.active.text.color i3-wm.bar.workspace.active.text.color "#586e75"

set_from_resource $i3-wm.bar.workspace.inactive.border.color i3-wm.bar.workspace.inactive.border.color "#002b36"
set_from_resource $i3-wm.bar.workspace.inactive.background.color i3-wm.bar.workspace.inactive.background.color "#002b36"
set_from_resource $i3-wm.bar.workspace.inactive.text.color i3-wm.bar.workspace.inactive.text.color "#586e75"

set_from_resource $i3-wm.bar.workspace.urgent.border.color i3-wm.bar.workspace.urgent.border.color "#dc322f"
set_from_resource $i3-wm.bar.workspace.urgent.background.color i3-wm.bar.workspace.urgent.background.color "#dc322f"
set_from_resource $i3-wm.bar.workspace.urgent.text.color i3-wm.bar.workspace.urgent.text.color "#fdf6e3"

# Sets i3 font for dialogs
set_from_resource $i3-wm.font i3-wm.font pango:Source Code Pro Medium 13
font $i3-wm.font

###############################################################################
# i3 Bar
###############################################################################

set_from_resource $i3-wm.bar.position i3-wm.bar.position bottom
set_from_resource $i3-wm.bar.font i3-wm.bar.font pango:Source Code Pro Medium 13, Material Design Icons 13
set_from_resource $i3-wm.bar.separator i3-wm.bar.separator " "
set_from_resource $i3-wm.bar.trayoutput i3-wm.bar.trayoutput none
set_from_resource $i3-wm.bar.stripworkspacenumbers i3-wm.bar.stripworkspacenumbers yes

# i3xrocks config file. Override this for custom status indicators on the bar.
set_from_resource $i3-wm.bar.status_command i3-wm.bar.status_command i3xrocks -u ~/.config/regolith/i3xrocks/conf.d -d /etc/regolith/i3xrocks/conf.d

# The bar configuration
bar {
  position $i3-wm.bar.position
  font $i3-wm.bar.font
  separator_symbol $i3-wm.bar.separator
  status_command $i3-wm.bar.status_command
  tray_output $i3-wm.bar.trayoutput
  strip_workspace_numbers $i3-wm.bar.stripworkspacenumbers

  colors {
      background $i3-wm.bar.background.color
      statusline $i3-wm.bar.statusline.color
      separator  $i3-wm.bar.separator.color

#                        BORDER  BACKGROUND TEXT
      focused_workspace  $i3-wm.bar.workspace.focused.border.color      $i3-wm.bar.workspace.focused.background.color   $i3-wm.bar.workspace.focused.text.color
      active_workspace   $i3-wm.bar.workspace.active.border.color       $i3-wm.bar.workspace.active.background.color    $i3-wm.bar.workspace.active.text.color
      inactive_workspace $i3-wm.bar.workspace.inactive.border.color     $i3-wm.bar.workspace.inactive.background.color  $i3-wm.bar.workspace.inactive.text.color
      urgent_workspace   $i3-wm.bar.workspace.urgent.border.color       $i3-wm.bar.workspace.urgent.background.color    $i3-wm.bar.workspace.urgent.text.color
  }
}

###############################################################################
# External programs launched with i3
###############################################################################

# Start the installed regolith-compositor
set_from_resource $i3-wm.program.compositor i3-wm.program.compositor /usr/share/regolith-compositor/init
exec --no-startup-id $i3-wm.program.compositor

# Start Rofication for notifications
set_from_resource $i3-wm.program.notifications i3-wm.program.notifications /usr/bin/rofication-daemon
exec --no-startup-id $i3-wm.program.notifications

# Launch first time user experience script
set_from_resource $i3-wm.program.ftui i3-wm.program.ftui /usr/bin/regolith-ftue
exec --no-startup-id $i3-wm.program.ftui

# Hide the mouse pointer if unused for a duration
set_from_resource $i3-wm.program.unclutter i3-wm.program.unclutter /usr/bin/regolith-ftue /usr/bin/unclutter -b
exec --no-startup-id $i3-wm.program.unclutter

# User programs from Xresources
# To use, define an Xresource key i3-wm.program.[1-3] with the value of the program to launch.
# See https://regolith-linux.org/docs/howto/override-xres/ for details.
set_from_resource $i3-wm.program.1 i3-wm.program.1 :
exec --no-startup-id $i3-wm.program.1
set_from_resource $i3-wm.program.2 i3-wm.program.2 :
exec --no-startup-id $i3-wm.program.2
set_from_resource $i3-wm.program.3 i3-wm.program.3 :
exec --no-startup-id $i3-wm.program.3

set_from_resource $i3-wm.program_always.1 i3-wm.program_always.1 :
exec_always --no-startup-id $i3-wm.program_always.1
set_from_resource $i3-wm.program_always.2 i3-wm.program_always.2 :
exec_always --no-startup-id $i3-wm.program_always.2
set_from_resource $i3-wm.program_always.3 i3-wm.program_always.3 :
exec_always --no-startup-id $i3-wm.program_always.3

#####################
# Custom by @srosato
#####################

### Startup 
exec_always feh --bg-scale --randomize ~/dev/srosato/linux-configs/wallpapers/*
exec --no-startup-id /usr/bin/nm-applet
exec --no-startup-id guake

### Keybindings

bindsym Mod1+Shift+Tab exec i3-cycle left
bindsym Mod1+Tab exec i3-cycle right
bindsym Mod1+F1 exec rofi -show window
bindsym Mod1+F2 exec rofi -show run
bindsym Mod1+F4 [con_id="__focused__"] kill
bindsym $mod+q exec google-chrome --new-window --profile-directory=Default
bindsym $mod+Ctrl+q exec google-chrome --new-window --profile-directory=srosato-personal

### Specific App Management

for_window [workspace=$ws1] layout tabbed
for_window [workspace=$ws2] layout tabbed
for_window [class="jetbrains-toolbox"] floating enable
for_window [class="jetbrains-phpstorm" title="win0"] floating enable, move position center
for_window [class="Guake"] floating enable
for_window [class="Zoiper"] floating enable

assign [class="jetbrains-phpstorm"] workspace $ws1
assign [class="Code"] workspace $ws1
assign [class="Slack"] workspace $ws15
assign [class="Notepadqq"] workspace $ws7

### Workspace Management

# calendar
set_from_resource $ws20 i3-wm.workspace.20.name "20"
bindsym $mod+d workspace number $ws20

# put the workspaces to their corresponding screens
set_from_resource $monitor_center i3-wm.monitor.center
set_from_resource $monitor_left i3-wm.monitor.left
set_from_resource $monitor_right i3-wm.monitor.right

workspace $ws4 output $monitor_left
workspace $ws6 output $monitor_left
workspace $ws7 output $monitor_left
workspace $ws15 output $monitor_left
workspace $ws1 output $monitor_center $monitor_left
workspace $ws2 output $monitor_center $monitor_left
workspace $ws3 output $monitor_center $monitor_left
workspace $ws5 output $monitor_right
workspace $ws11 output $monitor_right
workspace $ws14 output $monitor_center
workspace $ws20 output $monitor_center

# Restoring workspaces using i3-resurrect
set $i3_resurrect ~/.local/bin/i3-resurrect
mode "workspace restore" {
  # restore screens on desktop
  bindsym 1 exec xrandr \
    --output DVI-D-0 --mode 1920x1080 --pos 3840x0 --rotate normal \
    --output HDMI-0 --primary --mode 1920x1080 --pos 1920x0 --rotate normal \
    --output DVI-I-1 --mode 1920x1080 --pos 0x0 --rotate normal \
    --output DVI-I-0 --off \
    --output DP-1 --off \
    --output DP-0 --off; \
    mode "default"; \
    restart

  # restore screens on desktop when switched to Windows
  bindsym 2 exec xrandr \
    --output DVI-D-0 --mode 1920x1080 --pos 1920x0 --rotate normal \
    --output HDMI-0 --off \
    --output DVI-I-1 --primary --mode 1920x1080 --pos 0x0 --rotate normal \
    --output DVI-I-0 --off \
    --output DP-1 --off \
    --output DP-0 --off; \
    mode "default"; \
    restart;

  # restore work
  bindsym w exec $i3_resurrect restore -w $ws14; mode "default"

  # restore slack
  bindsym s exec $i3_resurrect restore -w $ws15; mode "default"

  # restore personal
  bindsym p exec $i3_resurrect restore -w $ws6; mode "default"

  # restore notes
  bindsym n exec $i3_resurrect restore -w $ws7; mode "default"

  #restore calendar
  bindsym c exec $i3_resurrect restore -w $ws20; mode "default"

  # Back to normal: Enter, Escape
  bindsym Return mode "default"
  bindsym Escape mode "default"
}
bindsym $mod+e mode "workspace restore"

# Easier workspace selection
mode "workspace selection" {
  # work
  bindsym w workspace number $ws14; mode "default"

  # slack
  bindsym s workspace number $ws15; mode "default"

  # personnal
  bindsym p workspace number $ws6; mode "default"

  # notes
  bindsym n workspace number $ws7; mode "default"

  # calendar
  bindsym c workspace number $ws20; mode "default"

  # meet
  bindsym t workspace number $ws11; mode "default"

  # virtual machines
  bindsym v workspace number $ws12; mode "default"

  # stream
  bindsym m workspace number $ws13; mode "default"

  # Back to normal: Enter, Escape
  bindsym Return mode "default"
  bindsym Escape mode "default"
}
bindsym $mod+w mode "workspace selection"

### Media Management

mode "media control" {
  # paulse-audio script to set sources
  bindsym 1 exec bash -c 'source ~/.bash_functions && pa-set 0'
  bindsym 2 exec bash -c 'source ~/.bash_functions && pa-set 1'
  bindsym 3 exec bash -c 'source ~/.bash_functions && pa-set 2'
  bindsym 4 exec bash -c 'source ~/.bash_functions && pa-set 3'

  bindsym k exec pulseaudio-ctl up
  bindsym j exec pulseaudio-ctl down
  bindsym m exec pulseaudio-ctl mute

  # Back to normal: Enter, Escape
  bindsym Return mode "default"
  bindsym Escape mode "default"
}
bindsym $mod+v mode "media control"

~/.config/regolith/Xresources was staged:

i3-wm.bar.trayoutput:primary

i3-wm.program.1: scream -i eno1

i3-wm.workspace.01.name:1main
i3-wm.workspace.02.name:2secondary
i3-wm.workspace.03.name:3search
i3-wm.workspace.04.name:4support1
i3-wm.workspace.05.name:5support2
i3-wm.workspace.06.name:6personal
i3-wm.workspace.07.name:7notes
i3-wm.workspace.11.name:11meet
i3-wm.workspace.12.name:12vms
i3-wm.workspace.13.name:13stream
i3-wm.workspace.14.name:14work
i3-wm.workspace.15.name:15slack
i3-wm.workspace.20.name:20calendar

i3-wm.monitor.center:HDMI-0
i3-wm.monitor.left:DVI-I-1
i3-wm.monitor.right:DVI-D-0

Installation Details

If you could help me diagnose this problem to see if its related to Regolith that would be very helpful! Thank you

moritzheiber commented 4 years ago

Adding my comment from Slack here as well: I don't believe gnome-flashback supports this, and since we're not using any other GNOME component that might support it (namely, gnome-shell or mutter) I'm not sure whether it'll be ever be supported

moritzheiber commented 4 years ago

cc @muktupavels (since he's probably the only person that could tell us what's possible or not possible)

muktupavels commented 4 years ago

Could you test GNOME Flashback session? I think it was supposed to work...

srosato commented 4 years ago

I confirm that on my laptop which has Ubuntu 20.04 LTS with popOS, that installing gnome-session-flashback and logging in shows the same problem.

If I log back in to the popOS session which I believe uses gnome3 and try the per application feature, it works as intended. So it indeed seems to be related to GNOME Flashback.

srosato commented 4 years ago

I could file an issue on their gitlab project if you guys believe it is associated to this package, just let me know, thanks!

muktupavels commented 4 years ago

@srosato Please open upstream issue mentioning gnome-flashback version. Also please add steps with how to reproduce problem in GNOME Flashback session including input sources you have added.

muktupavels commented 4 years ago

I am using Ubuntu development version - 20.10 and have gnome-flashback 3.37.3. I can not reproduce problem!

GNOME has Super + Space as default shortcut for switching to next input source. How/where it is changed/set to mod+alt+backspace? What is mod here?

srosato commented 4 years ago

Hmm strange, because I have the same issue both on my Ubuntu 18.04 with Linux Mint installed on desktop and my popOS Ubuntu 20.04 installed on laptop, both running regolith. I meant super instead of mod.

muktupavels commented 4 years ago

Post output of:

gsettings get org.gnome.desktop.input-sources sources
gsettings get org.gnome.desktop.input-sources xkb-options
gsettings get org.gnome.desktop.input-sources per-window
srosato commented 4 years ago

On laptop:

gsettings get org.gnome.desktop.input-sources sources >> [('xkb', 'us'), ('xkb', 'ca')] gsettings get org.gnome.desktop.input-sources xkb-options >> ['grp:switch', 'lv3:switch', 'grp_led:scroll'] gsettings get org.gnome.desktop.input-sources per-window >> true

On desktop: gsettings get org.gnome.desktop.input-sources sources >> [('xkb', 'us'), ('xkb', 'ca')] gsettings get org.gnome.desktop.input-sources xkb-options >> @as [] gsettings get org.gnome.desktop.input-sources per-window >> true

muktupavels commented 4 years ago

Someone will need to find what Regolith is changing/configuring that affects this functionality...

Installed Ubuntu 20.04 in VM. Installed all updates. Added ppa:regolith-linux/release. Installed regolith-desktop.

Added few input sources, enabled per-window setting and I can confirm it does not work. Installed GNOME Flashback session and it as not working there too. No idea why it works in Ubuntu session...

Then I tried new user. For some reason it had same input sources that I added for previous user (that was unexpected!!!). Enabled per-window setting and now it works. Then logged in Regolith session, does not work and after that does not work in Flashback session.

So on login Regolith is doing something that breaks functionality in gnome-flashback. It still might be bug in gnome-flashback, but someone will need to find what is causing/triggering this problem first.

srosato commented 4 years ago

Nice finds! Thanks for helping out. Do you still want me to file a bug on the gitlab of gnome flashback? Seems there is a chance it might be related, since trying gnome-flashback alone without Regolith does not seem to work either

kgilmer commented 4 years ago

If there is something that Regolith is doing during login, it should just be dconf mutation. But, the code in the release PPA is not using the gsettings overrides changes that are present in the stable and unstable repos. I will try and follow @muktupavels test against unstable and see what happens.

kgilmer commented 4 years ago

I have tested against the unstable repo on Ubuntu 20.04 and see the error behavior. Meaning, a terminal session and gnome editor session "share" the same input source even if I change it after changing focus from one app to another. I specified the configuration in gnome-settings as directed in the top post to this issue, and installed another language and input source. Then I rebooted and performed the test. (I mention these details because I do not use the multiple language feature in gnome so I may have missed some detail). Here is the code that executes when a regolith session starts: https://github.com/regolith-linux/regolith-gnome-flashback/blob/master/usr/bin/regolith-session-init

All of the xdg desktop files are in the same repo, in case it helps: https://github.com/regolith-linux/regolith-gnome-flashback/tree/master/usr

muktupavels commented 4 years ago

No need for upstream bug if we don't know what is causing this problem...

Deleted .cache and .config dirs, logged out, logged in, re-enabled per-window input sources. Works in GNOME Flashback session. Logged in Regolith session. And looks like it works here too now (tried with 2 terminal windows)! Logout and login, now does not work...

Sorry, I have no time to debug this...

gen1us2k commented 3 years ago

I faced the same issue. Tried to upgrade from 20.04 to 20.10 and the issue persist

I tried to remove .cache dir, rebooted the system, and have the same problem.

gsettings get org.gnome.desktop.input-sources sources        
[('xkb', 'us'), ('xkb', 'ru')]

gsettings get org.gnome.desktop.input-sources xkb-options
['grp:caps_toggle']

gsettings get org.gnome.desktop.input-sources per-window
true

gnome-flashback 3.38.0-0ubuntu1
regolith-gnome-flashback 2.6.2-1
regolith-desktop-standard 2.92-1groovy
gen1us2k commented 3 years ago

Also, I tried to use gxkb (I used this one on Arch Linux with i3). I have this behavior

  1. Run gxkb with gnome-session. It breaks layout switching completely and they mix with each other
  2. Kill gnome-session with gxkb running. It works fine but breaks at least sound.

I assume that this bug somewhere in X or in gnome-session. I'll try a couple of other options and come back with results

I hope that helps!

mvartanyan commented 3 years ago

same here, fresh install of Regolith Linux, vanilla config. Works first time around, stops working after next login.

zor1984qq commented 3 years ago

I think I have helpful command for you ;D I issued that for myself, instead of not even working localectl from systemd package. I am too using ubuntu 20.10 ppa on regolith desktop.

And sway 1.5 firefox having flickering on wayland but these not part of regolith or these topic. Well they have 1.5.1 release as well as regolith just updated today with same 1.5.1 bugfix.

I have no even wallpaper or can't open up gnome settings using $mod+c bindkey sym. And I have grey plain color on my desktop. Even sway 1.5 has preconfigured background image like tropic stuff etc. ...;D

The only thing is that its not pre window layout switching why ever these is needed to you lel? Its not convenient to have different layout for each window. Well I think you have to man setxkbmap, maybe they have such functionality. But after these command was issued all kind of switching problems was gone. Just press Alt+Shift and all will be ok. You can man localectl or setxkbmap for more info.

Note that other programs may relay on dbus or some gnome session trash so for me only setxkbmap works I even add these line to my .bashrc file so when I open up console or any terminal it gots issued again for me. You can start it from any script as you wish for work.

setxkbmap -v -option grp:alt_shift_toggle -layout us,ru -model logitech_g15

ThSGM commented 3 years ago

Please feel free to ignore this if it is not related, but I posted something about setxkbmap behaviour to the Unix Stack Exchange yesterday: Why does setxkbmap on a single device also change other devices?

I did not mention Regolith on there since I thought this was not related.

But I've been confused at how the keyboard layouts are set in Regolith, which led me to this thread, which made me wonder if it's actually a Regolith thing. If it's not a related item to the current discussion, I can file it separately.

Ubuntu version: 20.04.1 LTS Regolith version: 1.5.1

lastgosumatt commented 2 years ago

I have the same problem, everything else is perfect.

Ubuntu 21.04, Regolith 1.6

Hope I can help somehow to solve this problem.

cfsmp3 commented 2 years ago

This is not really a regolith issue but an i3 issue - as far as I can tell, anyway.

This could help

https://github.com/Zebradil/xkb-switch-i3

lastgosumatt commented 2 years ago

This is not really a regolith issue but an i3 issue - as far as I can tell, anyway.

This could help

https://github.com/Zebradil/xkb-switch-i3

Thank you very much. The closest solution I found so far, but still not working, I wrote to the author, maybe he can help.

srosato commented 2 years ago

Today I installed regolith 2.0 alpha on popOS 22.04 (therefore using Ubuntu 22.04). I was able to switch keyboard layout per application now!

image

Not the best news for those still on 1.6 with an older OS version, but at least if you decide to move forward you will no longer bring that bug with you.