Hi Rodion,

Rodion Goritskov <[email protected]> writes:

> Hi Fredrik, thank you for your participation!
>
> Fredrik Salomonsson <[email protected]> writes:
>
>> Hi Rodion, and fellow Guixers!
>>
>> Great initiative! And sorry for taking so long to respond.
>>
>
> Really entertaining and detailed story,

Thanks!

> not surprised it took so long to be written (:

Haha, yeah took a bit of time to gather and test a few things before I
could sit down and write.

>> ** Setup
>>
>> I went with a dual boot solution with Guix and SteamOS.  I'm treating
>> SteamOS as I did Windows way back in the days when I dual booted Windows
>> and other linux distributions, and that is keep them separate.  SteamOS
>> will nuke anything outside of the home directory and it will overwrite
>> the UEFI boot meny every time it updates.  There might be a way to tell
>> it to keep Guix around in the UEFI boot meny.  I decided to avoid that
>> headache as I discovered that you can just as easy in the UEFI boot from
>> an EFI file.  So to boot Guix I navigate to its EFI partition and pick
>> the =guix.efi= file and boot.  Similar with SteamOS.  But I'm getting a
>> bit ahead of myself.
>
> Just out of curiosity - do you consider using Guix as the only system?

You could use Guix as the only system on it.  Reason why I opted for
dual boot is to have an escape hatch to play certain games.  I run
pretty much the same system on my desktop and sometimes some games have
some odd behavior due to sway etc and they will work perfectly in
SteamOS.  I suspect if I can get gamescope [0] setup in sway it would
solve most of those problems.  There are also firmware updates — at
least for the dock — that you get from SteamOS.

[0] https://github.com/ValveSoftware/gamescope

> What are showstoppers for this - performance, battery life, usability or
> or maybe something else?

Both battery life and performance seems to be in the same ballpark for
both Guix and SteamOS.  Only showstopper for me right now is time.  The
Steam Deck is really like a normal x86 laptop, but with a gamepad bolted
on and no keyboard.

>>
>> For my sway configuration I have:
>>
>> #+begin_src guile
>> (home-sway-service-type
>>         config => (sway-configuration
>>                    (inherit config)
>>                    (variables `((main . "'Valve Corporation ANX7530 U 
>> 0x00000001'")
>>                                 (touch . "10248:4117:FTS3528:00_2808:1015")
>>                                  …))
>>                    …
>>                    (inputs
>>                     (list (sway-input
>>                            (identifier '$touch)
>>                            (extra-content '("map_to_output $main")))
>>                           …))))
>> #+end_src
>>
>> To map the touchscreen correctly to the built-in monitor.  And that's
>> it.
>
> Is Sway usable with touchscreen (I am a bit surprised)?

It is quite capable out of the box.  I.e. drag scroll works and you can
switch workspaces by just pressing the workspace in the bar — same as
you would with a mouse.  It does support gestures from libinput, but
sadly by default libinput does not support touchscreens only touchpads.
I did find lisgd [1] that allows you to use the touchscreen for
gestures.

I got this:

#+begin_src guile
(define-public plt-lisgd-steam-deck
  (package
    (inherit lisgd-wayland)
    (name "plt-lisgd-steam-deck")
    (arguments
     (substitute-keyword-arguments (package-arguments lisgd-wayland)
       ((#:phases phases)
        #~(modify-phases #$phases
            (add-after 'unpack 'copy-config
              (lambda _
                (copy-file #$(local-file "patches/steam-deck-config.h.in")
                           "config.h")
                (substitute* "config.h"
                  (("@SWAY@") #$sway)
                  (("@ROFI@") #$rofi))))))))))
#+end_src

With the =patches/steam-deck-config.h.in=:

#+begin_src conf
/*
  distancethreshold: Minimum cutoff for a gestures to take effect
  degreesleniency: Offset degrees within which gesture is recognized (max=45)
  timeoutms: Maximum duration for a gesture to take place in miliseconds
  orientation: Number of 90 degree turns to shift gestures by
  verbose: 1=enabled, 0=disabled; helpful for debugging
  device: Path to the /dev/ filesystem device events should be read from
  gestures: Array of gestures; binds num of fingers / gesturetypes to commands
            Supported gestures: SwipeLR, SwipeRL, SwipeDU, SwipeUD,
                                SwipeDLUR, SwipeURDL, SwipeDRUL, SwipeULDR
*/

unsigned int distancethreshold = 125;
unsigned int distancethreshold_pressed = 60;
unsigned int degreesleniency = 15;
unsigned int timeoutms = 800;
unsigned int orientation = 0;
unsigned int verbose = 0;
double edgesizeleft = 50.0;
double edgesizetop = 50.0;
double edgesizeright = 50.0;
double edgesizebottom = 50.0;
double edgessizecaling = 1.0;
char *device = "/dev/input/by-path/platform-AMDI0010:01-event";

//Gestures can also be specified interactively from the command line using -g
Gesture gestures[] = {
        /* nfingers  gesturetype  command */
        { 1,         SwipeLR,     EdgeLeft, DistanceAny, ActModeReleased, 
"@SWAY@/bin/swaymsg workspace prev" },
        { 1,         SwipeRL,     EdgeRight, DistanceAny, ActModeReleased, 
"@SWAY@/bin/swaymsg workspace next" },
        { 2,         SwipeUD,     EdgeTop, DistanceAny, ActModeReleased, 
"@ROFI@/bin/rofi -show drun" },
        { 2,         SwipeDU,     EdgeBottom, DistanceAny, ActModeReleased, 
"pidof $KEYBOARD || $KEYBOARD &" },
        { 2,         SwipeUD,     EdgeBottom, DistanceAny, ActModeReleased, 
"pkill -9 -f $KEYBOARD" },
};
#+end_src

That allows me to swipe the sides to move between workspaces.  Two
finger swipe at the top brings down my rofi launcher.  Then two finger
swipe should bring up a keyboard.  But I haven't gotten that far.  I
think wvkbd [2] should work for this.

[1] https://github.com/jjsullivan5196/lisgd
[2] https://git.sr.ht/~proycon/wvkbd

There is the project Sxmo [3], which uses sway on a mobile.  I only
played around with it a tiny bit on one of my somewhat working old
phone.  But I have taken some inspiration from that for my steam deck.
There is also a good thread [4] for sway on the framework 12 on the
frame work forum.  

So you can make it work, just require a bit of hacking.

[3] https://sxmo.org/
[4] https://community.frame.work/t/sway-on-the-framework-laptop-12/73173

>>
>> Overall I'm quite happy with the setup.  It's not as convenient as a
>> regular laptop, it takes a bit more time to setup and tear down and the
>> 7" screen can get a bit crowded for web browsing.  The battery life and
>> suspend are great.  Combining those two I had no problem making a full
>> day on Guix Days without needing to charge.  And it makes for a great
>> travel companion as I can game on it while on an airplane, train or
>> other transportation.  Then boot to Guix when I want to do some hacking.
>> So no extra laptop is required, which cuts down on travel gear.
>
> Battery-wise it is much better than RK3588 Pocket Reform, which lasts
> only for ~4 hours

Interesting, I should do a proper battery test on the Steam Deck.  It
might be that it only last for ~4 hours contiguously as well.  But my
habit of suspending it when I not use it, feels like it last longer.

>
> Thank you again, very unusual experience.

And thank you for starting this thread and gave me the kick I needed to
write this!

One more thing that I forgot to mention in my first email.  One way to
get into the boot menu, is to first turn the Steam Deck off.  Then hold
down volume up, and while holding that press the power button.  Wait
until it beeps then release the volume up and the UEFI menu should pop
up.

-- 
s/Fred[re]+i[ck]+/Fredrik/g

Reply via email to